Add bundled OKF index template - #19
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Bundled template selector validation currently runs before output-type validation, which can produce misleading errors for non-Elasticsearch outputs using --template _....
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adds first-class support for bundled (embedded) Elasticsearch composable index templates—starting with an Open Knowledge Format (OKF) v0.2 template selected via --template _okf—and updates the Elasticsearch preflight flow to create/merge a shared cluster-side template by appending exact target index names while preserving stored fields.
Changes:
- Embed and resolve bundled templates via
rust-embed, including_okfwith explicit OKF v0.2 mappings and a bounded keyword dynamic template for unknown strings. - Extend template installation logic to (for bundled templates) GET the selected cluster-side template, create it if missing, or append the exact target index into
index_patternswhen absent. - Add comprehensive unit/integration tests, OpenSpec specs/archives, and documentation updates (README, skill, changelog, examples).
File summaries
| File | Description |
|---|---|
| tests/fixtures/okf_v0_2.ndjson | Adds representative OKF v0.2 fixture documents. |
| tests/bundled_template.rs | Adds end-to-end request-capture tests for bundled template behavior. |
| src/output/mod.rs | Adds preflight validation hook for bundled template selectors. |
| src/output/elasticsearch/embedded_templates.rs | Implements embedded template catalog + mapping/fixture tests. |
| src/output/elasticsearch.rs | Adds TemplateSource + bundled install/merge logic for templates. |
| src/main.rs | Adjusts startup ordering to preflight bundled templates before input construction. |
| src/input.rs | Adds lightweight multi-source local discovery helper used during startup. |
| README.md | Documents bundled template selection and OKF template semantics. |
| openspec/specs/okf-index-template/spec.md | Defines OKF bundled template mapping requirements. |
| openspec/specs/elasticsearch-index-template/spec.md | Specifies bundled selector semantics + merge behavior. |
| openspec/changes/archive/2026-08-27-add-bundled-okf-template/tasks.md | Archives completed implementation task checklist. |
| openspec/changes/archive/2026-08-27-add-bundled-okf-template/specs/okf-index-template/spec.md | Archives the OKF index template spec snapshot. |
| openspec/changes/archive/2026-08-27-add-bundled-okf-template/specs/elasticsearch-index-template/spec.md | Archives the ES template selector/merge spec snapshot. |
| openspec/changes/archive/2026-08-27-add-bundled-okf-template/proposal.md | Archives the change proposal. |
| openspec/changes/archive/2026-08-27-add-bundled-okf-template/design.md | Archives the design rationale and trade-offs. |
| openspec/changes/archive/2026-08-27-add-bundled-okf-template/.openspec.yaml | Adds OpenSpec metadata for the archived change. |
| examples/steam-games/steam-games-template.yaml | Adds/renames example template to .yaml. |
| examples/steam-games/steam-games-pipeline.yaml | Adds/renames example pipeline to .yaml. |
| examples/steam-games/readme.md | Updates example command to .yaml filenames. |
| CHANGELOG.md | Notes the new bundled _okf template feature. |
| Cargo.toml | Includes embedded assets in packaging and adds rust-embed dependency. |
| Cargo.lock | Locks new dependency graph for rust-embed. |
| assets/templates/_okf.yaml | Adds the bundled OKF v0.2 composable index template asset. |
| .agents/skills/espipe/SKILL.md | Updates the espipe skill to describe --template _okf usage. |
Review details
- Files reviewed: 21/24 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🔵 Needs a closer look
It introduces a new embedded-asset pipeline and modifies Elasticsearch preflight/installation behavior, warranting final human validation despite strong test coverage.
Review details
- Files reviewed: 22/25 changed files
- Comments generated: 0 new
- Review effort level: Lite
Summary
--template _okfopen-knowledge-formattemplate by appending exact target index names--template-nameoverrides for bundled templates while preserving file-backed behaviorVerification
cargo fmt --checkcargo test(215 passed, 5 ignored)assets/templates/_okf.yaml