From 1a196780f31cb4b13a56be9dde3110c03e8356ca Mon Sep 17 00:00:00 2001 From: bchanot Date: Fri, 20 Nov 2026 18:08:02 +0100 Subject: [PATCH] =?UTF-8?q?chore(memory):=20journal=20=E2=80=94=20feat=20l?= =?UTF-8?q?evers-followup,=20mods=20timeout=20dropped?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude/memory/journal.md | 1 + .claude/tasks/TODO.md | 5 +- .../2026-11-20-levers-followup-1725.md | 52 +++++ .../plans/2026-11-20-levers-followup-1725.md | 220 ++++++++++++++++++ 4 files changed, 276 insertions(+), 2 deletions(-) create mode 100644 .claude/tasks/contracts/2026-11-20-levers-followup-1725.md create mode 100644 .claude/tasks/plans/2026-11-20-levers-followup-1725.md diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index cac2fa3..d811650 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -790,3 +790,4 @@ rules: ## 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. - /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. diff --git a/.claude/tasks/TODO.md b/.claude/tasks/TODO.md index b36e1a8..9a229ec 100644 --- a/.claude/tasks/TODO.md +++ b/.claude/tasks/TODO.md @@ -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") - [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 ### 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) - [ ] 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) -- [ ] 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) ### 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 diff --git a/.claude/tasks/contracts/2026-11-20-levers-followup-1725.md b/.claude/tasks/contracts/2026-11-20-levers-followup-1725.md new file mode 100644 index 0000000..664f928 --- /dev/null +++ b/.claude/tasks/contracts/2026-11-20-levers-followup-1725.md @@ -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 files; out-of-scope: $' $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) diff --git a/.claude/tasks/plans/2026-11-20-levers-followup-1725.md b/.claude/tasks/plans/2026-11-20-levers-followup-1725.md new file mode 100644 index 0000000..1e31895 --- /dev/null +++ b/.claude/tasks/plans/2026-11-20-levers-followup-1725.md @@ -0,0 +1,220 @@ +# 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 ` → `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: / A: (pass B and mid-run entries: [gated ]) + Print one line to the user, then continue the flow: + `CONTRACT: — criteria, scope , 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 + ``` ++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/ → 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. | + + --- +```