Packet — .agents/skills/colibri-verification/SKILL.md body rewrite
1. Plan
Section-by-section surgical edits using the Edit tool. Most of the body is preserved (the R82.K rewrite is sound); this round augments four specific sections with live-code citations and the session_id honesty caveat, and refreshes the trailing italic stamp.
2. Edit list (in execution order)
Edit 1 — Top-of-file reality stamp refresh
- Anchor: line 9 (
> **Phase 0 reality stamp (R76 — 2026-04-18)** ...line). - Change: Append a second sentence to the existing reality stamp paragraph: a short note that the body was reconciled this round to add live-code citations and to acknowledge the
session_idgap. R76.H2 wording stays — that stamp is the historical anchor. - Net delta: ~1 sentence added.
Edit 2 — Pre-Execution / Audit Session — writeback hard-block context
- Anchor: §4 of “Pre-Execution Readiness Checklist” — “Audit Session” subsection (lines 65-69).
- Change: Add a final bullet noting that the audit-session ID is the key the post-execution writeback hard-block (
src/domains/tasks/writeback.ts:97) checks indirectly viatask_id— i.e. record the session early so the writeback bind isn’t an afterthought. - Wording principle: this is a forward pointer, not a duplication of the writeback section.
- Net delta: ~1 bullet added.
Edit 3 — Post-Execution / Colibri Writeback — hard-block citation
- Anchor: §1 of “Post-Execution Completion Checklist” — “Colibri Writeback (REQUIRED)” subsection (lines 110-113).
- Change: Add a one-line note immediately after the existing checklist items explaining that this step is runtime-enforced:
enforceWriteback(db, taskId)atsrc/domains/tasks/writeback.ts:97blocks thestatus="done"SQL UPDATE if nothought_recordexists for the task. Reference CLAUDE.md §7. Mention the call site atsrc/domains/tasks/repository.ts:475. - Wording principle: explicit “runtime-enforced, not convention” framing matches CLAUDE.md §7.
- Net delta: ~3 lines added.
Edit 4 — VERIFY Acceptance Criteria — verifier citation
- Anchor: §VERIFY Acceptance Criteria table row “Audit chain intact” (line 206).
- Change: Update the table row’s “Tool” column from bare
audit_verify_chaintoaudit_verify_chainplus a footnote/inline reference to the implementationverifyChainatsrc/domains/trail/verifier.ts:119. - Wording principle: keep the table compact; add the line citation as an inline parenthetical, not a new column.
- Net delta: ~0 lines (one row text expanded inline).
Edit 5 — Verification Tools Quick Reference — Phase 0 honesty
- Anchor: code block lines 230-259.
- Change:
- Add a leading paragraph (above the code block) explaining the canonical proof-grade ordering AND the Phase 0 reality:
merkle_finalize(session_id=X)queriesthought_records WHERE session_id = ?(src/tools/merkle.ts:296-300) but thethought_recordMCP tool input schema (src/domains/trail/repository.ts:114-119) does NOT acceptsession_id. So in current Phase 0 the proof-grade chain is incomplete —merkle_finalizewill throwNoThoughtRecordsError. ADR-007 (Proposed) addresses this by addingsession_idto thethought_recordinput schema and writing it through to the DB column added in migration006_eta.sql:54. - Update the code block: drop
session_idfrom thethought_recordcall (matching the shipped Zod input schema), and add a// TODO: ADR-007 …comment marking the gap. Theaudit_verify_chainandmerkle_finalizecalls keepsession_idbecause they DO accept it.
- Add a leading paragraph (above the code block) explaining the canonical proof-grade ordering AND the Phase 0 reality:
- Wording principle: do not pretend the gap is closed; do not duplicate ADR-007 content; just signal the gap and point readers to it.
- Net delta: ~10 lines added (paragraph + comments).
Edit 6 — Common Verification Failures — new row
- Anchor: failure-mode table at lines 266-272.
- Change: Add one row covering the
merkle_finalizezero-records failure that occurs whenthought_recordwas called withoutsession_id(which is the only mode currently shipping). Failure column:merkle_finalizeraisesNoThoughtRecordsError. Cause column: shippedthought_recorddoes not yet acceptsession_id(gap; ADR-007 Proposed). Resolution column: until ADR-007 lands, scopemerkle_finalizeto sessions whosethought_recordswere written via a backfill UPDATE; for new code, wait for ADR-007. - Net delta: 1 table row added.
Edit 7 — See Also — additional cross-references
- Anchor: “See Also” list (lines 290-293).
- Change: Add two bullets:
docs/agents/writeback-protocol.md— canonical writeback protocol contractdocs/architecture/decisions/ADR-007-...(Proposed) — closes thesession_idgap
- Net delta: 2 bullets added.
Edit 8 — Trailing italic stamp refresh
- Anchor: line 297 (italic update note).
- Change: Append a new italic sentence stating: rewrite hygiene round (post-R83), 2026-05-05 — body augmented with live-code citations to writeback hard-block (
writeback.ts:97) and chain verifier (verifier.ts:119),verifyCompletionexample reconciled to Phase 0thought_recordschema with ADR-007 (Proposed) gap acknowledgement, new failure-mode row added. Frontmatter byte-stable. Mirror at.claude/skills/colibri-verification/SKILL.mdflagged for resync (separate task). - Net delta: 1 paragraph added.
3. What stays untouched
- Frontmatter (lines 1-4).
- HERITAGE note (lines 11-21) — already correct from R82.K.
- Quick Reference table (lines 24-37).
- Pre-Execution checklist sections 1-3 (Task Context / Task Validation / Environment Validation).
- Execution Safety Checklist (entire).
- Post-Execution Completion Checklist sections 2 / 3 / 4 (Thought Record / Merkle Proof / Git Checkpoint) — already cite the right tools and the ordering rule.
- Phase Acceptance Criteria GATHER / ANALYZE / PLAN / EXECUTE / CLOSE rows.
- Common Verification Failures existing rows.
- Integration with Tier-1 Chains.
4. Risks & mitigations
| Risk | Mitigation |
|---|---|
Adding line numbers (writeback.ts:97, verifier.ts:119) creates maintenance burden when those lines drift. |
Use the same lines CLAUDE.md §7 already names — co-drift means a single fix; net new fragility = zero. |
Reconciling the JS example to drop session_id may cause copy-paste consumers to break their own scripts. |
Add explicit // TODO: ADR-007 inline comment so the consumer knows there’s a pending unification, and link to ADR-007 in the explanatory paragraph. |
| Adding the “Phase 0 honesty” caveat could read as “the proof-grade pipeline is broken”. | Frame it as “Phase 0 ships with a known gap; the canonical ordering is sound and survives ADR-007 unchanged” — the gap is in the input schema, not the protocol. |
npm test may have a snapshot test on this skill’s body. |
The skill content is not snapshotted in src/__tests__/. The capability index test (P0.6.3) only reads frontmatter — preserved. Build & lint are doc-agnostic. |
5. Verification plan
After Edit 8:
- Read the rewritten file end-to-end — confirm flow.
- Run
grep -Efor the donor-tool pattern set, restricted to lines outside the HERITAGE note. Expect zero matches. - Run
grepforwriteback.ts:97,verifier.ts:119,ADR-007. Expect each ≥ 1 match. - Diff the frontmatter (lines 1-4) against
origin/main’s file — expect zero diff. - Diff the
.claude/skills/colibri-verification/SKILL.mdagainstorigin/main— expect zero diff (mirror untouched). - Run
npm run build && npm run lint && npm test. Expect green.
6. Commit plan
| Step | Commit subject |
|---|---|
| 1 (this packet) | packet(rewrite-colibri-verification-skill): execution plan |
| 4 (implement) | feat(rewrite-colibri-verification-skill): rewrite SKILL.md body to 14-tool surface |
| 5 (verify) | verify(rewrite-colibri-verification-skill): test evidence |
(Steps 1-3 already committed: audit, contract, packet.)