From 3b1722d547dcf443fbc234f64fee803a606a9a43 Mon Sep 17 00:00:00 2001 From: bchanot Date: Sat, 21 Nov 2026 20:07:12 +0100 Subject: [PATCH 1/7] fix(doctor): tracked default model is opus[1m] --- doctor.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doctor.sh b/doctor.sh index 97a7f9d..74f9fa8 100644 --- a/doctor.sh +++ b/doctor.sh @@ -152,8 +152,8 @@ else warn "user-scope residue: $(diff <(echo "$_ep_head") <(echo "$_ep_work") | grep '^[<>]' | tr -s ' ' | tr '\n' ';'); restore per MIGRATION "Profiles and packs" step 1" fi _m="$(jq -r '.model // "-"' "$REPO/settings.json" 2>/dev/null || echo "-")" -if [ "$_m" = opus ]; then pass "settings.json model is opus" -else warn "settings.json model is $_m (tracked default is opus)"; fi +if [ "$_m" = "opus[1m]" ]; then pass "settings.json model is opus[1m]" +else warn "settings.json model is $_m (tracked default is opus[1m])"; fi unset _ep_head _ep_work _m echo "" From 953b5f1600bb779d1dd244ca1964bab074c03277 Mon Sep 17 00:00:00 2001 From: bchanot Date: Sat, 21 Nov 2026 20:07:13 +0100 Subject: [PATCH 2/7] =?UTF-8?q?chore(memory):=20BDR-125=20amended=20?= =?UTF-8?q?=E2=80=94=20hotfix=20doctor=20model=20default=20=C2=B7=20TODO?= =?UTF-8?q?=20+0=20/=20-0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude/memory/decisions.md | 1 + .claude/memory/journal.md | 1 + .../2026-11-21-doctor-model-default-2004.md | 24 +++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 .claude/tasks/contracts/2026-11-21-doctor-model-default-2004.md diff --git a/.claude/memory/decisions.md b/.claude/memory/decisions.md index 92eabae..5dfba45 100644 --- a/.claude/memory/decisions.md +++ b/.claude/memory/decisions.md @@ -1414,6 +1414,7 @@ Branch feature/user-writing-web-rules, UNMERGED (human gate). - **Amendment 8 (2026-10-25, model per project and per conversation)**: user ask (one Claude Code conversation per project, often concurrent: Fable on one, opus on another). Measured headless (scratchpad modeltest): project `.claude/settings.local.json` `"model"` wins over user settings, `--settings '{"model":…}'` wins over both; same scopes as packs. `/model` writes the TRACKED user settings.json (fable landed there 2026-10-25): never the per-project route. Applied: tracked default `opus`, this repo local `claude-fable-5-1[1m]`. Phase 5 profile = `enabledPlugins` + `model`; doctor warns when tracked `model` ≠ `opus`. Residuals accepted by the user: interpreters (`python3 -c`, `node -e`) rest on prose + classifier (491/661 calls from sub-agents, an ask rule would fail executors); Bash write forms out of the routing guard until a measured evasion. - **Status (2026-10-29)**: accepted, phase 1 shipped 2026-10-29 (BDR-130): next phase 5 - **Status (2026-11-16)**: accepted, all phases shipped: 0 925dafa, 0b 06012ea, 4a 017a28b, 1 9a20ca7, 5 3cc4e0d, 2 29624d7, 4b dfadf8a, 4c ddb04f4, 4d dcb593a. Phase 3 closed unbuilt 2026-11-03 (60f28a6). Per-phase /context delta unrecorded for 4a 5 2 4b-4d; headless 26.2k (10-29) to 27.1k (11-12), interactive 40k (11-03), gap LRN-270, synced skills cut BDR-141 +- **Status (2026-11-21)**: accepted, amended 2026-11-21 (user): tracked default model opus[1m] (2bcb75b), doctor checks it (bugfix/doctor-model-default) ## BDR-126 — model-router `/model ` scope dialog: project / conversation / everywhere [accepted] (2026-10-25) diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index 650e6ce..9549317 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -796,3 +796,4 @@ rules: - /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. - /hotfix challenge-cutoff (343ccc2): confirmation BLOCKER/MAJOR on revised point not revised again, [deferred] for human; memory commit carries · TODO +n/-m. Rule applied to own run: r2 additions (stop-before-dispatch, hotfix escape) deferred to user. TODO triage: 28 dropped (no evidence/date/user ask), 51 → 24 open, list in .claude/tasks/plans/2026-11-21-todo-triage.md. MEASURE re-anchored 343ccc2. - BDR-125 phases audit 2026-11-21: all phases shipped, residual blocks done, F faunosteo verified done on its develop (530af1b, fa41bc2e); TODO F closed. Only open phase-adjacent: release (develop 235 ahead of main v3.0.0). +- /hotfix doctor-model-default: doctor passes on opus[1m], tracked default per user 2026-11-21 (BDR-125 status amended). diff --git a/.claude/tasks/contracts/2026-11-21-doctor-model-default-2004.md b/.claude/tasks/contracts/2026-11-21-doctor-model-default-2004.md new file mode 100644 index 0000000..5f3c3f0 --- /dev/null +++ b/.claude/tasks/contracts/2026-11-21-doctor-model-default-2004.md @@ -0,0 +1,24 @@ +# CONTRACT — doctor-model-default +- date: 2026-11-21 | flow: hotfix | branch: bugfix/doctor-model-default +- status: active +- run-base: 0d0ba78484e3356b661f3bc8577ed970c9036974 + +## REQUEST (verbatim — IMMUTABLE) +doctor.sh:155-156 warns "settings.json model is opus[1m] (tracked default is opus)" on every run, but the user decided 2026-11-21 to keep `opus[1m]` as the tracked default ("laisse le opus 1m"; committed 2bcb75b 2026-11-16). Fix: doctor passes on `opus[1m]` (the tracked default) and warns on anything else, naming opus[1m] as the default. + +## CLARIFICATIONS +none — request complete + +## ACCEPTANCE CRITERIA +1. Symptom gone: doctor.sh passes on `opus[1m]` with "settings.json model is opus[1m]" and its warn branch names `opus[1m]` as the tracked default; no "tracked default is opus)" text left. + CHECK: grep -q '^if \[ "$_m" = "opus\[1m\]" \]; then pass "settings.json model is opus\[1m\]"$' doctor.sh && grep -q '(tracked default is opus\[1m\])"; fi$' doctor.sh && [ "$(grep -c 'tracked default is opus)' doctor.sh)" -eq 0 ] && bash doctor.sh 2>&1 | grep -q 'settings.json model is opus\[1m\]$' && echo DOCTOR_OK + EXPECT: DOCTOR_OK + EVIDENCE: MET exit=0 marker-found :: DOCTOR_OK +2. Shell lint stays clean on doctor.sh. + CHECK: shellcheck doctor.sh && echo LINT_OK + EXPECT: LINT_OK + EVIDENCE: MET exit=0 marker-found :: LINT_OK + +## FILE SCOPE +- doctor.sh +- this contract (run artifact) From ca65852fc17aba2f8bc86a01a298544445f0b304 Mon Sep 17 00:00:00 2001 From: bchanot Date: Sat, 21 Nov 2026 21:05:02 +0100 Subject: [PATCH 3/7] fix(doctrine): a deferred point stops the run once for the human (keep, cut, reopen) --- agents/plan-challenger.md | 10 ++++++---- lib/challenge-plan.md | 29 +++++++++++++++++++++++------ 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/agents/plan-challenger.md b/agents/plan-challenger.md index 3e58827..0965792 100644 --- a/agents/plan-challenger.md +++ b/agents/plan-challenger.md @@ -131,11 +131,13 @@ the MAIN loop, never here): must-address — the lenses are orthogonal, so a lone security/rollback finding is real, never outvoted by lens-count. Cross-lens agreement only RANKS the MINORs. - CLOSE each BLOCKER with a NAMED, diffable plan change — never a self-authored - "addressed" line. A BLOCKER consciously kept is tagged `[deferred ]` for - the human to accept at the gate. + "addressed" line. A BLOCKER consciously kept is tagged `[deferred ]`; + every `[deferred]` point stops the run once, at the end of the challenge step, + for the human to keep, cut or reopen it (`lib/challenge-plan.md` § OUTPUT). - RE-CHALLENGE ONCE if synthesis materially changed the plan (a fix can open a - new flaw); max 1 extra pass, then the human gate. + new flaw); max 1 extra pass, then the human gate. A BLOCKER or MAJOR that + pass still lands on a revised point is deferred, not revised again. - ADVISORY: the revised plan + a challenge summary (raised / addressed / deferred / any lens that failed to return / an `Advisor:` row) feed the orchestrator's existing human gate. The human decides — this is not a - hard block. + hard block, except the deferred stop above. diff --git a/lib/challenge-plan.md b/lib/challenge-plan.md index 51197b9..33e1ec0 100644 --- a/lib/challenge-plan.md +++ b/lib/challenge-plan.md @@ -8,9 +8,9 @@ on the big model; `verify-secure-loop.md`: fresh blind gates, decisions in the loop). It never merges, executes, or edits code — it hardens the plan and hands it to the orchestrator's existing human gate. -The challenge is ADVISORY into that gate — no new hard block — but a BLOCKER is -never silently carried past: it is either closed by a NAMED plan change or -explicitly deferred for the human. +The challenge is ADVISORY into that gate (its one hard stop is the deferred +stop of OUTPUT below), but a BLOCKER is never silently carried past: it is +either closed by a NAMED plan change or explicitly deferred for the human. ## Inputs the caller must have ready @@ -116,13 +116,13 @@ Parse each `CHALLENGE — LENS: … — VERDICT:` line and merge the FINDINGS: - **RE-THINK the aspect the challenge pointed at.** For each BLOCKER (and each MAJOR you accept): revise the plan on THAT aspect — a NAMED, diffable change to the plan, never a self-authored "addressed" line. A BLOCKER you consciously keep - is tagged `[deferred ]` for the human to accept at the gate. + is tagged `[deferred ]`, handled per OUTPUT below. - **Re-challenge once if the plan materially changed** — a fix can open a new flaw. Re-persist the revised `PLAN`, dispatch ONE fresh confirmation challenger, max 1 extra pass, then the gate. A BLOCKER or MAJOR that confirmation pass still lands on a point the revision touched is not revised again: it is - tagged `[deferred ]` with the finding quoted, for the human to - accept at the gate. + tagged `[deferred ]` with the finding quoted, handled per OUTPUT + below. ## OUTPUT — into the existing human gate @@ -135,3 +135,20 @@ Feed the orchestrator's gate: `not called (absent | error | already called this run | sub-agent)`. The human remains the decider. + +Every `[deferred]` point, from any pass, stops the run once, at the end of +the challenge step (after any confirmation pass) and before the caller's +next step, whatever gate the caller holds later: one batched question to +the human, each finding quoted and each option's effect stated. Per +point: keep (the plan runs as written), cut (the item leaves the plan, +and the report or envelope the caller applies from when it applies from +one) or reopen (the main loop revises it). After a cut or a reopen the run +goes on with no further challenge unless the human asks for one (then one +confirmation challenger, whose deferred points are asked once, with no +challenger after them). A keep or cut answer binds the rest of the run: +it is appended to the contract's CLARIFICATIONS as `[gated ]`, with +every criterion that requires a cut item amended in the same entry, and +it joins the CONSTRAINTS of every later challenge, so it is never +re-asked. /hotfix asks the same question itself, with no escalation. No +human reachable (a sub-agent run, headless): stop and hand the points +back. No `[deferred]` point, no extra stop. From 828f3284dcca3f3949c88b9613e29123be1401da Mon Sep 17 00:00:00 2001 From: bchanot Date: Sat, 21 Nov 2026 21:05:03 +0100 Subject: [PATCH 4/7] =?UTF-8?q?chore(memory):=20journal=20=E2=80=94=20hotf?= =?UTF-8?q?ix=20deferred-stop,=20decision=20closed=20=C2=B7=20TODO=20+0=20?= =?UTF-8?q?/=20-1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude/memory/journal.md | 1 + .claude/tasks/TODO.md | 2 +- .../2026-11-21-deferred-stop-2007.md | 29 +++++ .../plans/2026-11-21-deferred-stop-2007.md | 109 ++++++++++++++++++ 4 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 .claude/tasks/contracts/2026-11-21-deferred-stop-2007.md create mode 100644 .claude/tasks/plans/2026-11-21-deferred-stop-2007.md diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index 9549317..2be9054 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -797,3 +797,4 @@ rules: - /hotfix challenge-cutoff (343ccc2): confirmation BLOCKER/MAJOR on revised point not revised again, [deferred] for human; memory commit carries · TODO +n/-m. Rule applied to own run: r2 additions (stop-before-dispatch, hotfix escape) deferred to user. TODO triage: 28 dropped (no evidence/date/user ask), 51 → 24 open, list in .claude/tasks/plans/2026-11-21-todo-triage.md. MEASURE re-anchored 343ccc2. - BDR-125 phases audit 2026-11-21: all phases shipped, residual blocks done, F faunosteo verified done on its develop (530af1b, fa41bc2e); TODO F closed. Only open phase-adjacent: release (develop 235 ahead of main v3.0.0). - /hotfix doctor-model-default: doctor passes on opus[1m], tracked default per user 2026-11-21 (BDR-125 status amended). +- /hotfix deferred-stop: [deferred] point stops run once at end of challenge step (keep/cut/reopen, answers bind via contract [gated] + later CONSTRAINTS, /hotfix asks itself, no re-challenge after cut/reopen unless asked). r2 confirmation 5 MAJORs deferred → user answered batch (rule dogfooded). TODO decision closed. diff --git a/.claude/tasks/TODO.md b/.claude/tasks/TODO.md index 7d02be3..c397023 100644 --- a/.claude/tasks/TODO.md +++ b/.claude/tasks/TODO.md @@ -6,7 +6,7 @@ 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) - [x] DONE 0db885e, merged cef1754 (user accepted the partial delivery 2026-11-21, criterion 4 deferred): 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 343ccc2, confirmation challenger 2026-11-21, contract .claude/tasks/contracts/2026-11-21-challenge-cutoff-1213.md): must a `[deferred]` point stop the flow before its dispatch where the human gate is already past or comes after the dispatch (feat pass B before STEP 1b, bugfix approval before 3b, seo/geo AUTO items), and does /hotfix escalate to /bugfix on one? Today: the human accepts it at the gate. +- [x] DECIDED user 2026-11-21 ("oui si ça ne fait pas boucler") + 4 batched answers, DONE on bugfix/doctor-model-default (contract .claude/tasks/contracts/2026-11-21-deferred-stop-2007.md): a deferred point stops the run once for keep/cut/reopen, answers bind the run, /hotfix asks itself. Was: USER DECISION (deferred from 343ccc2, confirmation challenger 2026-11-21, contract .claude/tasks/contracts/2026-11-21-challenge-cutoff-1213.md): must a `[deferred]` point stop the flow before its dispatch where the human gate is already past or comes after the dispatch (feat pass B before STEP 1b, bugfix approval before 3b, seo/geo AUTO items), and does /hotfix escalate to /bugfix on one? Today: the human accepts it at the gate. - [ ] 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 343ccc2 (memory commits carry `· TODO +n / -m`, read with `git log --oneline --grep '· TODO'`; /capitalize and /close commits carry none, memory-feedback ones do): 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 diff --git a/.claude/tasks/contracts/2026-11-21-deferred-stop-2007.md b/.claude/tasks/contracts/2026-11-21-deferred-stop-2007.md new file mode 100644 index 0000000..50344bf --- /dev/null +++ b/.claude/tasks/contracts/2026-11-21-deferred-stop-2007.md @@ -0,0 +1,29 @@ +# CONTRACT — deferred-stop +- date: 2026-11-21 | flow: hotfix | branch: bugfix/doctor-model-default +- status: active +- run-base: 953b5f1600bb779d1dd244ca1964bab074c03277 + +## REQUEST (verbatim — IMMUTABLE) +Décision utilisateur 2026-11-21 ("defered … j'aurais tendance à dire oui si ça ne fait pas boucler comme avant") : un point `[deferred]` (premier passage ou confirmation) arrête le run avant le prochain dispatch, quel que soit l'endroit de la gate humaine du flow appelant (feat, bugfix, seo, geo n'ont pas d'arrêt à ce moment-là) : l'humain le garde (le plan tourne tel quel), le retire (coupé du plan) ou le rouvre (la boucle principale le révise et dispatche sans nouveau challenge sauf si l'humain en demande un, donc pas de boucle) ; /hotfix bascule vers /bugfix. Fichiers : lib/challenge-plan.md (OUTPUT) + son miroir agents/plan-challenger.md (protocole). + +## CLARIFICATIONS +Q (deferred by the r2 confirmation, 4 points, asked once 2026-11-21) / A [gated 2026-11-21]: (1) caller-gate clause → cut: every caller stops at the end of its challenge step; (2) /hotfix → simplify: it asks keep/cut/reopen itself, no handoff to /bugfix; (3) cut → via the contract: CLARIFICATIONS `[gated]` entry amends every criterion requiring the cut item, no ABANDON; the item also leaves the report/envelope the caller applies from; (4) answers bind: keep/cut join CLARIFICATIONS `[gated]` and the CONSTRAINTS of every later challenge, never re-asked. + +## ACCEPTANCE CRITERIA +1. lib/challenge-plan.md: every `[deferred]` point, from any pass, stops the run once at the end of the challenge step, before the caller's next step, whatever gate the caller holds later; one batched question, findings quoted, effects stated; keep / cut (item leaves the plan and the applied report or envelope) / reopen; no further challenge after cut or reopen unless asked; keep/cut answers bind the run (contract CLARIFICATIONS `[gated]` amending the criteria, CONSTRAINTS of later challenges, never re-asked); /hotfix asks itself, no escalation; no human reachable → stop and hand back; no deferred point, no stop. No ABANDON; the header and the two older sentences point to OUTPUT. + CHECK: f=lib/challenge-plan.md; s=$(awk '/^## OUTPUT/{p=1;next} /^## /{p=0} p' $f); grep -q '^Every `\[deferred\]` point, from any pass, stops the run once, at the end of$' <<<"$s" && grep -q '^next step, whatever gate the caller holds later: one batched question to$' <<<"$s" && grep -q '^challenger after them). A keep or cut answer binds the rest of the run:$' <<<"$s" && grep -q '^it is appended to the contract.s CLARIFICATIONS as `\[gated \]`, with$' <<<"$s" && grep -q '^re-asked. /hotfix asks the same question itself, with no escalation. No$' <<<"$s" && [ "$(grep -c 'ABANDON' <<<"$s")" -eq 0 ] && grep -q '^The challenge is ADVISORY into that gate (its one hard stop is the deferred$' $f && grep -q '^ is tagged `\[deferred \]`, handled per OUTPUT below.$' $f && [ "$(grep -c 'accept at the gate' $f)" -eq 0 ] && echo STOP_OK + EXPECT: STOP_OK + EVIDENCE: MET exit=0 marker-found :: STOP_OK +2. agents/plan-challenger.md mirror: every `[deferred]` point stops the run once at the end of the challenge step for the human to keep, cut or reopen it (citing `lib/challenge-plan.md` § OUTPUT); a BLOCKER or MAJOR the confirmation still lands on a revised point is deferred, not revised again; the ADVISORY bullet names the deferred-stop exception. + CHECK: f=agents/plan-challenger.md; grep -q '^ every `\[deferred\]` point stops the run once, at the end of the challenge step,$' $f && grep -q '^ for the human to keep, cut or reopen it (`lib/challenge-plan.md` § OUTPUT).$' $f && grep -q '^ pass still lands on a revised point is deferred, not revised again.$' $f && grep -q '^ hard block, except the deferred stop above.$' $f && echo MIRROR_OK + EXPECT: MIRROR_OK + EVIDENCE: MET exit=0 marker-found :: MIRROR_OK +3. Locking suites green; only the two files change (10 removed lines). + CHECK: [ "$(git diff --name-only 953b5f1600bb779d1dd244ca1964bab074c03277 -- lib agents | wc -l)" -eq 2 ] && [ "$(git diff --numstat 953b5f1600bb779d1dd244ca1964bab074c03277 -- lib agents | awk '{d+=$2} END{print d+0}')" -eq 10 ] && make test suite="lib/tests/doctrine-citers.test.sh lib/tests/plan-challenger.test.sh lib/tests/subagent-advisor.test.sh" 2>&1 | tail -1 + EXPECT: all suites green + EVIDENCE: MET exit=0 marker-found :: all suites green + +## FILE SCOPE +- lib/challenge-plan.md +- agents/plan-challenger.md +- this contract and .claude/tasks/plans/2026-11-21-deferred-stop-2007.md (run artifacts) diff --git a/.claude/tasks/plans/2026-11-21-deferred-stop-2007.md b/.claude/tasks/plans/2026-11-21-deferred-stop-2007.md new file mode 100644 index 0000000..aa25675 --- /dev/null +++ b/.claude/tasks/plans/2026-11-21-deferred-stop-2007.md @@ -0,0 +1,109 @@ +# FIX r3 — deferred-stop (/hotfix, 2026-11-21 20:07) + +Contract: `.claude/tasks/contracts/2026-11-21-deferred-stop-2007.md`. Base 953b5f1 (bugfix/doctor-model-default). + +## Why +User decision 2026-11-21 on the deferred question of 343ccc2: a `[deferred]` point must stop the run for the human, provided it does not loop. Today feat (pass B before STEP 1b), bugfix (approval before 3b), seo/geo (AUTO items dispatched before the GATED gate) can reach their dispatch with a deferred point only printed. The rule sits in challenge-plan.md OUTPUT, which every caller reads at the end of its challenge step, right before its dispatch. + +## No loop, by construction +- keep: the plan runs as written; drop: the point is cut; reopen: the main loop revises it and dispatches with no further challenge unless the human asks for one. +- No deferred point: no extra stop (nominal runs unchanged). +- /hotfix: no human stop exists before its dispatch; it escalates to /bugfix (its existing BLOCKER path). + +## Edge cases +- A deferred BLOCKER already folded into feat pass B or the bugfix approval gate (their current text) counts as the stop if that gate comes after the challenge; otherwise the main loop asks at the end of the challenge step. +- The mirror agents/plan-challenger.md also states the confirmation cutoff of 343ccc2 (MINOR dropped then, now in scope). + +## Challenge r1 (correctness CONCERNS(1), robustness CONCERNS(4), simplicity SOLID) +- Stop timing unstable ("before its next dispatch" also names the confirmation challenger; too late for bugfix/feat/init-project contract and branch) (2 lenses MAJOR) → "once, when this phase ends (after any confirmation pass), before the caller's next step". +- Cut never reaches the contract → verify loop rebuilds it (robustness MAJOR) → a criterion only the cut item backs gets `ABANDON: cut by the human `. +- /hotfix escalation loses the point via bugfix's trivial fast path (robustness MAJOR) → STOP quotes findings; that /bugfix run asks before dispatch and skips the fast path. +- Same-file contradictions (robustness MAJOR + 2 MINORs) → the three "accept at the gate"/"deferred for the human" sentences point to OUTPUT; mirror ADVISORY names the exception. +- MINORs taken: batched question with each option's effect; "cut" instead of "drop" (clash with "MINOR dropped"); answer written beside the tag, never re-asked; caller gate after the challenge carries the question; no further challenge after cut or reopen unless asked (then one confirmation challenger); no human reachable → stop and hand back; mirror cutoff restated with severity and revised point. +- MINOR dropped: test lock on the stop sentence (third file, hotfix cap); stale citers feat:136, bugfix:141, seo:524, geo:99 (superseded by the include read at the end of their challenge step). + +## Challenge r2 (confirmation, robustness: CONCERNS(5)) → deferred, user answered (rule applied to itself) +- 5 MAJORs on r2 clauses (caller-gate carry, /hotfix handoff, cut→ABANDON holes, never re-asked unenforced, fix-bundle sources): deferred, asked once in one batch; user answers in the contract CLARIFICATIONS [gated 2026-11-21]. r3 = those answers, no further challenge (reopen rule). +- MINORs taken: header line 11 names the one hard stop; bare-ABANDON and hotfix-contract-abort findings moot (no ABANDON, no escalation). + +## EXACT DIFF (against 953b5f1) + +```diff +diff --git a/agents/plan-challenger.md b/agents/plan-challenger.md +index 3e58827..0965792 100644 +--- a/agents/plan-challenger.md ++++ b/agents/plan-challenger.md +@@ -131,11 +131,13 @@ the MAIN loop, never here): + must-address — the lenses are orthogonal, so a lone security/rollback finding + is real, never outvoted by lens-count. Cross-lens agreement only RANKS the MINORs. + - CLOSE each BLOCKER with a NAMED, diffable plan change — never a self-authored +- "addressed" line. A BLOCKER consciously kept is tagged `[deferred ]` for +- the human to accept at the gate. ++ "addressed" line. A BLOCKER consciously kept is tagged `[deferred ]`; ++ every `[deferred]` point stops the run once, at the end of the challenge step, ++ for the human to keep, cut or reopen it (`lib/challenge-plan.md` § OUTPUT). + - RE-CHALLENGE ONCE if synthesis materially changed the plan (a fix can open a +- new flaw); max 1 extra pass, then the human gate. ++ new flaw); max 1 extra pass, then the human gate. A BLOCKER or MAJOR that ++ pass still lands on a revised point is deferred, not revised again. + - ADVISORY: the revised plan + a challenge summary (raised / addressed / + deferred / any lens that failed to return / an `Advisor:` row) feed the + orchestrator's existing human gate. The human decides — this is not a +- hard block. ++ hard block, except the deferred stop above. +diff --git a/lib/challenge-plan.md b/lib/challenge-plan.md +index 51197b9..33e1ec0 100644 +--- a/lib/challenge-plan.md ++++ b/lib/challenge-plan.md +@@ -8,9 +8,9 @@ on the big model; `verify-secure-loop.md`: fresh blind gates, decisions in the + loop). It never merges, executes, or edits code — it hardens the plan and hands + it to the orchestrator's existing human gate. + +-The challenge is ADVISORY into that gate — no new hard block — but a BLOCKER is +-never silently carried past: it is either closed by a NAMED plan change or +-explicitly deferred for the human. ++The challenge is ADVISORY into that gate (its one hard stop is the deferred ++stop of OUTPUT below), but a BLOCKER is never silently carried past: it is ++either closed by a NAMED plan change or explicitly deferred for the human. + + ## Inputs the caller must have ready + +@@ -116,13 +116,13 @@ Parse each `CHALLENGE — LENS: … — VERDICT:` line and merge the FINDINGS: + - **RE-THINK the aspect the challenge pointed at.** For each BLOCKER (and each + MAJOR you accept): revise the plan on THAT aspect — a NAMED, diffable change to + the plan, never a self-authored "addressed" line. A BLOCKER you consciously keep +- is tagged `[deferred ]` for the human to accept at the gate. ++ is tagged `[deferred ]`, handled per OUTPUT below. + - **Re-challenge once if the plan materially changed** — a fix can open a new + flaw. Re-persist the revised `PLAN`, dispatch ONE fresh confirmation challenger, + max 1 extra pass, then the gate. A BLOCKER or MAJOR that confirmation pass + still lands on a point the revision touched is not revised again: it is +- tagged `[deferred ]` with the finding quoted, for the human to +- accept at the gate. ++ tagged `[deferred ]` with the finding quoted, handled per OUTPUT ++ below. + + ## OUTPUT — into the existing human gate + +@@ -135,3 +135,20 @@ Feed the orchestrator's gate: + `not called (absent | error | already called this run | sub-agent)`. + + The human remains the decider. ++ ++Every `[deferred]` point, from any pass, stops the run once, at the end of ++the challenge step (after any confirmation pass) and before the caller's ++next step, whatever gate the caller holds later: one batched question to ++the human, each finding quoted and each option's effect stated. Per ++point: keep (the plan runs as written), cut (the item leaves the plan, ++and the report or envelope the caller applies from when it applies from ++one) or reopen (the main loop revises it). After a cut or a reopen the run ++goes on with no further challenge unless the human asks for one (then one ++confirmation challenger, whose deferred points are asked once, with no ++challenger after them). A keep or cut answer binds the rest of the run: ++it is appended to the contract's CLARIFICATIONS as `[gated ]`, with ++every criterion that requires a cut item amended in the same entry, and ++it joins the CONSTRAINTS of every later challenge, so it is never ++re-asked. /hotfix asks the same question itself, with no escalation. No ++human reachable (a sub-agent run, headless): stop and hand the points ++back. No `[deferred]` point, no extra stop. +``` From a732c6c0e3cf8ece53685cdd2c8f26da1d588871 Mon Sep 17 00:00:00 2001 From: bchanot Date: Sat, 21 Nov 2026 21:09:17 +0100 Subject: [PATCH 5/7] docs: deferred stop, doctor opus[1m] (README, USAGE, CHANGELOG) --- CHANGELOG.md | 3 ++- README.md | 8 ++++---- USAGE.md | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3047cf2..e40949e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,7 @@ The BDR-125 context queue is delivered: phases 0, 0b, 4a, 1, 5, 2 and 4b-4d ship - **model-router: Fable leaves auto-routing**: the `best` and `big` tiers default to opus then sonnet (were fable>opus>sonnet and opus>fable>sonnet), so Opus is the strongest model the router routes to and Fable is the advisor (`advisorModel` in settings.json). Fable stays in the model table and first in the fallback rank, so a hand pick of fable ranks above opus. The first-use Change dialog offers opus, sonnet and haiku; the bare `/model` dialog still offers fable, labelled `fable (custom)`. The ask before Fable only fires when a machine override puts fable at the head of `best`: otherwise `/route ask-tier on` answers `(inert: best is not headed by fable)` and `/route show` prints `ask-tier: inert`. An agent on a best or big row keeps its opus frontmatter when Opus is down. The `tiers.best does not lead the fallback chain` log is gone; `routing.json` is unchanged. Tests: `mods/model-router/hooks/register.test.ts`; `lib/tests/effort-routing.test.sh` floors every row on its tier's head. The `/client-handover` skill-runner children and the `lib/model-gate.md` dispatch doctrine pin `model: "opus"` instead of `"fable"` (BDR-150: Fable is the advisor, never a dispatch target), and the model gate lets a sub-agent pass when the route answer says its model is `fixed at spawn`. Tests: `lib/tests/model-routing.test.sh` refuses any fable dispatch pin under agents/, skills/ and lib/; `lib/tests/effort-routing.test.sh` checks the 7 opus/effort="high" client-handover dispatches. - **Advisor doctrine (`CLAUDE.global.md` § Workflow, `lib/effort-shift.md` § Advisor, `lib/challenge-plan.md`, `lib/verify-secure-loop.md`, `agents/plan-challenger.md`, `agents/verifier.md`, `agents/security-auditor.md`, `agents/analyzer.md`, `skills/{feat,bugfix,hotfix,ship-feature,init-project,onboard,code-clean,harden,a11y,guardrails,audit-delta,tour,release-candidate}/SKILL.md`, `skills/pack-seo/skills/{seo,geo}/SKILL.md`, `skills/pack-web-validate/skills/web-validate/SKILL.md`)**: when a stronger model is needed (an approach to settle before building, a stuck problem, a long task before calling it done, a change to recommend to the doctrine, the architecture or a public interface), the main loop calls the advisor tool (Fable, settings `advisorModel`, set by `/advisor`), at least on the written plan before the plan challengers are dispatched (`lib/challenge-plan.md`, every skill that challenges a plan, once per skill run, not before a re-challenge: an answer that lands a real flaw revises the plan file as plain plan text with no advisor attribution, the advice never enters a challenger brief, and the CHALLENGE SUMMARY of every caller gains an `Advisor:` row (the plan change it drove, `called, no change` or `not called (absent | error | already called this run)`), each caller sending its route before the challenge with the first tool call of `lib/challenge-plan.md`; the ORCHESTRATOR PROTOCOL in `agents/plan-challenger.md` mirrors this advisor-first step and the row), once per verify-secure run at the first gate loop to fail twice (floor, conformity, security, or a second structural failure, counting main-loop calls since GATE 0 first ran; the advice stays in the main loop and never enters an executor brief; every cap or escalation STOP carries it and says whether it predates the last iteration), and before proposing a merge (`gitflow finish`) or calling a long task done: one end-of-run call per skill run, never skipped for an earlier plan or stuck call, except that audit-delta and tour skip it when the run applied no fix and feat and bugfix skip it when GATE 0 said MET, the verifier CONFORME and security PASS (not DEGRADED), each on its first attempt, their summary's `ADVISOR` field then reading `skipped (gates clean on first pass)`. It sits at the commit step of feat and bugfix and at the end step of ship-feature, init-project, a11y and guardrails: the main loop first prints the run's diff stat, the answer goes into the reply or finish proposal as an `Advisor:` line, or into the feat/bugfix summary's `ADVISOR` field, a fix it drives goes back through the gates, and a later merge proposal reuses the last run's answer, or its skip, and names any code commit made after it (doc and memory commits excepted). It also sits at the end of audit-delta and tour when the run applied a fix (tour: main loop only, never a runner), and at release-candidate STEP 4 before the go / hold ask. In those three the answer is reported only: a fix it calls for waits for a new run, and at the release gate it makes hold the recommended answer. The same six gate skills carry a `Stuck:` line that points at the verify-secure rule. Inside a skill run these points cover the triggers: no second call for the same recommendation. `plan-challenger`, `verifier`, `security-auditor` and `analyzer` may call it only when dispatched as a sub-agent, at most once per dispatch, late, before their verdict or report; the analyzer's output rests on the code it read, never on the advice alone, and advice proposing a design or a fix counts only where the brief asks for one. For the three gates advice only adds: the verifier may go back to a contract criterion and tags a resulting NOT-MET `(advisor-prompted)`, never clearing a gap on advice; the challenger never drops or lowers a finding on advice alone; the security-auditor tags an added finding `advisor:` at that class's severity (REPORTED LOW when it matches no class), and tags a raised one `+advisor` only when the class's severity is higher than the finding's own; a raise that does not apply, or matches no class, changes nothing (no tag, no PROOF count). Its PROOF ends with `; advisor added/raised`. Executors and every other sub-agent do not call it, even when the tool is listed. Advisor absent or erroring → proceed as written; advice waives no gate, cap or guard and, at a loop cap, feeds the STOP diagnosis. Fable on main comes only from a hand pick, a typed `/route model=fable`, a phase naming `model: fable` or a machine override that puts fable in a tier (BDR-150). Prose that still named Fable as the `audit` row head or a skill-runner pin (`agents/plan-challenger.md`, `lib/challenge-plan.md`, `lib/effort-shift.md`, `skills/tour/SKILL.md`) now says opus. - **gates.sh timeout**: the default per-CHECK timeout (`GATES_TIMEOUT`) is 600 s, up from 120 s. A full `make test` (about 135 s) went NOT-MET on the timeout alone. A run lasts the sum of its CHECKs: a caller with a shorter limit (a foreground tool call stops at 600 s) runs it in the background, and a killed run writes nothing back, so the floor stays PENDING. -- **Done and triage levers (`lib/verify-secure-loop.md`, `lib/challenge-plan.md`, `lib/capitalize-commit.md`, `lib/contract-interview.md`, `skills/{ship-feature,init-project}/SKILL.md`, `agents/verifier.md`, `CLAUDE.global.md`)**: a run is done when its oracles are green (GATE 0 MET, verifier CONFORME and security PASS on the same diff); a later review reopens it only with reproducible evidence, a command that fails on HEAD or real output shown wrong. The post-gate code review (`/ship-feature` STEP 6, `/init-project` STEP 10) fixes a CRITICAL or Important finding only when it carries that evidence (it used to fix every CRITICAL): without it, one attempt at a failing command, else the finding is triaged as a MINOR; a security finding goes to the user. The review loop back to implementation applies to those items, capped at 2 cycles. A MINOR finding is folded into the plan before the dispatch or dropped as one `MINOR dropped: ` line in the run report and plan file, never in TODO.md or a registry; a security finding is never dropped and goes to the user. A run that only places a decision the user already made skips the plan challenge and its advisor call and prints `Challenge: skipped (placed decision: …)`. A BLOCKER or MAJOR that the one confirmation challenger still lands on a point the revision touched is not revised a second time: it is tagged `[deferred ]` with the finding quoted, for the human to accept at the plan gate. Before the first dispatch, right after the flow's branch step, the main loop records `- run-base: ` in the contract (a value written before the branch step is replaced by `git rev-parse HEAD` after it) and dry-runs its CHECKs with `gates.sh run` on a `mktemp -d` copy. Every flow that writes a contract with `CHECK:` lines does this, whether or not it challenges its plan, `/ship-feature` and `/init-project` included (`lib/contract-interview.md` STEP 4); a flow's own positive control on the unfixed tree stands for the `gates.sh` half, and `- run-base:` is still recorded. A TODO loop notes its start SHA in TODO.md and runs that list plus user additions. The memory commit's message and its report line end with `· TODO +n / -m`, so `git log --oneline --grep '· TODO'` lists each run's movement; `TODO n/a` when the diff fails or the run base is not a 7-40 hex SHA (the diff now passes `--end-of-options` before it). The verifier counts run artifacts in scope: an added plan file, appended `MINOR dropped:` lines, the contract's `EVIDENCE:`, `- run-base:` and `[gated]` lines. +- **Done and triage levers (`lib/verify-secure-loop.md`, `lib/challenge-plan.md`, `agents/plan-challenger.md`, `lib/capitalize-commit.md`, `lib/contract-interview.md`, `skills/{ship-feature,init-project}/SKILL.md`, `agents/verifier.md`, `CLAUDE.global.md`)**: a run is done when its oracles are green (GATE 0 MET, verifier CONFORME and security PASS on the same diff); a later review reopens it only with reproducible evidence, a command that fails on HEAD or real output shown wrong. The post-gate code review (`/ship-feature` STEP 6, `/init-project` STEP 10) fixes a CRITICAL or Important finding only when it carries that evidence (it used to fix every CRITICAL): without it, one attempt at a failing command, else the finding is triaged as a MINOR; a security finding goes to the user. The review loop back to implementation applies to those items, capped at 2 cycles. A MINOR finding is folded into the plan before the dispatch or dropped as one `MINOR dropped: ` line in the run report and plan file, never in TODO.md or a registry; a security finding is never dropped and goes to the user. A run that only places a decision the user already made skips the plan challenge and its advisor call and prints `Challenge: skipped (placed decision: …)`. A BLOCKER or MAJOR that the one confirmation challenger still lands on a point the revision touched is not revised a second time: it is tagged `[deferred ]` with the finding quoted. Every `[deferred]` point, from either pass, stops the run once at the end of the challenge step, before the caller's next step and whatever gate the caller holds later, with one batched question to the human (each finding quoted, each option's effect stated): keep (the plan runs as written), cut (the item leaves the plan, and the report or envelope the caller applies from) or reopen (the main loop revises it). After a cut or a reopen the run goes on with no further challenge unless the human asks for one; that one confirmation challenger's deferred points are asked once, with no challenger after them. A keep or cut answer is appended to the contract's CLARIFICATIONS as `[gated ]`, amending in the same entry every criterion that requires a cut item, and joins the CONSTRAINTS of every later challenge, so it is never re-asked. /hotfix asks the question itself, with no escalation; with no human reachable (a sub-agent run, headless) the run stops and hands the points back. This deferred stop is the challenge's one hard stop; otherwise it stays advisory. Before the first dispatch, right after the flow's branch step, the main loop records `- run-base: ` in the contract (a value written before the branch step is replaced by `git rev-parse HEAD` after it) and dry-runs its CHECKs with `gates.sh run` on a `mktemp -d` copy. Every flow that writes a contract with `CHECK:` lines does this, whether or not it challenges its plan, `/ship-feature` and `/init-project` included (`lib/contract-interview.md` STEP 4); a flow's own positive control on the unfixed tree stands for the `gates.sh` half, and `- run-base:` is still recorded. A TODO loop notes its start SHA in TODO.md and runs that list plus user additions. The memory commit's message and its report line end with `· TODO +n / -m`, so `git log --oneline --grep '· TODO'` lists each run's movement; `TODO n/a` when the diff fails or the run base is not a 7-40 hex SHA (the diff now passes `--end-of-options` before it). The verifier counts run artifacts in scope: an added plan file, appended `MINOR dropped:` lines, the contract's `EVIDENCE:`, `- run-base:` and `[gated]` lines. ### Removed - `hooks/design-toolchain-reminder.sh`, its `UserPromptSubmit` entry in `settings.json` (`ctx7-reminder` stays the only one) and its suite `lib/tests/design-toolchain-reminder.test.sh`. Measured 2026-10-31: 59 fires, 0 Reads of `rules/web-building.md`. Design routing stays with the `rules/web-building.md` path rule and the `CLAUDE.global.md` pointer. The fire log `~/.claude/logs/design-toolchain-fires.log` is left in place. @@ -40,6 +40,7 @@ The BDR-125 context queue is delivered: phases 0, 0b, 4a, 1, 5, 2 and 4b-4d ship - Hooks: `hooks/code-limits.sh` keeps its per-session state in a private dir (`mkdir -m 700` without `-p`, else an existing dir is accepted only if it is ours, a directory and mode 700); `hooks/session-start.sh` bounds `memory.sh` and the feedback reminder with `timeout`, else `gtimeout`, else a perl alarm (stock macOS), never unbounded; each runner kills the command's whole process group at the deadline, and the perl one also TERMs a leftover after a normal exit; the gitflow pre-commit hook (generator `lib/gitflow.sh` and both copies) blocks when `git diff --cached` or its filter fails instead of letting the commit through. Tests: `lib/tests/code-limits.test.sh` T16, `lib/tests/session-digest.test.sh` SD19 and SD19b, new `lib/tests/precommit-failclosed.test.sh` PC1-PC4. - `hooks/session-start.sh`: the memory digest prints `- open: none` when no blocker is open and `- open: unknown (memory.sh index failed)` when `memory.sh index blocker` fails or times out. Both cases used to print no blocker line, so a failed read looked like a clean slate. `lib/profile-state.jq` (`profile.sh current --plain`): a newline or CR in a printed value becomes a space, and a plugin id that does not match `\A[A-Za-z0-9._-]+@[A-Za-z0-9._-]+\z` is dropped, so a settings value can no longer forge a `plugin:` line. Tests: `lib/tests/session-digest.test.sh` SD9a-SD9d, SD12; `lib/tests/profile.test.sh` T28. - doctor.sh: the user-scope residue check compares `enabledPlugins` and `skillOverrides` between HEAD and the working `settings.json` (it compared `enabledPlugins` only), so a UI write into user-scope `skillOverrides` that dirties the tracked file is now reported; the pass and skip lines name both keys. MIGRATION "Profiles and packs" step 1 restores both keys. +- `doctor.sh`: the `settings.json` model check passes on `opus[1m]`, the tracked default, and warns on any other value. It checked for `opus`, so a clean install warned on the tracked model. - Agents and skills (77041e5): client-handover reads the project root through a quoted heredoc and refuses a root with control characters; `lib/plugin-gate.md` prints single-quoted remedies, never runs an unsafe root, checks against the git common dir and refuses `$HOME` (as `lib/profile.sh` now does); plugin-advisor recommends `minimal` only from project signals; onboard and tour use the packs vocabulary; graphify labels match the install trap. - `mods/` type-check under `claude plugin validate --strict` (CLI 2.1.323 started type-checking mods): 17 sites narrowed, failure behaviour unchanged (6433e4d, BLK-049); the write guard has since moved to fail-closed (see Changed). - model-router: a Skill call whose answer carries `isError` (refused or unknown skill) no longer opens the write guard for the rest of the session. Test: `mods/model-router/hooks/register.test.ts` (GUARD: an isError Skill answer leaves the latch closed). diff --git a/README.md b/README.md index b9543f2..bf3bb93 100644 --- a/README.md +++ b/README.md @@ -70,9 +70,9 @@ commands, settings, secrets, maintenance. ## Agent model routing (model-tiering v2) -Doctrine: the main loop runs on the `opus` session model; the model-router rows -route main-loop reflection (brainstorm, plan, contract, audit judgment, loop -decisions) to the `best` tier, opus at the phase's effort. Fable is never +Doctrine: the main loop runs on the `opus[1m]` session model; the model-router +rows route main-loop reflection (brainstorm, plan, contract, audit judgment, +loop decisions) to the `best` tier, opus at the phase's effort. Fable is never auto-routed: it is the advisor (`advisorModel` in settings.json) and a hand pick. The main loop calls the advisor at least on the written plan before the plan challengers see it (`lib/challenge-plan.md`, once per skill run; the @@ -326,7 +326,7 @@ cd my-existing-project/ /ship-feature "feature description" # → STEP 0: plugin check, project context, contract # → STEP 1-2: brainstorm + plan (vendored superpowers skills) -# → STEP 2b: adversarial plan-challenge (3 lenses, report-only) +# → STEP 2b: adversarial plan-challenge (3 lenses, report-only; a `[deferred]` point stops once: keep / cut / reopen) # → STEP 3: validation gate — user approval required # → STEP 4: implement (TDD) # → STEP 5: verify + secure (fresh verifier and security-auditor gates) diff --git a/USAGE.md b/USAGE.md index fe333ac..72d8bc9 100644 --- a/USAGE.md +++ b/USAGE.md @@ -387,7 +387,7 @@ Ajouter un archétype : créer `~/.claude/lib/project-archetypes/.md` (voi # Feature simple, pas d'orchestration lourde /feat "ajouter un endpoint GET /api/v1/users/:id/stats" # → plan + challenge, exécuteur `feater`, gates fraîches verifier + sécurité -# Pas de brainstorming superpowers, pas de gate de validation +# Pas de brainstorming superpowers, pas de gate de validation (seul un point `[deferred]` du challenge arrête le run, une fois : garder / couper / rouvrir) ``` **Choisir entre /ship-feature et /feat :** From 55c2d7f684baca85894b6157db14a193781fda91 Mon Sep 17 00:00:00 2001 From: bchanot Date: Sat, 21 Nov 2026 21:14:48 +0100 Subject: [PATCH 6/7] fix(skills): feat, bugfix and hotfix cite the deferred stop --- skills/bugfix/SKILL.md | 4 ++-- skills/feat/SKILL.md | 4 ++-- skills/hotfix/SKILL.md | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/skills/bugfix/SKILL.md b/skills/bugfix/SKILL.md index 223e7cd..fea2981 100644 --- a/skills/bugfix/SKILL.md +++ b/skills/bugfix/SKILL.md @@ -137,8 +137,8 @@ dispositions. Three blind challengers attack it (correctness = is the root cause right; robustness = blast radius / regressions; simplicity = is the fix minimal); RE-THINK every aspect a BLOCKER lands, re-challenge once if the plan materially changed. STEP 3.5 writes the contract from the REVISED plan. Print a CHALLENGE SUMMARY -(BLOCKERs addressed / deferred / lenses returned / advisor), folding any -deferred BLOCKER into the STEP 3 approval gate. +(BLOCKERs addressed / deferred / lenses returned / advisor), and stop once on any +`[deferred]` point (keep / cut / reopen, `lib/challenge-plan.md` § OUTPUT). ## STEP 3.5 — CONTRACT diff --git a/skills/feat/SKILL.md b/skills/feat/SKILL.md index 9f6ffcb..35ab68a 100644 --- a/skills/feat/SKILL.md +++ b/skills/feat/SKILL.md @@ -132,8 +132,8 @@ Persist it to `.claude/tasks/plans/--.md`, then run Three blind challengers attack it; RE-THINK every aspect a BLOCKER lands (a named plan change, or `[deferred]`), re-challenge once if the plan materially changed. The STEP 3 executor receives the REVISED plan. Before dispatch, print a CHALLENGE SUMMARY -(BLOCKERs addressed / deferred / lenses returned / advisor), surfacing any -deferred BLOCKER in the STEP 1 pass B batch. +(BLOCKERs addressed / deferred / lenses returned / advisor), and stop once on any +`[deferred]` point (keep / cut / reopen, `lib/challenge-plan.md` § OUTPUT). ## STEP 2 — BRANCH diff --git a/skills/hotfix/SKILL.md b/skills/hotfix/SKILL.md index 2c7b62e..de1d556 100644 --- a/skills/hotfix/SKILL.md +++ b/skills/hotfix/SKILL.md @@ -103,7 +103,8 @@ contract's acceptance criteria. Three blind challengers attack the fix; the main loop RE-THINKS any aspect a BLOCKER lands (a named change to the fix, or `[deferred]`) and re-challenges once if it materially changed. Print a CHALLENGE SUMMARY (BLOCKERs addressed / deferred / lenses returned / advisor). -A BLOCKER that shows the fix is wrong or incomplete means this was never +A `[deferred]` point: /hotfix asks keep / cut / reopen itself +(`lib/challenge-plan.md` § OUTPUT). A BLOCKER that shows the fix is wrong or incomplete means this was never a hotfix — escalate to `/bugfix` (its STEP 3b runs the same phase under the full verify+secure loop). From d48939e2295ab6596ed4263561487f3929ca3697 Mon Sep 17 00:00:00 2001 From: bchanot Date: Sat, 21 Nov 2026 21:14:49 +0100 Subject: [PATCH 7/7] =?UTF-8?q?chore(memory):=20journal=20=E2=80=94=20feat?= =?UTF-8?q?=20deferred-citers=20=C2=B7=20TODO=20+0=20/=20-0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude/memory/journal.md | 1 + .../2026-11-21-deferred-citers-2108.md | 30 +++++++++ .../plans/2026-11-21-deferred-citers-2108.md | 61 +++++++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 .claude/tasks/contracts/2026-11-21-deferred-citers-2108.md create mode 100644 .claude/tasks/plans/2026-11-21-deferred-citers-2108.md diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index 2be9054..8596904 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -798,3 +798,4 @@ rules: - BDR-125 phases audit 2026-11-21: all phases shipped, residual blocks done, F faunosteo verified done on its develop (530af1b, fa41bc2e); TODO F closed. Only open phase-adjacent: release (develop 235 ahead of main v3.0.0). - /hotfix doctor-model-default: doctor passes on opus[1m], tracked default per user 2026-11-21 (BDR-125 status amended). - /hotfix deferred-stop: [deferred] point stops run once at end of challenge step (keep/cut/reopen, answers bind via contract [gated] + later CONSTRAINTS, /hotfix asks itself, no re-challenge after cut/reopen unless asked). r2 confirmation 5 MAJORs deferred → user answered batch (rule dogfooded). TODO decision closed. +- /feat deferred-citers (first placed-decision challenge skip): feat/bugfix/hotfix point at challenge-plan § OUTPUT deferred stop. Gates first pass (MET, CONFORME, PASS). Docs a732c6c (README/USAGE/CHANGELOG). diff --git a/.claude/tasks/contracts/2026-11-21-deferred-citers-2108.md b/.claude/tasks/contracts/2026-11-21-deferred-citers-2108.md new file mode 100644 index 0000000..cc850b2 --- /dev/null +++ b/.claude/tasks/contracts/2026-11-21-deferred-citers-2108.md @@ -0,0 +1,30 @@ +# CONTRACT — deferred-citers +- date: 2026-11-21 | flow: feat | branch: bugfix/doctor-model-default +- status: active +- run-base: 828f3284dcca3f3949c88b9613e29123be1401da + +## REQUEST (verbatim — IMMUTABLE) +Patch des citers de la règle [deferred] (ca65852), décision utilisateur 2026-11-21 "Patch now" : skills/feat/SKILL.md:135-136, skills/bugfix/SKILL.md:140-141, skills/hotfix/SKILL.md:102-109 repointés vers lib/challenge-plan.md § OUTPUT (un point [deferred] arrête le run une fois à la fin de l'étape de challenge : garder / couper / rouvrir ; /hotfix pose la question lui-même ; l'escalade hotfix → /bugfix reste pour un BLOCKER non différé qui montre le fix faux). + +## CLARIFICATIONS +none — request complete. Challenge: skipped (placed decision: deferred-stop rule ca65852, challenged in its run and answered by the user 2026-11-21). + +## ACCEPTANCE CRITERIA +1. feat and bugfix challenge steps stop once on any `[deferred]` point (keep / cut / reopen) citing `lib/challenge-plan.md` § OUTPUT; the old "surfacing any deferred BLOCKER in the STEP 1 pass B batch" and "folding any deferred BLOCKER into the STEP 3 approval gate" are gone. + CHECK: for f in skills/feat/SKILL.md skills/bugfix/SKILL.md; do grep -q '^`\[deferred\]` point (keep / cut / reopen, `lib/challenge-plan.md` § OUTPUT).$' $f || exit 1; done; [ "$(grep -c 'pass B batch\|STEP 3 approval gate' skills/feat/SKILL.md skills/bugfix/SKILL.md | awk -F: '{s+=$2} END{print s}')" -eq 0 ] && echo FB_OK + EXPECT: FB_OK + EVIDENCE: MET exit=0 marker-found :: FB_OK +2. hotfix STEP 1.8: a `[deferred]` point is asked by /hotfix itself (keep / cut / reopen, § OUTPUT); the BLOCKER-shows-the-fix-wrong escalation to /bugfix stays. + CHECK: f=skills/hotfix/SKILL.md; grep -q '^A `\[deferred\]` point: /hotfix asks keep / cut / reopen itself$' $f && grep -q '^(`lib/challenge-plan.md` § OUTPUT). A BLOCKER that shows the fix is wrong' $f && grep -q 'escalate to `/bugfix`' $f && echo HF_OK + EXPECT: HF_OK + EVIDENCE: MET exit=0 marker-found :: HF_OK +3. Only the three skill files change (5 removed lines) and the locking suites stay green (census resolves the three new § OUTPUT citations). + CHECK: [ "$(git diff --name-only 828f3284dcca3f3949c88b9613e29123be1401da -- skills | wc -l)" -eq 3 ] && [ "$(git diff --numstat 828f3284dcca3f3949c88b9613e29123be1401da -- skills | awk '{d+=$2} END{print d+0}')" -eq 5 ] && make test suite="lib/tests/doctrine-citers.test.sh lib/tests/plan-challenger.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 +- skills/feat/SKILL.md +- skills/bugfix/SKILL.md +- skills/hotfix/SKILL.md +- this contract and .claude/tasks/plans/2026-11-21-deferred-citers-2108.md (run artifacts) diff --git a/.claude/tasks/plans/2026-11-21-deferred-citers-2108.md b/.claude/tasks/plans/2026-11-21-deferred-citers-2108.md new file mode 100644 index 0000000..3eae9e9 --- /dev/null +++ b/.claude/tasks/plans/2026-11-21-deferred-citers-2108.md @@ -0,0 +1,61 @@ +# PLAN — deferred-citers (/feat, 2026-11-21 21:08) + +Contract: `.claude/tasks/contracts/2026-11-21-deferred-citers-2108.md`. Base 828f328. + +Challenge: skipped (placed decision: deferred-stop rule ca65852, user 2026-11-21). The three conditions hold: the text only repoints three citers at the rule; the rule was challenged in the run that wrote it and the user answered its deferred points; /feat runs lib/verify-secure-loop.md after its dispatch. The skip discharges the plan advisor point. + +PLAN: + [ ] skills/feat/SKILL.md:135-136: "surfacing any deferred BLOCKER in the STEP 1 pass B batch" → "and stop once on any `[deferred]` point (keep / cut / reopen, `lib/challenge-plan.md` § OUTPUT)". + [ ] skills/bugfix/SKILL.md:140-141: same repoint (was "folding any deferred BLOCKER into the STEP 3 approval gate"). + [ ] skills/hotfix/SKILL.md:105-106: insert "A `[deferred]` point: /hotfix asks keep / cut / reopen itself (`lib/challenge-plan.md` § OUTPUT)." before the BLOCKER-escalation sentence, which stays. + +Disposition: honors BDR-151 lever 3 (placed-decision skip) and the ca65852 rule; LRN-297 (rule restated at the act site). + +## EXACT DIFF (against 828f328) + +```diff +diff --git a/skills/bugfix/SKILL.md b/skills/bugfix/SKILL.md +index 223e7cd..fea2981 100644 +--- a/skills/bugfix/SKILL.md ++++ b/skills/bugfix/SKILL.md +@@ -137,8 +137,8 @@ dispositions. Three blind challengers attack it (correctness = is the root cause + right; robustness = blast radius / regressions; simplicity = is the fix minimal); + RE-THINK every aspect a BLOCKER lands, re-challenge once if the plan materially + changed. STEP 3.5 writes the contract from the REVISED plan. Print a CHALLENGE SUMMARY +-(BLOCKERs addressed / deferred / lenses returned / advisor), folding any +-deferred BLOCKER into the STEP 3 approval gate. ++(BLOCKERs addressed / deferred / lenses returned / advisor), and stop once on any ++`[deferred]` point (keep / cut / reopen, `lib/challenge-plan.md` § OUTPUT). + + ## STEP 3.5 — CONTRACT + +diff --git a/skills/feat/SKILL.md b/skills/feat/SKILL.md +index 9f6ffcb..35ab68a 100644 +--- a/skills/feat/SKILL.md ++++ b/skills/feat/SKILL.md +@@ -132,8 +132,8 @@ Persist it to `.claude/tasks/plans/--.md`, then run + Three blind challengers attack it; RE-THINK every aspect a BLOCKER lands (a named + plan change, or `[deferred]`), re-challenge once if the plan materially changed. The + STEP 3 executor receives the REVISED plan. Before dispatch, print a CHALLENGE SUMMARY +-(BLOCKERs addressed / deferred / lenses returned / advisor), surfacing any +-deferred BLOCKER in the STEP 1 pass B batch. ++(BLOCKERs addressed / deferred / lenses returned / advisor), and stop once on any ++`[deferred]` point (keep / cut / reopen, `lib/challenge-plan.md` § OUTPUT). + + ## STEP 2 — BRANCH + +diff --git a/skills/hotfix/SKILL.md b/skills/hotfix/SKILL.md +index 2c7b62e..de1d556 100644 +--- a/skills/hotfix/SKILL.md ++++ b/skills/hotfix/SKILL.md +@@ -103,7 +103,8 @@ contract's acceptance criteria. Three blind challengers attack the fix; the main + loop RE-THINKS any aspect a BLOCKER lands (a named change to the fix, or + `[deferred]`) and re-challenges once if it materially changed. Print a + CHALLENGE SUMMARY (BLOCKERs addressed / deferred / lenses returned / advisor). +-A BLOCKER that shows the fix is wrong or incomplete means this was never ++A `[deferred]` point: /hotfix asks keep / cut / reopen itself ++(`lib/challenge-plan.md` § OUTPUT). A BLOCKER that shows the fix is wrong or incomplete means this was never + a hotfix — escalate to `/bugfix` (its STEP 3b runs the same phase under the full + verify+secure loop). + +```