R82.K Contract — colibri-verification body + stale tasks-domain comments

1. Public API boundary

This slice is documentation-grade and comment-grade. The contract is therefore about surface text, not about a function signature or an exported type.

1.1 Files in scope (exactly three)

Path Edit scope Logic affected?
.agents/skills/colibri-verification/SKILL.md Body rewrite (lines 11+, preserving lines 1–9 R76.H2 stamp); bottom reconcile stamp added n/a (markdown skill)
src/domains/tasks/repository.ts Top block comment only (line 34 in current file) No
src/domains/tasks/state-machine.ts Comments only (lines 20 and 124 in current file) No

1.2 Files explicitly out of scope

  • Every other file in the repo, including:
    • .claude/skills/colibri-verification/SKILL.md — MIRROR zone; do not edit by hand per CLAUDE.md §9.2; resync is a separate wave.
    • src/server.ts — tool registration is already correct; no change needed.
    • Any writeback.ts, test files under src/__tests__/, or other parts of the β domain — these are not in the slice.

2. Invariants after this slice

2.1 Phantom-string invariants (hard, grep -c-checkable)

Sweep File Must return
S1 grep -cE "roadmap_\|unified_\|task_eisenhower\|task_deps\|task_create_batch\|task_link_roadmap\|gsd_\|context_\|memory_pack\|thought_plan\|thought_decide\|audit_session_set_context\|unified_backup\|merkle_attest" .agents/skills/colibri-verification/SKILL.md 0
S2 grep -cE "task_cancel\|task_link\|task_unlink" src/domains/tasks/repository.ts 0
S3 grep -cE "task_transition" src/domains/tasks/state-machine.ts 0

2.2 Positive invariants (prose-level)

Check How to verify
Skill body names at least 3 of the 14 shipped tools in active voice Manual read + grep -c for any individual tool name; expect many hits
R76.H2 top-of-file reality stamp preserved verbatim diff between post-edit line 1–9 and pre-edit line 1–9 is empty (except permitted whitespace tolerance)
Skill body structure (Quick Reference, Pre/Execution/Post-Execution, Phase Acceptance Criteria, Verification Tools Quick Reference, Common Verification Failures, Integration with Tier-1 Chains, See Also) retained Section headers before and after edit match
R82 reconcile stamp appended at the bottom of SKILL.md grep -c "R82" .agents/skills/colibri-verification/SKILL.md ≥ 1 in the footer section
repository.ts top comment lists exactly 5 β tool names (task_create, task_get, task_update, task_list, task_next_actions) inside the “Consumed by (future)” bullet at lines 31–34 (or its successor) Manual read of the block
state-machine.ts comments at lines 20 and 124 no longer name task_transition as a live MCP tool Sweep S3 passes

2.3 Code-behavior invariants (hard — must not drift)

Check How to verify
src/domains/tasks/repository.ts exports unchanged grep -c "^export " src/domains/tasks/repository.ts before vs. after → equal
src/domains/tasks/state-machine.ts exports + types + error class unchanged grep -c "^export " src/domains/tasks/state-machine.ts before vs. after → equal
TASK_STATES, VALID_TRANSITIONS, TERMINAL_STATES, canTransition, transition, InvalidTransitionError all unchanged in bytes (excluding comment lines above them) Confirmed via packet diff — only comment lines edited
registerTaskTools signature + Zod schemas unchanged No code-line edit touches lines 583–814

2.4 Build / lint / test invariants (gate)

All three gates must pass, in order, at Step 5:

npm run build      # tsc emits dist/ cleanly; no TS errors
npm run lint       # eslint (see eslint.config.js) reports 0 errors
npm test           # jest ESM full suite; expected 1123/1123 passing

Baseline at b88d7ca0 (post-R81 Wave 1 seal, R82 starting commit): 1123 tests green (1085 pre-R81 + 38 new bigint bps helper tests from P1.1.1).

Pre-existing startup — subprocess smoke flake may appear once; one retry is authorized if and only if all other suites are green on the first pass. Document the retry in Step 5.

3. Error contracts

No new error types introduced. No existing error types altered.

TaskNotFoundError (repository.ts:141) and InvalidTransitionError (state-machine.ts:129) remain as-is. Their comment blocks may be trimmed of task_transition references but the classes and their behavior do not change.

4. Dependency rules

4.1 What this slice may import / reference

  • Nothing new; no import changes.

4.2 What the three files may reference after the edit

.agents/skills/colibri-verification/SKILL.md:

  • May name only the 14 shipped tools: server_ping, server_health, skill_list, thought_record, thought_record_list, task_create, task_get, task_update, task_list, task_next_actions, audit_session_start, audit_verify_chain, merkle_finalize, merkle_root.
  • May describe in prose what donor-era families existed (HERITAGE context) without enumerating their exact tool names as code literals. This is the key rewrite pattern.
  • Must not name task_cancel, task_link, task_unlink, task_delete, task_transition, server_info, server_shutdown, audit_session_end, merkle_attest, nor any *_* donor family wildcard.

src/domains/tasks/repository.ts top comment:

  • May list only task_create, task_get, task_update, task_list, task_next_actions in the “future MCP tools” / “Consumed by” bullet. The word “future” itself is stale — these tools are all shipped (Wave D/E, P0.3.4); comment should reflect that they are registered by registerTaskTools below, not “future P0.3.4”.

src/domains/tasks/state-machine.ts comments:

  • May describe task_update’s status-routing path as the consumer.
  • May mention the internal transition() function as the engine task_update uses.
  • Must not describe task_transition as a separately-registered MCP tool.

5. Rollback contract

Each of the three files can be individually reset:

git checkout -- .agents/skills/colibri-verification/SKILL.md
git checkout -- src/domains/tasks/repository.ts
git checkout -- src/domains/tasks/state-machine.ts

A full slice rollback:

git reset --hard <audit-commit-sha>

a7345a6a is the pre-implementation state (audit committed, no other changes).

6. Test strategy

6.1 Static sweeps (Step 5 verification)

Three grep -cE sweeps from §2.1 above, each must return 0.

6.2 Positive prose sweep (Step 5 verification)

grep -cE "server_ping|server_health|skill_list|thought_record|audit_verify_chain|task_create|task_get|task_update|task_list|task_next_actions|audit_session_start|merkle_finalize|merkle_root" .agents/skills/colibri-verification/SKILL.md → should be ≥ 30 (every acceptance criteria already references ≥ 2 shipped tools).

6.3 Build / lint / test (Step 4 during, Step 5 after)

npm run build && npm run lint && npm test must return 0 exit code at Step 4 (before committing the implementation) and at Step 5 (after committing the verification file). If either pass is red, the slice is not ready to merge.

6.4 Manual diff review

git diff main -- src/domains/tasks/repository.ts src/domains/tasks/state-machine.ts should only show comment-line changes. A quick grep -vE "^\+ *\*|^\+ */\*\*|^\+ */|^\- *\*|^\- */\*\*|^\- */|^\-\-\-|^\+\+\+|^@@ |^ " on the diff should return zero non-header lines.

7. Out-of-scope observations (flagged for later rounds)

During the audit the following were seen but are not in this slice:

  • src/domains/tasks/repository.ts:34 comment still uses “Consumed by (future)” framing while the code is shipped. This slice touches line 34 only to strike phantoms; a future hygiene round may also replace “future” → “Consumed by” as a full rephrasing.
  • state-machine.ts:124 comment inside InvalidTransitionError references “the s17 error envelope” — that is not drift, that is a live cross-ref to spec s17 (error envelope). No change.
  • R76.H2 top-of-file reality stamp in SKILL.md refers to “14-tool surface” — still accurate, keep verbatim.

8. Acceptance gate for Step 3 (Packet)

The packet must:

  • Specify the exact text of the HERITAGE-block rewrite in SKILL.md (Group-by-group, or a single prose paragraph that doesn’t enumerate donor names as code literals).
  • Specify the exact text of the repository.ts:34 single-line change.
  • Specify the exact text of both state-machine.ts:20 and state-machine.ts:124 changes.
  • Confirm the R82 reconcile stamp text to be appended to SKILL.md.

Part of the R82 phase-0-1-stabilization round. Manifest at .agents/spawns/r82-phase-0-1-stabilization/manifest.md.


Back to top

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

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