Knowledge Unification
Architecture: Knowledge Unification
Context and Scope
- Capability identity:
apps/wiki/content/docs/project/specs/wiki/knowledge-unification. The capability makesapps/wikithe one Knowledge home of this repository and makes sure that no repository gate fails because of the wiki. Linear issue: IP-439. - Actors and outcome: agents that write or read project knowledge, maintainers that run CI and releases, and target repositories that receive shared skills through the Baseline. The outcome is one place to write and find knowledge, and no wiki-caused gate failure (Q1, Q2).
- In scope: delete root
docs/; keep its pages at their current wiki routes; merge the tech-debt sections; move authority statements, rules,AGENTS.mdduties and thedocssubagent to the wiki; remove the root-docs/projection; isolate the wiki from CI, Vercel PR statuses, install and lint/type/test scripts; fix the shared skills that hard-code rootdocs/; rewrite IP-439. - Non-goals: replace Fumadocs (Q2); reorganize the moved pages by domain (Q5); add CLI migration code for target repositories (Q3); rewrite historical text (Q13); add a failing wiki guard (Q15).
- Spec: sibling
SPEC.mdin this folder.
Canonical Terms
Terms come from the published glossary and the status glossary.
- Knowledge home: the one directory that owns all durable project knowledge. Here:
apps/wiki. - Projection: a committed wiki page that
scripts/sync-content.mjsgenerates from a source outsidecontent/docs. After this change the only source isapps/wiki/specs/. - Root docs: the repository directory
docs/. This change deletes it. - Wiki gate isolation: no lint, type check, test, CI job, commit gate or deploy status fails because of wiki content or wiki code.
Axioms: apps/wiki is the only knowledge home and root docs/ does not exist. No gate fails because of the wiki. Fumadocs renders the one routed tree apps/wiki/content/docs. Wiki health findings are reports, never gate failures. "Root docs/" names the directory; "route /docs/..." names wiki URLs.
Sources
| Source | Role | Exact location and anchor | Immutable revision or content hash |
|---|---|---|---|
| S1 | Grill status and closure | Status, #branches, #technical-grounding | Commit 45fc437bb4dad8271e3f3ce8c7cebbf9f1e53c7a; SHA-256 270e515f966b9887435f1fd645857bfa569162c75d12935a61d577c6da83af9e |
| S2 | Durable grill log | Log, #q1 to #q20, #r2-checkpoint, #closure | Commit 45fc437bb; SHA-256 78114c4b42f0965609f7a6b3b41105c1de4ff0bc8895ac9485069996856f553e |
| S3 | Current glossary | Status #glossary; published glossary | Status as S1; glossary SHA-256 a221f7c99fd31bb04f98870666b712c1be50965cdba5dc8caa1f398b5eb07a64 |
| S4 | Superseded prior decision | Knowledge-maintenance Q8 | Commit 45fc437bb; SHA-256 fee0fcac62c46b3917783126d2c5fa8ef755f30666ba137b14b10ac33f56bd57 |
| S5 | Observed current code (not design) | apps/wiki/scripts/sync-content.mjs:119-160,214-228; apps/wiki/package.json scripts; turbo.json @punks/wiki#build, #check:content, #check-types; scripts/behavior-contract/run-ci-verification.mjs:253-291; package.json:48,63; apps/wiki/vercel.json; apps/cli/scripts/classify-release-impact.mjs:168; .agents/rules/docs/knowledge-boundary.md; .agents/subagents/manifest.mjs docs entry | Commit 45fc437bb (tree identical to origin/main 0777e5bd7 outside apps/wiki/content and apps/wiki/log.md) |
| S6 | Shared skills source | /home/stefan/repos/skills main: resolve-debt-phase/SKILL.md, implement-spec/references/lifecycle.md, docs-ingest-phase/{SKILL.md,phases/private-internal.md,phases/router.md,references/repo-docs.md} | main at 189cb11 |
S5 records current behavior. The design below records accepted target behavior. Neither proves the other.
Source Disposition
| Question / entry | Disposition | Accepted detail, replacement, or unresolved point | Evidence | Parked owner / resume trigger |
|---|---|---|---|---|
| Q1 to Q14 | accepted | See exact detail coverage | S2 | Not parked |
| Q15 | accepted | Advisory check:health; supersedes the R1 draft that proposed a failing guard | S2 #q15 | Not parked |
| Q16 to Q20 | accepted | See exact detail coverage | S2 | Not parked |
| Knowledge-maintenance Q8 | superseded | Root docs/ is no longer the authority for implemented operations; replaced by Q1 and Q12 | S4, S2 #q12 | Not parked |
| R2 checkpoint | accepted (consequences of Q1, Q3, Q16, Q18) | Dead docs/ prefix in the release classifier; orphaned assert-wiki-generated-source.mjs; docsRoot re-derived by hi update; Vercel build does not read turbo inputs | S2 #r2-checkpoint, S5 | Not parked |
Whole System
Anchors: Q1, Q2, Q14, Q16–Q20. Conclusion: today two write paths and two authorities exist, and the wiki has four edges into gates. The target has one write path and one authority. The wiki has no edge into any gate. The only remaining wiki signal is a report.
| Block selector / component / level | Owner | State and authority | Interface / dependency | Supported constraint and source |
|---|---|---|---|---|
| ARC-001 Knowledge home | apps/wiki | apps/wiki/content/docs is the only authoritative knowledge tree; root docs/ is absent, with no stub or redirect | Fumadocs routes /docs/... | One knowledge home (Q1, Q2) |
| ARC-002 Moved pages and index | apps/wiki | The committed copies under project/reference/* and project/runbooks/* become authored pages at their current routes. docs/README.md entries move into project/index.mdx and the section index pages; its "Historical records" block is dropped | Existing route links (about 400) stay valid | No route churn; one index (Q5, Q6) |
| ARC-003 Tech-debt section | apps/wiki | One section project/tech-debt/<domain>/...; the 17 files under project/reference/tech-debt/ move there, keeping their sub-paths | resolve-debt-phase, implement-spec write here | One tech-debt route (Q7) |
| ARC-004 Authority and guidance | repository guidance | HI-DOCS-001 states: all project knowledge lives in apps/wiki; no root docs/ knowledge tree may exist (review rule, not CI). Root and nested AGENTS.md duty: "update the owning wiki page and its section index". docs subagent and docs/AGENTS.md retired; its harness mirrors removed. HI-REPO-003 and other live rules, guidance and links point at the wiki pages | Rule Registry; .agents/subagents/manifest.mjs; harness mirrors under .claude, .codex, .cursor, .opencode | One authority (Q8–Q11) |
| ARC-005 Decision history | apps/wiki | Knowledge-maintenance grill log gets a new entry that supersedes its Q8 and links this grill; live statements in its SPEC.md and ARCHITECTURE.md that make root docs/ the authority are updated. Grill logs, log.md entries, research reports, other spec artifacts and commit-pinned links stay unchanged | Append-only log | Truthful history (Q12, Q13) |
| ARC-006 Projection pipeline | apps/wiki/scripts | sync-content.mjs keeps only the specs/ projection; the root-docs/ copy, its link-rewrite projections and tech-decisions.md copy are deleted. turbo.json loses $TURBO_ROOT$/docs/**. build no longer depends on check:content; it writes the specs/ copies and continues | bun run build = sync-content.mjs && fumadocs-mdx && next build | No dead input; no build failure from stale copies (Q14, Q20) |
| ARC-007 Health reporting | apps/wiki/scripts/check-health.mjs | Reports a returned root docs/, broken frontmatter source: paths and dead links. Never wired into a build, CI job or commit gate | Run by agents through docs-ingest-phase and the knowledge-maintenance flow | Advisory detection (Q15) |
| ARC-008 CI isolation | root scripts, turbo.json | run-ci-verification.mjs passes --filter=!@punks/wiki to the affected and plan turbo runs; static runs only root tasks and stays free of wiki tasks. Root test:ci also excludes @punks/wiki. The wiki turbo inputs no longer list root CHANGELOG.md or BASELINE_CHANGELOG.md | GitHub check "Affected Verification" | Wiki never selected in CI (Q16) |
| ARC-009 Vercel deploy status | apps/wiki/vercel.json | An ignoreCommand skips every build whose branch is not main; only main deploys the wiki | Vercel project harness-intelligence-wiki | No failing wiki status on PRs (Q17) |
| ARC-010 Wiki script surface | apps/wiki/package.json | Scripts kept: build, dev, start, check:content, check:health. Deleted: lint, format, format:check, check-types, types:check, check, test, test:ci, postinstall, the 5 test files, and the files and dev dependencies that only they used. Turbo entries for deleted tasks are removed | bun install runs no wiki step | Nothing can lint, type-check or test the wiki (Q18–Q20) |
| ARC-011 Shared skills and Baseline | /home/stefan/repos/skills main | resolve-debt-phase and implement-spec write tech debt to <wiki-root>/content/docs/project/tech-debt/<domain>/.... docs-ingest-phase routes implemented operations to the wiki and treats a root docs/ as legacy input to merge, never a write target. Changes reach this repository through bun run sync:skills and reach targets through the Baseline; BASELINE_CHANGELOG.md Unreleased gets a reviewed note | apps/cli/scripts/sync-skills-repo.mjs pin | Same knowledge home in targets, no CLI migration code (Q3) |
| ARC-012 Backlog identity | Linear | IP-439 is rewritten to the accepted scope in the HARNESS INTELLIGENCE project; label fog removed at grill closure | Linear issue IP-439 | One delivery identity (Q4) |
| ARC-013 Peripheral consequences | repository scripts, CLI | classify-release-impact.mjs drops its docs/ prefix; scripts/assert-wiki-generated-source.mjs is deleted with its turbo input and lint:repo argument. The CLI keeps its target-repository behavior: docsRoot detection and the docs/AGENTS.md prompt stay; this repository's generated .devpunks artifacts refresh on the next hi update | apps/cli/src/registry/shape.ts:142 | No dead paths; no CLI change (R2 checkpoint, Q3) |
Critical Flows and Boundaries
- FLOW-001-STEP-001: The committed copies already carry rewritten
/docs/...links and frontmatter. They stay in place and become authored (Q5). - FLOW-001-STEP-002: Tech-debt files move to
project/tech-debt/<domain>/...; inbound links follow (Q7). - FLOW-001-STEP-003: Current entries move into the wiki index pages; "Historical records" is dropped (Q6).
- FLOW-001-STEP-004: Root
docs/and the copy code are deleted together, so no step sees a source without its copy step or the reverse (Q1, Q14). - FLOW-001-STEP-005: Authority statements, rules, live links and the subagent move in the same change (Q8–Q11).
- FLOW-001-STEP-006:
check:healthreports remaining findings; no gate consumes the report (Q15).
Conclusion: the steps land in one squashed commit on main. No intermediate state reaches main, so no reader sees two authorities or a half-moved tree.
- FLOW-002-STEP-001: No
postinstallexists in the wiki, so a wiki failure cannot breakbun install(Q20). - FLOW-002-STEP-002: Turbo never selects
@punks/wiki; changelog edits do not make it affected (Q16). - FLOW-002-STEP-003: Vercel skips the wiki build on every non-
mainbranch (Q17). - FLOW-002-STEP-004: A
mainbuild runssync-content.mjs,fumadocs-mdx,next build. Its failure affects the deployed wiki only; no repository gate reads it (Q2).
Conclusion: every entry point into a gate has no wiki edge. Changed-file lint/format, root check and the commit gate contracts already exclude the wiki (S2 #branch-wiki-gate-isolation).
- FLOW-003-STEP-001: Guidance names the owning wiki page and its section index (Q8, Q9).
- FLOW-003-STEP-002: Shared skills route to
<wiki-root>; a rootdocs/is legacy input only (Q3). - FLOW-003-STEP-003: Tech debt lands in
project/tech-debt/<domain>/...(Q7). - FLOW-003-STEP-004: The agent reads the health report and acts on it (Q15).
Conclusion: the two write paths that diverged before (status brainstorm finding) become one.
- FLOW-004-STEP-001: Edit and commit the skills on
/home/stefan/repos/skillsmain; push and tag. - FLOW-004-STEP-002: Move the pin in
apps/cli/scripts/sync-skills-repo.mjs, runbun run sync:skills, verify the receipt SHA. - FLOW-004-STEP-003: Add the reviewed
BASELINE_CHANGELOG.mdUnreleasednote; release classification selectsbaseline; the release workflow publishes the Baseline frommain. - FLOW-004-STEP-004: A target runs
hi update; a target that keeps a rootdocs/reconciles it in the post-command handoff only if needed.
Anchors: Q3; repository rule "Shared skills source of truth". Conclusion: targets change through the existing Baseline path; the CLI gets no new code.
Accepted Detail Coverage
| Question + exact entry/evidence anchor | Exact accepted choice and supplied detail | Provided rationale / alternatives | Architecture selector + applicable visual | System constraint served |
|---|---|---|---|---|
| Q1 | Delete root docs/ completely; no stub docs/README.md or redirect | User: "no docs we keep apps/wiki only" | ARC-001, FLOW-001-STEP-004 | One knowledge home |
| Q2 | Keep Fumadocs and one content/docs tree; no gate may fail because of the wiki; no lint or type check of the wiki | User: "no lints or ci or whatever must EVER fail due to wiki" | ARC-001, ARC-008–ARC-010, FLOW-002 | Wiki gate isolation |
| Q3 | Migrate here only; fix resolve-debt-phase, implement-spec, docs-ingest-phase (references/repo-docs.md) in the shared source on main, then sync; targets follow through the Baseline; no CLI migration code; BASELINE_CHANGELOG.md note | User: "will apply here only due to baseline update" | ARC-011, ARC-013, FLOW-004 | Reusable reach without CLI change |
| Q4 | Rewrite IP-439 in HARNESS INTELLIGENCE; remove label fog at grill closure | not recorded | ARC-012 | One delivery identity |
| Q5 | Moved pages stay at project/reference/* and project/runbooks/*; domain reorganization is later separate work | About 400 links stay valid | ARC-002, FLOW-001-STEP-001 | No route churn |
| Q6 | docs/README.md entries move into project/index.mdx and section index pages; "Historical records" dropped | A second index goes out of date; git keeps history | ARC-002, FLOW-001-STEP-003 | One index |
| Q7 | One section project/tech-debt/<domain>/...; 17 files move; resolve-debt-phase and implement-spec point there | Two routes; skills wrote to the wrong one | ARC-003, ARC-011, FLOW-001-STEP-002, FLOW-003-STEP-003 | One tech-debt route |
| Q8 | Rewrite HI-DOCS-001: all project knowledge in apps/wiki; no root docs/ knowledge tree; review rule, not CI | Keeps agents from bringing docs/ back | ARC-004, FLOW-003-STEP-001 | One authority |
| Q9 | Nested, root and apps/wiki AGENTS.md: "update the owning wiki page and its section index" | Same duty, new place | ARC-004, FLOW-003-STEP-001 | One authority |
| Q10 | Retire docs/AGENTS.md and the docs subagent (manifest entry and harness mirrors); apps-wiki owns the pages | Two owners conflict | ARC-004 | One owner |
| Q11 | HI-REPO-003 and other rules naming root docs/ paths point at the moved wiki pages | not recorded | ARC-004, FLOW-001-STEP-005 | No dead authority paths |
| Q12 | New entry in the knowledge-maintenance grill log supersedes its Q8; live SPEC and ARCHITECTURE statements updated | not recorded | ARC-005 | Truthful history |
| Q13 | Historical text unchanged: grill logs, log.md, research reports, commit-pinned links | Log append-only; pinned links resolve | ARC-005 | Truthful history |
| Q14 | Delete root-docs/ copy and link-rewrite code and $TURBO_ROOT$/docs/**; keep specs/ copy (about 50 files) | Dead input after the move | ARC-006, FLOW-001-STEP-004 | No dead pipeline |
| Q15 | check:health reports returned root docs/, broken source: paths, dead links; never fails a build, CI job or commit gate | A failing guard is a wiki-caused failure | ARC-007, FLOW-001-STEP-006, FLOW-003-STEP-004 | Advisory detection |
| Q16 | --filter=!@punks/wiki in affected, plan, static; changelog files out of wiki turbo inputs | Only change that gives the guarantee | ARC-008, FLOW-002-STEP-002 | Wiki gate isolation |
| Q17 | Ignore step in apps/wiki/vercel.json; build only main | Rejected: keep previews with a red non-blocking status | ARC-009, FLOW-002-STEP-003 | No failing PR status |
| Q18 | Delete lint, format, format:check, check-types, types:check, check and their turbo entries | Removing scripts guarantees nothing runs them | ARC-010 | No wiki lint/type check |
| Q19 | Delete test, test:ci and the 5 test files | Tests CI never runs decay; rejected: keep sync-content.test.mjs | ARC-010 | No dead tests |
| Q20 | Remove postinstall: fumadocs-mdx; remove build dependency on check:content | build and dev already run fumadocs-mdx | ARC-006, ARC-010, FLOW-002-STEP-001 | No install or build break |
| R2 checkpoint | Release classifier docs/ prefix removed; assert-wiki-generated-source.mjs, its turbo input and lint:repo argument removed; docsRoot left to hi update; Vercel build does not read turbo inputs | Planning findings, no new decision | ARC-013, ARC-009 | No orphans; no CLI change |
Spec Traceability
- State: complete
| Spec code / section selector | Architecture selectors | Accepted grill Q / exact log-entry and evidence anchors | Coverage explanation |
|---|---|---|---|
OUT-001 / SPEC.md#out-001 | ARC-001, ARC-002, ARC-003, FLOW-001 | Q1, Q5–Q7 | One knowledge home with stable routes and one tech-debt section |
OUT-002 / SPEC.md#out-002 | ARC-004, ARC-005, FLOW-003 | Q8–Q13 | One authority in guidance and history |
OUT-003 / SPEC.md#out-003 | ARC-006–ARC-010, ARC-013, FLOW-002 | Q14–Q20, R2 checkpoint | Wiki gate isolation |
OUT-004 / SPEC.md#out-004 | ARC-011, ARC-012, FLOW-004 | Q3, Q4, Q7 | Shared skills and Baseline carry the change to targets; backlog identity |
AC-001 / SPEC.md#ac-001 | ARC-001, FLOW-001-STEP-004 | Q1 | Root docs/ absent, no stub |
AC-002 / SPEC.md#ac-002 | ARC-002, FLOW-001-STEP-001 | Q5 | Reference and runbook routes unchanged |
AC-003 / SPEC.md#ac-003 | ARC-002, FLOW-001-STEP-003 | Q6 | README entries in wiki indexes |
AC-004 / SPEC.md#ac-004 | ARC-003, FLOW-001-STEP-002 | Q7 | One tech-debt section; links follow |
AC-005 / SPEC.md#ac-005 | ARC-004 | Q8 | HI-DOCS-001 text and activation |
AC-006 / SPEC.md#ac-006 | ARC-004, FLOW-003-STEP-001 | Q9 | AGENTS.md duty moved |
AC-007 / SPEC.md#ac-007 | ARC-004 | Q10 | docs subagent and mirrors gone |
AC-008 / SPEC.md#ac-008 | ARC-004, FLOW-001-STEP-005 | Q11, Q13 | No live root-docs/ path outside historical text |
AC-009 / SPEC.md#ac-009 | ARC-005 | Q12, Q13 | Q8 superseded; history intact |
AC-010 / SPEC.md#ac-010 | ARC-006 | Q14, Q20 | Projection pipeline reduced to specs/ |
AC-011 / SPEC.md#ac-011 | ARC-007, FLOW-003-STEP-004 | Q15 | Report-only health check |
AC-012 / SPEC.md#ac-012 | ARC-008, FLOW-002-STEP-002 | Q16 | Wiki excluded from CI selection |
AC-013 / SPEC.md#ac-013 | ARC-009, FLOW-002-STEP-003 | Q17 | Vercel builds main only |
AC-014 / SPEC.md#ac-014 | ARC-010, FLOW-002-STEP-001 | Q18–Q20 | Wiki script surface reduced |
AC-015 / SPEC.md#ac-015 | ARC-013 | R2 checkpoint, Q3 | Orphans removed; CLI unchanged |
AC-016 / SPEC.md#ac-016 | ARC-011, FLOW-004 | Q3, Q7 | Shared skills route to the wiki |
AC-017 / SPEC.md#ac-017 | ARC-011, FLOW-004-STEP-003 | Q3 | Baseline release note and classification |
AC-018 / SPEC.md#ac-018 | ARC-012 | Q4 | IP-439 rewritten |
Flow Failure Coverage
| Lens | Evidence / unknown / justified not applicable | Guarantee at stake | Material unresolved gap |
|---|---|---|---|
| Entry points and path convergence | Writers: agents via AGENTS.md, HI-DOCS-001, shared skills, subagents (ARC-004, ARC-011). Gate entries: install, turbo CI, Vercel, root test:ci (ARC-008–ARC-010) | All writers reach one home; no gate reaches the wiki | None |
| Critical execution paths | FLOW-001 order; FLOW-004 order skills → pin → changelog → main | No intermediate state on main | None |
| State ownership and authority | ARC-001: content/docs authoritative; apps/wiki/specs sole projection source (ARC-006) | One authority | None |
| Transaction and side-effect boundaries | Repository change lands as one squashed commit; skills repo commit and Linear edit are separate side effects (FLOW-004, ARC-012) | Skills commit precedes the pin; Linear edit does not block the repository change | None |
| Concurrency and stale state | Not applicable for runtime state; tracked-file move only (S1 technical grounding). Concurrent main commits are handled by rebase before push | Rebase keeps the single-commit guarantee | None |
| Idempotency and retries | Re-running sync-content.mjs after the change touches only specs/ copies; re-running sync:skills with the same pin is a no-op | Repeated runs converge | None |
| Partial failure and recovery | Skills repo pushed but this repository not landed: pin unchanged, no effect on targets. Repository landed but Baseline publish failed: release workflow recovery path (RELEASE_RECOVERY.json) | No half-released Baseline | None |
| Execution lifetime and durability | Git commits are the only durable state; no process outlives the change | Not applicable beyond Git | None |
| Lifecycle and dependency transitions | Dependents of root docs/: links, rules, AGENTS.md, subagent mirrors, turbo input, classifier, CLI docsRoot (S2 evidence, R2 checkpoint). All removed or repointed in ARC-004, ARC-006, ARC-013 | No live reference to a deleted path | None |
| Completion and observability | check:health report, link grep for live root-docs/ paths, turbo dry run without @punks/wiki, release classification baseline | Completion is observable | None. Unknown, non-material: whether Vercel shows a skipped build as neutral or hides it; either way it cannot fail |
Parked Work and Non-material Unknowns
| Question / source | Disposition and scope consequence | Owner / resume trigger | Why current guarantees remain closed |
|---|---|---|---|
| Q5 domain reorganization | Out of scope; later separate work | Wiki maintainers; when routes are reorganized by domain | Pages keep current routes now |
| Vercel skipped-build display | Non-material unknown | none | A skipped build cannot fail a PR |
Pre-existing broken link project/runbooks/harness-trust-gate (S1 brainstorm findings) | Out of scope; reported by check:health | Wiki maintainers | Not caused by this change |
Validation
- Decision/source/glossary reconciliation: S1 confirmation
confirmed; Q1–Q20answered; glossary terms used unchanged. - Exact-detail and cross-level coverage: every accepted Q entry maps to an ARC or FLOW selector above.
- Relative links and selector targets: grill links resolve to the retained S1/S2 files; selectors have explicit anchors.
- Spec-code → architecture → grill coverage: complete for OUT-001–OUT-004 and AC-001–AC-018.
- Mermaid parsing: 4/4 blocks pass
mermaid.parsewith mermaid 11.15.0 (apps/wikidependency) under Bun, with the DOMPurify hooks stubbed because no DOM library is installed. Visual rendering was not checked. - Existing spec agreement: the knowledge-maintenance spec pair names root
docs/as the authority for implemented operations; ARC-005 updates those live statements. - Remaining limits: no runtime proof; this artifact compiles accepted design only.