Author SHA1 Message Date
bchanot e54256a171 chore(tasks): levers-followup plan, MINOR dropped line 2026-11-20 18:10:36 +01:00
bchanot 1a196780f3 chore(memory): journal — feat levers-followup, mods timeout dropped 2026-11-20 18:08:02 +01:00
bchanot 0db885ed48 feat(doctrine): levers reach every contract flow and post-gate review
Contract dry run and run-base in contract-interview STEP 4 and after gitflow start in ship-feature/init-project; their review steps fix CRITICAL or Important only on reproducible evidence; run_base SHA-checked with --end-of-options.
2026-11-20 18:07:41 +01:00
12 changed files with 319 additions and 196 deletions

No files matched your search

+1 -3
View File
@@ -790,6 +790,4 @@ rules:
## 2026-11-20 ## 2026-11-20
- /ship-feature advisor-subagent-scope (7979b9b 6be0669 b71db28): leak root cause = advisor server tool on every sub-agent, no filter, opus ignores CLAUDE.md attachment; rule moved into agent defs/briefs + SubagentStart hook + SDD sonnet pin; LRN-303; behavioural proof pending next usage table. - /ship-feature advisor-subagent-scope (7979b9b 6be0669 b71db28): leak root cause = advisor server tool on every sub-agent, no filter, opus ignores CLAUDE.md attachment; rule moved into agent defs/briefs + SubagentStart hook + SDD sonnet pin; LRN-303; behavioural proof pending next usage table.
- /feat done-triage-levers (19dfe7e 39cf9dd, docs e8c061e): six levers in verify-secure-loop/challenge-plan/capitalize-commit/verifier/CLAUDE.global + effort-shift citer. r1 3 lenses 9 MAJOR (unrecorded base), r2 2 MAJOR in r1 fixes; gates first pass. BDR-151 LRN-304 EVAL-060. Follow-up /feat (5 files) + MEASURE line in TODO. Branch UNMERGED. - /feat done-triage-levers (19dfe7e 39cf9dd, docs e8c061e): six levers in verify-secure-loop/challenge-plan/capitalize-commit/verifier/CLAUDE.global + effort-shift citer. r1 3 lenses 9 MAJOR (unrecorded base), r2 2 MAJOR in r1 fixes; gates first pass. BDR-151 LRN-304 EVAL-060. Follow-up /feat (5 files) + MEASURE line in TODO. Branch UNMERGED.
- /feat levers-followup (0db885e, feature/levers-followup UNMERGED): dry run + run-base in contract-interview STEP 4 and after gitflow start (ship-feature/init-project), review CRITICAL/Important only on reproducible evidence, run_base SHA guard + --end-of-options. Verdict ABANDONED(1): verifier [gated] item deferred to user (act sites outside run). mods.test timeout dropped (45 s at load 0.9). gates.sh ABANDON 1b masking reproduced → /hotfix next.
## 2026-11-21
- /hotfix gates-abandon-id (5bba6ce, bugfix/gates-abandon-id UNMERGED): ABANDON regex anchored to numeric id, catch-all malformed ERROR, leading whitespace accepted (robustness challenger: game ledger indented handoff silently MET). 3 lenses + 1 confirmation, security PASS.
+4 -3
View File
@@ -5,7 +5,8 @@ Done history before 2026-10-08 removed 2026-10-23 (git keeps it: `git log -p --
### Done, triage and loop levers (user 2026-11-20: "oui lance une session neuve avec les six leviers") ### Done, triage and loop levers (user 2026-11-20: "oui lance une session neuve avec les six leviers")
- [x] DONE 19dfe7e + 39cf9dd (docs e8c061e), merged 1c9289a (memory b58d885) /feat feature/done-triage-levers: /feat the six levers in .claude/tasks/plans/2026-11-20-done-and-triage-levers.md (done = oracles green, reopen only on reproducible evidence; MINOR fixed before dispatch or dropped; no challenge on a placed decision; loop on a frozen list; contract dry run + plan artifacts in scope; `TODO +n / -m` in summaries). 5 files: lib/verify-secure-loop.md, lib/challenge-plan.md, CLAUDE.global.md (1 line), lib/capitalize-commit.md, agents/verifier.md (contract .claude/tasks/contracts/2026-11-20-done-triage-levers-1413.md) - [x] DONE 19dfe7e + 39cf9dd (docs e8c061e), merged 1c9289a (memory b58d885) /feat feature/done-triage-levers: /feat the six levers in .claude/tasks/plans/2026-11-20-done-and-triage-levers.md (done = oracles green, reopen only on reproducible evidence; MINOR fixed before dispatch or dropped; no challenge on a placed decision; loop on a frozen list; contract dry run + plan artifacts in scope; `TODO +n / -m` in summaries). 5 files: lib/verify-secure-loop.md, lib/challenge-plan.md, CLAUDE.global.md (1 line), lib/capitalize-commit.md, agents/verifier.md (contract .claude/tasks/contracts/2026-11-20-done-triage-levers-1413.md)
- [ ] NEXT: follow-up /feat (user 2026-11-20, pass B + GATE 2 answers), 5 files: lib/contract-interview.md STEP 4 (dry run + `- run-base:` from every contract-writing flow: guardrails, a11y, ship-feature, init-project, bugfix fast path, hotfix); skills/ship-feature STEP 6 (:262/:344) and skills/init-project STEP 10 (:280/:382) "Fix all CRITICAL" bound by lever 1 (reopen only on reproducible evidence); lib/capitalize-commit.md:75 `git diff --end-of-options` + `^[0-9a-f]{7,40}$` check on `run_base` (GATE 2 LOW); agents/verifier.md STEP 4 `[gated]` lines in scope only on an untracked contract (GATE 2 design note) - [x] DONE 0db885e on feature/levers-followup, UNMERGED, verdict ABANDONED(1) (criterion 4 deferred, user to accept the partial delivery): follow-up /feat, 4 of 5 files: lib/contract-interview.md STEP 4 (dry run + `- run-base:` from every contract-writing flow: guardrails, a11y, ship-feature, init-project, bugfix fast path, hotfix); skills/ship-feature STEP 6 (:262/:344) and skills/init-project STEP 10 (:280/:382) "Fix all CRITICAL" bound by lever 1 (reopen only on reproducible evidence); lib/capitalize-commit.md:75 `git diff --end-of-options` + `^[0-9a-f]{7,40}$` check on `run_base` (GATE 2 LOW); agents/verifier.md STEP 4 `[gated]` lines in scope only on an untracked contract (GATE 2 design note) (contract .claude/tasks/contracts/2026-11-20-levers-followup-1725.md)
- [ ] USER DECISION (deferred from 0db885e, confirmation challenger 2026-11-20): `[gated]` lines in scope only on an untracked contract. Only init-project bites (contract root-committed by gitflow init `git add -A`); every in-verifier version grew mechanism (GATED line, re-verify on removal, structural-failure rule, diff reference point) and its routing must live at the GATE 1 act sites (lib/verify-secure-loop.md GATE 1, skills/init-project STEP 9). Choose: fix at those act sites, or keep today's behaviour and record the limit
- [ ] MEASURE 2026-11-20 levers, after ~5 runs from 19dfe7e: dispatches/run, `TODO +n / -m` per run (measurement lines counted apart), `MINOR dropped:` lines per run plan, challenge skips taken → EVAL. Tripwires (reopen the levers): a BUGS-FOUND entry whose cause matches a `MINOR dropped:` line of a merged run; net open TODO growing run over run; a placed-decision skip on a run that settled an open choice - [ ] MEASURE 2026-11-20 levers, after ~5 runs from 19dfe7e: dispatches/run, `TODO +n / -m` per run (measurement lines counted apart), `MINOR dropped:` lines per run plan, challenge skips taken → EVAL. Tripwires (reopen the levers): a BUGS-FOUND entry whose cause matches a `MINOR dropped:` line of a merged run; net open TODO growing run over run; a placed-decision skip on a run that settled an open choice
### Advisor call points (user 2026-11-17: "oui 1 et 2, et le 3 aussi"; amends BDR-150) ### Advisor call points (user 2026-11-17: "oui 1 et 2, et le 3 aussi"; amends BDR-150)
@@ -27,7 +28,7 @@ Done history before 2026-10-08 removed 2026-10-23 (git keeps it: `git log -p --
- [ ] census test: every agents/*.md served on opus (frontmatter or a model="opus" dispatch) carries either the never-call line or an allowance; every model="opus" general-purpose brief in skills/agents names its advisor rule (STEP 6 review minor 3, low) - [ ] census test: every agents/*.md served on opus (frontmatter or a model="opus" dispatch) carries either the never-call line or an allowance; every model="opus" general-purpose brief in skills/agents names its advisor rule (STEP 6 review minor 3, low)
- [ ] hooks/subagent-advisor.sh shortcut: SubagentStart only, a sub-agent that compacts may lose the line; re-inject on SessionStart `compact` when agent_type is set (hook header shortcut, low) - [ ] hooks/subagent-advisor.sh shortcut: SubagentStart only, a sub-agent that compacts may lose the line; re-inject on SessionStart `compact` when agent_type is set (hook header shortcut, low)
- [ ] advisor-scope review minors: lib/model-gate.md Dispatch tiers names the advisor line for opus built-ins; feat/bugfix ADVISOR fields gain `not called (sub-agent)`; client-handover-writer quoted child templates carry the line literally, not only the routing paragraph (STEP 6 review minors 1, 6, 8, low) - [ ] advisor-scope review minors: lib/model-gate.md Dispatch tiers names the advisor line for opus built-ins; feat/bugfix ADVISOR fields gain `not called (sub-agent)`; client-handover-writer quoted child templates carry the line literally, not only the routing paragraph (STEP 6 review minors 1, 6, 8, low)
- [ ] lib/tests/mods.test.sh model-router plugin test runs ~121 s alone vs CLI_TIMEOUT=120 (load avg 26-31 on 2026-11-19): flaky red in make test, probable cause of run 1 feater's unexplained red; raise the bound or speed the test (Run C GATE 0, low) - [x] DROPPED 2026-11-20 (lever 2, no failure on HEAD): mods.test.sh model-router plugin test 45 s alone at load 0.9 vs CLI_TIMEOUT=120; the 121 s was at load 26-31 (2026-11-19); full make test 2026-11-20 green on it. Was: lib/tests/mods.test.sh model-router plugin test runs ~121 s alone vs CLI_TIMEOUT=120 (load avg 26-31 on 2026-11-19): flaky red in make test, probable cause of run 1 feater's unexplained red; raise the bound or speed the test (Run C GATE 0, low)
- [x] Stale citers after A: README/USAGE/CHANGELOG patched, BUGS-FOUND residual superseded + LOW logged, BDR-150 status, LRN-295 (LRN-294 kept: its lesson holds) - [x] Stale citers after A: README/USAGE/CHANGELOG patched, BUGS-FOUND residual superseded + LOW logged, BDR-150 status, LRN-295 (LRN-294 kept: its lesson holds)
### BDR-125 close-out run (user 2026-11-12): no phase 0/0b/4a/1/5/2/4b/4c/4d line left in TODO or BUGS-FOUND ### BDR-125 close-out run (user 2026-11-12): no phase 0/0b/4a/1/5/2/4b/4c/4d line left in TODO or BUGS-FOUND
@@ -104,7 +105,7 @@ Open children of the shipped phases (History 2026-11-12), text verbatim.
- [x] D6 project rule (done c69ce9c; lead paragraph fixed too, follow-ups in BUGS-FOUND): .claude/rules/graphify-vendored.md says `graphify install --platform claude` "touches nothing else", but graphifyy 0.9.67 appends a `# graphify` block to ~/.claude/CLAUDE.md (= CLAUDE.global.md); `graphify claude install` writes into the caller's cwd, so the install-plugins.sh trap protects $REPO only when run from $REPO - [x] D6 project rule (done c69ce9c; lead paragraph fixed too, follow-ups in BUGS-FOUND): .claude/rules/graphify-vendored.md says `graphify install --platform claude` "touches nothing else", but graphifyy 0.9.67 appends a `# graphify` block to ~/.claude/CLAUDE.md (= CLAUDE.global.md); `graphify claude install` writes into the caller's cwd, so the install-plugins.sh trap protects $REPO only when run from $REPO
- [x] DONE c25a7ea, merged 2d8e457 (docs 15c6d09, memory 44dc0b3 482fd37 LRN-299) (bugfix/gates-label-timeout, user 2026-11-17 "reject"; also rejects a 2nd CHECK/EXPECT/EVIDENCE on one criterion: indented ` 2.`, `- `, `**2.**` gave the same false MET) gates.sh: warn or reject a criterion row labelled `^[0-9]+[a-z]\.` (LRN-284: `1b.` absorbed into criterion 1, its CHECK/EXPECT overwritten, false MET) - [x] DONE c25a7ea, merged 2d8e457 (docs 15c6d09, memory 44dc0b3 482fd37 LRN-299) (bugfix/gates-label-timeout, user 2026-11-17 "reject"; also rejects a 2nd CHECK/EXPECT/EVIDENCE on one criterion: indented ` 2.`, `- `, `**2.**` gave the same false MET) gates.sh: warn or reject a criterion row labelled `^[0-9]+[a-z]\.` (LRN-284: `1b.` absorbed into criterion 1, its CHECK/EXPECT overwritten, false MET)
- [x] DONE c25a7ea (user 2026-11-17: default 600 s, env override kept) gates.sh default `GATES_TIMEOUT=120` < full `make test` (~135 s on 2026-11-16): a "Full make test green" criterion goes NOT-MET on timeout alone (A6 run, re-run with GATES_TIMEOUT=400). Raise the default or have contract-interview write the timeout for full-suite criteria. - [x] DONE c25a7ea (user 2026-11-17: default 600 s, env override kept) gates.sh default `GATES_TIMEOUT=120` < full `make test` (~135 s on 2026-11-16): a "Full make test green" criterion goes NOT-MET on timeout alone (A6 run, re-run with GATES_TIMEOUT=400). Raise the default or have contract-interview write the timeout for full-suite criteria.
- [x] DONE 5bba6ce bugfix/gates-abandon-id (UNMERGED), /hotfix 2026-11-20: numeric id required, indented ABANDON counts (game ledger 2026-09-30-verify-qual-deparse MET → ABANDONED(1)), malformed → ERROR, 5 tests. Was: gates.sh:93 ABANDON regex `([0-9]+)?` reads `ABANDON: 1b …` / `1.1` as id 1: after a renumber (LRN-284) criterion 1 is masked ABANDONED (rc 3) instead of "unknown criterion" ERROR. Anchor the id `([0-9]+)([[:space:]]|$)` + test (robustness challenger, gates hotfix 2026-11-17) - [ ] gates.sh:93 ABANDON regex `([0-9]+)?` reads `ABANDON: 1b …` / `1.1` as id 1: after a renumber (LRN-284) criterion 1 is masked ABANDONED (rc 3) instead of "unknown criterion" ERROR. Anchor the id `([0-9]+)([[:space:]]|$)` + test (robustness challenger, gates hotfix 2026-11-17)
- [ ] gates.sh residual: a stray oracle (indented ` 2.`, `- `, `**2.**` label) after a MANUAL criterion still attaches to it, row MANUAL → MET/NOT-MET on an unrelated oracle (no red oracle overwritten; accepted 2026-11-17) - [ ] gates.sh residual: a stray oracle (indented ` 2.`, `- `, `**2.**` label) after a MANUAL criterion still attaches to it, row MANUAL → MET/NOT-MET on an unrelated oracle (no red oracle overwritten; accepted 2026-11-17)
- [ ] lib/verify-secure-loop.md:46-47 ERROR(n) cause list is examples, incomplete: missing "no numbered criteria", "ABANDON names unknown criterion", malformed label, second attribute (c25a7ea) - [ ] lib/verify-secure-loop.md:46-47 ERROR(n) cause list is examples, incomplete: missing "no numbered criteria", "ABANDON names unknown criterion", malformed label, second attribute (c25a7ea)
- [ ] lib/design-tool-gate.sh:70 `perl -e 'alarm shift; exec @ARGV' 15 21st whoami` kills one process only (same limit as the old session-start runner, fixed 490ad83): reuse the group-kill runner when this file is next touched. - [ ] lib/design-tool-gate.sh:70 `perl -e 'alarm shift; exec @ARGV' 15 21st whoami` kills one process only (same limit as the old session-start runner, fixed 490ad83): reuse the group-kill runner when this file is next touched.
@@ -1,37 +0,0 @@
# CONTRACT — gates-abandon-id
- date: 2026-11-20 | flow: hotfix | branch: bugfix/gates-abandon-id
- status: active
- run-base: 23c580249e20d3b185bd9278726b024b5729132b
## REQUEST (verbatim — IMMUTABLE)
lib/gates.sh:110 ABANDON regex `([0-9]+)?` reads `ABANDON: 1b …` / `1.1` as criterion 1: after a renumber criterion 1 is masked ABANDONED (rc 3) instead of an "unknown criterion" ERROR. Reproduced 2026-11-20: contract with criteria 1 (runnable) and 2 (manual) + `ABANDON: 1b moved after renumber` → `gates.sh status` prints "1 ABANDONED", VERDICT ABANDONED(1), rc 3. Fix: anchor the id so `1b`, `1.1` and an id-less line give ERROR, `ABANDON: 1 reason` stays ABANDONED; regression test in lib/tests/gates.test.sh; real ledgers (git grep '^ABANDON:' .claude/tasks/contracts) keep their verdict. TODO .claude/tasks/TODO.md:107.
## CLARIFICATIONS
none — request complete
## ACCEPTANCE CRITERIA
1. Symptom gone: `ABANDON: 1b …`, `ABANDON: 1.1 …` and an id-less `ABANDON: reason` each give `GATES — VERDICT: ERROR` with "malformed ABANDON" (rc 2), never a masked ABANDONED; `ABANDON: 1 reason` still gives ABANDONED (rc 3) and `ABANDON: 1` still "blank reason".
CHECK: t=$(mktemp -d); for id in '1b moved' '1.1 moved' 'upstream offline'; do printf '## ACCEPTANCE CRITERIA\n1. ok\n CHECK: true\n EXPECT: x\n EVIDENCE: pending\n2. manual\n\nABANDON: %s\n' "$id" > $t/c.md; o=$(bash lib/gates.sh status $t/c.md 2>&1); rc=$?; [ $rc -eq 2 ] && [[ "$o" == *"malformed ABANDON"* ]] && [[ "$o" != *"ABANDONED"* ]] || { echo "BAD $id rc=$rc"; exit 1; }; done; printf '## ACCEPTANCE CRITERIA\n1. ok\n CHECK: echo M\n EXPECT: M\n EVIDENCE: pending\n2. manual\n\nABANDON: 2 upstream offline\n' > $t/v.md; o=$(bash lib/gates.sh run $t/v.md 2>&1); [ $? -eq 3 ] && [[ "$o" == *"VERDICT: ABANDONED(1)"* ]] && echo SYMPTOM_GONE
EXPECT: SYMPTOM_GONE
EVIDENCE: MET exit=0 marker-found :: SYMPTOM_GONE
2. Regression tests in lib/tests/gates.test.sh cover `1b`, `1.1` and the id-less line, and the suite is green.
CHECK: grep -q 'ABANDON: 1b' lib/tests/gates.test.sh && grep -q 'ABANDON: 1.1' lib/tests/gates.test.sh && grep -q '^ ABANDON: 1b moved' lib/tests/gates.test.sh && make test suite=lib/tests/gates.test.sh 2>&1 | tail -1
EXPECT: all suites green
EVIDENCE: MET exit=0 marker-found :: all suites green
3. Real ledgers keep their verdict: phase2-guards ABANDONED(2) (the levers-followup ledger lives on its own branch).
CHECK: bash lib/gates.sh status .claude/tasks/contracts/2026-11-02-phase2-guards-1545.md 2>&1 | tail -1
EXPECT: GATES — VERDICT: ABANDONED(2)
EVIDENCE: MET exit=0 marker-found :: GATES — VERDICT: ABANDONED(2)
5. [gated 2026-11-20 orchestrator, challenge robustness MAJOR] An `ABANDON:` line indented under its criterion counts as an abandonment (ABANDONED, rc 3), and an indented malformed one gives the malformed ERROR; the game ledger with the indented handoff reads ABANDONED(1).
CHECK: t=$(mktemp -d); printf '## ACCEPTANCE CRITERIA\n1. ok\n CHECK: echo M\n EXPECT: M\n EVIDENCE: pending\n2. manual\n ABANDON: 2 upstream offline\n' > $t/a.md; o=$(bash lib/gates.sh run $t/a.md 2>&1); [ $? -eq 3 ] && [[ "$o" == *"VERDICT: ABANDONED(1)"* ]] || exit 1; printf '## ACCEPTANCE CRITERIA\n1. ok\n CHECK: true\n EXPECT: x\n EVIDENCE: pending\n ABANDON: 1b x\n' > $t/b.md; o=$(bash lib/gates.sh status $t/b.md 2>&1); [ $? -eq 2 ] && [[ "$o" == *"malformed ABANDON"* ]] || exit 1; g=$t/game.md; git -C /home/bchanot/Documents/game show develop:.claude/tasks/contracts/2026-09-30-verify-qual-deparse-1925.md > $g && bash lib/gates.sh status $g 2>&1 | tail -1
EXPECT: GATES — VERDICT: ABANDONED(1)
EVIDENCE: MET exit=0 marker-found :: GATES — VERDICT: ABANDONED(1)
4. Contract and gates suites stay green.
CHECK: make test suite="lib/tests/contract-verifier.test.sh lib/tests/loops-light.test.sh" 2>&1 | tail -1
EXPECT: all suites green
EVIDENCE: MET exit=0 marker-found :: all suites green
## FILE SCOPE
- lib/gates.sh
- lib/tests/gates.test.sh
- this contract and .claude/tasks/plans/2026-11-20-gates-abandon-id-1811.md (run artifacts)
@@ -0,0 +1,52 @@
# CONTRACT — levers-followup
- date: 2026-11-20 | flow: feat | branch: feature/levers-followup
- status: active
- run-base: 23c580249e20d3b185bd9278726b024b5729132b
## REQUEST (verbatim — IMMUTABLE)
Suivi des six leviers (TODO "NEXT: follow-up /feat", décidé par l'utilisateur le 2026-11-20 en pass B et au GATE 2 du run done-triage-levers) : (a) lib/contract-interview.md STEP 4 fait faire le dry run + `- run-base:` à tout flow qui écrit un contrat ; (b) skills/ship-feature STEP 6 et skills/init-project STEP 10 : "Fix all CRITICAL" lié au levier 1 (rouvert seulement sur preuve reproductible) ; lib/capitalize-commit.md : `--end-of-options` + check `^[0-9a-f]{7,40}$` sur run_base ; agents/verifier.md STEP 4 : lignes `[gated]` en scope seulement sur un contrat non suivi. 5 fichiers.
(User, same turn: "d'accord fais les dans l'ordre alors sans t'arrêter".)
## CLARIFICATIONS
none — request complete (each item is a placement of a decision taken 2026-11-20 in the done-triage-levers run, contract .claude/tasks/contracts/2026-11-20-done-triage-levers-1413.md)
## ACCEPTANCE CRITERIA
1. (a) lib/contract-interview.md STEP 4: a paragraph after the print line says that before the first dev-step dispatch, after the flow's branch step, a contract with `CHECK:` lines gets its dry run (records `- run-base:`, the run's start SHA for the TODO count; `gates.sh run` on a `mktemp -d` copy from the project root, citing § BEFORE THE FIRST DISPATCH), in every flow that writes such a contract, challenged or not; a value written before the branch step is replaced by `git rev-parse HEAD` right after it; a flow's own positive control on the unfixed tree counts as the `gates.sh` half and `- run-base:` is still recorded. The template carries no run-base placeholder.
CHECK: f=lib/contract-interview.md; s=$(awk '/^## STEP 4/{p=1;next} /^## MID-RUN/{p=0} p' $f); grep -q '^Before the first dev-step dispatch, after the flow.s branch step, a$' <<<"$s" && grep -q '^`- run-base:` (the run.s start SHA, for the TODO count of$' <<<"$s" && grep -q '^root, runs `bash ~/.claude/lib/gates.sh run` on a `mktemp -d` copy of the$' <<<"$s" && grep -q '^contract (`lib/verify-secure-loop.md` § BEFORE THE FIRST DISPATCH). Every$' <<<"$s" && grep -q '^replaced by `git rev-parse HEAD` right after it) and, from the project$' <<<"$s" && grep -q '^`gates.sh` half, and `- run-base:` is still recorded.$' <<<"$s" && [ "$(grep -c 'run-base: <' <<<"$s")" -eq 0 ] && echo CI_OK
EXPECT: CI_OK
EVIDENCE: MET exit=0 marker-found :: CI_OK
2. (b) skills/ship-feature/SKILL.md STEP 6 and skills/init-project/SKILL.md STEP 10: "Fix all CRITICAL before proceeding." becomes "Fix every CRITICAL or Important finding that carries reproducible evidence … before proceeding", with the one-attempt-else-MINOR clause, security to the user, citing `lib/verify-secure-loop.md` § DONE and `lib/verify-secure-loop.md` § MINOR triage (both path-prefixed); both RULES lines and the ship-feature loop-back table row say "CRITICAL or Important" with reproducible evidence; no "Fix all CRITICAL" left in either file; ship-feature STEP 4 and init-project STEP 8 carry, right after their `gitflow.sh start` block, a pointer to the contract dry run on that branch.
CHECK: for f in skills/ship-feature/SKILL.md skills/init-project/SKILL.md; do grep -q '^verdict" (code review, BDR-150). Fix every CRITICAL or Important finding$' $f && grep -q '^command, else it is a MINOR; a security finding goes to the user$' $f && grep -q '^(`lib/verify-secure-loop.md` § DONE;$' $f && grep -q '^`lib/verify-secure-loop.md` § MINOR triage).$' $f && grep -q '^- Fix every CRITICAL or Important review issue that carries$' $f && [ "$(grep -c 'Fix all CRITICAL' $f)" -eq 0 ] && grep -A2 'lib/gitflow.sh" start feature' $f | grep -q '^Then, before the first dispatch, the contract dry run on this branch$' || exit 1; done; grep -q '^ reproducible evidence before proceeding (STEP 6).$' skills/ship-feature/SKILL.md && grep -q '^ reproducible evidence before proceeding (STEP 10).$' skills/init-project/SKILL.md && grep -q '^| STEP 6 — review returns CRITICAL or Important items with reproducible evidence | Loop back' skills/ship-feature/SKILL.md && echo REVIEW_OK
EXPECT: REVIEW_OK
EVIDENCE: MET exit=0 marker-found :: REVIEW_OK
3. lib/capitalize-commit.md: the snippet guards `run_base` with `[[ $run_base =~ ^[0-9a-f]{7,40}$ ]]` and passes it after `--end-of-options`; the prose says a non-SHA `run_base` gives `TODO n/a`. Run on a fixture (one open item closed, a closed one edited, two added): a full SHA and a 7-char SHA give `TODO +2 / -1` (also from a subdirectory after a commit); `HEAD`, `--output=x` and an unknown SHA give `TODO n/a`, and `--output=x` writes no file.
CHECK: f=$PWD/lib/capitalize-commit.md; grep -q '^ `run_base` that is not a 7-40 hex SHA, or a failing `git diff` →$' $f && t=$(mktemp -d) && s=$t/s.sh && awk '/^ if \[\[ \$run_base =~/{p=1} p{print} p&&/todo="TODO n\/a"; fi$/{exit}' $f | sed 's/^ //' > $s && [ "$(wc -l < $s)" -eq 7 ] && grep -q -- '--end-of-options "$run_base"' $s && mkdir $t/r && cd $t/r && git init -q && mkdir -p .claude/tasks sub && printf -- '- [ ] a\n- [ ] b\n- [x] old\n' > .claude/tasks/TODO.md && git add . && git -c user.email=t@t -c user.name=t commit -qm base && b=$(git rev-parse HEAD) && b7=$(git rev-parse --short=7 HEAD) && printf -- '- [x] a DONE\n- [ ] b\n- [x] old edited\n- [ ] c\n- [ ] d\n' > .claude/tasks/TODO.md && r1=$(run_base=$b bash -c ". $s; echo \"\$todo\"") && r2=$(run_base=$b7 bash -c ". $s; echo \"\$todo\"") && r3=$(run_base=HEAD bash -c ". $s; echo \"\$todo\"") && r4=$(run_base=--output=x bash -c ". $s; echo \"\$todo\"") && r5=$(run_base=0123456789abcdef0123456789abcdef01234567 bash -c ". $s; echo \"\$todo\"") && git add . && git -c user.email=t@t -c user.name=t commit -qm run && r6=$(cd sub && run_base=$b bash -c ". $s; echo \"\$todo\"") && [ ! -e x ] && [ ! -e sub/x ] && echo "R1=$r1 R2=$r2 R3=$r3 R4=$r4 R5=$r5 R6=$r6"
EXPECT: R1=TODO +2 / -1 R2=TODO +2 / -1 R3=TODO n/a R4=TODO n/a R5=TODO n/a R6=TODO +2 / -1
EVIDENCE: MET exit=0 marker-found :: R1=TODO +2 / -1 R2=TODO +2 / -1 R3=TODO n/a R4=TODO n/a R5=TODO n/a R6=TODO +2 / -1
4. agents/verifier.md: STEP 4 keeps on a tracked contract only `EVIDENCE:` lines and the `- run-base:` line in scope; a `[gated]` entry added to a tracked contract goes on a new `GATED:` OUTPUT line, never in the out-of-scope count; the ORCHESTRATOR PROTOCOL routes `GATED:` entries to the orchestrator (check against the plan's decisions or ask the human, never a dev task or ECARTS gap, unconfirmable entry removed by the orchestrator and named in the final report).
CHECK: f=agents/verifier.md; s=$(awk '/^## STEP 4/{p=1;next} /^## /{p=0} p' $f); grep -q '^untracked or added, else only its `EVIDENCE:` lines and `- run-base:` line.$' <<<"$s" && grep -q '^A `\[gated\]` entry added to a tracked contract goes on the `GATED:` line,$' <<<"$s" && grep -q '^never in the out-of-scope count: nothing in the diff proves who wrote it.$' <<<"$s" && grep -A1 '^SCOPE: in-scope <n> files; out-of-scope: <list | none>$' $f | grep -q '^GATED: <`\[gated\]` entries added to a tracked contract | none>$' && grep -q '^ - `GATED:` entries (any verdict) → the orchestrator checks each against$' $f && grep -q '^ never an ECARTS gap. An entry nobody can confirm is removed by the$' $f && echo VF_OK
EXPECT: VF_OK
EVIDENCE: NOT-MET exit=1 (nonzero) ::
5. No em-dash in any line this run adds, except the pre-existing ship-feature table row it extends; exactly the four files of criteria 1-3 change (7 removed lines), agents/verifier.md untouched (criterion 4 abandoned).
CHECK: F="lib/contract-interview.md skills/ship-feature/SKILL.md skills/init-project/SKILL.md lib/capitalize-commit.md"; n=$(git diff -U0 23c580249e20d3b185bd9278726b024b5729132b -- $F | grep '^+[^+]' | grep -v '^+| STEP 6 — review returns CRITICAL or Important items' | grep -c '—'); [ "$n" -eq 0 ] && [ "$(git diff --name-only 23c580249e20d3b185bd9278726b024b5729132b -- $F | wc -l)" -eq 4 ] && [ "$(git diff --quiet 23c580249e20d3b185bd9278726b024b5729132b -- agents/verifier.md; echo $?)" -eq 0 ] && [ "$(git diff --numstat 23c580249e20d3b185bd9278726b024b5729132b -- $F | awk '{d+=$2} END{print d+0}')" -eq 7 ] && echo SCOPE5_OK
EXPECT: SCOPE5_OK
EVIDENCE: MET exit=0 marker-found :: SCOPE5_OK
6. Locking suites stay green (doctrine census incl. the new § DONE / § MINOR triage citations, challenge wiring, advisor locks, effort routing).
CHECK: make test suite="lib/tests/doctrine-citers.test.sh lib/tests/plan-challenger.test.sh lib/tests/subagent-advisor.test.sh lib/tests/effort-routing.test.sh" 2>&1 | tail -1
EXPECT: all suites green
EVIDENCE: MET exit=0 marker-found :: all suites green
7. Loop and gate suites stay green.
CHECK: make test suite="lib/tests/loops-light.test.sh lib/tests/loops-heavy.test.sh lib/tests/model-routing.test.sh lib/tests/contract-verifier.test.sh lib/tests/gates.test.sh" 2>&1 | tail -1
EXPECT: all suites green
EVIDENCE: MET exit=0 marker-found :: all suites green
8. Not loosened (judgement): apart from the changes criteria 1-4 name, nothing in the five files is removed or weakened; the review CRITICAL rule only adds the evidence condition and the security route already decided in lever 1/2.
ABANDON: 4 deferred 2026-11-20 by the orchestrator after the r3 confirmation challenge: a `[gated]`-on-tracked-contract rule only bites init-project (contract root-committed by gitflow init), and its routing must live at the GATE 1 act sites (lib/verify-secure-loop.md GATE 1, skills/init-project STEP 9), outside this run's files; every in-verifier version added mechanism (GATED line, re-verify on removal, structural-failure rule, diff reference point). Handoff: TODO line for the user's decision (fix at those act sites, or keep today's behaviour and record the limit).
## FILE SCOPE
- lib/contract-interview.md
- skills/ship-feature/SKILL.md
- skills/init-project/SKILL.md
- lib/capitalize-commit.md
- agents/verifier.md (criterion 4, abandoned: stays untouched)
- this contract and .claude/tasks/plans/2026-11-20-levers-followup-1725.md (run artifacts)
@@ -1,87 +0,0 @@
# FIX — gates-abandon-id (/hotfix, 2026-11-20 18:11)
Contract: `.claude/tasks/contracts/2026-11-20-gates-abandon-id-1811.md`. Branch bugfix/gates-abandon-id
off develop 23c5802.
## Root cause
lib/gates.sh:110 `^ABANDON:[[:space:]]*([0-9]+)?[[:space:]]*(.*)$`: the id group is optional and
unanchored, so `ABANDON: 1b moved` captures id `1` and reason `b moved`. Criterion 1 is then
reported ABANDONED (rc 3) instead of a ledger error. Reproduced on a scratch contract.
## Exact edit
lib/gates.sh, `_absorb`, replace the two ABANDON lines (110-111):
```
elif [[ "$1" =~ ^ABANDON:[[:space:]]*([0-9]+)?[[:space:]]*(.*)$ ]]; then
_ABANDON_ID+=("${BASH_REMATCH[1]}"); _ABANDON_WHY+=("${BASH_REMATCH[2]}")
```
with
```
elif [[ "$1" =~ ^[[:space:]]*ABANDON:[[:space:]]*([0-9]+)([[:space:]]+(.*))?$ ]]; then
_ABANDON_ID+=("${BASH_REMATCH[1]}"); _ABANDON_WHY+=("${BASH_REMATCH[3]}")
elif [[ "$1" =~ ^[[:space:]]*ABANDON: ]]; then
_err "malformed ABANDON at line $2 (want \`ABANDON: N reason\`)"
```
The second branch is required: with only the anchored regex, `ABANDON: 1b` would match no branch
and be silently dropped, losing the handoff and letting the ledger read MET.
lib/tests/gates.test.sh, after the "abandonment naming nothing" case, three cases of this
exact shape (same as gates.test.sh:277-287), the last line varying:
```
gate "abandonment id 1b is malformed" run "malformed ABANDON" 2 <<'EOF'
## ACCEPTANCE CRITERIA
1. green
CHECK: echo "M"
EXPECT: M
EVIDENCE: pending
2. manual
ABANDON: 1b moved after renumber
EOF
```
plus one valid case, same fixture with ` ABANDON: 2 upstream offline` (3 leading spaces),
label "indented abandonment counts", `run "GATES — VERDICT: ABANDONED(1)" 3`.
Malformed labels / last lines: "abandonment id 1.1 is malformed" / `ABANDON: 1.1 moved after
renumber`; "abandonment without id is malformed" / `ABANDON: upstream offline` (was
"unknown criterion: ''", now malformed); "indented malformed abandonment" /
` ABANDON: 1b moved` (3 leading spaces) expecting `run "malformed ABANDON" 2`.
## Edge cases
- `ABANDON: 1` (no reason): still matches (group 2 optional) → existing "blank reason" test.
- `ABANDON: 1 reason` with extra spaces: `[[:space:]]+` then `(.*)` → reason trimmed by
`_trim` at the blank check.
- Both ABANDON branches accept leading whitespace: an `ABANDON:` written indented under its
criterion (the game ledger 2026-09-30-verify-qual-deparse-1925.md:31) was silently dropped
(status MET); it now counts (ABANDONED). Prose `ABANDONED`/`ABANDONMENT` never matches (the
colon is required). No attribute line starts with `ABANDON:`.
- Punctuation right after the id (`ABANDON: 4: reason`, `5, reason`, `3—reason`) was ABANDONED
and is now the malformed ERROR, on purpose: the documented form is `ABANDON: <n> <reason>`
(contract-interview.md), fail closed; no real ledger uses it (all refs grepped).
## Challenge r1 (correctness SOLID, robustness CONCERNS(1), simplicity SOLID)
- robustness MAJOR: indented `ABANDON:` silently dropped, real instance in the game repo →
leading whitespace accepted in both branches + indented test case.
- simplicity MINOR: fixture spelled out literally (above).
- correctness MINOR: punctuation after the id declared malformed on purpose (Edge cases).
- MINOR dropped: ABANDON line outside `## ACCEPTANCE CRITERIA` ignored (no real instance found).
- MINOR dropped: bulleted `- ABANDON: …` still ignored (no real instance found).
## Challenge r2 (confirmation, robustness: SOLID)
- MINORs taken: 5th test case (indented malformed); criterion 5 reads the game ledger at a
pinned revision (`git -C … show develop:…`).
- Limit named: an indented code fence under a criterion is not a fence to the parser
(`_parse` toggles column-0 fences only), so an example `ABANDON:` line nested there now
counts; no contract has one (10 repos grepped); indented CHECK lines already share this.
- MINOR dropped: indented ABANDON id not checked against its enclosing criterion (rc 3 still
routes to the human gate; no real ledger misplaces one).
## Replay (real ledgers)
phase2-guards-1545 status ABANDONED(2) before; must stay. levers-followup-1725 lives on
feature/levers-followup (ABANDONED(1), `ABANDON: 4 deferred …`): matches the anchored form.
Cross-repo (robustness challenger, `^[[:space:]]*ABANDON` over the contracts of the 9 other
repos' working trees): only the game ledger above, which goes MET → ABANDONED(1).
## Advisor
Covered by the end-of-run call of the levers-followup run, made just before this run started:
it named the silent fall-through and the replay. No second call.
@@ -0,0 +1,222 @@
# PLAN r4 — levers-followup (/feat, 2026-11-20 17:25)
Contract: `.claude/tasks/contracts/2026-11-20-levers-followup-1725.md`. Base: develop 23c5802.
Branch: feature/levers-followup. Source decisions: user answers of 2026-11-20 in the
done-triage-levers run (pass B scope (a)+(b), GATE 2 REPORTED (1)+(2)), BDR-151.
## Mechanism (exact text: § EXACT DIFF)
- [ ] lib/contract-interview.md STEP 4: one paragraph after the print line. Before the first
dev-step dispatch, after the flow's branch step, a contract with `CHECK:` lines gets its dry
run: `- run-base:` recorded (start SHA for the TODO count) and `gates.sh run` on a `mktemp -d`
copy from the project root (§ BEFORE THE FIRST DISPATCH). Every flow that writes such a
contract, challenged or not; a flow's own positive control on the unfixed tree counts as the
`gates.sh` half (guardrails, a11y) and `- run-base:` is still recorded. No template
placeholder; a run-base written before the branch step (challenge-plan is read before it) is
replaced by `git rev-parse HEAD` right after the branch step.
- [ ] skills/ship-feature/SKILL.md + skills/init-project/SKILL.md: STEP 6 / STEP 10 "Fix all
CRITICAL" → fix every CRITICAL or Important finding that carries reproducible evidence; else
one attempt at a failing command, else MINOR; security → user; both citations path-prefixed
(census-locked, both flip-tested). RULES lines and the ship-feature loop-back table row say
"CRITICAL or Important" with reproducible evidence. Right after each `gitflow.sh start` block (STEP 4 / STEP 8, a later turn): a
pointer to the contract dry run on that branch.
- [ ] lib/capitalize-commit.md: `[[ $run_base =~ ^[0-9a-f]{7,40}$ ]]` guard + `--end-of-options`;
prose: non-SHA `run_base` → `TODO n/a`.
- [-] agents/verifier.md: DEFERRED (contract criterion 4 ABANDON): see Challenge r2.
## Executor steps
1. One shell call from /home/bchanot/Documents/claude: `t=$(mktemp -d); awk '/^```diff$/{p=1;next}
p&&/^```$/{exit} p' /home/bchanot/Documents/claude/.claude/tasks/plans/2026-11-20-levers-followup-1725.md
> "$t/p.patch" && git apply --check "$t/p.patch" && git apply "$t/p.patch" && git diff --numstat`.
Recovery: `git checkout -- lib/contract-interview.md skills/ship-feature/SKILL.md
skills/init-project/SKILL.md lib/capitalize-commit.md agents/verifier.md`.
2. `bash ~/.claude/lib/gates.sh run <contract>` → `GATES — VERDICT: MET`.
## Edge cases
- hotfix contracts carry no `CHECK:` → no dry run, no run-base → capitalize uses `HEAD`
(pending edits only, existing shortcut).
- `run_base` short SHA accepted; `HEAD`, branch names, `-`-led values → `TODO n/a` (fixture,
`--output=x` writes no file).
- ship-feature table row keeps its pre-existing em-dash (criterion 5 excludes that one line).
## Proof before dispatch
Scratch clone r3: criteria 1-5 MET, census green, both new citations flip-tested; untouched
tree: 1-5 NOT-MET. CHECKs use shell variables, no temp files.
## Advisor (plan point)
Drove: [gated] exit path, run-base write site, dispatch-step pointers, the citer grep.
## Challenge r1 (3 lenses: correctness CONCERNS(2), robustness CONCERNS(1), simplicity CONCERNS(1))
- `[gated]` routing unwired and self-contradicting, init-project contract tracked (3 lenses) →
`GATED:` OUTPUT line outside the ECARTS count + PROTOCOL bullet (robustness/correctness fix,
inside verifier.md); "Rare" dropped.
- run-base written with the contract = before the branch switch, wrong base (correctness) →
template line dropped; written at the dry run after the branch step; pointers moved below
`gitflow.sh start`.
- MINORs taken: one run-base write site (no placeholder); "first dev-step dispatch";
positive control counts as the dry run; second citation path-prefixed (census-locked);
Important findings follow the same evidence rule; CHECK temp files → variables;
challenge-plan.md copy named below.
- MINOR dropped: capitalize-commit:70 source pointer (still correct: the dry run writes run-base).
## Challenge r2 (confirmation, correctness: CONCERNS(3)), closed in r4
- `GATED:` routing lives where no orchestrator reads it (GATE 1 parsing in verify-secure-loop,
init-project STEP 9) + removing an entry leaves its CONFORME (2 MAJOR) → item (2) DEFERRED:
every in-verifier version grew mechanism; the fix belongs at the GATE 1 act sites, outside
this run. agents/verifier.md untouched, criterion 4 ABANDON with handoff, TODO line for the
user. Run reports ABANDONED, never "fully complete".
- run-base timing claim false; challenge-plan (read before the branch) can record it early
(MAJOR) → contract-interview: an early value is replaced by `git rev-parse HEAD` right after
the branch step; false parenthetical removed.
- MINORs taken: positive control = `gates.sh` half, run-base still recorded; "CRITICAL or
Important" in RULES lines and table row. MINORs 5, 6, 7, 9 concerned the deferred verifier
change: moot here, carried into the TODO handoff.
## Disposition
- honors BDR-151: places levers 1, 2, 5, 6 at the act sites.
- applies LRN-297 (act-site restatement), LRN-304 (counter guard + fixture), LRN-296, LRN-281.
## Not done
- The dry-run rule now lives at: verify-secure-loop § BEFORE THE FIRST DISPATCH (source),
challenge-plan "Challenged or skipped" paragraph, contract-interview STEP 4, ship-feature
STEP 4, init-project STEP 8. A change to it patches all five.
- Item (2) of the request (`[gated]` only on an untracked contract): deferred, user decision
in TODO (fix at verify-secure-loop GATE 1 + init-project STEP 9, or keep today's behaviour).
- verify-secure-loop.md:26 "Records … once" not reworded; contract-interview states the
replacement after the branch step.
- Vendored skills-external/requesting-code-review/SKILL.md:44-46 "Fix Critical immediately /
Fix Important before proceeding / Note Minor for later" (foreign, not edited): the
orchestrator's STEP 6 / STEP 10 text is the act-site rule.
- skills/tour/SKILL.md:161 audit fix policy, not a post-gate review reopen; untouched.
- MEASURE line from BDR-151 stays open.
## EXACT DIFF (against develop 23c5802)
```diff
diff --git a/lib/capitalize-commit.md b/lib/capitalize-commit.md
index de907ec..34a44f8 100644
--- a/lib/capitalize-commit.md
+++ b/lib/capitalize-commit.md
@@ -70,9 +70,11 @@ never a shell argument.
(`lib/verify-secure-loop.md` § BEFORE THE FIRST DISPATCH), else
`git rev-parse HEAD` now (shortcut: without a contract only the pending
TODO edits count; edits committed earlier in the run are missed). A
- failing `git diff` → `TODO n/a`, never a silent `+0 / -0`.
+ `run_base` that is not a 7-40 hex SHA, or a failing `git diff` →
+ `TODO n/a`, never a silent `+0 / -0`.
- if d=$(git diff --no-color --no-ext-diff "$run_base" \
+ if [[ $run_base =~ ^[0-9a-f]{7,40}$ ]] && d=$(git diff --no-color \
+ --no-ext-diff --end-of-options "$run_base" \
-- ':/.claude/tasks/TODO.md' 2>/dev/null); then
n=$(printf '%s\n' "$d" | grep -c '^+ *- \[ \]')
m=$(printf '%s\n' "$d" | grep -c '^- *- \[ \]')
diff --git a/lib/contract-interview.md b/lib/contract-interview.md
index 1c453a6..def4925 100644
--- a/lib/contract-interview.md
+++ b/lib/contract-interview.md
@@ -141,6 +141,17 @@ Q: <question> / A: <answer> (pass B and mid-run entries: [gated <YYYY-MM-DD>])
Print one line to the user, then continue the flow:
`CONTRACT: <path> — <n> criteria, scope <files|repo-wide>, <q> questions asked`
+Before the first dev-step dispatch, after the flow's branch step, a
+contract with `CHECK:` lines gets its dry run: the main loop records
+`- run-base:` (the run's start SHA, for the TODO count of
+`lib/capitalize-commit.md`; a value written before the branch step is
+replaced by `git rev-parse HEAD` right after it) and, from the project
+root, runs `bash ~/.claude/lib/gates.sh run` on a `mktemp -d` copy of the
+contract (`lib/verify-secure-loop.md` § BEFORE THE FIRST DISPATCH). Every
+flow that writes such a contract does this, whether or not it challenges
+its plan; a flow's own positive control on the unfixed tree counts as the
+`gates.sh` half, and `- run-base:` is still recorded.
+
## MID-RUN CLARIFICATION (the channel executors halt into)
An executor cannot talk to the human. It halts with `NEED-DECISION`, the
diff --git a/skills/init-project/SKILL.md b/skills/init-project/SKILL.md
index 40066ab..2a73752 100644
--- a/skills/init-project/SKILL.md
+++ b/skills/init-project/SKILL.md
@@ -224,6 +224,9 @@ Start the MVP feature branch off develop, then implement on it:
```bash
bash "$HOME/.claude/lib/gitflow.sh" start feature mvp
```
+Then, before the first dispatch, the contract dry run on this branch
+(`lib/contract-interview.md` STEP 4;
+`lib/verify-secure-loop.md` § BEFORE THE FIRST DISPATCH).
Invoke `subagent-driven-development` (vendored superpowers skill) for the per-task implement loop
**and** the final whole-branch review **only**. Do NOT run its terminal
`finishing-a-development-branch` step — this orchestrator owns integration via
@@ -277,7 +280,12 @@ Invoke `requesting-code-review` (vendored superpowers skill). **Model routing (B
review subagent it dispatches MUST carry `model: "opus"` and `effort="xhigh"` in the Agent call —
craft review is dispatched judgment, never inherited from the session.
Add to its brief: "you may call the `advisor` tool once, before your
-verdict" (code review, BDR-150). Fix all CRITICAL before proceeding.
+verdict" (code review, BDR-150). Fix every CRITICAL or Important finding
+that carries reproducible evidence (a command that fails on HEAD, or real
+output shown wrong) before proceeding. Without it, one attempt at a failing
+command, else it is a MINOR; a security finding goes to the user
+(`lib/verify-secure-loop.md` § DONE;
+`lib/verify-secure-loop.md` § MINOR triage).
## STEP 10b — CAPITALIZE FOUNDING DECISIONS (memory registries)
A greenfield's founding architecture decisions are the highest-value BDRs — the
@@ -379,7 +387,8 @@ bash "$HOME/.claude/lib/gitflow.sh" finish # feature/mvp → develop
- Scaffolder = skeleton only, zero logic.
- Features → subagent pipeline only.
- Broken build = unacceptable output.
-- Fix all CRITICAL review issues before proceeding.
+- Fix every CRITICAL or Important review issue that carries
+ reproducible evidence before proceeding (STEP 10).
- Stop if requirements unclear at any step.
---
diff --git a/skills/ship-feature/SKILL.md b/skills/ship-feature/SKILL.md
index 81ae90a..4996778 100644
--- a/skills/ship-feature/SKILL.md
+++ b/skills/ship-feature/SKILL.md
@@ -186,6 +186,9 @@ Start the feature branch off develop, then implement on it:
```bash
bash "$HOME/.claude/lib/gitflow.sh" start feature <name>
```
+Then, before the first dispatch, the contract dry run on this branch
+(`lib/contract-interview.md` STEP 4;
+`lib/verify-secure-loop.md` § BEFORE THE FIRST DISPATCH).
Invoke `subagent-driven-development` (vendored superpowers skill) for the per-task implement loop
**and** the final whole-branch review **only**. Do NOT run its terminal
`finishing-a-development-branch` step — this orchestrator owns integration via
@@ -259,7 +262,12 @@ Invoke `requesting-code-review` (vendored superpowers skill). **Model routing (B
review subagent it dispatches MUST carry `model: "opus"` and `effort="xhigh"` in the Agent call —
craft review is dispatched judgment, never inherited from the session.
Add to its brief: "you may call the `advisor` tool once, before your
-verdict" (code review, BDR-150). Fix all CRITICAL before proceeding.
+verdict" (code review, BDR-150). Fix every CRITICAL or Important finding
+that carries reproducible evidence (a command that fails on HEAD, or real
+output shown wrong) before proceeding. Without it, one attempt at a failing
+command, else it is a MINOR; a security finding goes to the user
+(`lib/verify-secure-loop.md` § DONE;
+`lib/verify-secure-loop.md` § MINOR triage).
## STEP 7 — CAPITALIZE (memory registries)
Call memory_pending first, per /capitalize STEP 1 "Captured first".
@@ -341,7 +349,8 @@ bash "$HOME/.claude/lib/gitflow.sh" finish # feature/<name> → develop
- No skipping steps. No merged agent responsibilities.
- No implement without user approval at STEP 3.
- Subagents isolated — no shared context between tasks.
-- Fix all CRITICAL review issues before proceeding.
+- Fix every CRITICAL or Important review issue that carries
+ reproducible evidence before proceeding (STEP 6).
- Stop if requirements unclear at any step.
- STEP 4 errors → STEP 4b gate required before any fix. Never auto-patch a failing subagent.
@@ -361,7 +370,7 @@ The pipeline must handle these without aborting silently:
| STEP 3 — user replies "request changes" | Loop back to STEP 2 with user's notes. Cap at 3 iterations; on the 3rd "request changes" without approval, ask "Pause and rescope this feature?" |
| STEP 4 — subagent crashes (tool error, not test failure) | Treat as STEP 4b error path, present hypothesis-led gate. |
| STEP 4b — option A retried 2× still failing | Force fall-through to B or C. Do not loop a 3rd time. |
-| STEP 6 — review returns CRITICAL items | Loop back to STEP 4 for those items only. Cap at 2 review-cycle iterations; if still CRITICAL, escalate. |
+| STEP 6 — review returns CRITICAL or Important items with reproducible evidence | Loop back to STEP 4 for those items only. Cap at 2 review-cycle iterations; if still CRITICAL, escalate. |
| STEP 7 — `.claude/memory/` missing | Create the registry files from `~/.claude/templates/memory/` first, then proceed. |
---
```
MINOR dropped: ship-feature STEP 6 loop-back table outcome cell still reads "if still CRITICAL, escalate" (verifier GATE 1 note); the row header carries the evidence rule.
+4 -2
View File
@@ -70,9 +70,11 @@ never a shell argument.
(`lib/verify-secure-loop.md` § BEFORE THE FIRST DISPATCH), else (`lib/verify-secure-loop.md` § BEFORE THE FIRST DISPATCH), else
`git rev-parse HEAD` now (shortcut: without a contract only the pending `git rev-parse HEAD` now (shortcut: without a contract only the pending
TODO edits count; edits committed earlier in the run are missed). A TODO edits count; edits committed earlier in the run are missed). A
failing `git diff` → `TODO n/a`, never a silent `+0 / -0`. `run_base` that is not a 7-40 hex SHA, or a failing `git diff` →
`TODO n/a`, never a silent `+0 / -0`.
if d=$(git diff --no-color --no-ext-diff "$run_base" \ if [[ $run_base =~ ^[0-9a-f]{7,40}$ ]] && d=$(git diff --no-color \
--no-ext-diff --end-of-options "$run_base" \
-- ':/.claude/tasks/TODO.md' 2>/dev/null); then -- ':/.claude/tasks/TODO.md' 2>/dev/null); then
n=$(printf '%s\n' "$d" | grep -c '^+ *- \[ \]') n=$(printf '%s\n' "$d" | grep -c '^+ *- \[ \]')
m=$(printf '%s\n' "$d" | grep -c '^- *- \[ \]') m=$(printf '%s\n' "$d" | grep -c '^- *- \[ \]')
+11
View File
@@ -141,6 +141,17 @@ Q: <question> / A: <answer> (pass B and mid-run entries: [gated <YYYY-MM-DD>])
Print one line to the user, then continue the flow: Print one line to the user, then continue the flow:
`CONTRACT: <path> — <n> criteria, scope <files|repo-wide>, <q> questions asked` `CONTRACT: <path> — <n> criteria, scope <files|repo-wide>, <q> questions asked`
Before the first dev-step dispatch, after the flow's branch step, a
contract with `CHECK:` lines gets its dry run: the main loop records
`- run-base:` (the run's start SHA, for the TODO count of
`lib/capitalize-commit.md`; a value written before the branch step is
replaced by `git rev-parse HEAD` right after it) and, from the project
root, runs `bash ~/.claude/lib/gates.sh run` on a `mktemp -d` copy of the
contract (`lib/verify-secure-loop.md` § BEFORE THE FIRST DISPATCH). Every
flow that writes such a contract does this, whether or not it challenges
its plan; a flow's own positive control on the unfixed tree counts as the
`gates.sh` half, and `- run-base:` is still recorded.
## MID-RUN CLARIFICATION (the channel executors halt into) ## MID-RUN CLARIFICATION (the channel executors halt into)
An executor cannot talk to the human. It halts with `NEED-DECISION`, the An executor cannot talk to the human. It halts with `NEED-DECISION`, the
+2 -4
View File
@@ -107,10 +107,8 @@ _absorb() { # _absorb <raw-line> <lineno>
elif [[ "$1" =~ ^[0-9] ]]; then elif [[ "$1" =~ ^[0-9] ]]; then
_err "malformed criterion label at line $2 (want \`N. text\`)" _err "malformed criterion label at line $2 (want \`N. text\`)"
_CUR=-1 _CUR=-1
elif [[ "$1" =~ ^[[:space:]]*ABANDON:[[:space:]]*([0-9]+)([[:space:]]+(.*))?$ ]]; then elif [[ "$1" =~ ^ABANDON:[[:space:]]*([0-9]+)?[[:space:]]*(.*)$ ]]; then
_ABANDON_ID+=("${BASH_REMATCH[1]}"); _ABANDON_WHY+=("${BASH_REMATCH[3]}") _ABANDON_ID+=("${BASH_REMATCH[1]}"); _ABANDON_WHY+=("${BASH_REMATCH[2]}")
elif [[ "$1" =~ ^[[:space:]]*ABANDON: ]]; then
_err "malformed ABANDON at line $2 (want \`ABANDON: N reason\`)"
elif [[ "$1" =~ ^(CHECK|EXPECT|EVIDENCE): ]]; then elif [[ "$1" =~ ^(CHECK|EXPECT|EVIDENCE): ]]; then
_err "unindented ${BASH_REMATCH[1]}: at line $2" _err "unindented ${BASH_REMATCH[1]}: at line $2"
elif [[ "$1" =~ ^[[:space:]]+(CHECK|EXPECT|EVIDENCE):(.*)$ ]]; then elif [[ "$1" =~ ^[[:space:]]+(CHECK|EXPECT|EVIDENCE):(.*)$ ]]; then
-55
View File
@@ -302,61 +302,6 @@ gate "abandonment naming nothing" run "unknown criterion" 2 <<'EOF'
ABANDON: 9 names a criterion that does not exist ABANDON: 9 names a criterion that does not exist
EOF EOF
gate "abandonment id 1b is malformed" run "malformed ABANDON" 2 <<'EOF'
## ACCEPTANCE CRITERIA
1. green
CHECK: echo "M"
EXPECT: M
EVIDENCE: pending
2. manual
ABANDON: 1b moved after renumber
EOF
gate "abandonment id 1.1 is malformed" run "malformed ABANDON" 2 <<'EOF'
## ACCEPTANCE CRITERIA
1. green
CHECK: echo "M"
EXPECT: M
EVIDENCE: pending
2. manual
ABANDON: 1.1 moved after renumber
EOF
gate "abandonment without id is malformed" run "malformed ABANDON" 2 <<'EOF'
## ACCEPTANCE CRITERIA
1. green
CHECK: echo "M"
EXPECT: M
EVIDENCE: pending
2. manual
ABANDON: upstream offline
EOF
gate "indented malformed abandonment" run "malformed ABANDON" 2 <<'EOF'
## ACCEPTANCE CRITERIA
1. green
CHECK: echo "M"
EXPECT: M
EVIDENCE: pending
2. manual
ABANDON: 1b moved
EOF
gate "indented abandonment counts" run "GATES — VERDICT: ABANDONED(1)" 3 <<'EOF'
## ACCEPTANCE CRITERIA
1. green
CHECK: echo "M"
EXPECT: M
EVIDENCE: pending
2. manual
ABANDON: 2 upstream offline
EOF
echo "── usage ──" echo "── usage ──"
# usage <label> <expected-substring> <argv...> # usage <label> <expected-substring> <argv...>
+11 -2
View File
@@ -224,6 +224,9 @@ Start the MVP feature branch off develop, then implement on it:
```bash ```bash
bash "$HOME/.claude/lib/gitflow.sh" start feature mvp bash "$HOME/.claude/lib/gitflow.sh" start feature mvp
``` ```
Then, before the first dispatch, the contract dry run on this branch
(`lib/contract-interview.md` STEP 4;
`lib/verify-secure-loop.md` § BEFORE THE FIRST DISPATCH).
Invoke `subagent-driven-development` (vendored superpowers skill) for the per-task implement loop Invoke `subagent-driven-development` (vendored superpowers skill) for the per-task implement loop
**and** the final whole-branch review **only**. Do NOT run its terminal **and** the final whole-branch review **only**. Do NOT run its terminal
`finishing-a-development-branch` step — this orchestrator owns integration via `finishing-a-development-branch` step — this orchestrator owns integration via
@@ -277,7 +280,12 @@ Invoke `requesting-code-review` (vendored superpowers skill). **Model routing (B
review subagent it dispatches MUST carry `model: "opus"` and `effort="xhigh"` in the Agent call — review subagent it dispatches MUST carry `model: "opus"` and `effort="xhigh"` in the Agent call —
craft review is dispatched judgment, never inherited from the session. craft review is dispatched judgment, never inherited from the session.
Add to its brief: "you may call the `advisor` tool once, before your Add to its brief: "you may call the `advisor` tool once, before your
verdict" (code review, BDR-150). Fix all CRITICAL before proceeding. verdict" (code review, BDR-150). Fix every CRITICAL or Important finding
that carries reproducible evidence (a command that fails on HEAD, or real
output shown wrong) before proceeding. Without it, one attempt at a failing
command, else it is a MINOR; a security finding goes to the user
(`lib/verify-secure-loop.md` § DONE;
`lib/verify-secure-loop.md` § MINOR triage).
## STEP 10b — CAPITALIZE FOUNDING DECISIONS (memory registries) ## STEP 10b — CAPITALIZE FOUNDING DECISIONS (memory registries)
A greenfield's founding architecture decisions are the highest-value BDRs — the A greenfield's founding architecture decisions are the highest-value BDRs — the
@@ -379,7 +387,8 @@ bash "$HOME/.claude/lib/gitflow.sh" finish # feature/mvp → develop
- Scaffolder = skeleton only, zero logic. - Scaffolder = skeleton only, zero logic.
- Features → subagent pipeline only. - Features → subagent pipeline only.
- Broken build = unacceptable output. - Broken build = unacceptable output.
- Fix all CRITICAL review issues before proceeding. - Fix every CRITICAL or Important review issue that carries
reproducible evidence before proceeding (STEP 10).
- Stop if requirements unclear at any step. - Stop if requirements unclear at any step.
--- ---
+12 -3
View File
@@ -186,6 +186,9 @@ Start the feature branch off develop, then implement on it:
```bash ```bash
bash "$HOME/.claude/lib/gitflow.sh" start feature <name> bash "$HOME/.claude/lib/gitflow.sh" start feature <name>
``` ```
Then, before the first dispatch, the contract dry run on this branch
(`lib/contract-interview.md` STEP 4;
`lib/verify-secure-loop.md` § BEFORE THE FIRST DISPATCH).
Invoke `subagent-driven-development` (vendored superpowers skill) for the per-task implement loop Invoke `subagent-driven-development` (vendored superpowers skill) for the per-task implement loop
**and** the final whole-branch review **only**. Do NOT run its terminal **and** the final whole-branch review **only**. Do NOT run its terminal
`finishing-a-development-branch` step — this orchestrator owns integration via `finishing-a-development-branch` step — this orchestrator owns integration via
@@ -259,7 +262,12 @@ Invoke `requesting-code-review` (vendored superpowers skill). **Model routing (B
review subagent it dispatches MUST carry `model: "opus"` and `effort="xhigh"` in the Agent call — review subagent it dispatches MUST carry `model: "opus"` and `effort="xhigh"` in the Agent call —
craft review is dispatched judgment, never inherited from the session. craft review is dispatched judgment, never inherited from the session.
Add to its brief: "you may call the `advisor` tool once, before your Add to its brief: "you may call the `advisor` tool once, before your
verdict" (code review, BDR-150). Fix all CRITICAL before proceeding. verdict" (code review, BDR-150). Fix every CRITICAL or Important finding
that carries reproducible evidence (a command that fails on HEAD, or real
output shown wrong) before proceeding. Without it, one attempt at a failing
command, else it is a MINOR; a security finding goes to the user
(`lib/verify-secure-loop.md` § DONE;
`lib/verify-secure-loop.md` § MINOR triage).
## STEP 7 — CAPITALIZE (memory registries) ## STEP 7 — CAPITALIZE (memory registries)
Call memory_pending first, per /capitalize STEP 1 "Captured first". Call memory_pending first, per /capitalize STEP 1 "Captured first".
@@ -341,7 +349,8 @@ bash "$HOME/.claude/lib/gitflow.sh" finish # feature/<name> → develop
- No skipping steps. No merged agent responsibilities. - No skipping steps. No merged agent responsibilities.
- No implement without user approval at STEP 3. - No implement without user approval at STEP 3.
- Subagents isolated — no shared context between tasks. - Subagents isolated — no shared context between tasks.
- Fix all CRITICAL review issues before proceeding. - Fix every CRITICAL or Important review issue that carries
reproducible evidence before proceeding (STEP 6).
- Stop if requirements unclear at any step. - Stop if requirements unclear at any step.
- STEP 4 errors → STEP 4b gate required before any fix. Never auto-patch a failing subagent. - STEP 4 errors → STEP 4b gate required before any fix. Never auto-patch a failing subagent.
@@ -361,7 +370,7 @@ The pipeline must handle these without aborting silently:
| STEP 3 — user replies "request changes" | Loop back to STEP 2 with user's notes. Cap at 3 iterations; on the 3rd "request changes" without approval, ask "Pause and rescope this feature?" | | STEP 3 — user replies "request changes" | Loop back to STEP 2 with user's notes. Cap at 3 iterations; on the 3rd "request changes" without approval, ask "Pause and rescope this feature?" |
| STEP 4 — subagent crashes (tool error, not test failure) | Treat as STEP 4b error path, present hypothesis-led gate. | | STEP 4 — subagent crashes (tool error, not test failure) | Treat as STEP 4b error path, present hypothesis-led gate. |
| STEP 4b — option A retried 2× still failing | Force fall-through to B or C. Do not loop a 3rd time. | | STEP 4b — option A retried 2× still failing | Force fall-through to B or C. Do not loop a 3rd time. |
| STEP 6 — review returns CRITICAL items | Loop back to STEP 4 for those items only. Cap at 2 review-cycle iterations; if still CRITICAL, escalate. | | STEP 6 — review returns CRITICAL or Important items with reproducible evidence | Loop back to STEP 4 for those items only. Cap at 2 review-cycle iterations; if still CRITICAL, escalate. |
| STEP 7 — `.claude/memory/` missing | Create the registry files from `~/.claude/templates/memory/` first, then proceed. | | STEP 7 — `.claude/memory/` missing | Create the registry files from `~/.claude/templates/memory/` first, then proceed. |
--- ---