R75 PLAN-RED — Step 2 Contract
This contract defines the invariants that MUST hold after the PLAN-RED rebuild lands. It gates the packet step (Step 3): the packet may not change any invariant stated here without amending this document first. Every invariant is verifiable; Step 5 verification MUST cite each one.
Upstream authority: docs/PLAN-RED.md (T0-authorized 2026-04-13) and docs/colibri-system.md (canonical vision). Where this contract tightens or narrows PLAN-RED it is because Phase 2 is further along than PLAN-RED assumed and the audit (Step 1, commit eb15dd31) surfaced 12 missing glue files, 41 pending ABSORB pairs, and 453 inbound KILL-path links. User directive 2026-04-16 overrides any earlier wording: Phase 0 documentation MUST be written accurately and sufficiently for implementation; donor residue MUST be deleted or rewritten, not preserved for genealogy.
§1. Post-rebuild shape invariants
The docs/ tree after this round MUST match the World Schema v3 spine from PLAN-RED §21-39. The following top-level paths under docs/ MUST exist and MUST NOT exist:
MUST exist (each as a directory with an index.md, or a single file as noted):
docs/0-mutate/— foundational layerdocs/1-transport/— MCP + JSON-RPC + 19 toolsdocs/2-plugin/— server boot, modes, database, middleware, healthdocs/3-world/with subdirsphysics/,social/,execution/, andphysics/laws/,physics/enforcement/docs/4-additions/— ν integrationsdocs/5-time/— session → round → task → roadmapdocs/spec/(SEED, untouched: s01–s19 + index)docs/architecture/decisions/(SEED, untouched: ADR-001 through ADR-006 + README)docs/agents/(SEED, untouched except for outbound link fixes)docs/reference/extractions/(SEED, untouched: 49 heritage archive files)docs/reference/glossary.md,docs/reference/cross-reference.md,docs/reference/design-system.md,docs/reference/mcp-tools-phase-0.md(all SEED or ABSORB-target)docs/guides/— quick-start, first-pr, write-a-skill, agent-bootstrap, agent-handoff, self-build-loop, deploy, troubleshoot, backup, implementation/docs/index.md,docs/world-schema.md,docs/colibri-system.md,docs/PLAN-RED.md
MUST NOT exist (Phase 4 deletions):
docs/concepts/(directory gone — includes α–ξ concept files,index.md,map.md,arbitration.md)docs/how-it-works/(directory gone)docs/security/(directory gone — content absorbed into3-world/physics/hardening.md)docs/operations/(directory gone — content absorbed into2-plugin/health.mdandguides/)docs/comparisons/(directory gone)docs/developers/(directory gone)docs/roadmap/(directory gone — content absorbed into5-time/roadmap.md)docs/architecture/*.md— every non-decisions file at thedocs/architecture/level is removed; only thedecisions/subdirectory survivesdocs/colibri-master-context.md,docs/faq.md,docs/inventory-r74-2.md,docs/session-seal-s6.md,docs/README.md,docs/constraints.md,docs/truth.md,docs/promise.md,docs/scenario.md,docs/scale.md,docs/extensions.md,docs/glossary.md,docs/cross-reference.md,docs/design-system.md,docs/multi-surface-topology.md,docs/master-flow.md,docs/pipeline-definition.md— all ABSORB-sources, removed after content migrates
§2. Content freshness invariants (Phase 0 accuracy)
No CANON doc MAY contain any of the following phrases as an unqualified current-Colibri fact. An “unqualified” occurrence is one not enclosed in a heritage banner, not under zone: heritage frontmatter, and not on a line that explicitly negates the claim.
Banned phrases in CANON:
78 tables,74 regular + 4 FTS5, or any donor AMS table count484 tools,490 tools,493 tools, or any donor tool count (except19 toolswhich is the Phase 0 canon)11 middleware layers,6-layer middleware, or any donor middleware count outside a labeled heritage blockdata/ams.dbpresented as the live Colibri write target. The only permitted phrasing is: “donor AMS task store, retained as HERITAGE during Phase 0 bootstrap, writeable only by task/writeback tools”AMS_*environment variables presented as the Colibri namespace. Colibri Phase 0 usesCOLIBRI_*(see2-plugin/boot.mdfor the intended namespace, e.g.COLIBRI_MODE,COLIBRI_LOG_LEVEL)~85 env varsor any bulk env-var count without an explicit heritage label
Permitted locations for donor-era numbers:
- Files under
docs/reference/extractions/(49 HERITAGE archive files, frozen) - Files carrying
zone: heritagefrontmatter AND an explicit HERITAGE banner in the body. Post-round, there MUST be at most three such files insidedocs/outside ofreference/extractions/ docs/PLAN-RED.md(historical record of what was deleted — it MUST cite old numbers to describe them)- Root
README.mdandCLAUDE.mdwhen referencing the donor lineage as history
Phase 0 target values that Phase 0-authored docs MUST align with (upstream source: docs/colibri-system.md):
- Database: exactly
data/colibri.db. Single-writer. WAL mode.better-sqlite3driver. - Middleware: exactly 5 stages, in order —
tool-lock → schema-validate → audit-enter → dispatch → audit-exit. This is the α chain. - Tool surface (Phase 0): 14 tools shipped (was a 19-tool plan at R74.5 — see ADR-004 R75 Wave H amendment for the 5 closed/deferred tools and the 1 added): 5 β Task (
task_create,task_list,task_get,task_update,task_next_actions) + 4 ζ Audit (audit_session_start,thought_record,thought_record_list,audit_verify_chain) + 2 η Proof (merkle_finalize,merkle_root) + 1 ε (skill_list) + 2 System (server_ping,server_health). This is a subset of the 60–80 long-horizon ceiling. Phase 0 docs that pre-date Wave H may still cite 19; new docs must cite the shipped 14. - Tables load-bearing for Phase 0: at minimum
thought_records,merkle_nodes,audit_events. Any additional table named in a Phase 0 doc MUST be earned by a Phase 0 sub-task acceptance criterion (P0.1.1 – P0.9.3). - Phase 0 sub-task count: exactly 28 (P0.1.1 through P0.9.3, across 9 task groups, 6 rounds R75–R80). This is the Phase 0 subset of the 63-task full-phase catalog at
docs/guides/implementation/task-breakdown.md. No doc may conflate the two counts. - Model tier: Claude only in Phase 0. Kimi, Codex, and GPT-class models are deferred to Phase 1.5 per ADR-005.
§3. Link-integrity invariants
After Phase 4 deletions run, the following MUST hold across every CANON markdown file (all files under docs/ except reference/extractions/ and files with zone: heritage frontmatter):
- Every outbound markdown link of form
](relative/path.md)or](relative/path.md#anchor)MUST resolve to a file that exists in the post-round tree. - Every doc in
docs/MUST be reachable fromdocs/index.mdin at most three hops. - Spec files s01–s19 MUST be reachable via the path
docs/index.md → docs/spec/index.md → docs/spec/sNN-*.md. - The three root docs
CLAUDE.md,AGENTS.md,README.mdMUST link only into paths that survive the rebuild. - All 453 inbound KILL-path links inventoried by the Step 1 audit MUST be either (a) rewritten to a surviving target, (b) redirected via an updated section, or (c) deleted together with their host file.
- The two link-rot hotspots identified by the audit —
docs/reference/glossary.md(34 KILL links) anddocs/reference/cross-reference.md(50 KILL links) — MUST have every one of those 84 links resolved.
§4. Root-file invariants
CLAUDE.md§9.3 “Root-level files” count MUST read 6 (bumped from 5 in R74.3.2 whenSECURITY.mdwas added). The list MUST enumerateAGENTS.md · CLAUDE.md · CODE_OF_CONDUCT.md · CONTRIBUTING.md · README.md · SECURITY.md.CLAUDE.md§11 “Documentation reference” path list MUST point only at post-round paths. Any reference toconcepts/,how-it-works/,architecture/*.md(other thanarchitecture/decisions/),security/, oroperations/MUST be gone.CLAUDE.md§9.2docs/row MUST describe the new World Schema v3 tree and MUST NOT referencetemp/plan-red-cleanup.batas a pending action once Phase 4 runs.AGENTS.mdreading order MUST be aligned with World Schema v3 layers 0-mutate → 5-time. Any link todocs/concepts/index.md(audit identified two at lines 156, 167, and 168) MUST be rewritten.AGENTS.mdMUST NOT link todocs/multi-surface-topology.mdordocs/pipeline-definition.mdas standalone files (both are ABSORB-sources that get deleted). Targets become3-world/social/surfaces.mdand5-time/round.md+5-time/task.mdrespectively.CONTRIBUTING.mdMUST NOT link todocs/concepts/index.md(audit identified two occurrences at lines 11, 15).README.md“Documentation” link MUST point atdocs/index.md(the rebuilt master hub).colibri-world-schema.mdat repo root MUST NOT exist post-round. The canonical copy isdocs/world-schema.md. The root duplicate is deleted (audit §6 flagged both files coexisting).
§5. Skill-layer invariants
.claude/skills/ams-executor/,.claude/skills/ams-observability/,.claude/skills/ams-pm/,.claude/skills/ams-tier1-chains/— all four redirect-stub skills MUST NOT exist post-round..claude/skills/README.mdMUST NOT reference anyams-*skill..agents/README.mdMUST carry an active-vs-deferred skill classification per PLAN-RED §267-269: 10 Phase 0 active skills explicitly listed, 12 heritage/deferred skills explicitly listed,swarms/colibri-5/explicitly reclassified from HERITAGE to ACTIVE.- No
.agents/skills/colibri-*SKILL.md file is altered by this round (out of scope — skills resync is deferred to a later R75.x).
§6. Data/ zone invariants
Per PLAN-RED §297-308:
data/ams.db(binary, ~72MB) MUST be retained untouched.data/README.mdMUST be retained and MUST be reduced to a one-line heritage banner describingams.dbas the Phase 0 writeback target.data/meta-prompts/(15.mdfiles) MUST NOT exist post-round.data/roadmaps/(58.mdfiles + JSON deps) MUST NOT exist post-round.data/projects/— MUST NOT exist post-round (audit confirmed it is already gone in this worktree; invariant preserves that state).- Every other
.mdfile underdata/MUST NOT exist post-round. - Total
data/*.mdfile count post-round MUST equal 1 (the retainedREADME.md).
§7. Non-regressions
In this round, the following files and directories MUST NOT be modified except to fix outbound links into KILL paths:
- Every file under
docs/spec/(s01 through s19 plusindex.md). These are SEED and frozen. - Every file under
docs/architecture/decisions/(ADR-001 through ADR-006 plusREADME.md). Frozen except for outbound link fixes. - Every file under
docs/agents/(sigma-orchestrator.md,pm-contract.md,executor-contract.md,writeback-protocol.md). Frozen except for outbound link fixes. - Every file under
docs/reference/extractions/(49 heritage archive files). Frozen. - Every file under
.agents/spawns/,.agents/swarms/,.agents/archive/. HERITAGE, read-only. - Every file under
.github/(issue templates, PR template, workflow docs). - Every file under
assets/and_includes/. _config.ymlMAY be edited only for thenavkey reflecting the new tree; no other keys change.
Phase 0 TypeScript code is out of scope entirely: no file under src/ is created in this round, and tests/ remains absent. This round ships Phase 0 documentation; it does not begin Phase 0 implementation.
§8. Verifiable acceptance criteria (Step 5 input)
Step 5 verification passes if and only if every one of the following holds. Each MUST be explicitly cited in docs/verification/r75-plan-red-verification.md.
find docs -name "*.md" | wc -lreturns a value in the inclusive range [110, 135] (target ~120 per PLAN-RED §236).grep -rE "78 tables|484 tools|data/ams\.db" docs/matches only inside files underdocs/reference/extractions/, files withzone: heritagefrontmatter, ordocs/PLAN-RED.md. Any other match fails this criterion.- An automated link-checker run over every CANON
.mdunderdocs/reports zero broken]( )targets. The checker MUST follow relative paths and MUST ignore anchors pointing at heading IDs that exist in the target file. - The
/colibri-docs-checkslash-command output classifies the tree as PASS: no orphans, no broken links, no unlabeled stale numbers, no missing indexes. - All six WARN items from the
/colibri-docs-checkbaseline run at the start of this session are each cited indocs/verification/r75-plan-red-verification.mdwith a resolution note. - GitHub Pages CI on
feature/r75-plan-red-executionMUST be green (build + deploy both succeed) before the PR is opened for merge. ls colibri-world-schema.mdat the repo root MUST return “No such file or directory”.ls .claude/skills/ams-*MUST return “No such file or directory”.find data -name "*.md" | wc -lMUST return exactly 1.
§9. Scope boundary
Explicitly out of scope for this round:
- Phase 0 code (P0.1.1 through P0.9.3). No
src/, notests/, nopackage.json, notsconfig.json. This round writes the documentation that supports Phase 0, not Phase 0 itself. - Obsidian vault re-sync. The vault is updated post-merge by the user via the canonical
temp/sync-full.batrecipe; no vault file is edited in this round. - Full resync of
.claude/skills/colibri-*against the.agents/skills/canon. Deferred to a later R75.x task. - Any edit to
.agents/spawns/,.agents/swarms/(other than the README classification note), or.agents/archive/. - Any edit to GitHub workflow files under
.github/workflows/.
Step 2 of 5 — gates docs/packets/r75-plan-red-packet.md. Audit baseline: commit eb15dd31. Authority: docs/PLAN-RED.md + docs/colibri-system.md. Any invariant here that conflicts with those upstream docs is a bug in this contract.