Skip to content

feat(wiki): fill the deterministic skeleton with narrative, tagged model-authored #358

Description

@cdeust

Context

curate_wiki already produces authoring jobs from clustered memories, and the file-doc skeletons already expose curation gaps rather than hiding them. What is missing is the link: a deterministic structural skeleton arriving as the input to that machinery, instead of the curator inferring page decomposition from memory clusters alone.

Provenance is the differentiator worth building for, but the claim has to be stated precisely, because tools in this category already enforce citation discipline. At least one competing generator labels every node of every diagram it emits with file:line, requires two or more file:line citations behind every duplication claim, and asks its own sub-agents for a confidence note plus a list of known gaps. "We cite our sources" is not a differentiator.

The difference is who vouches for the citation:

  • theirs — a model writes the citation and another model rejects reports that lack one. Self-policed. A plausible-looking hallucinated file:line passes.
  • ours — the tag is derived. extracted comes from the AST, inferred comes from the resolver, and the gaps come from a measured missed graph rather than from a model's self-assessment.

Hence three tags rather than a confidence adjective:

  • extracted — read from the AST
  • inferred — produced by the resolver
  • authored — written by a model

The first two arrive in the skeleton (cdeust/ai-architect-mcp-codebase#196) and are machine-checkable. This issue adds the third and, more importantly, guarantees the first two survive curation rather than being paraphrased into unsourced prose. A curated page that quietly downgrades a derived claim to an authored one has destroyed the only property that separates this output from a well-prompted one-shot generator.

Scope

Consume the skeleton through the existing curate_wiki queue and emit curated pages.

Acceptance criteria

  1. Skeleton in, curated pages out, through the existing queue. No parallel authoring path is introduced.
  2. Every paragraph making a structural claim carries a provenance tag. authored is permitted only where no skeleton claim backs the sentence; a test asserts a curated page cannot tag a skeleton-backed claim as authored.
  3. file:line citations from the skeleton are preserved verbatim in the rendered page. A test reconciles a curated page's citations against the skeleton it came from, catching paraphrase drift. This reconciliation is the machine-checkable guarantee the differentiator rests on; if it is only spot-checked, the differentiator is rhetoric.
  4. A citation that does not resolve to a symbol at that location in the indexed tree fails the build rather than shipping. Asserted with a deliberately corrupted skeleton.
  5. Coverage gaps carried by the skeleton appear on the curated page. A test asserts that a page generated from a skeleton with a non-empty coverage block renders that block, and that an empty block renders as an explicit "no known gaps" rather than vanishing.
  6. wiki_verify passes on the generated set.
  7. Generated pages are scored against the 42 canonical scopes in mcp_server/core/wiki_coverage.py; uncovered scopes are reported as gaps in the output, not omitted.
  8. Scoped mutation run on the changed files: zero surviving non-equivalent mutants, or each survivor documented as equivalent.
  9. Completion Ledger in the PR.

Depends on

Out of scope

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions