Skip to content

feat: implement Knowledge Wiki retrieval layer (pre-generation grounding) #54

Description

@devfloor9

Summary

Implement the Knowledge Wiki layer described as a design proposal in docs/docs/knowledge-wiki.md. Today that page is explicitly marked "design proposal, not yet shipped" — this issue tracks turning it into an implemented layer.

Motivation

The Ontology axis validates after generation (oma validate rejects a malformed entity), and the Harness enforces before a tool runs. Neither tells an agent, before it authors a typed artifact, what the domain already knows (existing enums, prior ADR rationale, naming conventions). This is the same root cause behind the canonical "deployment target" drift (one skill meant a cluster name, another meant the eks|ec2|lambda enum) — validation only caught the clash after both documents already diverged.

A semantic retrieval layer queried before generation grounds the agent in established intent, preventing drift at the source instead of catching it at handoff.

Layer positioning (complementary, not competing)

Layer Question When it acts Status
Knowledge Wiki "what is already known?" before generation (grounding) 🔭 this issue
Ontology (8 schemas) "is this true?" after generation (validation) ✅ shipped
Harness (PreToolUse) (execution deny) before a tool runs (enforcement) ✅ shipped

Open design questions (resolve in an ADR before implementation)

  1. Source of truth — the wiki MUST derive from the schemas + ADR/Spec docs, never the reverse, or it becomes a competing definition and reintroduces the drift it is meant to prevent.
  2. Staleness — a retrieval layer lagging the schemas is worse than none; ingestion must re-run on every ontology change (Inner-Loop hook).
  3. Retrieval surface — MCP tool vs. skill vs. build-time index; each has different harness implications.

Acceptance criteria (draft)

  • ADR authored resolving the three open design questions above
  • Wiki corpus derives from schemas/ontology/ + ADR/Spec documents (one-way)
  • Re-ingestion hook wired to ontology changes (staleness guard)
  • Retrieval interface decided and implemented per the ADR
  • self-improving-loop consumes accumulated domain knowledge as a second input alongside operational signal
  • docs/docs/knowledge-wiki.md status banner updated from "design proposal" to shipped

References


Detailed implementation to be carried out in a separate working session.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions