Skip to content

Add bundled OKF index template - #19

Open
VimCommando wants to merge 3 commits into
mainfrom
feat/bundled-okf-template
Open

Add bundled OKF index template#19
VimCommando wants to merge 3 commits into
mainfrom
feat/bundled-okf-template

Conversation

@VimCommando

Copy link
Copy Markdown
Owner

Summary

  • bundle an OKF v0.2 Elasticsearch template and resolve it with --template _okf
  • create or update the shared open-knowledge-format template by appending exact target index names
  • support --template-name overrides for bundled templates while preserving file-backed behavior
  • map official OKF metadata explicitly and map unknown strings as bounded keywords
  • sync and archive the completed OpenSpec change

Verification

  • cargo fmt --check
  • cargo test (215 passed, 5 ignored)
  • strict OpenSpec validation
  • packaged crate contains assets/templates/_okf.yaml

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 _okf with 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_patterns when 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.

Comment thread src/output/mod.rs Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants