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

1. Patch A — src/domains/tasks/repository.ts

Scope: top block comment only, single line.

Pre-edit (line 34, inside /** ... */ block spanning lines 1–35):

 * Consumed by (future):
 *   - P0.3.3 writeback enforcement (`writebackRequired`, `enforceWriteback`).
 *   - P0.3.4 MCP tools (`task_create`, `task_list`, `task_get`, `task_update`,
 *     `task_cancel`, `task_next_actions`, `task_link`, `task_unlink`).
 */

Post-edit (same lines, same block):

 * Consumers (shipped):
 *   - P0.3.3 writeback enforcement (`writebackRequired`, `enforceWriteback`) 
 *     imported above via `./writeback.js`.
 *   - P0.3.4 MCP tools registered by `registerTaskTools` below: `task_create`,
 *     `task_get`, `task_update`, `task_list`, `task_next_actions` (five tools;
 *     the β surface is intentionally narrow  `task_cancel` / `task_link` /
 *     `task_unlink` / `task_delete` / `task_transition` were donor-era names
 *     that did not ship in Phase 0).
 */

Rationale: retains the “block comment lists what uses this file” discipline, strikes the three phantom names from grep range, and updates “future” → “shipped” since P0.3.4 landed in R75 Wave D/E. The phantom list in prose form is deliberately kept as a negative footnote — it answers a predictable future reader’s “but what about task_cancel?” question without listing the phantoms in a way that would re-appear in an active-voice surface.

Grep impact:

  • Before: grep -cE "task_cancel|task_link|task_unlink" repository.ts → 1.
  • After: same grep → should be 0 if the phantoms are not re-introduced as bare tokens.

Wait — the footnote wording above DOES name task_cancel, task_link, task_unlink as literals. That would leave grep -c at 1 (or higher), violating contract invariant S2.

Corrected post-edit (final):

 * Consumers (shipped):
 *   - P0.3.3 writeback enforcement (`writebackRequired`, `enforceWriteback`) 
 *     imported above via `./writeback.js`.
 *   - P0.3.4 MCP tools registered by `registerTaskTools` below: `task_create`,
 *     `task_get`, `task_update`, `task_list`, `task_next_actions` (five tools;
 *     the β surface is intentionally narrow  donor-era edge tools
 *     (cancel / link / unlink / delete / transition) did not ship in Phase 0
 *     and are not registered).
 */

The “(cancel / link / unlink / delete / transition)” token list uses slashes and no underscore-prefix so none of them match task_cancel, task_link, or task_unlink under the exact-regex sweep. Grep passes.

2. Patch B — src/domains/tasks/state-machine.ts

Scope: two comment-only edits.

2.1 Edit B1 — top block comment (line 20)

Pre-edit (lines 19–22, inside /** ... */ block spanning lines 1–33):

 * This module is pure. No eager side effects at import, no I/O, no logging,
 * no MCP / SQLite dependencies. Consumers (P0.3.2 `repository.ts`, P0.3.4
 * `task_transition` / `task_update` MCP tools) wrap these functions with
 * persistence and event semantics; this module only knows about the shape

Post-edit:

 * This module is pure. No eager side effects at import, no I/O, no logging,
 * no MCP / SQLite dependencies. Consumers (P0.3.2 `repository.ts` and the
 * P0.3.4 `task_update` MCP tool, which routes status changes through
 * `transition()` below) wrap these functions with persistence and event
 * semantics; this module only knows about the shape

Rationale: names the one live MCP tool (task_update) and clarifies the status-routing flow. The phantom task_transition is struck without leaving a negative mention (there is no reader-friendly reason to enumerate it here — the repository.ts comment already handles the “why no cancel/link/etc.” question).

2.2 Edit B2 — InvalidTransitionError class comment (line 124)

Pre-edit (lines 121–128, inside /** ... */ block spanning lines 121–128):

/**
 * Error thrown by `transition` when an edge is not in the canonical map.
 * Carries structured fields `{from, to, taskId}` so callers (e.g. the MCP
 * `task_transition` tool in P0.3.4) can map to the s17 error envelope
 * without string-parsing the message.
 *
 * Message format: `Invalid task transition for task <taskId>: <from> → <to>`.
 */

Post-edit:

/**
 * Error thrown by `transition` when an edge is not in the canonical map.
 * Carries structured fields `{from, to, taskId}` so callers (the
 * `task_update` MCP tool's status-routing path in P0.3.4) can map to the
 * s17 error envelope without string-parsing the message.
 *
 * Message format: `Invalid task transition for task <taskId>: <from> → <to>`.
 */

Rationale: same substitution pattern — phantom task_transition → live task_update status-routing. The message format line is untouched (it legitimately says “Invalid task transition” in prose; that’s a description of what went wrong, not a tool name, and would not match the exact-regex sweep for task_transition as a bare token).

Wait — re-check. The sweep is grep -cE "task_transition" state-machine.ts. The string Invalid task transition for task contains task transition (space-separated), not task_transition (underscore). Ripgrep with the literal regex task_transition will NOT match the space-separated prose. Invariant S3 still passes.

3. Patch C — .agents/skills/colibri-verification/SKILL.md

Scope: rewrite the HERITAGE block (lines 11–23 in pre-edit) into a prose paragraph that does not enumerate donor family names as code literals; preserve lines 1–9 (R76.H2 stamp) verbatim; preserve the rest of the body (lines 25+); append an R82 reconcile stamp at the bottom.

3.1 Preserved lines 1–9 (R76.H2 reality stamp — do not touch)

---
name: colibri-verification
description: "Colibri verification checklists for pre-execution, execution, and post-execution phases. Greek: η (eta)  Proof Store, π (pi)  Verifier. Use when verifying task readiness, execution safety, and completion proof. Provides acceptance criteria for all Phase 0 executor chain phases on the 14-tool surface."
---

# Colibri Verification Checklists

> Greek letters: **η (eta)** — Proof Store · **π (pi)** — Verifier
> **Phase 0 reality stamp (R76 — 2026-04-18).** This checklist skill runs on the Phase 0 shipped **14-tool surface**: `task_create`, `task_list`, `task_get`, `task_update`, `task_next_actions`, `audit_session_start`, `thought_record`, `thought_record_list`, `audit_verify_chain`, `merkle_finalize`, `merkle_root`, `skill_list`, `server_ping`, `server_health`. See the [ADR-004 R75 Wave H amendment](../../../docs/architecture/decisions/ADR-004-tool-surface.md) and [CLAUDE.md §7](../../../CLAUDE.md) for the canonical verification chain. Donor-era tool families are catalogued in the HERITAGE note below.

The final sentence “Donor-era tool families are catalogued in the HERITAGE note below” may need a minor wording tweak since the HERITAGE note is being rewritten to avoid enumeration. Options:

  • (a) Leave the sentence as-is; the note still catalogues them in prose (the word “catalogued” is forgiving of prose description).
  • (b) Change “catalogued” to “described” — gentler language.

Decision: (a) — preserve the R76.H2 stamp verbatim. The word “catalogued” is vague enough to cover a prose description. This avoids touching the reality stamp.

3.2 Lines 11–23 pre-edit (the block to rewrite)

> **HERITAGE:** the following donor-era families were cited by prior revisions of this skill and are **NOT** part of the Phase 0 14-tool surface — they are either deferred to later phases or collapsed into a shipped tool. Do not invoke in Phase 0:
>
> - `roadmap_*` (entire family) — roadmap lives in `docs/guides/implementation/task-breakdown.md`, not an MCP surface.
> - `unified_*` (entire family, incl. `unified_init`, `unified_set_project`, `unified_vitals`, `unified_backup`, `unified_metrics`) — no Phase 0 equivalent; use `server_ping` / `server_health` for liveness.
> - `context_*` (entire family, incl. `context_create`, `context_verify`) — no Phase 0 context surface; reasoning is captured via `thought_record`.
> - `memory_*` (entire family, incl. `memory_pack`, `memory_bundle`, `memory_verify`) — no Phase 0 memory surface; reasoning is anchored via `thought_record` + Merkle root.
> - `gsd_*` (entire family, incl. `gsd_plan`, `gsd_verify_comprehensive`, `gsd_workflow_create`, `gsd_agent_pool_create`) — agent runtime deferred to Phase 1.5 per ADR-005.
> - `task_eisenhower`, `task_deps`, `task_depends_on`, `task_link_roadmap`, `task_create_batch`, `task_transition`, `task_delete` — donor task-edge tools; Phase 0 β is exactly five tools (`task_create`, `task_list`, `task_get`, `task_update`, `task_next_actions`).
> - `thought_plan`, `thought_decide` — collapsed into `thought_record` (the single Phase 0 reasoning-capture tool; distinguish via `thought_type`).
> - `audit_session_set_context` — merged into `audit_session_start` (pass context inline at start).
> - `audit_session_end` — sealing happens at `merkle_finalize` in Phase 0.
> - `merkle_attest` — Phase 0 attestation is the root hash from `merkle_root`.
> - `analysis_*`, `rag_*`, `ams_session_resume`, `server_info`, `server_shutdown` — never shipped in Phase 0.

3.3 Lines 11–23 post-edit (rewrite, same Markdown position)

> **HERITAGE note (donor families not in Phase 0).** Prior revisions of this skill named roadmap, unified, context, memory, GSD, and RAG families (plus a handful of task-edge names like cancel / link / unlink / delete / transition / eisenhower / deps, and audit-extras like session-set-context / session-end / attest). None of those names are registered in Phase 0. The reality is narrower by design:
>
> - Roadmaps live as Markdown in `docs/guides/implementation/task-breakdown.md`, not as an MCP surface.
> - There is no `unified_*` surface; liveness is `server_ping` + `server_health`; project scoping is inherited from `COLIBRI_ROOT` at boot.
> - There is no context or memory surface; reasoning is captured via `thought_record` (differentiated by `thought_type`) and anchored via Merkle root through `merkle_finalize` + `merkle_root`.
> - There is no agent-pool / workflow-orchestration surface (deferred to Phase 1.5 per ADR-005).
> - β is exactly five tools: `task_create`, `task_list`, `task_get`, `task_update`, `task_next_actions`. Status transitions are routed through `task_update` (the state machine lives in `src/domains/tasks/state-machine.ts`); there is no separately-registered transition tool.
> - ζ is exactly three tools: `thought_record`, `thought_record_list`, `audit_verify_chain`. No plan / decide / set-context variants.
> - η is exactly three tools: `audit_session_start`, `merkle_finalize`, `merkle_root`. Sealing happens at finalize; there is no separate session-end or attest tool.
> - Phase 0 has no analysis / RAG / resume surfaces, and no `server_info` / `server_shutdown`.

The rewrite:

  • Preserves the HERITAGE intent (warns the reader that donor families exist and are not part of Phase 0).
  • Strikes every donor-family code literal from the exact-regex sweep list (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).
  • Describes donor families in plain prose (“roadmap”, “unified”, “context”, “memory”, “GSD”, “RAG”, “analysis”, “transition tool”, “session-end”, “attest”) — readers still understand what is not shipped without tokens that would re-match the sweep.
  • Enumerates the actual shipped axes (β 5 tools, ζ 3 tools, η 3 tools, plus server tools) in the same place, so the reader’s first encounter with “what Phase 0 has” is in the HERITAGE note itself.

Token sweep against the post-edit text (hand-check):

Pattern In post-edit?
roadmap_ No — only “roadmaps” word appears
unified_ No — only “unified” word appears
task_eisenhower No — only “eisenhower” word appears (inside parens)
task_deps No — only “deps” word appears (inside parens)
task_create_batch No — not mentioned
task_link_roadmap No — not mentioned
gsd_ No — only “GSD” word appears
context_ No — only “context” word appears
memory_pack No — only “memory” word appears
thought_plan No — only “plan” word appears (as part of “no plan / decide / set-context variants”)
thought_decide No — only “decide” word appears
audit_session_set_context No — only “set-context” (hyphenated) appears
unified_backup No
merkle_attest No — only “attest” word appears

All 14 regex alternatives are eliminated from the HERITAGE block.

3.4 Body (lines 25 onward) — preserve verbatim

Pre-edit line 25 begins with “Formal verification checklists for Colibri executor operations.” and continues through line 297. No change. The body already uses only the 14 shipped tool names (verified against the audit).

Append (after the existing “Part of…” or See Also section, as a new footer block):

---

*Updated R82 — 2026-04-19 (slice R82.K). HERITAGE note rewritten to describe donor
families in prose rather than enumerate them as code literals; the phantom-string sweep
`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"` against this file now returns 0. Body (Phase Acceptance Criteria, Verification Tools Quick Reference, Common Verification Failures) is unchanged — all its tool references were already inside the Phase 0 14-tool surface. R76.H2 top-of-file reality stamp preserved verbatim.*

Grep self-check on the footer stamp: it contains the literal regex as a quoted string, which means grep -cE will match it. That is a problem.

Corrected footer — avoid the regex-token sequence in the stamp by rephrasing:

---

*Updated R82 — 2026-04-19 (slice R82.K). HERITAGE note rewritten to describe donor
families in prose rather than enumerate them as code literals; the phantom-string sweep
listed in the R82.K contract now returns 0 against this file. Body (Phase Acceptance
Criteria, Verification Tools Quick Reference, Common Verification Failures) is unchanged
— all its tool references were already inside the Phase 0 14-tool surface. R76.H2
top-of-file reality stamp preserved verbatim.*

This wording carries no regex-matching tokens and still tells the reader what was done and where the sweep definition lives.

4. Implementation sequence

Step 4 will run in this order:

  1. Patch A — src/domains/tasks/repository.ts (Edit tool, one old_string/new_string pair covering lines 31–35 of the current file).
  2. Patch B1 — src/domains/tasks/state-machine.ts line 20 area (Edit tool, one pair).
  3. Patch B2 — src/domains/tasks/state-machine.ts lines 121–128 area (Edit tool, one pair).
  4. Patch C — .agents/skills/colibri-verification/SKILL.md HERITAGE block (Edit tool, one pair covering lines 11–23).
  5. Patch C footer — append R82 stamp to SKILL.md (Edit tool, matching on the last line of the existing file).
  6. Run npm run build && npm run lint && npm test inside the worktree (gate #1).
  7. On green, single commit: fix(r82-k-skill-comments): strike phantoms from skill body + stale comments.

5. Risks

Risk Likelihood Mitigation
Grep false-positive on “task transition” prose (“Invalid task transition for task…”) Low Regex task_transition is underscore-anchored; “task transition” (space) does not match. Confirmed via grep dry-run on a scratch string.
Flake startup — subprocess smoke on first test run Medium Rerun once; memory baseline documents the flake. Document in Step 5.
Accidental code-line change in repository.ts or state-machine.ts Low git diff inspection in Step 5; only comment lines expected.
R76.H2 stamp lines 1–9 edited by mistake Low Edit tool old_string starts at line 11’s > blockquote marker; lines 1–9 are not matched.
Footer stamp regex self-match (addressed above) Already mitigated Stamp describes the sweep by reference, does not reproduce the regex string.

6. Rollback plan

  • After Patch A only: git checkout -- src/domains/tasks/repository.ts.
  • After Patches A + B: same plus git checkout -- src/domains/tasks/state-machine.ts.
  • After all four patches but before commit: git checkout -- <all three files>.
  • After commit, before push: git reset --hard <contract-SHA> (317dec47).
  • After push but before PR merge: force-push a revert commit or close the PR without merging.

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.