From 828f3284dcca3f3949c88b9613e29123be1401da Mon Sep 17 00:00:00 2001 From: bchanot Date: Sat, 21 Nov 2026 21:05:03 +0100 Subject: [PATCH] =?UTF-8?q?chore(memory):=20journal=20=E2=80=94=20hotfix?= =?UTF-8?q?=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. +```