Knowledge Unification
Spec: Knowledge Unification
Context
This repository has two knowledge homes. Root docs/ holds 24 files (reference pages, 17 tech-debt pages, runbooks, a 94 KB index) and apps/wiki/scripts/sync-content.mjs copies them into the wiki. HI-DOCS-001, 15 AGENTS.md files and the docs subagent make root docs/ the authority for implemented operations, while apps/wiki owns everything else. Agents that follow different guidance write to different places. The wiki also takes part in CI, bun install, Vercel PR statuses and lint/type/test scripts, so wiki problems can fail gates.
Linear IP-439 asked to unify the knowledge. The closed grill accepted: delete root docs/, keep Fumadocs, make apps/wiki the only Knowledge home, and enforce Wiki gate isolation. Terms follow the glossary.
Non-Goals
- Replace Fumadocs or the one routed tree
apps/wiki/content/docs(Q2). - Reorganize moved pages by domain (Q5; later separate work).
- Add CLI code that migrates target repositories (Q3).
- Rewrite historical text: grill logs,
apps/wiki/log.mdentries, research reports, existing spec artifacts other than the knowledge-maintenance pair, commit-pinned links, tracked.tmp/proof artifacts (Q13). - Add any failing wiki check (Q15).
- Fix the pre-existing broken link
project/runbooks/harness-trust-gate.
Requirements and Outcomes
OUT-001: One knowledge home with stable routes
Root docs/ does not exist. Its pages live in apps/wiki/content/docs at their current routes, its index entries live in the wiki index pages, and tech debt lives in one section.
Architecture: OUT-001 mapping; ARC-001, ARC-002, ARC-003, FLOW-001.
OUT-002: One authority in guidance and history
Rules, AGENTS.md files, subagents and live links name only the wiki as the knowledge home. The decision history records the change without rewriting old records.
Architecture: OUT-002 mapping; ARC-004, ARC-005, FLOW-003.
OUT-003: Wiki gate isolation
No lint, type check, test, CI job, commit gate, install step or PR deploy status can fail because of wiki content or wiki code.
Architecture: OUT-003 mapping; ARC-006 to ARC-010, ARC-013, FLOW-002.
OUT-004: Target repositories follow through the Baseline
The shared skills route knowledge and tech debt to the wiki. The change ships as a Baseline release, and IP-439 describes the accepted scope.
Architecture: OUT-004 mapping; ARC-011, ARC-012, FLOW-004.
Acceptance Criteria
- AC-001:
git ls-files docsreturns nothing, and no filedocs/README.mdor redirect page exists at the repository root.- Covers: OUT-001
- Architecture: ARC-001, FLOW-001-STEP-004
- AC-002: Every page that existed under
apps/wiki/content/docs/project/reference/(excepttech-debt/) andapps/wiki/content/docs/project/runbooks/before the change exists at the same path after it, with its content kept.- Covers: OUT-001
- Architecture: ARC-002, FLOW-001-STEP-001
- AC-003: Each current entry of the former
docs/README.md(outside its "Historical records" block) is linked fromproject/index.mdxor the index page of the section that owns the target. The "Historical records" block is not copied.- Covers: OUT-001
- Architecture: ARC-002, FLOW-001-STEP-003
- AC-004:
apps/wiki/content/docs/project/reference/tech-debt/does not exist. The 17 files are underapps/wiki/content/docs/project/tech-debt/<domain>/...with the same sub-paths, are listed inmeta.jsonnavigation and the section index, and no live link targets/docs/project/reference/tech-debt.- Covers: OUT-001
- Architecture: ARC-003, FLOW-001-STEP-002
- AC-005:
HI-DOCS-001requires all project knowledge inapps/wikiand forbids a rootdocs/knowledge tree; its authority and activation name no rootdocs/path; its verification is a review check, not a CI check.- Covers: OUT-002
- Architecture: ARC-004
- AC-006: No
AGENTS.mdfile asks to updatedocs/README.md. RootAGENTS.md,apps/wiki/AGENTS.mdand every nestedAGENTS.mdthat had the duty ask to update the owning wiki page and its section index. EachCLAUDE.mdmirror stays a symlink.- Covers: OUT-002
- Architecture: ARC-004, FLOW-003-STEP-001
- AC-007:
.agents/subagents/manifest.mjshas nodocsagent, and.claude/agents/docs.md,.codex/agents/docs.toml,.cursor/agents/docs.md,.opencode/agents/docs.mddo not exist. All other harness agent mirrors match the manifest and guidance files.- Covers: OUT-002
- Architecture: ARC-004
- AC-008: Outside the historical text named in Non-Goals, outside
apps/clitarget-repository behavior and its tests, and outside generated.devpunksartifacts, no tracked file links to or names a rootdocs/path (docs/README.md,docs/reference/...,docs/runbooks/...,docs/AGENTS.md) as a live location.HI-REPO-003names the wiki page ofdp-requirements.- Covers: OUT-002
- Architecture: ARC-004, FLOW-001-STEP-005
- AC-009: The knowledge-maintenance grill log has a new entry that supersedes its Q8 and links this grill; its Q8 entry is unchanged. The knowledge-maintenance
SPEC.mdandARCHITECTURE.mdno longer state that rootdocs/is the authority for implemented operations.- Covers: OUT-002
- Architecture: ARC-005
- AC-010:
sync-content.mjsreads no path under rootdocs/; it still projectsapps/wiki/specs/tocontent/docs/project/specs/.turbo.jsonhas no$TURBO_ROOT$/docs/**input, and@punks/wiki#builddoes not depend oncheck:content.bun run --cwd apps/wiki check:contentreports the wiki current.- Covers: OUT-003
- Architecture: ARC-006
- AC-011:
bun run --cwd apps/wiki check:healthreports a rootdocs/directory, a frontmattersource:path that does not resolve, and a dead link, and exits 0 when it finds them. No build, CI job or commit gate runs it.- Covers: OUT-003
- Architecture: ARC-007, FLOW-003-STEP-004
- AC-012: A turbo dry run of the
affectedtask set with a change limited toapps/wikior toCHANGELOG.md/BASELINE_CHANGELOG.mdselects no@punks/wikitask.run-ci-verification.mjspasses--filter=!@punks/wikiinaffectedandplan; roottest:ciexcludes@punks/wikiin every turbo run.- Covers: OUT-003
- Architecture: ARC-008, FLOW-002-STEP-002
- AC-013:
apps/wiki/vercel.jsonhas anignoreCommandthat exits 0 (skip) whenVERCEL_GIT_COMMIT_REFis notmainand exits 1 (build) onmain.- Covers: OUT-003
- Architecture: ARC-009, FLOW-002-STEP-003
- AC-014:
apps/wiki/package.jsonscripts are exactlybuild,dev,start,check:content,check:health. No wiki test file, vitest config, oxlint config, oxlint tool or health test fixture remains; dev dependencies used only by them are removed andbun.lockmatches.turbo.jsonhas no entry for a deleted wiki task.bun installruns no wiki lifecycle script.- Covers: OUT-003
- Architecture: ARC-010, FLOW-002-STEP-001
- AC-015:
classify-release-impact.mjshas nodocs/prefix rule.scripts/assert-wiki-generated-source.mjsdoes not exist, and no turbo input orlint:repoargument names it.apps/cli/srcis unchanged by this work.- Covers: OUT-003
- Architecture: ARC-013
- AC-016: In the shared skills source on
mainand in the synced copies here,resolve-debt-phaseandimplement-specname<wiki-root>/content/docs/project/tech-debt/<domain>/...for tech debt, anddocs-ingest-phaseroutes implemented operations to the wiki and treats a rootdocs/only as legacy input to merge. The sync receipt names the pinned commit. - AC-017:
BASELINE_CHANGELOG.mdUnreleasedhas a non-empty note for this change, andbun run release:classify -- --base origin/main --head HEADselectsbaseline.- Covers: OUT-004
- Architecture: ARC-011, FLOW-004-STEP-003
- AC-018: Linear IP-439 in HARNESS INTELLIGENCE describes the accepted scope, links this spec, and has no
foglabel.- Covers: OUT-004
- Architecture: ARC-012
Constraints
- Moved pages keep their routes (Q5). Tech-debt pages move once, to
project/tech-debt/<domain>/...(Q7). - The repository change lands on
mainas one squashed commit, somainnever holds two authorities or a half-moved tree. - Shared skills are edited only in
/home/stefan/repos/skillsonmain, then synced;.agents/skills/*andapps/cli/skills/*are not edited by hand. Skill andAGENTS.mdtext followswriting-for-agents. CLAUDE.mdfiles stay symlinks to theirAGENTS.md.- Wiki health findings never fail a gate (Q15).
Dependency Readiness
No Stack Required
Branch/Base Intent
Not applicable. The user directed one squashed commit on main.
Architecture Source
- URL: https://github.com/wearedevpunks/harness-intelligence/blob/d795b03ee26e8ec6551592e2c94cbd312f6e167e/apps/wiki/content/docs/project/specs/wiki/knowledge-unification/ARCHITECTURE.md
- Commit:
d795b03ee26e8ec6551592e2c94cbd312f6e167e - Path:
apps/wiki/content/docs/project/specs/wiki/knowledge-unification/ARCHITECTURE.md - Content identity: SHA-256
46b99403eafebcfeb8b9b25abddef3796fdd226ed4d82071284d5106476dc451
Accepted Technical Decisions
| Decision | Detail | Source |
|---|---|---|
| Knowledge home | apps/wiki/content/docs; root docs/ deleted with no stub | Q1, ARC-001 |
| Renderer | Keep Fumadocs and one routed tree | Q2 |
| Routes | Keep project/reference/* and project/runbooks/* | Q5, ARC-002 |
| Index | docs/README.md entries into project/index.mdx and section indexes; drop "Historical records" | Q6 |
| Tech debt | project/tech-debt/<domain>/...; skills point there | Q7, ARC-003 |
| Rules and guidance | HI-DOCS-001 rewritten; AGENTS.md duty "owning wiki page and its section index"; docs subagent retired; HI-REPO-003 repointed | Q8–Q11, ARC-004 |
| History | Supersede knowledge-maintenance Q8 by a new entry; update its live SPEC/ARCHITECTURE text; keep historical text | Q12, Q13, ARC-005 |
| Projection | Only apps/wiki/specs/; remove $TURBO_ROOT$/docs/**; build does not depend on check:content | Q14, Q20, ARC-006 |
| Health | check:health is report-only | Q15, ARC-007 |
| CI | --filter=!@punks/wiki in affected, plan; root test:ci filtered; changelog files out of wiki turbo inputs | Q16, ARC-008 |
| Vercel | ignoreCommand builds main only | Q17, ARC-009 |
| Scripts | Keep build, dev, start, check:content, check:health; delete lint, format, type-check, check, test scripts, postinstall, tests and orphaned files | Q18–Q20, ARC-010 |
| Skills and release | Fix resolve-debt-phase, implement-spec, docs-ingest-phase on skills main; sync; BASELINE_CHANGELOG.md note; no CLI code | Q3, ARC-011 |
| Orphans | Release classifier docs/ rule and assert-wiki-generated-source.mjs removed | R2 checkpoint, ARC-013 |
Accepted Testing Decisions
- The wiki has no automated tests after this change (Q19). Verification uses commands and inspection, not new tests.
- Repository script changes (
run-ci-verification.mjs,classify-release-impact.mjs) are verified by their existing tests and by a turbo dry run.
Verification Seams
git ls-files,git grepfor live root-docs/paths (AC-001, AC-004, AC-006, AC-008, AC-015).bun run --cwd apps/wiki check:contentandcheck:health(AC-010, AC-011).turbo run build check-types test --affected --filter=!@punks/wiki --dry=jsonwithTURBO_SCM_BASE/TURBO_SCM_HEAD(AC-012).apps/wiki/vercel.jsonignoreCommandrun withVERCEL_GIT_COMMIT_REF=mainand another branch (AC-013).apps/cli/.devpunks-cache/skills-sync.jsonreceipt (AC-016);release:classifyoutput (AC-017); Linear readback (AC-018).