Skip to content

scripts/kg/ exists in template but is missing from the manifest; CLAUDE.md hints at it #62

Description

@psaboia

Defect

scripts/kg/ exists in the template repo with substantive content (build scripts, SPARQL queries, README, fixtures):

```
scripts/kg/build-graph.sh
scripts/kg/build-graph.py
scripts/kg/wiki-to-jsonld.py
scripts/kg/README.md
scripts/kg/sparql/.rq (13 sparql query files)
scripts/kg/fixtures/mini-wiki/
(test fixtures)
scripts/kg/build/ (runtime build artifacts, ignored)
scripts/kg/.cache/ (runtime cache, ignored)
```

But `scripts/kg/` is not enumerated in any array of `scripts/lib/template-manifest.sh` (introduced in PR #60), so neither `adopt.sh` nor `update-from-template.sh` nor `check-template-version.sh` sync those files. Meanwhile, `wiki/agents/claude-code/templates/claude-md-snippet.md` (which the overlay's `setup.sh` injects into derived projects' `CLAUDE.md`) references a `### Knowledge Graph` subsection, hinting at a KG/SPARQL pipeline that derived projects never receive.

How it surfaced

Manual end-to-end test during PR #60 review-resolution: adopted on a FUNSD scratch clone, opened Claude Code, ran `/wiki-experiment`. The agent honestly flagged the gap:

"CLAUDE.md references a `scripts/kg/` KG/SPARQL pipeline, but `scripts/kg/` does not exist in this adoption — KG rebuild not run, not verified."

The agent applied observe-the-failure discipline correctly. The defect is pre-existing (predates PR #60); the manifest just made the discrepancy auditable.

Design decision needed

Option A — ship the executable subset. Add to `TEMPLATE_SHARED_INFRA`:

  • `scripts/kg/build-graph.sh`
  • `scripts/kg/build-graph.py`
  • `scripts/kg/wiki-to-jsonld.py`
  • `scripts/kg/README.md`
  • All `scripts/kg/sparql/*.rq` (13 files)

Plus gitignore `scripts/kg/build/` and `scripts/kg/.cache/` at the template level (or check that the existing `.gitignore` handles them; they may already be ignored). `scripts/kg/fixtures/mini-wiki/` is a test fixture — decide whether it belongs in the shipped set or stays template-internal.

After Option A, derived projects gain the KG pipeline that `claude-md-snippet.md` already hints at. The expectation in `CLAUDE.md` and reality on disk match.

Option B — remove the KG reference from the snippet. Edit `wiki/agents/claude-code/templates/claude-md-snippet.md` to drop the `### Knowledge Graph` subsection. `CLAUDE.md` in derived projects no longer makes a promise the template does not deliver. Smallest scope, smallest blast radius.

Option C — make KG opt-in via the features mechanism (RFC #13). Move `scripts/kg/` into `features/knowledge-graph/` with a `feature.json`, so adopters that want it run `./scripts/enable-feature.sh knowledge-graph`. Larger surface; aligns with the feature-flag direction.

Recommendation: Option B short-term (immediate consistency); Option C medium-term if the team wants KG to be a first-class opt-in capability. Option A is tempting but ships ~20 files most adopters do not actively want.

Acceptance

  • After whichever option is chosen: a fresh adopt + Claude Code session on a non-template repo does NOT surface the gap (no honest "references X but X does not exist" flag).
  • `scripts/test/tests/unit/manifest-shape/` continues to pass.
  • If Option A: a new convergence assertion that `scripts/kg/` files reach the adopted host (the existing convergence smoke would catch this for free if the paths land in `TEMPLATE_SHARED_INFRA`).
  • If Option B: any wiki page that links to the Knowledge Graph subsection of `CLAUDE.md` is updated to stop expecting it.

Context

Surfaced during PR #60 manual adoption test (Bloco 1 recipe documented in the PR body). The defect demonstrates that the manifest works as an auditing tool: discrepancies between "what `CLAUDE.md` tells users about" and "what the template actually ships" become findable. This issue is the first such finding.

Refs: PR #60 (manifest introduction; "Out of scope" section flagged this); `wiki/agents/claude-code/templates/claude-md-snippet.md`; RFC #13 (features mechanism, if Option C).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions