BookStack task lifecycle enforcement — ANVIL Claude Code
BookStack task lifecycle enforcement — ANVIL Claude Code
Status: PRE-WORK / implementation in progress
Date: 2026-08-21
Scope: /Users/makinja/system and the active Claude Code hook configuration on ANVIL
Mission Control: #900118
Problem
The active Claude Code configuration did not enforce the operating requirement that task documentation be read before work and updated after work. The task-scoped pilot-discover-inject.py path returned immediately when MC_TASK_ID was present, mc.js start only warned for a subset of tasks, and mc.js done accepted an unverified URL string in free text.
Before-work plan
- Add a deterministic BookStack task-page verifier that uses the BookStack API, accepts only canonical
https://docs.alai.no/...pages, and checks task-specific lifecycle markers. - Make
mc.js startfail closed for every real MC task unless its linked page exists and contains a task-specific BEFORE marker. - Make
mc.js readyandmc.js donefail closed unless the same page contains the AFTER marker and its APIupdated_atis newer than the baseline captured at start. - Store the API verification timestamps/page identity on the MC task so a pasted URL or unrelated old page cannot satisfy the gate.
- Repair task-scoped context injection so the linked BookStack page content is placed in front of the worker instead of being skipped.
- Add bidirectional tests: valid lifecycle passes; missing URL, wrong host, missing marker, stale page, changed page, and API failure block.
- Re-run the hook inventory and targeted negative tests; list residual hook problems honestly instead of claiming all hooks are healthy.
Acceptance criteria
- BEFORE proof is mandatory before the task can transition to active work.
- AFTER proof is mandatory before review/completion.
- Free-text
docs.alai.nomentions do not satisfy completion. - API failure is UNKNOWN and blocks lifecycle transitions; it is never treated as PASS.
- Tests do not contact or mutate production BookStack or the live Mission Control database.
After-work results
Pending implementation and independent verification.