Phase completion contract
Mini enforces an adopted, finite completion contract at the Plan→Execute boundary and
at phase close. This is the customer-safe port of the qualified full-pack workflow
(full-pack commit ebc8f687), covering mini issues #60 and #59's active amendment.
What a phase gets
- Adoption — a phase contract is adopted through the canonical decision writer
(
prometheus kbd decision record); amendments append with--supersedeslineage, and adopted bytes are never edited in place. - Readiness —
kbd-phase-readiness-checkanswers READY only when the contract, its live adoption digest, identity (project/run/phase) and scenario task coverage all hold; otherwise BLOCKED with the minimal missing list, REJECT-IDENTITY, or REJECT-STALE. - Gate enforcement — the real Plan→Execute transition validates the handoff semantically; a blocked readiness gate (exit 2) is never treated as success, and a CLOSED phase refuses execute dispatch.
- Terminal evaluation —
kbd-phase-close-evalconsumes only scenario-result evidence. FAIL prevents a successful qualification; missing, stale or wrong-run evidence is BLOCKED; missing budget accounting is BLOCKED; exceeding budget blocks qualification while at-ceiling closes completed in-budget work; unknown token telemetry stays UNKNOWN. - No unauthorized successor — reflection alone never creates the next phase; continuation requires explicit operator authorization.
When the scope changes
Suppose a project adopted two export formats and the operator withdraws one midway. Keep the signed, adopted scope and the observed result for each exercised scenario. The operator supplies a signed supersession manifest naming the withdrawals, their destinations and the budget basis. The evaluator reads the terminal disposition back from canonical state. Report its actual label, including CLOSED_UNMET when no scenario was exercised. An exercised failure remains visible.
node <pack-root>/scripts/kbd-phase-close-eval.mjs --phase <id> --superseded <manifest> --signature <signature>
After the execute handoff and reflection review have been accepted, run the following from the consumer project to persist accepted lessons and dispatch eligible completion actions. Retry the same command if an action remains pending. Starting a successor is a separate signed operator decision.
node <pack-root>/scripts/kbd-reflection-finalize.mjs --phase <id> --accepted
Commands
node scripts/kbd-contract-adopt.mjs <contract.json> [--supersedes <decision-id>]
node scripts/kbd-phase-readiness-check.mjs --phase <phase-id>
node scripts/kbd-phase-close-eval.mjs --phase <phase-id>
The same scripts ship in both the Claude and Codex plugin payloads under
dist/plugins/*/prometheus-skills-mini/scripts/.
Full behavior, the paired full/mini scenario matrix (RC-01…RC-08), evidence bindings, deferred successor requirements (the #59 M1–M6 addendum), and install/rollback notes live in the repository document docs/phase-completion-contract.md.
Record one scenario at a time
Mini uses the shared native receipt and readiness rules.
An accepted receipt resolves only its named scenario at its current
attempt. Use prometheus kbd phase readiness --id phase-id --json to
find outstanding items, resolve them separately, and close only through
the normal authorized path. Recheck a previously resolved item only if
its evidence has become stale. A successful item record is not a phase
certification.
Lean 4 checks narrow predicates extracted from the shared Rust source. It is not required to install or use Mini, and does not replace VLBV in your actual harness. Install Mini in its own supported location rather than over Full.
Requalify a settled focused validation
Mini 1.23.1 supports a signed successor for one exact Git candidate. The operator binds the original focused grant and its three settled passing receipts to the new commit and tree, a fresh prepared root, and the verified inputs for that candidate. The successor keeps the same scenario and owner within the existing frozen parent scope. Each original grant can have one requalification successor. The native CLI requires Unix file identity for this operation, so it is available on macOS and Linux and refused on native Windows.
After the native writer admits the authorization, keep the returned
grantSha256. Check it against the successor shown by the focused item
worklist. Phases that opted into scenario admission show canonical readiness
in the worklist command. Run these commands separately from the consumer
project with the same qualified prometheus CLI on PATH. Worklist exit code 8
means items remain open.
prometheus kbd validation recover-focus --authorization candidate.json --signature candidate.json.sig
node "<pack-root>/scripts/kbd-item-run.mjs" worklist --phase <phase-id>
node "<pack-root>/scripts/kbd-item-run.mjs" run --phase <phase-id> --item <scenario-id> --grant <successor-digest>
The runner requires the admitted successor grant. It runs preparation before the adopted case, then runs the dependent negative control. The predecessor’s receipts remain in the journal. Use the usual authorized phase-close path after the current evidence clears the remaining items.