Wiki Knowledge Maintenance: implementation notes
Wiki Knowledge Maintenance: implementation notes
Execution record for the spec and plan. Branch feat/wiki-knowledge-maintenance; delivery mode planning-only (no Linear projection, plan decision P1).
Task ledger
| Task | Result | Commit |
|---|---|---|
| T0 | Branch from origin/main plus five spec commits; plan committed | 5951809ef |
| T1–T3 | docs-ingest-phase entry, wiki contract, source capture with readback script, health reference | skills 2319349 |
| T4 | Reconciliation by recorded freshness; one log rule | skills 0500473 |
| T5 | create-plan Wiki Context step | skills 83478d8 |
| T6 | requirements-grill and create-spec bookkeeping resolve the wiki root from the contract | skills 3da47eb |
| T7 | apps/wiki check:health with fixture tests | 1b6aa37fa |
| T8 | Project wiki contract in apps/wiki/AGENTS.md; operator docs | 7308b0837 |
| T11 | Skills pushed and tagged sync/wiki-knowledge-maintenance-3da47ebbf8ec; synced into apps/cli/skills | 56c22bf8e |
| T9 | Real proof: capture, health, ingest, discovery, runtime | this commit series |
| T10 | IP-439 knowledge consultation (AC-037 consumer proof): research/ip-439-knowledge-consultation.md | cb7596199 |
Skills commits are on wearedevpunks/skills main; all 37 tests/wiki-*.contract.test.mjs pass at 3da47ebbf8ec.
T9 proof run
The run followed the synced apps/cli/skills/phases/docs-ingest-phase (the installed .agents/skills copy is older; see Deviations).
Readiness
Contract: resolved at the start. All six fields are declared in apps/wiki/AGENTS.md lines 15–20, and every declared path exists. The runtime check later found one conflicting value: the declared per-page Markdown form /docs/<path>.mdx does not work (see Runtime). That gap covers no destination this run writes, so the branches proceeded.
| Area | Before health | After health | Evidence |
|---|---|---|---|
| Source storage | ready | ready | raw/ is tracked in Git and not ignored; the Karpathy record reads back OK |
| Knowledge/navigation | not ready: check:health 38 findings | ready | bun run check:health exits 0 |
| Rendering | not run | ready | bun run --cwd apps/wiki build exits 0 (1695 static pages) |
Capture
Outcome committed (reuse, AC-012) for apps/wiki/raw/external/karpathy-llm-wiki/ac46de1ad27f/. The pinned retrieved_url (gist revision ac46de1ad27f92b28ac95459c782c07f6b8c964a) was fetched again into a scratch directory: HTTP 200, 11985 bytes, SHA-256 dc3efe98ae62f23dd08acad13aba2e95287beb20b6bec2f4af0423557fe37401, byte-identical to the stored original. verify-captured-source.mjs printed OK … derived=0 at HEAD (56c22bf8e54e). The stored original is unchanged. No file was written; the scratch directory was removed.
Health
Structural record:
| Command | Covers | Result |
|---|---|---|
bun run check:health | links, navigation, frontmatter, source references | before: fail, 38 (30 link, 8 navigation); after: pass |
bun run check:content | projection drift | pass |
bun run test:ci | routes, rendering, sync and health scripts | pass |
Repairs:
- 19 projected
linkfindings (runbooks and reference projections):scripts/sync-content.mjsnow rewrites a relative link that resolves only from the projection source. A wiki page becomes its/docs/...route; another repository file becomes ahttps://github.com/<repo>/blob/HEAD/<path>URL; links that resolve, absolute links and code stay unchanged (TDD, see below). 17 were fixed by the rewrite alone. Two links indocs/reference/harness-intelligence.mdwere broken at the source too; they were fixed there and then rewritten. - 7 links in
research/effect-prepare-script-simplification-research-report.mdescaped the repository; they now point to permalinks at the report's commit91e61685, because most cited files no longer exist. BACKLOG-RESULT.md(issue 197): one wrong relative depth fixed.get-started/basic-usage.mdxanddomains/harness.mdx: links into the emptyharness/lifecycle-flowsnow go to the successors that the harness-public-entrypoints grill log maps (/docs/harness/entrypoints,/docs/harness/entrypoints/brainstorming-requirements-backlog). No content was invented for the empty folder; its omission fromharness/meta.jsonis intentional.tech-debt/index.mdx: the card to the index-lesstech-debt/clifolder became a sidebar pointer.- Navigation:
domainsandbacklog-providerinproject/meta.json(generated bysync-content.mjs, TDD); the two research reports,harness-public-entrypoints-backlog, and thefinder-phaseandharness-public-entrypointswriter folders in their owningmeta.json;!trust-and-adoptioninharness/meta.jsonrecords that the retained trust-and-adoption stub is intentionally hidden (its content moved to/docs/harness/trust, IP-298/IP-306).
check:health is now in the wiki check script.
Semantic record (scope: pages this run touched, their linkers, pages sharing the Karpathy source):
| Kind | Pages | Evidence | Status |
|---|---|---|---|
stale_claim | apps/wiki/index.md | Said "punks / dp CLI" and listed wikilinks | resolved: rewritten as bookkeeping that points to the routed map |
discovery_gap | project/index.mdx | Cards without scope summaries or cues | resolved: root map with one "Applies when" cue per section and topic |
contradiction | Linear IP-439 vs this spec | IP-439 proposes removing apps/wiki; the spec keeps it | unresolved (P2): IP-439's scaffold premise is stale since CLI 6.0.0 (80a483bcf); remaining conflicts are one authority versus docs/ projection, and the knowledge home and renderer. User direction pending requirements-grill (see Debt and follow-ups) |
stale_claim | domains/harness.mdx | Intro still names "lifecycle flows"; the section moved to entrypoints | unresolved: text outside the link-only amendment; owner Harness domain docs |
stale_claim | .agents/notes/2026-07-10-project-owned-wiki-sync.md | First paragraph describes hi update recreating the sync script; since CLI 6.0.0 hi init never creates or aligns a wiki (docs/reference/hi-requirements.md) | unresolved: outside T9 paths; owner coordinator |
stale_claim | docs/README.md line 5 | Calls project-owned setup/adoption "proposed"; it is implemented | unresolved: outside T9 paths; owner coordinator |
contradiction | apps/wiki/AGENTS.md contract, proxy.ts | Contract declares per-page Markdown at /docs/<path>.mdx; GET returns 404 because proxy.ts is not compiled | unresolved: runtime fix (likely move to src/proxy.ts) outside T9 paths; owner coordinator |
missing_connection | glossary | No link from the glossary to the new hub; the plan keeps the glossary unchanged | unresolved: reachable from the hub and the root map; next glossary edit |
Refresh outcomes: .agents/notes/2026-07-10-project-owned-wiki-sync.md mark_stale (recommended, not applied; see above). research/karpathy-compounding-wiki-research-report.md keep: point-in-time primary evidence; its reusable knowledge now lives in the hub concept. Resume: not applicable. Conflicts: none.
Ingest
Outcome complete.
- Sources: this
SPEC.md(blob1629e04a357e2e791044eda11a4e13403a32d293, freshness unknown before this run: no recorded identity), these notes,ARCHITECTURE.md, the implementation commits above, and the Karpathy original (sourcesfrontmatter). - Flows (written first): setup and adoption, source capture, reconciliation, consultation, health and recovery.
- Concepts: hub, wiki contract, provenance record, freshness, health outcome. The glossary stays the term owner; the pages link it instead of repeating it.
- Route:
project/domains/, beside the glossary.harness/lifecycle-flowsis empty and superseded byharness/entrypoints, so it is not a home. - Discovery: all ten pages in
domains/meta.json, one root-map entry each inproject/index.mdx, hub card indomains/index.mdx. - Bookkeeping:
SPEC.mdgained onlyingested_revisionandlast_ingested(coordinator-approved). These notes carry their owningested_revision. - Log: one entry appended to
apps/wiki/log.md.
Runtime
Production build served by next start behind a task-owned portless proxy at https://t9-wiki-proof.localhost:1357, inside systemd-run --user --scope units. The shared proxy on port 1355 belongs to another user's state directory and does not route this user's names, so the run started its own proxy on 1357 and stopped it afterwards.
| Request | Status | Content type | Evidence |
|---|---|---|---|
GET /llms.txt | 200 | text/plain;charset=UTF-8 | 11 lines for /docs/project/domains/wiki-knowledge-maintenance*, for example - [Wiki Knowledge Maintenance](/docs/project/domains/wiki-knowledge-maintenance): The capability that keeps … |
GET /llms.mdx/docs/project/domains/wiki-knowledge-maintenance/content.md | 200 | text/markdown | Contains the sources line with apps/wiki/raw/external/karpathy-llm-wiki/ac46de1ad27f/llm-wiki.md and SHA-256 dc3efe98…7401, the IP-439 open question and wearedevpunks/skills@3da47eb |
GET /api/search?query=source%20capture | 200 | application/json | First result: page /docs/project/domains/wiki-knowledge-maintenance-provenance-record |
GET /api/search?query=provenance%20record | 200 | application/json | Provenance record page at result 9; four more new pages follow |
GET /docs/project | 200 | text/html | Root map renders with its "Applies when" cues |
GET /raw/external/karpathy-llm-wiki/ac46de1ad27f/llm-wiki.md | 404 | Raw home is not served; source.json, /docs/raw/…, /index.md and /log.md also return 404 | |
GET /docs/project/domains/wiki-knowledge-maintenance.mdx | 404 | text/html | Contract form of per-page Markdown fails; Accept: text/markdown on the page returns HTML |
The last row is a pre-existing defect: apps/wiki/proxy.ts (the Next.js 16 request proxy that rewrites /docs/<path>.mdx and negotiates Markdown) sits at the app root, but the app uses src/app, and the build's .next/server/middleware-manifest.json lists no middleware. The direct route /llms.mdx/docs/<path>/content.md works.
Cleanup: both scopes stopped; ports 4214, 4797 and 1357 have no listener; the task route and its host certificates were removed from ~/.portless; .next was restored to its pre-task 33 files (1.7 MB); scratch files in /tmp were removed.
TDD: projected links and project navigation
tdd_status: required for scripts/sync-content.mjs only.
| Cycle | RED | GREEN |
|---|---|---|
| Projected links | bunx vitest run scripts/sync-content.test.mjs: new case failed at ok(projected.includes("- [Spec](/docs/project/specs/demo/SPEC#scope)")), 1 failed / 6 passed | 7 passed |
| Project navigation | new case failed at ok(pages.includes("domains")), 1 failed / 7 passed | 8 passed |
Before the sync was applied, node scripts/sync-content.mjs --check listed only update entries (five projected pages and project/meta.json) and no removals.
Rule evidence (T9)
- HI-WIKI-001 pass: every new page is in its owning
meta.json; the spec folder order (SPEC, PLAN, IMPLEMENTATION-NOTES, ARCHITECTURE) is generated bysync-content.mjs; no new route surface;check:contentpasses. - HI-WIKI-003 pass: schema-valid frontmatter,
check:health0 findings,test:ci66/66 (includes the public wiki contract test),SPEC.mdand notes bookkeeping, log entries appended. - HI-DOCS-001 pass: domain knowledge stays in
apps/wiki; the one rootdocs/edit is a canonical-source link fix, synced into its projection. Follow-up fordocs/README.mdbelow. - HI-UI-001 not applicable: no UI component or composition changed.
- HI-REPO-003 pass: no local URL changed; the runtime check used a portless hostname; no raw
localhost:<port>URL was added.
Review and repair
Review ordinal 1: report, retained in fd9f38a65. Two axes (standards, spec); 5 verified findings, 4 medium and 1 low.
| Finding | Severity | Defect | Resolution |
|---|---|---|---|
| wkm-r1-001 | medium | The contract declared per-page Markdown at /docs/<path>.mdx (404) | 41a309d0c: the contract declares /llms.mdx/docs/<path>/content.md; the uncompiled proxy.ts stays a follow-up |
| wkm-r1-002 | medium | The consultation flow and these notes called T10 and AC-037 pending | Docs ingest 2026-10-08 (see Consultation returns) |
| wkm-r1-003 | medium | check:health accepted relative links that leave content/docs | 41a309d0c: such links are link findings, with a fixture test; escaping links now use routed pages or GitHub blobs |
| wkm-r1-004 | medium | verify-captured-source.mjs accepted ../ in source.json file values | skills 189cb114 rejects non-plain file names; synced by c54d0bba3 |
| wkm-r1-005 | low | PLAN.md kept empty RED/GREEN evidence for the TDD tasks | 9184d9a20: evidence recorded per task |
Focused repair validation: check:health clean, test:ci 67/67, lint 0 findings, check-types 0 errors, skills suite 315/301/14, equal to the pre-repair baseline. A second review pass is eligible and not requested.
Consultation returns
The T10 consultation returned R1–R3 (returned findings). Docs ingest 2026-10-08:
- R1 resolved: the overview IP-439 callout and the
contradictionrow above name the stale scaffold premise and the two remaining conflicts. - R2 resolved:
decisions/wiki-content-ownership.mdxsourcepoints tocontent/docs/project/specs/cli/IP-99-private-harness-wiki-app/SPEC.md. - R3 unresolved, semantic
contract_gap:docs-ingest-phase/references/wiki-ingest.md§ Log lists the kindscapture | ingest | maintenance | grill | spec. A consultation that writes a page and a retained review report have no kind;log.mdlogs them asmaintenanceandreview. Owner: shared skills, throughwearedevpunks/skillsmain.
Deviations
- The installed
.agents/skillsmirror still holds the pre-delivery skills. It updates only when a published baseline is adopted; Registry publication was not requested. This run read the syncedapps/cli/skillscopy. - Scope: the
sync-content.mjsnavigation cycle (domains,backlog-provider) and the twoSPEC.mdbookkeeping lines were outside the original T9 amendment; the coordinator approved both. project/index.mdxlost its "Current Operator Lifecycle" paragraph (an IP-322 pointer); the Runbooks and Specs map entries cover it.- The links frontmatter in these notes uses
/docs/...routes, asSPEC.mddoes, not the wikilink form of thewiki-ingest.mdtemplate.
Debt and follow-ups
create-spec/references/folder-naming.mdin the shared skills still hard-codes theapps/wikispecs roots instead of reading the wiki contract.docs/README.mdshould mention the projected-link rewrite in itssync-content.mjsparagraph, and drop "proposed" for setup/adoption.- The unresolved semantic findings above, first the inactive
proxy.ts. - IP-439 user direction, 2026-10-08, verbatim: "no docs we keep apps/wiki only". Accepted by the user, not integrated. It reverses Q8 and
HI-DOCS-001; arequirements-grillround on IP-439 runs before any change todocs/, rules or this spec (record). - R3: add log entry kinds for consultation and review to the shared
wiki-ingest.md§ Log (see Consultation returns).