R82.G — Contract

1. Scope

In scope (4 files):

  • docs/spec/s17-mcp-surface.md
  • docs/spec/index.md
  • docs/spec/s12-dsl.md
  • docs/world-schema.md

Plus chain artefacts (written into main via this branch):

  • docs/audits/r82-g-spec-world-audit.md (Step 1, already landed)
  • docs/contracts/r82-g-spec-world-contract.md (this file)
  • docs/packets/r82-g-spec-world-packet.md (Step 3)
  • docs/verification/r82-g-spec-world-verification.md (Step 5)

Out of scope:

  • Every other spec file (s01–s16, s18, s19) — no drift found in audit §1.
  • docs/world-schema.md beyond the 4 listed line-level drifts.
  • ../concepts/ broken-link remap across spec docs — R82.J’s domain.
  • Any src/ code change — R82.G is docs-only.

2. Contract gates

2.1 Negative sweeps (must return 0 post-edit)

grep -rcE "19 tools|all 19|exactly 19|19 MCP tools|19 Phase 0" docs/spec/ docs/world-schema.md
# Expected: 0 net hits. Any hit must be explicitly-historical/heritage (e.g.
# "ADR-004 R75 Wave H amendment — 19 planned → 14 shipped" is allowed because
# the amendment framing disambiguates "19 planned" from "19 current").

grep -rcE "task_transition|server_shutdown|server_info|audit_session_end|task_delete|task_depends_on|task_link|task_assign|unified_init|unified_vitals|unified_set_project|unified_mode" docs/spec/ docs/world-schema.md
# Expected: 0. These are all phantoms.

grep -rcE "\bthought_list\b" docs/spec/ docs/world-schema.md
# Expected: 0. Shipped name is `thought_record_list`. Word-boundary prevents
# matching thought_record_list as a false positive.

2.2 Positive sweeps (must return ≥ 1)

grep -cF "14 tools" docs/world-schema.md
# Expected: ≥ 2 post-edit (L20 + L204 + L419 lines, minimum).

grep -cF "14 shipped" docs/spec/s17-mcp-surface.md
# Expected: ≥ 1 (opening prose + surface table header).

grep -cE "Session 7.*SEALED|Session 7.*closed" docs/world-schema.md
# Expected: ≥ 1.

grep -cE "Session 8.*ACTIVE|Session 8.*R75" docs/world-schema.md
# Expected: ≥ 1.

2.3 Frontmatter preservation

Every edited file must retain valid Jekyll/just-the-docs frontmatter:

head -n 1 docs/spec/s17-mcp-surface.md docs/spec/index.md docs/spec/s12-dsl.md docs/world-schema.md
# Every line must be `---`.

2.4 s17 frontmatter graduation

grep -E "^colibri_code: partial" docs/spec/s17-mcp-surface.md
# Expected: 1 hit. Graduation per ADR-006 §Decision — a spec whose Phase 0
# slice has merged qualifies as `partial`.

2.5 Allowed historical/amendment exceptions

The following post-edit strings are allowed even though they contain the literal “19”:

  • “19 planned → 14 shipped” (world-schema L20 and s17 opening) — amendment framing.
  • “the original 19-tool plan” (s17 opening) — explicitly past-tense.
  • “ADR-004 R75 Wave H amendment” (multiple locations) — citation.
  • References in s02 to “6 categories × 19 codes” (event taxonomy) — NOT the tool count; unrelated.
  • References to “s19-governance” — spec number, not tool count.
  • out/ of 19 specs in index.md §Reading order — spec count, not tool count.

Verification will enumerate any post-edit “19” hit and classify each.

3. Invariants preserved

  1. Spec numbering unchangeds01–s19 remain; their meanings unchanged.
  2. ADR-004 citation semantics — the tool-count amendment is ADR-004 (R75 Wave H), not a new ADR.
  3. Heritage framing — donor-era language in s17 §1 heritage note (AMS ~480 tools) and §4 heritage note (11-layer middleware) remains verbatim.
  4. ζ/η ownership in world-schema — L204–L221 “14 tools” table stays with its current ζ 4 / η 2 grouping (retains existing internal structure).
  5. Cross-ref removal does not break Jekyll Pages — the ../concepts/ links being removed from s17 §9 are already 404s; removing them eliminates the broken refs without replacing them.
  6. No source-code edits — R82.G touches zero src/ files.

4. Invariants changed (intentional)

  1. s17-mcp-surface.md frontmatter colibri_code: nonepartial (ADR-006 graduation; shipped Phase 0 slice).
  2. world-schema.md session table: S7 ACTIVE → S7 SEALED 2026-04-09; add S8 ACTIVE row.
  3. s17 §7 Relationship block: canonicalize audit_session_start ownership from ζ (as-originally-specced) to η (as-shipped per src/server.ts L571–L575 registerMerkleTools).
  4. s17 §8 acceptance criteria: flip [ ][x] on shipped items.

5. Risk register

Risk Likelihood Impact Mitigation
A post-edit 19 hit in an unrelated context (event codes, spec count) fails the negative sweep Medium Low Verification doc enumerates every residual “19” hit and classifies; the sweep uses extended regex targeted at “19 tools” / “all 19” / “exactly 19” / “19 MCP tools” / “19 Phase 0”, not the bare digit.
Broken ADR-004 link if target path has changed Low Low Grep at implement time; no known rename in R75–R82.
ζ → η reassignment of audit_session_start in s17 §7 contradicts world-schema.md L210–L212 ζ grouping Low Low Explicit callout in implement: world-schema reflects conceptual ownership (ζ chain), s17 §7 reflects loader ownership (η registry). Both are true; both are retained.
Jekyll build breaks because frontmatter drifts in the manual edits Low High Each file’s frontmatter is preserved verbatim except s17’s one-line colibri_code change, which keeps YAML valid.

6. Rollback plan

Single-branch revert. If any gate in §2 fails after implement, revert the implement commit and re-enter Step 3 (packet revision).

7. Definition of done for R82.G

  1. All §2.1 negative sweeps return 0 (or only allowed exceptions enumerated in §2.5).
  2. All §2.2 positive sweeps return their required minimums.
  3. §2.3 frontmatter integrity intact.
  4. §2.4 s17 colibri_code graduation verified.
  5. Verification doc docs/verification/r82-g-spec-world-verification.md committed with captured sweep output.
  6. PR body carries the writeback block (task_id, branch, worktree, 5 commits, tests=docs-only, summary, blockers).
  7. Sigma Phase B gate-check recognizes the manifest path reconciliation (§audit-10) as a transcription error, not drift regression.

Back to top

Colibri — documentation-first MCP runtime. Apache 2.0 + Commons Clause.

This site uses Just the Docs, a documentation theme for Jekyll.