diff --git a/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/FOLLOW-UPS.md b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/FOLLOW-UPS.md new file mode 100644 index 00000000..bcf21420 --- /dev/null +++ b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/FOLLOW-UPS.md @@ -0,0 +1,116 @@ +# Follow-ups — FEAT-LOOP-2026-0251 + +Seventh close, 2026-11-26. No entry is open. The re-run conditions of #3608, #3609, #3610, +#3612, #3613, #3614, #3617, #3618 and #3619 hold. + +## Resolved + +#### Definition of done clause 5 (arm-time warning) + +**Tracked as #3617.** **Re-run condition holds.** The entry's gap was that clause 5 did not +allow the parent-directory match. `GATE-01.md` clause 5 now says the warning is silent when +the body names the path's parent directory, narrowed under `PLAN.md` decision 7. This +close's probe of `check_produces_mentioned` on `specfuse/loop/loop.py`: silent for the full +path, the file name and `specfuse/loop/data/docs` (the entry's case, which contains the +parent `specfuse/loop`); WARN for a body naming none. The entry's silent result is now the +stated behaviour. With the parent directory dropped from the check in a scratch copy, +`TestArmTimeWarning` gives 1 failure. + +- command: `PYTHONPATH=. python3 $TMPDIR/close7/p5.py` +- exit: 0 + +#### Definition of done clause 4 (tree and note) + +**Tracked as #3618.** **Re-run condition holds.** On a kept tree, attempt 2 writing only +`docs/events.jsonl`, or only `docs/PROGRESS.md`, now gets that file in its note, with +fail-fast on and off; so do the same names at the repository root and a `docs/WU-T01.md`. +Writing nothing still says "changed no files". Covered by +`test_agent_files_named_like_driver_bookkeeping_are_listed`. With the base-name filter put +back in a scratch copy, `TestTreeAndNote` gives 2 failures. The driver's own three files in +the feature folder are still left out. Git-ignored files are still not listed; the entry did +not name them (see `RETROSPECTIVE.md`). + +- command: `PYTHONPATH=. python3 $TMPDIR/close7/p4.py` (uses + `TestTreeAndNote._second_attempt_note`) +- exit: 0 + +#### T04#3 + +**Tracked as #3619.** **Re-run condition holds**, by amendment. T04's RESULT notes still have +not been seen: the driver keeps none for passed attempts. `GATE-01.md` clause 5 ("Measurement +record") accepts the `check_produces_mentioned` docstring and the sixth judge's recount. The +docstring reads 81 and 35 of 401, matching `GATE-01.md`. This close's own recount of `done` +units with `produces:` gave 81 and 35 of 402. + +- command: `PYTHONPATH=. python3 $TMPDIR/close7/count.py` +- exit: 0 + +### Resolved at earlier closes + +**Tracked as #3621.** + +The text below is as the sixth close wrote it. Its "this close" and "this session" mean the +close named in each entry or the sixth. Where #3614 lists files named like driver bookkeeping +as a limit, #3618 above has since narrowed it. + +#### The retry note's path list missed renames, non-ASCII names and mode changes + +**Tracked as #3614.** **Re-run condition holds** (first branch). In this close's probe the +note lists the right paths in R9 (both rename names), R10, R11, R13 and R15, and R7 and R14 +say nothing changed, with fail-fast on and off. Tests cover each of R9, R10, R11, R13, R15 +and R14 with both settings (`test_rename_lists_both_names`, +`test_writing_back_a_renamed_file_lists_it`, `test_mode_only_change_lists_it`, the three +`test_non_ascii_name_*` tests). R7 (a deleted tracked file, then nothing) rests on the probe. +Remaining limits that no entry named (git-ignored files, files named like driver +bookkeeping, non-UTF-8 names, and the older `git add -N` crash) are in `RETROSPECTIVE.md`. + +#### A kept file that an attempt deletes or reverts is missing from its retry note + +**Tracked as #3613.** **Re-run condition holds** (first branch). The note lists a deleted +kept file, a reverted tracked edit, and a deleted file plus a new one, with fail-fast on and +off (`test_deleting_a_kept_file_lists_it`, +`test_reverting_a_kept_tracked_edit_lists_it`, +`test_deleting_a_kept_file_and_writing_another_lists_both`; probe cases R1, R2, R5). With +the removed-path branch disabled in a scratch copy, `TestTreeAndNote` gives 6 failures. The +condition covers deletes and reverts of ordinary names; other kinds of change were #3614, above. + +#### A later attempt's note listed the earlier attempt's kept edits as its own + +**Tracked as #3612.** **Re-run condition holds** for the case the entry describes. Attempt 2 +writing nothing now gets "this attempt changed no files", and attempt 2 writing another file +gets only that file, with fail-fast on and off +(`test_later_attempt_that_changed_nothing_says_so`, +`test_kept_edits_of_an_earlier_attempt_are_not_listed`, +`test_editing_a_kept_file_again_lists_it`; probe cases R0 and R3). With the filter removed in +a scratch copy, `TestTreeAndNote` gives 4 failures. The entry named no deletion or revert; +that was #3613, below. + +#### The early refusal also outranks three other checks, and no precedence is stated for them + +**Tracked as #3610.** **Re-run condition holds** (first branch). `GATE-01.md` ("Precedence +when two refusals apply") and the close unit's escalation trigger both state that a +deliverable refusal outranks every check that runs after the agent session, which covers +cases D to G. `docs/methodology.md` states it too, with the kept-tree side effect. The +third close reran D to G with the same results as before, plus controls; see +`RETROSPECTIVE.md` under "Early against late, same input". A test asserts only the +`files_changed_mismatch` pair; the other pairs rest on the probe. + +#### An early refusal records a different outcome from the late order for one input + +**Tracked as #3608.** **Re-run condition holds.** `GATE-01.md` ("Precedence when two +refusals apply") and the close unit's escalation trigger state that the deliverable refusal +takes precedence over `files_changed_mismatch`. +`test_deliverable_refusal_outranks_files_changed_mismatch` asserts both sides and passed in +this session; the probe's case A agrees. + +#### Clause 6 does not hold literally for two pre-existing tests + +**Tracked as #3609.** **Re-run condition holds.** `GATE-01.md` clause 6, widened on +2026-11-26, covers edits forced by moving code into a shared helper and by new lint wording. +The ten changed modules pass (68 tests, exit 0), and the two edits are named in +`RETROSPECTIVE.md`. + +This seventh close reran the oracle (which holds the #3608, #3612, #3613, #3614 and #3618 +tests) and the ten modules behind #3609 (68 tests, `OK`). It did not repeat the earlier +mutation for #3612 and #3613 or probe cases D to G. For #3610 the condition is wording in +`GATE-01.md`, the close unit and `docs/methodology.md`; the fifth close found it present. diff --git a/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/GATE-01-CRITERIA.md b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/GATE-01-CRITERIA.md new file mode 100644 index 00000000..21ece184 --- /dev/null +++ b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/GATE-01-CRITERIA.md @@ -0,0 +1,77 @@ +### T01#1 + +- **criterion:** `tests.test_fail_fast_deliverables.TestProducesNotInDiffEarly` fails on HEAD and passes +- **state:** `unverified` +- **covers:** specfuse/loop/loop.py, tests/test_fail_fast_deliverables.py + +### T01#2 + +- **criterion:** The early refusal's `failure_class`, `failure_signature` and `summary` equal what the late +- **state:** `unverified` +- **covers:** specfuse/loop/loop.py, tests/test_fail_fast_deliverables.py + +### T01#3 + +- **criterion:** `python3 -m unittest tests.test_dispatch_skeleton tests.test_gate_timings -b` passes; any +- **state:** `unverified` +- **covers:** specfuse/loop/loop.py, tests/test_fail_fast_deliverables.py + +### T02#1 + +- **criterion:** `tests.test_fail_fast_deliverables.TestPresenceEarly` fails on HEAD and passes after: an +- **state:** `unverified` +- **covers:** specfuse/loop/loop.py, .specfuse/verification.yml.example, specfuse/loop/data/verification.yml.example, tests/test_fail_fast_deliverables.py + +### T02#2 + +- **criterion:** `TestOptOut` fails on HEAD and passes after: with `fail_fast_deliverables: false`, each of +- **state:** `unverified` +- **covers:** specfuse/loop/loop.py, .specfuse/verification.yml.example, specfuse/loop/data/verification.yml.example, tests/test_fail_fast_deliverables.py + +### T02#3 + +- **criterion:** `diff .specfuse/verification.yml.example specfuse/loop/data/verification.yml.example` is +- **state:** `unverified` +- **covers:** specfuse/loop/loop.py, .specfuse/verification.yml.example, specfuse/loop/data/verification.yml.example, tests/test_fail_fast_deliverables.py + +### T03#1 + +- **criterion:** `tests.test_fail_fast_deliverables.TestTreeAndNote` fails on HEAD and passes after. It +- **state:** `unverified` +- **covers:** specfuse/loop/loop.py, tests/test_fail_fast_deliverables.py + +### T03#2 + +- **criterion:** The cap holds: a diff of 30 paths lists 20 and the count of the remaining 10. +- **state:** `unverified` +- **covers:** specfuse/loop/loop.py, tests/test_fail_fast_deliverables.py + +### T04#1 + +- **criterion:** `tests.test_fail_fast_deliverables.TestArmTimeWarning` fails on HEAD and passes after: a +- **state:** `unverified` +- **covers:** specfuse/loop/lint_plan.py, docs/methodology.md, specfuse/loop/data/docs/methodology.md, tests/test_fail_fast_deliverables.py + +### T04#2 + +- **criterion:** `specfuse lint` exits 0 on every feature folder under `.specfuse/features/` (WARN only). +- **state:** `unverified` +- **covers:** specfuse/loop/lint_plan.py, docs/methodology.md, specfuse/loop/data/docs/methodology.md, tests/test_fail_fast_deliverables.py + +### T04#3 + +- **criterion:** The RESULT's notes give the measured count and total from the Context bullet. +- **state:** `unverified` +- **covers:** specfuse/loop/lint_plan.py, docs/methodology.md, specfuse/loop/data/docs/methodology.md, tests/test_fail_fast_deliverables.py + +### T04#4 + +- **criterion:** `diff docs/methodology.md specfuse/loop/data/docs/methodology.md` is empty. +- **state:** `unverified` +- **covers:** specfuse/loop/lint_plan.py, docs/methodology.md, specfuse/loop/data/docs/methodology.md, tests/test_fail_fast_deliverables.py + +### T04#5 + +- **criterion:** `grep -c "unittest.skip" tests/test_fail_fast_deliverables.py` prints `0`. +- **state:** `unverified` +- **covers:** specfuse/loop/lint_plan.py, docs/methodology.md, specfuse/loop/data/docs/methodology.md, tests/test_fail_fast_deliverables.py diff --git a/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/GATE-01.md b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/GATE-01.md new file mode 100644 index 00000000..adbeb1ec --- /dev/null +++ b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/GATE-01.md @@ -0,0 +1,86 @@ +--- +gate: 1 +status: passed +feature_oracle: "python3 -m unittest tests.test_fail_fast_deliverables -v -b" +cost_budget_usd: 14.00 +broad_run: + tree: 005cbf7fae31cc70ae2611ac1daa3e6f33f8c06b:07bbf72d1e7af3c1a03af605f40e5563dc3a18db:0ec7c6da6e74f0b56753f09657b654a6d289b91b:12064a6191eeb830a9826d911a8543fbaba3da75:27968248a450a842ccd187b7dce0fb0ded934866:287efde8f90320baffac08f5f3287b9456a65cb9:2e29b2f7e073a0cbe290f01d3b397e1cdd10c81c:42796ea0e0a6c03811b0e4bc9dbd3b5ee62dd2e4:453dde1cefd6975f95fef87586aebf0587449a5d:4acc6dfc5e8cece358c167d876515eba4a39a500:56ae45adcc17a1292977c436fd195ef8c61cc9e4:834d9d9c16094a386cd9b5a6f9ced9a3a9b4e7fb:bbd1aea514612d76722a18c7aece7c767cf1a076:c23b62e87f1ae3890c6f9e3d8c7ca7ec9225ed81:caffe2d63ceacde448842a91bc7a12c206a67523:d74b7d113b844e84f0009098f576fd28477f072d:e3b0de29b81a6c8e0abeacb3898519b98014b9ef:edd5a2872c1d0bda9e1273c586da80e330e1652c:fa2f4f88657587b6e3b560977858810846b1d366 + ran_at: 2026-11-26T21:46:35.359538+00:00 + ok: true + failing: [] +--- + +# Gate 1 — a missing deliverable is refused before any verification gate runs + +## Definition of done + +**Stated as an outcome.** In temporary feature folders, with a stubbed agent session that +leaves a known diff and a `verify_fn` that counts its calls: + +1. **`produces_not_in_diff` early.** An attempt whose diff leaves a declared `produces:` path + untouched, with no `produces_unchanged:` / `produces_amended:` in its RESULT, ends + `produces_not_in_diff` with `verify_fn` called zero times, `verify_seconds: 0` and no + `gate_result` events. The same unit with the path changed calls `verify_fn` once and passes. +2. **Presence early.** `deliverable_missing` (a declared path absent or empty) and + `no_deliverable_files` (the diff names only the unit file and events) are likewise refused + with `verify_fn` never called. +3. **Opt-out.** With `defaults.fail_fast_deliverables: false`, each of the three cases calls + `verify_fn` before refusing, with the same outcome and failure class as today. +4. **Tree and note.** An early refusal keeps or resets the tree per + `defaults.retain_on_guard_refusal`, as the late refusal does; its retry note states that + verification did not run and lists the paths this attempt changed (or says it changed + none). +5. **Arm-time warning.** `specfuse lint` prints a WARN for a dispatchable unit whose `produces:` + path appears nowhere in its body, by full path, file name or parent directory, and stays + silent when it does. *(Parent directory added 2026-11-26 by the operator after the sixth + close, #3617: `PLAN.md` decision 7 required narrowing above a 10% warning rate; by full path + or file name the warning fired on 81 of 401 `done` units with `produces:` (20.2%), with the + parent directory on 35 (8.7%).)* **Measurement record** *(operator, 2026-11-26, #3619):* the + driver keeps no RESULT notes from passed attempts, so T04's measured count and total are + recorded by the `check_produces_mentioned` docstring in `specfuse/loop/lint_plan.py` (81 and + 35 of 401) and confirmed by the sixth close's judge, who recounted independently (81 and 35 + of 402; one unit finished since). That pair is the accepted evidence for WU-04's reporting + criterion. +6. **Nothing else changes.** Every existing test of the three guards passes unchanged, apart + from assertions on the order of `verify` and the guard, and edits forced by moving code into + a shared helper or by new lint wording that a text-matching assertion picks up. No such edit + removes or weakens an assertion, and each is named in the close. *(Widened 2026-11-26 by the + operator after the first close, #3609.)* + +**Precedence when two refusals apply** *(stated 2026-11-26 by the operator after the first +close, #3608; widened after the second close, #3610).* Under the default order a deliverable +refusal (`produces_not_in_diff`, `deliverable_missing`, `no_deliverable_files`) takes +precedence over every check that runs after the agent session: the verification gates and +the later guards, including `files_changed_mismatch`, `smoke_import_failed`, the +blocked-verdict guard and the closing-deliverable guards. An attempt that trips a +deliverable refusal and one of those checks records the deliverable refusal, and the other +check runs only on a later attempt, once the deliverable is fixed. With +`fail_fast_deliverables: false` the old order and its outcomes hold. The +`files_changed_mismatch` pair is asserted on both sides by +`TestProducesNotInDiffEarly.test_deliverable_refusal_outranks_files_changed_mismatch`. +Clause 3's "same outcome and failure class" applies to inputs that trip only one refusal. + +One side effect follows and is accepted. The early refusal keeps or resets the tree per +`defaults.retain_on_guard_refusal` (clause 4), so by default it keeps the tree. The +smoke-import and closing-deliverable refusals it now outranks always reset it. On an input +that trips both, the next attempt therefore starts from the kept tree, not a clean one. + +The `feature_oracle` proves 1–5. It is red on the current tree; `FEAT-LOOP-2026-0251/T01` is the +walking skeleton that creates `tests/test_fail_fast_deliverables.py` and turns clause 1 green, +with every other class `unittest.skip` naming its owner (T02–T04). A skip surviving to the close +is a hollow oracle. + +## Arming discipline (see `.specfuse/rules/planning-discipline.md`) + +- **One decision, two call sites.** The early and late checks call the same helper; a + duplicated condition is a defect. +- **Positive controls.** Clause 1 pairs a refused attempt with a passing one; clause 3 pairs + the opt-out with the default; clause 5 pairs a mentioned path with an unmentioned one. +- **Counted, not inferred.** "Verification did not run" is asserted by a call counter on + `verify_fn`, never by timing. +- **Expected self-halt.** `loop.py` and `lint_plan.py` are judge surfaces; acknowledge the stop + with your own reason and `/unblock-wu`. + +## Reflection notes + + diff --git a/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/LEARNINGS-pending.md b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/LEARNINGS-pending.md new file mode 100644 index 00000000..67eb16cc --- /dev/null +++ b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/LEARNINGS-pending.md @@ -0,0 +1,40 @@ + + +# Lessons staged for promotion — FEAT-LOOP-2026-0251 + +`autonomy_default: auto`, so `FEAT-LOOP-2026-0251/G1-CLOSE` may not append to +`.specfuse/LEARNINGS.md` directly (`assert_learnings_staged_under_auto`). Three entries generalize. + +## Entries + +- [FEAT-LOOP-2026-0251/T01] **A unit that moves a guard earlier must state which refusal wins + when two apply, for every check it now runs ahead of.** Moving `produces_not_in_diff` + before `verify()` also moved it ahead of `files_changed_mismatch`, the blocked-verdict + check, the smoke-import check and the closing-deliverable guards. The plan named none. The + amendment after the first close named one, and the re-close failed on the others. List + every overtaken check, probe each one early against late, and put the whole list in one + follow-up; a "read in the code" aside does not reach the operator's decision. Prefer one general rule + over a list of named exceptions: here a list cost a second re-close. Also name what else the + order changes besides the label, such as whether the tree is kept or reset. + +- [FEAT-LOOP-2026-0251/T04] **A unit that adds a lint message must run every test module + that lints, not only the ones its Verification section names.** Existing tests filtered + lint output on the word "directory"; the new WARN contained it, the narrow tier passed, + and the gate's broad run went red. The named module (`tests.test_lint_plan`) did not + exist, so check that each module a unit names can be imported before arming. + +- [FEAT-LOOP-2026-0251/T03] **A "what this attempt changed" list cannot be a filter over a + name-only diff.** On a kept tree it missed deletes and reverts, which leave the diff, and + after that fix it still missed a renamed file's old name (rename detection), later edits + to a non-ASCII name (git quotes it, so the file cannot be opened) and mode changes. + Compare attempt-start and attempt-end states over the union of their paths, read with + `--no-renames -z`. Test write, edit, delete, revert, rename and a non-ASCII name on a + second attempt, and probe the whole matrix before the first fix, not one case per close + (the state comparison closed the whole matrix at once; three filter fixes had not). When + switching git reads to `-z`, decide how a non-UTF-8 name decodes: quoting had hidden that. A filter that + hides the tool's own bookkeeping must match full paths: matched by base name it also hid an + agent's own `docs/events.jsonl`, and a close that argued such a limit was acceptable was + overruled by the judge. diff --git a/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/PLAN.baseline.json b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/PLAN.baseline.json new file mode 100644 index 00000000..eb7f1c0a --- /dev/null +++ b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/PLAN.baseline.json @@ -0,0 +1,39 @@ +{ + "gates": [ + { + "gate": 1, + "work_units": [ + { + "goal": "T01 \u2014 walking skeleton: refuse `produces_not_in_diff` before `verify()`", + "id": "FEAT-LOOP-2026-0251/T01", + "planned_cost_usd": 2.0, + "type": "implementation" + }, + { + "goal": "T02 \u2014 presence refusals early, and the `fail_fast_deliverables` opt-out", + "id": "FEAT-LOOP-2026-0251/T02", + "planned_cost_usd": 1.5, + "type": "implementation" + }, + { + "goal": "T03 \u2014 the retry note lists the paths the attempt did change", + "id": "FEAT-LOOP-2026-0251/T03", + "planned_cost_usd": 1.0, + "type": "implementation" + }, + { + "goal": "T04 \u2014 arm-time warning for an unmentioned `produces:` path, and docs", + "id": "FEAT-LOOP-2026-0251/T04", + "planned_cost_usd": 1.5, + "type": "implementation" + }, + { + "goal": "G1-CLOSE \u2014 terminal close", + "id": "FEAT-LOOP-2026-0251/G1-CLOSE", + "planned_cost_usd": 5.0, + "type": "close" + } + ] + } + ] +} diff --git a/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/PLAN.md b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/PLAN.md new file mode 100644 index 00000000..a91152c8 --- /dev/null +++ b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/PLAN.md @@ -0,0 +1,158 @@ +--- +feature_id: FEAT-LOOP-2026-0251 +title: Refuse a missing deliverable before the verification gates run +slug: fail-fast-deliverables +branch: feat/FEAT-LOOP-2026-0251-fail-fast-deliverables +roadmap_goal: An attempt whose declared deliverable is missing or untouched is refused before any verification gate runs, its retry note names the files it did change, and `specfuse lint` warns before arming when a `produces:` path appears nowhere in its unit's text. +autonomy_default: auto +status: done +planned_cost_usd: 11.00 +--- + +# Plan: Refuse a missing deliverable before the verification gates run + +Three driver refusals judge only the attempt's diff against the unit's `produces:` list: +`produces_not_in_diff`, `deliverable_missing` and `no_deliverable_files` (`loop.py`, the +deliverable-presence and produces-in-diff guards after `execute_unit_attempt()` returns). +Today they run only after `verify()` has passed, so each refusal pays for a full verification +run first. An operator report measured 19 of 48 non-passing attempts (of 184) ending in one of +these three, and 6 of 26 escalations were `deterministic_refusal_repeat`. + +This feature moves those three decisions ahead of `verify()`, adds the attempt's own changed +paths to their retry note, and adds an arm-time warning for a `produces:` path its unit never +mentions. It does not change what is refused, only when. + +## Decisions (2026-11-25) + +The operator said "take your recommendations" and then accepted this list. Each item is a +recommendation applied on that instruction. + +1. **All three asks of the report, item 3 narrowed.** The retry note already names the missing + path and shows the `produces_unchanged:` / `produces_amended:` fence + (`PRODUCES_REPAIR_EXAMPLE`, #1415). The missing piece is the list of paths the attempt did + change; only that is added. +2. **Autonomy `auto`.** A fresh judge session writes the terminal verdict from evidence only. + `loop.py` and `lint_plan.py` are judge surfaces, so the terminal judge-editing stop fires + before the close: acknowledge it with your own reason and `/unblock-wu`. +3. **One gate**, four substantive units and a terminal `close` (`docs/methodology.md` §6). +4. **Fail-fast covers exactly the three diff-only refusals.** The smoke-import guard, the + closing-deliverable guards and `files_changed_mismatch` stay where they are. +5. **Same tree handling.** An early refusal keeps or resets the tree by the same + `defaults.retain_on_guard_refusal` rule the late one uses, so no finished work is + discarded; its note says verification did not run, never that it passed. +6. **Opt-out for gate-written deliverables.** A deliverable that only a verification gate + writes (a code generator, say) passes the late check today and would be refused by an early + one on every attempt. `defaults.fail_fast_deliverables` in `verification.yml`, read the way + `retain_on_guard_refusal` is, defaults to `true`; `false` restores today's order exactly. +7. **The arm-time lint is a WARN, measured before it ships.** T04 reports how many of this + repository's `done` units it fires on; above 10% it is narrowed before reporting complete + (the #771 lesson: a warning that fires on most features trains operators to ignore it). + +**Out of scope:** moving the smoke-import or closing-deliverable guards; changing +`detect_deterministic_refusal_repeat`; live progress or halt notification; parallel gates or a +result cache. + +## Existing-mechanism search (mandatory — see `.specfuse/rules/planning-discipline.md` §1) + +- **Grep command run:** `grep -n "produces_not_in_diff\|deliverable_missing\|no_deliverable_files\|deterministic_refusal_repeat" specfuse/loop/loop.py` + and `grep -n "produces" specfuse/loop/lint_plan.py` +- **Verdict:** reuse and extend. The three guards exist and run after `verify()`; this feature + reorders them, it does not add a refusal. The retry note exists (`_RETRY_CLASS_HINT`, + `PRODUCES_REPAIR_EXAMPLE`, `format_deliverable_missing_note`). Arm-time `produces:` lints + exist for an already-delivered path (`check_produces_satisfiability`), a directory entry + (`check_produces_shape`) and a Do-not-touch conflict (`check_produces_boundary`); none checks + that the unit's text mentions the path. +- **If reusing:** the produces-in-diff and presence decisions are lifted into callable helpers + so the early and late call sites share one implementation; `prep` sets (FEAT-2026-0057/T04) + are the precedent for a fail-fast step that skips work. + +## Escalation-predicate satisfiability (mandatory for any severity flip — §2) + +n/a — no check changes severity; the new lint is a WARN. + +## Task graph + +```yaml +gates: + - gate: 1 + file: GATE-01.md + work_units: + - id: FEAT-LOOP-2026-0251/T01 + file: WU-01-produces-before-verify.md + depends_on: [] + - id: FEAT-LOOP-2026-0251/T02 + file: WU-02-presence-and-opt-out.md + depends_on: [FEAT-LOOP-2026-0251/T01] + - id: FEAT-LOOP-2026-0251/T03 + file: WU-03-retry-note-paths.md + depends_on: [FEAT-LOOP-2026-0251/T01] + - id: FEAT-LOOP-2026-0251/T04 + file: WU-04-arm-time-lint-and-docs.md + depends_on: [FEAT-LOOP-2026-0251/T02, FEAT-LOOP-2026-0251/T03] + # --- closing sequence: single terminal close (single-gate feature) --- + - id: FEAT-LOOP-2026-0251/G1-CLOSE + file: WU-90-gate-1-close.md + depends_on: [FEAT-LOOP-2026-0251/T01, FEAT-LOOP-2026-0251/T02, FEAT-LOOP-2026-0251/T03, FEAT-LOOP-2026-0251/T04] +``` + +## Post-merge checklist + +- On the next real feature run that hits one of the three refusals, confirm its + `attempt_outcome` carries `verify_seconds: 0` and no `gate_result` events (FEAT-LOOP-2026-0250 + timings), i.e. the refusal really cost no gate run. +- In a project whose gates generate tracked files, confirm `fail_fast_deliverables: false` + restores the old order. + +## Notes + +- LEARNINGS `[FEAT-LOOP-2026-0250/T04]`: a unit that edits `docs/*.md` refreshes its packaged + copy under `specfuse/loop/data/docs/` in the same unit (`scripts/sync-scaffold.sh`). +- LEARNINGS `[FEAT-LOOP-2026-0250/T01]`: a test that validates events through `validate_event` + pins the packaged schemas and clears the validator caches. +- `produces:` lists only `.py` files under `tests/` (#3539). +- **Review follow-ups (2026-11-26, before the close, operator-approved).** An independent review + of the gate's diff found three behaviour changes the early order introduced; fixed on this + branch, test-first, in `tests/test_fail_fast_deliverables.py` (`TestEarlyRefusalRecovery`, + `TestEarlyRetainedNoteWording`): + 1. An early refusal now consults the re-plan trigger (`replan_before_last_attempt`, extracted + from the failed-verification path), unless it is a repeat on an unmoved tree, which stays + #597's halt. Before, a unit that never wrote its deliverable lost the re-plan a failed + verification used to give it. + 2. The refusal measurement `_refusal_touched` counts uncommitted edits to tracked files + (`git_diff_names(..., worktree=True)`, excluding the unit file). Before, an attempt that only + edited tracked files read as an untouched tree and could be halted as + `deterministic_refusal_repeat` after two early refusals. `detect_deterministic_refusal_repeat` + itself is unchanged; its #1415 rule (identical summary and identical changed-file set) still + halts. + 3. An early refusal with a retained tree gets its own retry lead: the edits are kept but NOT + verified, and the missing deliverable is the work to do — not "apply only the mechanical + fix". + Accepted, not fixed: a deliverable that only a verification gate writes (a code generator, a + formatter) is refused early on every attempt; `fail_fast_deliverables: false` is the remedy, + and no in-loop test covers a gate-written deliverable. +- **Third-close follow-up (2026-11-26, #3612).** With the tree kept, a later attempt's retry note + listed the earlier attempt's kept edits as its own, so "this attempt changed no files" never + showed after the first attempt. The driver now snapshots the content of every already-dirty path + when each attempt starts (`snapshot_dirty_tree`) and the note lists only paths that were clean + then or have changed since (`attempt_own_paths`). The guards' own diff and the events' + `files_touched` are unchanged, so `detect_deterministic_refusal_repeat` is unaffected. Tested in + `TestTreeAndNote` (kept edits left out, nothing-changed stated, a re-edited kept file listed), + both with and without `fail_fast_deliverables`. +- **Fourth-close follow-up (2026-11-26, #3613).** A kept file the attempt deleted, or reverted to + its committed content, had left the diff the guard judged, so the note missed it and could say + "changed no files". `attempt_own_paths` now also lists every attempt-start snapshot path that + is no longer in that diff and whose content has changed. Tested in `TestTreeAndNote` (deleted, + reverted tracked edit, deleted plus a new file), with and without `fail_fast_deliverables`. +- **Fifth-close follow-up (2026-11-26, #3614).** The list still missed renames, mode-only changes + and non-ASCII names, because each earlier fix filtered the guard's diff. It is now built by + comparison: every path that differs from the attempt's starting commit at its start or at the + refusal (`git diff --no-renames -z` plus untracked, read NUL-separated) is compared by state + (file type, executable bits, content digest) across the attempt. Tested in `TestTreeAndNote` + for each case, with and without `fail_fast_deliverables`; a non-ASCII kept edit left alone + still reads "changed no files". The driver crash on `git add -N` for a new non-ASCII file is a + separate, pre-existing defect (it predates this feature) and is not fixed here. +- **Sixth-close follow-up (2026-11-26, #3618).** The note left out the driver's bookkeeping by + base name, so an agent's own `docs/events.jsonl` or `docs/PROGRESS.md` was dropped and the note + could say "changed no files". It now matches the unit file, `events.jsonl` and `PROGRESS.md` by + full path in the unit's feature folder. Tested in `TestTreeAndNote`, with and without + `fail_fast_deliverables`. diff --git a/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/PROGRESS.md b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/PROGRESS.md new file mode 100644 index 00000000..b848c751 --- /dev/null +++ b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/PROGRESS.md @@ -0,0 +1,20 @@ +- **FEAT-LOOP-2026-0251/T01**: execute_unit_attempt now refuses an untouched, unjustified produces path before verify_fn, using the same decision and refusal helpers as the late post-squash site; added the gate oracle test file with clause 1 implemented. + - note: T02: early_produces_refusal returns None whenever assert_declared_deliverables or assert_implementation_touched_files would refuse, so those keep their own outcomes until you move them early; it reads the pending diff through pending_squash_names (scratch index), and the produces amendment is applied only at the late site, after verify. +- **FEAT-LOOP-2026-0251/T02**: deliverable_missing and no_deliverable_files now refuse before verify() via helpers shared with late sites; added defaults.fail_fast_deliverables opt-out (default true), documented and synced. Narrow tier green; broad gates not run. +- **FEAT-LOOP-2026-0251/T03**: Retry notes for all three deliverable refusals (early and late) now list the paths the attempt changed, from the diff the guard judged, capped at 20 plus a count of the rest, or say this attempt changed no files. + - note: The list leaves out driver bookkeeping (the unit's WU file, events.jsonl, PROGRESS note); otherwise an attempt that changed nothing could never say so. Early presence refusals now carry `touched` (the pending diff). Event `files_touched` and the refusal history are unchanged. `loop.run()` tests fail in the sandbox on `~/.claude/session-env`, so I ran them with HOME pointed under $TMPDIR. +- **FEAT-LOOP-2026-0251/T04**: Added the WARN check `check_produces_mentioned` to `specfuse lint`, replaced the skipped `TestArmTimeWarning` with real tests, and documented the early refusal order in docs/methodology.md. +- **FEAT-LOOP-2026-0251/G1-CLOSE**: Wrote the terminal close (retrospective, two follow-ups, two staged lessons, four changelog fragments) with advisory verdict not_met, because one input gets a different early and late refusal outcome and two pre-existing test edits are not order assertions. + - note: Operator must decide whether a deliverable refusal takes precedence over files_changed_mismatch (see FOLLOW-UPS.md) and acknowledge the four consumer-visible changes. +- **FEAT-LOOP-2026-0251/G1-CLOSE**: Re-ran the terminal close with advisory verdict not_met, because probes show the early deliverable refusal also yields a different outcome or failure class than the late order for smoke-import, blocked-verdict and closing-deliverable inputs, which the stated files_changed_mismatch precedence does not cover. + - note: The operator must decide the one open FOLLOW-UPS.md entry (recommended: one general precedence rule in GATE-01.md, the close trigger and docs/methodology.md) and acknowledge the four consumer-visible changes; the re-run conditions for +- **FEAT-LOOP-2026-0251/G1-CLOSE**: Updated the gate 1 close files for the third close after a fresh early-versus-late probe, recorded advisory verdict met, and extended one existing changelog fragment. + - note: docs/methodology.md still says "What is refused does not change, only when", which is not true for a gate-written deliverable under the default (probe case Q). +- **FEAT-LOOP-2026-0251/G1-CLOSE**: Fourth close of gate 1 records not_met because the retry note omits a kept file that a later attempt deleted or reverted, and can then say the attempt changed no files (clause 4); closing files updated in place. + - note: Fix by also listing attempt-start snapshot paths that left the diff and whose digest changed, with delete and revert tests; separately, a non-ASCII changed filename on a kept tree crashes git add -N, which also happens on the pre-feature loop.py. +- **FEAT-LOOP-2026-0251/G1-CLOSE**: Updated the gate 1 close files in place for the fifth close, with advisory verdict not_met because the retry note's path list still misses a renamed file's old name, later changes to kept non-ASCII-named files, a restore after an earlier rename, and mode-only changes (clause 4). + - note: Build the retry note's list by comparing attempt-start and attempt-end path states (content and mode, read with --no-renames -z), and reuse the -z reading for the git add -N crash on non-ASCII names. +- **FEAT-LOOP-2026-0251/G1-CLOSE**: Sixth close of gate 1 confirms the + - note: Weigh probe case N2 (a file named events.jsonl outside the feature folder is left out of the retry note); the non-UTF-8 decode in _paths_differing_from and the older git add -N crash have no filed issue. +- **FEAT-LOOP-2026-0251/G1-CLOSE**: Seventh close of gate 1 updated the closing files in place with advisory verdict met, confirming that the re-run conditions of + - note: No follow-up is open, so the older git add -N crash on non-ASCII names and the non-UTF-8 decode in _paths_differing_from have no tracked issue (see RETROSPECTIVE.md, "Notes for the human reviewer"). diff --git a/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/RETROSPECTIVE.md b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/RETROSPECTIVE.md new file mode 100644 index 00000000..0cff90e7 --- /dev/null +++ b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/RETROSPECTIVE.md @@ -0,0 +1,456 @@ +# Retrospective — FEAT-LOOP-2026-0251, refuse a missing deliverable before verification + +## Gate 1 + +## Verdict + +`met` (advisory; the judge concludes). This is the seventh close of the gate. The re-run +conditions of #3617, #3618 and #3619 hold: lint is silent on a parent-directory mention, as +amended clause 5 says; an agent's own `docs/events.jsonl` or `docs/PROGRESS.md` is now in the +retry note; and `GATE-01.md` records the warning-rate measurement and its accepted evidence, +which an independent recount in this session agrees with. The oracle passes (43 tests, no +skips). This session did not rerun the early-against-late probe; its tables below are the +fourth and fifth closes' observations. + +Limits that remain under clause 4: the note does not list files git ignores, and it leaves out +the driver's own three files in the feature folder (the unit file, `events.jsonl`, +`PROGRESS.md`) even if an agent edits one. Non-UTF-8 names and an older crash are under +"Notes for the human reviewer". + +## Measurements + +Commands in this section ran fresh in this seventh close on the working tree, unless a line +says otherwise. Test runs and probes used `HOME` under `$TMPDIR` with a stub git identity, +because with the real `HOME` the sandbox blocks the driver's preflight write (observed in +the fourth close). + +### feature_oracle: PASS + +`python3 -m unittest tests.test_fail_fast_deliverables -v -b`: exit 0, `Ran 43 tests`, `OK`, +no skips. `grep -c "unittest.skip" tests/test_fail_fast_deliverables.py` prints `0`. A search +of that file for `unittest.skip`, `skipIf`, `skipUnless`, `skipTest` and `@skip` finds nothing. + +### Retry note: files named like driver bookkeeping (#3618) + +A throwaway probe drove `loop.run()` through the oracle's `_second_attempt_note` (kept tree, +stubbed agent session and `verify`) and read attempt 2's path list. Every row gave the same +list with fail-fast on and off. + +| Attempt 2 does | Note lists | +|---|---| +| writes a new `docs/events.jsonl` | that file | +| writes a new `docs/PROGRESS.md` | that file | +| writes a new `events.jsonl` at the repository root | that file | +| writes a new `PROGRESS.md` at the repository root | that file | +| writes a new `docs/WU-T01.md` (the unit file's name) | that file | +| writes `docs/plain.md` (control) | that file | +| edits a tracked `docs/PROGRESS.md` that attempt 1 had edited | that file | +| nothing | "changed no files" | +| appends to the feature folder's own `events.jsonl` | "changed no files" (driver file, left out by design) | +| writes a git-ignored file | "changed no files" (**ignored file not listed**) | + +The guard itself still filters by base name (`assert_implementation_touched_files`, read from +the code). So an `implementation` attempt whose only new file is, say, `docs/events.jsonl` +can be refused as `no_deliverable_files` while its note lists that file. The note is right +about what changed; the guard rule is older than this feature and clause 6 leaves it alone. + +### Retry note on a kept tree (#3614 and beyond it), as run in the sixth close + +This table is the sixth close's observation, not run again. The oracle's tests for these +kinds of change passed in this session. Row N2 is superseded by the table above. + +A throwaway probe drove `loop.run()` through the oracle's own helper +(`_second_attempt_note`, kept tree, stubbed agent session and `verify`) and read the path +list in the note recorded for attempt 2. Every row below gave the same list with fail-fast on +and off. + +| Case | Attempt 1 | Attempt 2 | Attempt 2's note lists | Matches what attempt 2 changed | +|---|---|---|---|---| +| R0 | writes a new file | writes another | the second file | yes | +| R1 | writes a new file | deletes it | that file | yes | +| R2 | edits a tracked file | restores it | that file | yes | +| R3 | edits a tracked file | edits it again | that file | yes | +| R5 | writes a new file | deletes it, writes another | both | yes | +| R6 | deletes a tracked file | restores it | that file | yes | +| R7 | deletes a tracked file | nothing | "changed no files" | yes | +| R8 | writes a new file | renames it | both names | yes | +| R9 | writes `docs/x.md` | renames tracked `docs/tracked.md` to `docs/moved.md` | both rename names, not `x.md` | yes | +| R10 | renames a tracked file | writes the old name back | the old name | yes | +| R11 | writes a new file | makes it executable | that file | yes | +| R12 | writes a name with a space | edits it | that file | yes | +| R13 | edits tracked `docs/café.md` | edits it again | the file, unquoted | yes | +| R14 | edits tracked `docs/café.md` | nothing | "changed no files" | yes | +| R15 | edits tracked `docs/café.md` | restores it | the file | yes | +| S1 | writes a new file | `chmod` on a tracked file | the tracked file | yes | +| S2 | edits a tracked name holding `"` | edits it again | that file | yes | +| S3 | creates a symlink | retargets it | the link | yes | +| S4 | writes a file, sets `diff.renames=copies` | renames a tracked file | both names | yes | +| S5 | writes a new file | replaces it with a symlink | that file | yes | +| S6 | writes a new file | only `git add`s it | "changed no files" | yes (no content or mode change) | +| S7 | writes a new file | nothing | "changed no files" | yes | +| S8 | edits a tracked name holding a newline | edits it again | the file, split over two lines | yes, badly formatted | +| S9 | renames a tracked file | nothing | "changed no files" | yes | +| S10 | writes a new file | writes a git-ignored file | "changed no files" | **ignored file not listed** | +| N2 | writes a new file | writes `docs/events.jsonl` | "changed no files" | **file not listed** | + +N2 was true on the sixth close's tree, where `format_changed_paths` dropped by base name. +It now matches the three driver files by full path (#3618). `git_diff_names` still drops +`PROGRESS.md` by base name from the guard's diff, but the note's list is built from the +attempt-start comparison, so the table above shows the file listed. + +First attempt, reset tree, fail-fast on and off: a new `docs/ñ.md` is listed unquoted, and a +rename of the tracked deliverable `src/rule.py` lists both names (in the presence-refusal +note, under "Files this attempt touched"). + +With the opt-out, a stub gate that writes `gate-out.txt` during a late refusal gets that file +listed although the agent wrote nothing. This is the late order, not the early refusal that +clause 4 describes. + +Two probes crashed the driver: + +- R4, a new non-ASCII file in a kept tree: `CalledProcessError` from `git add -N` on the + quoted path, with fail-fast on and off. The close unit records this as older than the + feature. +- A nested repository with no commit: `CalledProcessError` from `git add -A`. This shows + nothing about the note. + +### Non-UTF-8 file names + +`_paths_differing_from` reads `git ... -z` output as strict UTF-8. In a temporary repository +with one tracked name holding byte `0xff` (made through the index, since macOS refuses such a +name on disk), `snapshot_dirty_tree` raised `UnicodeDecodeError`, while `git_diff_names` over +the same tree returned the quoted name. + +Through `loop.run()`, a simulated attempt that deletes that tracked file and writes nothing +else raised `UnicodeDecodeError` from `attempt_own_paths`. The pre-feature `loop.py` +(`bd7e508` pin) raised `UnicodeDecodeError` on the same input too, from +`retain_tree_after_refusal` with a kept tree and `reset_preserving_events` with a reset one. +So this input stops both builds. A case that stops only the new build was **not** shown +through `loop.run()`: a file already dirty at the start is refused by the branch guard (both +builds) when tracked, and an untracked one cannot be created on macOS. + +### Other oracles + +| Check | Result | +|---|---| +| `python3 -m unittest tests.test_dispatch_skeleton tests.test_gate_timings -b` | 25 tests, `OK` | +| `python3 -m unittest tests.test_lint_plan -b` (named by T04) | **import error: no such module** | +| the `tests/test_lint_plan*.py` modules that do exist | 46 tests, `OK` | +| the ten changed pre-existing test modules | 68 tests, `OK` | +| `.specfuse/scripts/lint_plan.py` over every feature folder with a `PLAN.md` | 97 linted, 0 non-zero exits | +| `diff` of `verification.yml.example` against its packaged copy | exit 0, empty | +| `diff docs/methodology.md specfuse/loop/data/docs/methodology.md` | exit 0, empty | +| `python3 -m specfuse.loop.changelog_fragments check` | exit 0 | + +This session did not run the full suite or coverage. The log of the driver's latest broad run +(`work/gate-logs/`, stamps `20261126T2143`) shows `Ran 5157 tests`, `OK (skipped=4)`, and 92% +total coverage. `GATE-01.md` records that run with `ok: true` and no failing gate. + +### Controls: the oracle observes the feature + +Each mutation ran in a scratch copy of the package, scripts, tests, docs and `.specfuse/` +(without the feature folders). The unmodified copy ran the 43 oracle tests: `OK`. + +| Mutation | Result | +|---|---| +| `resolve_fail_fast_deliverables` forced to return `False` | 43 tests: 13 failures | +| note filter turned back to base names | `TestTreeAndNote`, 19 tests: 2 failures | +| parent directory no longer accepted by the lint check | `TestArmTimeWarning`, 6 tests: 1 failure | + +Earlier controls, from the sixth close and not repeated: an unfiltered `attempt_own_paths` +(20 failures), rename pairing turned back on (3), mode bits left out of `_path_state` (2), +mangled non-ASCII names (4), attempt-start paths left out of the compared set (10), a no-op +`check_produces_mentioned` (2), and the pre-feature `loop.py` (`bd7e508` pin; 12 failures and +30 errors in 42 tests). On the old driver every failing `TestProducesNotInDiffEarly` and +`TestPresenceEarly` entry was an error, so the first mutation is the behaviour evidence for +those two classes. That substitution was not a full pre-feature tree. + +### Early against late, same input + +These tables are earlier closes' observations. **Neither the sixth nor this seventh close +ran the probe again.** The source changes named since are in the path-list code, reached only +through `format_changed_paths`, whose three call sites build retry notes (checked by `grep`). +This session reran the oracle, which holds the `files_changed_mismatch` pair (case A) and the +single-refusal pairs in `TestOptOut`. + +The probe drove `loop.run()` over the oracle's fixture and read the first `attempt_outcome` +for T01, once with fail-fast on and once off. Verification is a stub. The unit declares +`src/rule.py`. "Untouched" means the attempt writes only `docs/notes.md`. Each cell is +outcome / failure class. Where one name is shown, both are equal. Every early deliverable +refusal recorded `verify_seconds: 0` and `tree_retained: true`. + +As run in the fifth close: + +| Case | fail-fast on | fail-fast off | Differs because | +|---|---|---|---| +| A: RESULT claims `src/rule.py` in `files_changed` | `produces_not_in_diff` | `files_changed_mismatch` | outranks a later guard | +| B: verify stub fails, untouched | `produces_not_in_diff` | `failed` / `other` | outranks a gate | +| C: untouched, nothing else wrong | `produces_not_in_diff` | same | same | +| G without the smoke-import line: `src/rule.py` emptied | `deliverable_missing` / `guard_refusal` | same | same | +| K: verify stub fails, nothing written | `no_deliverable_files` / `guard_refusal` | `failed` / `other` | outranks a gate | +| L: nothing written (two deliverable refusals apply) | `no_deliverable_files` / `guard_refusal` | same | same | +| M: only `src/rule.py` deleted (two apply) | `deliverable_missing` / `guard_refusal` | same | same | +| O: RESULT `status: blocked`, untouched | `blocked`, no failure class | same | same | + +As run in the fourth close: + +| Case | fail-fast on | fail-fast off | +|---|---|---| +| D: failing smoke-import line, untouched | `produces_not_in_diff` | `smoke_import_failed` | +| E: also declares a report written with a `BLOCKED` verdict heading; untouched | `produces_not_in_diff` | `failed` / `guard_refusal` | +| F: unit typed `close`, untouched | `produces_not_in_diff` | `closing_deliverable_missing` / `guard_refusal` | +| G: failing smoke-import line, `src/rule.py` emptied | `deliverable_missing` / `guard_refusal` | `smoke_import_failed` | +| H: squash commit rejected (stub), untouched | `produces_not_in_diff` | `squash_commit_failed` | +| I: failing smoke-import line, nothing written | `no_deliverable_files` / `guard_refusal` | `smoke_import_failed` | +| J: `close` unit, nothing written | `produces_not_in_diff` | `closing_deliverable_missing` / `guard_refusal` | +| P: squash commit rejected (stub), `src/rule.py` emptied | `deliverable_missing` / `guard_refusal` | `squash_commit_failed` | +| Q: verify stub writes `src/rule.py`; the attempt did not | `produces_not_in_diff` | `passed` | + +Also not repeated, from earlier closes: case N (zero-token session), each second check +firing alone when every declared path is changed, and early presence refusals with +`retain_on_guard_refusal: false`. + +### Per-criterion results + +All 13 criteria were looked at again. `GATE-01-CRITERIA.md` is left as the driver seeded it, +because it is not one of this unit's permitted closing surfaces. + +| Criterion | Result | Evidence from this session | +|---|---|---| +| T01#1 | passes | `TestProducesNotInDiffEarly` in the oracle; first mutation. "Fails on HEAD" rests on the sixth close's old-driver run | +| T01#2 | passes | `test_early_record_equals_late_record` (plain RESULT, passing stub) | +| T01#3 | passes | 25 tests, `OK` | +| T02#1 | passes | `TestPresenceEarly` in the oracle; first mutation. "Fails on HEAD" as for T01#1 | +| T02#2 | passes | `TestOptOut` in the oracle | +| T02#3 | passes | empty diff | +| T03#1 | passes; limit: ignored files | `TestTreeAndNote` (19); lookalike probe; base-name mutation | +| T03#2 | passes | `test_list_is_capped_at_twenty` | +| T04#1 | passes | `TestArmTimeWarning`; parent-directory mutation; lint probe | +| T04#2 | passes with the repository script | 97 folders, 0 non-zero exits | +| T04#3 | accepted under clause 5's measurement record | T04's RESULT notes were not seen by any close; `GATE-01.md` accepts the docstring (81 and 35 of 401) and the sixth judge's recount. This session's recount agrees: 81 and 35 of 402 | +| T04#4 | passes | empty diff | +| T04#5 | passes | prints `0` | + +carried forward: 0 criteria, re-measured: 13 + +## Definition of done, clause by clause + +| Clause | Proven | By | +|---|---|---| +| 1. `produces_not_in_diff` early | Refused with 0 `verify_fn` calls, `verify_seconds` 0, no attempt-phase `gate_result`; a changed path verifies once and passes; a justified path still verifies; class, signature and summary equal the late site's | `TestProducesNotInDiffEarly` (6 tests) | +| 2. Presence early | Absent, empty and bookkeeping-only diffs are refused with 0 calls | `TestPresenceEarly` (3) | +| 3. Opt-out | With the key `false`, each of the three cases verifies once; outcome, class, signature and summary equal the default's, for inputs that trip one refusal | `TestOptOut` (4), on plain-RESULT, passing-stub inputs; probe cases C, L, M | +| 4. Tree and note | Proven, with the ignored-file limit. The note says verification did not run; lists written, edited, deleted, reverted, renamed (both names), mode-changed and non-ASCII-named paths, and agent files named like driver bookkeeping; leaves out untouched kept edits and the driver's own three files; caps at 20; the tree is kept or reset | `TestTreeAndNote` (19); this session's lookalike probe; sixth close's cases R0 to R15 and S1 to S9. The kept/reset assertions use `produces_not_in_diff` only | +| 5. Arm-time WARN | Warns on an unmentioned path; silent on full path, file name or parent directory (as amended, #3617), and on `done` / `abandoned`; `lint()` calls it. The measurement record is in `GATE-01.md` (#3619) | `TestArmTimeWarning` (6), including `test_parent_directory_mention_is_silent`; lint probe; recount | +| 6. Nothing else changes | Holds as widened for #3609. See the list below | `diff -ru` of `tests/` against the recorded base; the ten modules pass | +| Precedence over every later check | Holds on every probed pair. A test asserts only the `files_changed_mismatch` pair | `test_deliverable_refusal_outranks_files_changed_mismatch`; this session, the oracle test only; probe cases carried from the fourth and fifth closes | + +Three review fixes made before the first close, outside any work unit, are covered by +`TestEarlyRefusalRecovery` (3: re-plan still fires; uncommitted tracked edits count as a +moved tree; an untouched tree still halts) and `TestEarlyRetainedNoteWording` (2). + +## Pre-existing tests changed + +This seventh close ran no git command on the repository and did not repeat the tree comparison. +It listed the files under `tests/`, `specfuse/`, `scripts/`, `.specfuse/scripts/` and `docs/` +modified after the sixth close last wrote `LEARNINGS-pending.md`: only +`specfuse/loop/loop.py` and the feature's own `tests/test_fail_fast_deliverables.py` (the +#3618 fix and its tests). No pre-existing test is newer. The third to sixth closes +did the same kind of check, each against the close before, back to the second close's +comparison, below. These are modification-time checks, not content diffs. The ten modules +were rerun in this session. In the comparison text, "this session" means the second close. + +Compared against the public tarball of `a89373d119f8e2d8003a8956dbd4bd27dde8057f`, the +merge base recorded on the first close's `judged` event, and against public `main` as +fetched in this session. No git command was run. Against `main`, besides the new oracle +file, exactly ten test modules differ. Against the older base the same ten differ; three +further test files absent from that base are identical to `main`. The `.claude` directory +under `tests/` was left out of the comparison. + +Changed because of the order of verify and guard: + +| Test module | Change | Why | +|---|---|---| +| `test_files_changed_auto_repair` | `test_untouched_deliverable_still_refuses` now expects `produces_not_in_diff`, not `files_changed_mismatch`, and reads `payload["remaining"]` | The early check pre-empts the post-verify guard. The expected outcome changed; this is the stated precedence (#3608) | +| `test_guard_repair_e2e` | Patches `early_produces_refusal` to return `None` in one test | The absent `src/extra.py` would be refused early, so the guard under test would never run. The test now exercises the late order only | +| `test_arm_wiring` | Two dispatch stubs wrapped in `with_deliverable` | The stubs wrote nothing and relied on `verify` failing first | +| `test_loop_files_changed_guard` | One stub wrapped in `with_deliverable` | Same: it must get past the presence refusal to reach `verify` | +| `test_replan_end_to_end` | Stub wrapped in `with_deliverable` | Same | +| `test_replan_event_emission` | Stub wrapped in `with_deliverable` | Same | +| `test_replan_note_collision` | Stub wrapped in `with_deliverable` | Same | +| `test_replan_trigger` | One stub writes `deliverable.txt`; one comment rewritten | Attempts must reach `verify`; the comment's claim that the re-plan trigger is never consulted became false | + +Forced by the shared helper or the new lint wording (the widened clause 6): + +| Test module | Change | Why | +|---|---|---| +| `test_deterministic_refusal_repeat` | The source-text anchor moved from `"deliverable_missing",` to `if not deliv_ok:` | The emit call moved into the shared `refuse_deliverable_missing` helper. Both assertions are unchanged. They cover the late branch only | +| `test_produces_shape` | Two negative tests filter findings on `assert_declared_deliverables`, not `directory` | The new WARN text contains "directory". `lint_plan.py` puts the new marker in the shape ERROR, and the two positive tests are unchanged, so the negative tests still catch a shape ERROR on a file or glob | + +## What happened + +T01 to T04 each passed on the first attempt. The gate's first broad run +(2026-11-25T23:44Z) failed: `tests` with 5125 tests and 2 failures, both in +`test_produces_shape`, and `coverage` with `no_gate_marker`. The T04 WARN text caused the +two test failures. No unit's narrow tier selected that module. A later broad run was clean. +The terminal judge-editing stop then fired, as `GATE-01.md` expected. An independent review +found three behaviour changes, fixed test-first on the branch, and the operator +acknowledged the judge edits and re-armed this unit. + +The first close (2026-11-26T13:42Z) and the judge both recorded `not_met`, and the driver +filed #3608 and #3609. The operator amended `GATE-01.md` for both (precedence over +`files_changed_mismatch`; a wider clause 6), added a test for the precedence, and re-armed +this unit. The first close had noted the other overtaken checks from reading the code but +did not probe them or put them in a follow-up entry, so the amendment named only one. The second +close probed them (cases D to G). + +The second close (2026-11-26T14:10Z) and the judge recorded `not_met`, and the driver filed +#3610. The operator replaced the single named exception with a general precedence rule in +`GATE-01.md`, the close unit's trigger and `docs/methodology.md`, and re-armed this unit. +No source or test change accompanied it. + +The third close (2026-11-26T15:45Z) recorded `met`. The judge lowered it to `not_met` on +clause 4, and the driver filed #3612: the note listed an earlier attempt's kept edits as the +later attempt's own. That close, like the two before it, tested "changed nothing" only on a +first attempt. The fix (`snapshot_dirty_tree`, `attempt_own_paths`, three tests) was made on +the branch outside any work unit, and the operator re-armed this unit. The fourth close +probed removals on a kept tree and found that deleted and reverted files were missing. + +The fourth close (2026-11-26T16:28Z) and the judge recorded `not_met`, and the driver filed +#3613. The fix to `attempt_own_paths` and three tests were made on the branch outside any +work unit, and the operator re-armed this unit. The fifth close confirmed that fix and +probed renames, non-ASCII names and a mode change. #3612, #3613 and the gaps then open were +all in one list, built by filtering a name-only diff; each fix so far covered the cases the +previous close had named. + +The fifth close (2026-11-26T17:03Z) and the judge recorded `not_met`, and the driver filed +#3614. The fix replaced filtering of the guard's diff with a comparison of each path's state +at the start and end of the attempt, which is the first option that close recommended. It was +made on the branch outside any work unit, and the operator re-armed this unit. The sixth +close confirmed it on the whole earlier matrix and ten further cases. + +The sixth close (2026-11-26T18:04Z) recorded `met`. The judge lowered it to `not_met` on three +findings, and the driver filed #3617 (clause 5 never amended for the parent directory), #3618 +(the note dropped agent files by base name; the sixth close had probed this as case N2 and +judged it acceptable, wrongly) and #3619 (T04's measurement not visible in its RESULT notes). +The operator fixed #3618 on the branch outside any work unit, amended clause 5 for the other +two, and re-armed this unit. + +T04 passed although its Verification section names `tests.test_lint_plan`, which does not +exist. + +## Cost analysis + +Unit costs are from the `task_completed` events in `events.jsonl`. For a close, the figure +includes its judge: `record_judge_cost_fold` adds the judge's usage to the attempt before +`attempt_outcome` is emitted. + +| Unit | Planned USD | Actual USD | Of which judge | Actual / planned | Attempts | +|---|---|---|---|---|---| +| T01 | 2.00 | 0.88 | — | 44% | 1 | +| T02 | 1.50 | 0.77 | — | 51% | 1 | +| T03 | 1.00 | 0.55 | — | 55% | 1 | +| T04 | 1.50 | 0.47 | — | 32% | 1 | +| Substantive total | 6.00 | 2.67 | — | 45% | 4 | +| G1-CLOSE, first close | 5.00 (one plan line for all closes) | 1.69 | 0.44 | 34% | 1 | +| G1-CLOSE, second close | (same line) | 1.49 | 0.48 | 30% | 1 | +| G1-CLOSE, third close | (same line) | 1.73 | 0.57 | 35% | 1 | +| G1-CLOSE, fourth close | (same line) | 1.44 | 0.36 | 29% | 1 | +| G1-CLOSE, fifth close | (same line) | 1.35 | 0.47 | 27% | 1 | +| G1-CLOSE, sixth close | (same line) | 1.66 | 0.48 | 33% | 1 | +| G1-CLOSE, seventh close | (same line) | not yet recorded | — | — | in progress | +| G1-CLOSE, six recorded closes | 5.00 | 9.36 | 2.80 | 187% | 6 | + +Recorded unit spend is 12.03 USD. That is over the plan of 11.00 (109%) and under the gate +budget of 14.00, with this session's cost and its judge's still to be written. The earlier +`blocked_human` stop of this unit recorded 0.00. The independent review, its fixes, the +amendments and the #3612, #3613, #3614 and #3618 fixes happened outside the loop, so +`events.jsonl` has no cost for them. All six re-closes cost money for questions the plan or +the oracle had left open: two for an unstated precedence, one each for #3612, #3613 and +#3614, and this one for #3617 to #3619. + +**T04's warning rate.** T04 recorded, in the check's docstring, 81 of 401 `done` units with +`produces:` for path or file name alone (20.2%) and 35 with the parent directory (8.7%). +Re-measured this session: the shipped rule would fire on 35 of 402, **8.7%**, under the 10% +limit; path or file name alone on 81 of 402, 20.1%. The population has grown by one. T04's +progress note does not carry the count. The parent-directory match is a plain substring +test, so a short directory such as `tests` is satisfied by almost any body, and a mention of +a subdirectory (`specfuse/loop/data/docs`) also silences `specfuse/loop/loop.py`. The WARN is +weak for such paths. + +## Consumer-visible contract changes + +Pending human acknowledgment. Each has a `changelog.d/` fragment tracing to +`FEAT-LOOP-2026-0251`. This close added no fragment; it corrected the retry-note one in +place, replacing the base-name limit that #3618 fixed. + +1. **Changed:** the three deliverable refusals run before verification. They take precedence + over every verification gate and later guard. An attempt that also would have failed one + is reported as the deliverable refusal. By default its tree is kept, including where the + old order reset it. +2. **Added:** `defaults.fail_fast_deliverables`, default `true`. +3. **Changed:** the retry note for the three refusals lists the changed paths, at most 20 + plus a count. Untouched edits kept from an earlier attempt are left out; deletes, + reverts, both names of a rename, mode-only changes and non-ASCII names are listed. Not + listed: git-ignored files, and the driver's own unit file, `events.jsonl` and + `PROGRESS.md` in the feature folder. +4. **Added:** a `specfuse lint` WARN for a `produces:` path the unit's body never mentions. + +## Notes for the human reviewer + +None of these is a failed criterion. This unit may edit none of the files concerned. + +- **Non-UTF-8 names in the new reader.** `_paths_differing_from` decodes `-z` output + strictly and catches only `OSError` and `CalledProcessError`. It runs before every + attempt. From the code and the function-level probe, an untracked non-UTF-8 name (possible + on Linux) would raise there, where the old listing got an ASCII quoted form. Whether the + old driver would have finished such a run was not shown. Passing + `errors="surrogateescape"` is a likely fix; printing such a name into the note would need + checking too. Worth fixing with the crash below. + +- **Older defect, worth its own bug.** A refused attempt that keeps its tree and has a + changed file with a non-ASCII name stops the driver with `CalledProcessError`: + `git_diff_names` returns git's quoted form and `git add -N` rejects it (probe R4). The + fourth close saw the pre-feature `loop.py` do the same. R4 reproduced in the sixth close. No + close has filed an issue for it, and with no open follow-up entry the driver will file none. + +- **One sentence in `docs/methodology.md` is too strong.** It says "What is refused does not + change, only when." Probe case Q is an attempt that passes with the key `false` and is + refused with the default, because a gate writes the declared file. `PLAN.md` decision 6, + `verification.yml.example` and a changelog fragment describe the opt-out for this; that + paragraph of the methodology does not say when to set it. `PLAN.md` has the same sentence. +- **The side-effect list is incomplete.** `GATE-01.md` and `docs/methodology.md` name the + smoke-import and closing-deliverable refusals as ones that used to reset the tree. The + probe also saw the old order remove the attempt's file after a rejected squash commit, the + blocked-verdict check and a failed gate. The new behaviour follows clause 4 in each case. +- The rule's words "every check that runs after the agent session" mean, as `GATE-01.md` + goes on to say, the gates and later guards. A zero-token session and a `blocked` RESULT + are still decided first, in both orders (cases N and O). + +## What the loop did NOT verify + +- **A real project whose gates write a declared deliverable.** The opt-out is tested only + with stubs, probe case Q included. With the default, such a unit is refused early on every + attempt. +- **Real refused attempts on the new build.** T01 to T04 ran on a build pinned before the + change (`bd7e508`). Later pins exist and the closes were dispatched after them, but every + `attempt_outcome` in `events.jsonl` before this close is `passed`. No real early refusal + has happened, so no real saving in gate time is measured. +- The probes stubbed the agent session, `verify`, and (for H and P) the squash rejection. +- Every early-against-late probe case, the sixth close's path-list matrix, its crash and + non-UTF-8 probes, and the other observations listed as not run again. +- A non-UTF-8 name on a real filesystem, and any run on Linux. +- Submodules and nested repositories (the one nested probe crashed in `git add -A`), changes + to an empty directory, `core.filemode=false`, and special files such as a named pipe. +- That cases A to Q are the whole list of overtaken checks. The list comes from reading + `execute_unit_attempt()` and the post-squash guards in `run()`. The general rule does not + depend on the list being complete; the claim that it holds rests on the early check running + before all of them. +- `learnings_not_staged` and the judge run after the three deliverable guards in the late + order too. This is read from the code, not probed. +- A full pre-feature tree: only the old `loop.py` was substituted. +- Whether the pending-diff computation matches the squash diff for renames, submodules or + ignored files. +- The content of the pre-existing test edits was not compared again by this close. +- `specfuse lint` as the installed command. The installed build differs from this tree, so + the repository scripts were used. diff --git a/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-01-produces-before-verify.md b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-01-produces-before-verify.md new file mode 100644 index 00000000..d30644d8 --- /dev/null +++ b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-01-produces-before-verify.md @@ -0,0 +1,66 @@ +--- +id: FEAT-LOOP-2026-0251/T01 +type: implementation +status: done +attempts: 1 +oracle_env: macos_local +planned_cost_usd: 2.00 +produces: + - specfuse/loop/loop.py + - tests/test_fail_fast_deliverables.py +produces_driver_helper: + - execute_unit_attempt +model: sonnet +effort: medium +gate_set: code +driver_version: 0.33.2 +started_at: 2026-11-25T23:21:07.458266+00:00 +duration_seconds: 365.44 +cost_usd: 0.875979 +input_tokens: 26 +output_tokens: 19488 +--- + +# T01 — walking skeleton: refuse `produces_not_in_diff` before `verify()` + +**Objective.** Make the gate's `feature_oracle` runnable and turn Definition-of-done clause 1 +green. This is the tracer bullet: stubs are allowed here only. + +**Context.** `FEAT-LOOP-2026-0251/T01`; decisions 4 and 5 in `PLAN.md`. + +- Today the produces-in-diff decision (`prod_ok` / `_prod_remaining`, with its + `produces_unchanged:` and `produces_amended:` handling) runs in `run()` after + `execute_unit_attempt()` returns a passing verify. Lift that decision into one helper and + call it after the agent session and before `verify_fn` in `execute_unit_attempt()`. A + refusal there returns without calling `verify_fn`, and the attempt ends + `produces_not_in_diff` with the same failure class, signature and summary as today. +- The late call site keeps working through the same helper (it still guards the + `fail_fast_deliverables: false` path T02 adds), so the condition exists once. +- The early refusal's tree handling goes through `_resolve_guard_refusal_tree`, as the late one + does. Where its note would say verification passed, it must say verification did not run. + +Create `tests/test_fail_fast_deliverables.py`, one class per Definition-of-done clause in +`GATE-01.md`: `TestProducesNotInDiffEarly`, `TestPresenceEarly`, `TestOptOut`, +`TestTreeAndNote`, `TestArmTimeWarning`. Implement clause 1; skip the rest naming T02, T03, T04. + +**Acceptance criteria.** + +1. `tests.test_fail_fast_deliverables.TestProducesNotInDiffEarly` fails on HEAD and passes + after. With a stubbed session leaving a declared `produces:` path untouched and no + justification, the attempt ends `produces_not_in_diff`, `verify_fn`'s call counter is 0, the + attempt's `verify_seconds` is 0 and no `gate_result` event is emitted. The same unit with the + path changed calls `verify_fn` once and passes. +2. The early refusal's `failure_class`, `failure_signature` and `summary` equal what the late + refusal records for the same input (asserted in the class). +3. `python3 -m unittest tests.test_dispatch_skeleton tests.test_gate_timings -b` passes; any + existing test that asserted verify runs before this guard is updated and listed in the + RESULT's notes. + +**Do not touch.** The `deliverable_missing` and `no_deliverable_files` sites and +`verification.yml.example` (T02). Retry-note wording beyond "verification did not run" (T03). +`lint_plan.py` and docs (T04). + +**Verification.** The narrow tier for `implementation`, plus AC3's command. + +**Escalation triggers.** If the diff the late guard reads (the squash) cannot be reproduced +before `verify()` without committing, block with the evidence rather than committing early. diff --git a/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-02-presence-and-opt-out.md b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-02-presence-and-opt-out.md new file mode 100644 index 00000000..57c2a2bd --- /dev/null +++ b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-02-presence-and-opt-out.md @@ -0,0 +1,57 @@ +--- +id: FEAT-LOOP-2026-0251/T02 +type: implementation +status: done +attempts: 1 +oracle_env: macos_local +planned_cost_usd: 1.50 +produces: + - specfuse/loop/loop.py + - .specfuse/verification.yml.example + - specfuse/loop/data/verification.yml.example + - tests/test_fail_fast_deliverables.py +produces_driver_helper: + - execute_unit_attempt +model: sonnet +effort: medium +gate_set: code +driver_version: 0.33.2 +started_at: 2026-11-25T23:27:13.111963+00:00 +duration_seconds: 319.321 +cost_usd: 0.771194 +input_tokens: 40 +output_tokens: 19169 +--- + +# T02 — presence refusals early, and the `fail_fast_deliverables` opt-out + +**Objective.** Turn Definition-of-done clauses 2 and 3 green. + +**Context.** `FEAT-LOOP-2026-0251/T02`; decisions 4 and 6 in `PLAN.md`. + +- Route `deliverable_missing` and `no_deliverable_files` through the same pre-`verify_fn` step + T01 added, each through one helper shared with its late call site. +- Add `resolve_fail_fast_deliverables(verification_cfg)` beside + `resolve_retain_on_guard_refusal`, reading `defaults.fail_fast_deliverables`, default `True`. + `False` skips the early step, so all three refusals run after `verify_fn` exactly as before + this feature. +- Document the key in `.specfuse/verification.yml.example` next to `retain_on_guard_refusal`, + then run `scripts/sync-scaffold.sh` so the packaged copy matches. + +**Acceptance criteria.** + +1. `tests.test_fail_fast_deliverables.TestPresenceEarly` fails on HEAD and passes after: an + absent or empty declared path ends `deliverable_missing`, and a diff naming only the unit + file and events ends `no_deliverable_files`, each with `verify_fn` called 0 times. +2. `TestOptOut` fails on HEAD and passes after: with `fail_fast_deliverables: false`, each of + the three cases calls `verify_fn` once before refusing, with the same outcome and failure + class as the default path. +3. `diff .specfuse/verification.yml.example specfuse/loop/data/verification.yml.example` is + empty. + +**Do not touch.** Retry-note path lists (T03). `lint_plan.py` and docs (T04). + +**Verification.** The narrow tier for `implementation`. + +**Escalation triggers.** If `no_deliverable_files` depends on state only the squash commit +creates, block with the evidence. diff --git a/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-03-retry-note-paths.md b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-03-retry-note-paths.md new file mode 100644 index 00000000..31fdd04e --- /dev/null +++ b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-03-retry-note-paths.md @@ -0,0 +1,49 @@ +--- +id: FEAT-LOOP-2026-0251/T03 +type: implementation +status: done +attempts: 1 +oracle_env: macos_local +planned_cost_usd: 1.00 +produces: + - specfuse/loop/loop.py + - tests/test_fail_fast_deliverables.py +model: sonnet +effort: medium +gate_set: code +driver_version: 0.33.2 +started_at: 2026-11-25T23:32:32.585980+00:00 +duration_seconds: 135.836 +cost_usd: 0.55332 +input_tokens: 32 +output_tokens: 10935 +--- + +# T03 — the retry note lists the paths the attempt did change + +**Objective.** Turn Definition-of-done clause 4 green. + +**Context.** `FEAT-LOOP-2026-0251/T03`; decisions 1 and 5 in `PLAN.md`. The note already names +the missing path and shows `PRODUCES_REPAIR_EXAMPLE`; keep both. + +- For all three refusals, early or late, the retry note gains a line listing the paths this + attempt changed, from the same diff the guard judged, or "this attempt changed no files". + Cap the list (for example, the first 20 paths and a count of the rest) so a large diff + cannot flood the note. +- The early refusal's note says verification did not run, under both tree outcomes + (`retain_on_guard_refusal` true and false). + +**Acceptance criteria.** + +1. `tests.test_fail_fast_deliverables.TestTreeAndNote` fails on HEAD and passes after. It + asserts, for an early `produces_not_in_diff` refusal: the note names the missing path, lists + each changed path, and says verification did not run; with `retain_on_guard_refusal: true` + the tree is kept and with `false` it is reset; an attempt that changed nothing says so. +2. The cap holds: a diff of 30 paths lists 20 and the count of the remaining 10. + +**Do not touch.** The order of the early and late checks (T01, T02). `lint_plan.py` and docs +(T04). + +**Verification.** The narrow tier for `implementation`. + +**Escalation triggers.** None expected. diff --git a/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-04-arm-time-lint-and-docs.md b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-04-arm-time-lint-and-docs.md new file mode 100644 index 00000000..5eb11874 --- /dev/null +++ b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-04-arm-time-lint-and-docs.md @@ -0,0 +1,60 @@ +--- +id: FEAT-LOOP-2026-0251/T04 +type: implementation +status: done +attempts: 1 +oracle_env: macos_local +planned_cost_usd: 1.50 +produces: + - specfuse/loop/lint_plan.py + - docs/methodology.md + - specfuse/loop/data/docs/methodology.md + - tests/test_fail_fast_deliverables.py +model: sonnet +effort: medium +gate_set: code +driver_version: 0.33.2 +started_at: 2026-11-25T23:34:48.608747+00:00 +duration_seconds: 228.013 +cost_usd: 0.474428 +input_tokens: 34 +output_tokens: 12969 +--- + +# T04 — arm-time warning for an unmentioned `produces:` path, and docs + +**Objective.** Turn Definition-of-done clause 5 green and document the new order. + +**Context.** `FEAT-LOOP-2026-0251/T04`; decisions 6 and 7 in `PLAN.md`. Sits beside +`check_produces_satisfiability`, `check_produces_shape` and `check_produces_boundary` in +`lint_plan.py`. + +- Add a WARN check: for each dispatchable unit (not `done`, not `abandoned`), every `produces:` + path must appear in the unit's body by full path or by file name. The message names the unit, + the path, and the post-attempt refusal it pre-empts (`produces_not_in_diff`). +- Measure it on this repository before reporting: count the `done` units across + `.specfuse/features/` whose `produces:` would fire if they were dispatchable, and put the + count and the total in the RESULT's notes. If it exceeds 10% of `done` units with `produces:`, + narrow the match (for example, accept the path's parent directory) and re-measure. +- `docs/methodology.md`: in the outcome table and the guard paragraph that mentions + `retain_on_guard_refusal`, say the three refusals now run before verification unless + `defaults.fail_fast_deliverables` is `false`, and that the retry note lists the changed + paths. Then run `scripts/sync-scaffold.sh`. + +**Acceptance criteria.** + +1. `tests.test_fail_fast_deliverables.TestArmTimeWarning` fails on HEAD and passes after: a + `pending` unit whose `produces:` path its body never names gets the WARN; the same unit + naming the file name gets none; a `done` unit gets none. +2. `specfuse lint` exits 0 on every feature folder under `.specfuse/features/` (WARN only). +3. The RESULT's notes give the measured count and total from the Context bullet. +4. `diff docs/methodology.md specfuse/loop/data/docs/methodology.md` is empty. +5. `grep -c "unittest.skip" tests/test_fail_fast_deliverables.py` prints `0`. + +**Do not touch.** The driver module and its guard sites (T01–T03). + +**Verification.** The narrow tier for `implementation`, plus +`python3 -m unittest tests.test_lint_plan -b`. + +**Escalation triggers.** If no narrowing brings the measured rate to 10% or below, block with +the measurements instead of shipping a noisy warning. diff --git a/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-90-gate-1-close.md b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-90-gate-1-close.md new file mode 100644 index 00000000..603b8b99 --- /dev/null +++ b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-90-gate-1-close.md @@ -0,0 +1,159 @@ +--- +id: FEAT-LOOP-2026-0251/G1-CLOSE +type: close +status: done +attempts: 1 +oracle_env: macos_local +planned_cost_usd: 5.00 +verdict: met +auto_close_disabled: true +model: sonnet +effort: high +judge_edit_acknowledged: + paths: + - .specfuse/verification.yml.example + - produces_driver_helper + - specfuse/loop/data/verification.yml.example + - specfuse/loop/lint_plan.py + - specfuse/loop/loop.py + reason: "Review fixes tested, full suite green, accept the generator risk" +re_arm_count: 7 +re_arm_history: + - + timestamp: 2026-11-26T13:30:05+00:00 + prior_status: blocked_human + prior_attempts: 0 + prior_cost_usd: 0.0 + prior_duration_seconds: 0.0 + reason: "Review fixes tested, full suite green, accept the generator risk" + - + timestamp: 2026-11-26T13:50:58+00:00 + prior_status: done + prior_attempts: 1 + prior_cost_usd: 1.69295 + prior_duration_seconds: 291.43 + reason: "A for both, go ahead" + - + timestamp: 2026-11-26T15:22:22+00:00 + prior_status: done + prior_attempts: 1 + prior_cost_usd: 1.489002 + prior_duration_seconds: 259.427 + reason: "1, go ahead" + - + timestamp: 2026-11-26T16:08:13+00:00 + prior_status: done + prior_attempts: 1 + prior_cost_usd: 1.733084 + prior_duration_seconds: 379.569 + reason: "Trying to fix the last issue" + - + timestamp: 2026-11-26T16:44:22+00:00 + prior_status: done + prior_attempts: 1 + prior_cost_usd: 1.435437 + prior_duration_seconds: 478.949 + reason: "Fixed the deleted-file edge case, re-close it" + - + timestamp: 2026-11-26T17:35:20+00:00 + prior_status: done + prior_attempts: 1 + prior_cost_usd: 1.347591 + prior_duration_seconds: 616.642 + reason: "Fixed renames, modes and non-ASCII names, re-close it" + - + timestamp: 2026-11-26T21:34:17+00:00 + prior_status: done + prior_attempts: 1 + prior_cost_usd: 1.657563 + prior_duration_seconds: 747.309 + reason: "Amend both as recommended, fixed bookkeeping paths, re-close it" +cumulative_cost_usd: 9.355627 +cumulative_duration_seconds: 2773.326 +cumulative_input_tokens: 344 +cumulative_output_tokens: 223290 +cumulative_attempts: 6 +cost_usd: 0.975064 +duration_seconds: 415.272 +input_tokens: 42 +output_tokens: 25318 +folded_through_re_arm: 7 +gate_set: plannext +driver_version: 0.33.2 +started_at: 2026-11-26T21:46:35.862369+00:00 +--- + +# G1-CLOSE — terminal close + +**Context.** The feature's only gate: the three diff-only deliverable refusals run before +verification (with an opt-out), their retry note lists the changed paths, and `specfuse lint` +warns on a `produces:` path its unit never mentions. + +**Acceptance criteria.** + +1. `RETROSPECTIVE.md` records, per Definition-of-done clause in `GATE-01.md`, what was proven + and by which test, and that no `unittest.skip` survives in + `tests/test_fail_fast_deliverables.py`. It lists every pre-existing test that was changed + (clause 6, as widened for #3609), with why. +2. Each consumer-visible change (the new order, `defaults.fail_fast_deliverables`, the retry + note's path list, the lint WARN) is written with + `python3 -m specfuse.loop.changelog_fragments add`, tracing to `FEAT-LOOP-2026-0251`. +3. A `## Cost analysis` reconciles every unit against `planned_cost_usd` and `events.jsonl`, and + reports T04's measured warning rate. +4. "What the loop did NOT verify" names, at minimum: a real project whose gates write a declared + deliverable (the opt-out is tested only with stubs), and real refused attempts on the new + build (every attempt in this feature ran on a build pinned before the change). +5. `specfuse lint --closing` exits 0 before this unit reports `complete`. + +**Do not touch.** Source files under `specfuse/` and `scripts/`. Permitted closing surfaces: +`RETROSPECTIVE.md`, `LEARNINGS-pending.md`, `changelog.d/`, `.specfuse/roadmap.md`. + +**Verification.** `specfuse lint --closing`, plus the gate set in `.specfuse/verification.yml`. + +**Escalation triggers.** A surviving skip, or an early refusal whose outcome or failure class +differs from the late one for the same input, other than the precedence `GATE-01.md` states +under "Precedence when two refusals apply" (a deliverable refusal outranks every check that +runs after the agent session, #3608 and #3610): record `not_met` with a follow-up. + +**Re-close note (2026-11-26).** The first close recorded `not_met` on #3608 and #3609; the +operator chose to amend the definition of done for both (see `GATE-01.md` clause 6 and +"Precedence when two refusals apply"). That close already wrote `RETROSPECTIVE.md`, +`FOLLOW-UPS.md`, `LEARNINGS-pending.md` and changelog fragments: update them in place, do not +duplicate fragments, and say in `FOLLOW-UPS.md` whether each entry's re-run condition now holds. + +**Second re-close note (2026-11-26).** The second close recorded `not_met` on #3610 (cases D to +G: the deliverable refusal also outranks the smoke-import, blocked-verdict and +closing-deliverable checks). The operator chose to state one general precedence rule; it is in +`GATE-01.md`, in the escalation trigger above and in `docs/methodology.md`, together with the +kept-tree side effect. Update `RETROSPECTIVE.md`, `FOLLOW-UPS.md` and the other closing files in +place as before, and say in `FOLLOW-UPS.md` whether #3610's re-run condition now holds. + +**Third re-close note (2026-11-26).** The third close's judge recorded `not_met` on #3612: with +the tree kept, a later attempt's retry note listed the earlier attempt's kept edits as its own +(clause 4). Fixed on the branch (`snapshot_dirty_tree`, `attempt_own_paths` in `loop.py`; tests +in `TestTreeAndNote`; see `PLAN.md` Notes). Update the closing files in place as before, and say +in `FOLLOW-UPS.md` whether #3612's re-run condition now holds. + +**Fourth re-close note (2026-11-26).** The fourth close recorded `not_met` on #3613: a kept file +the attempt deleted or reverted was missing from its retry note. Fixed on the branch +(`attempt_own_paths` in `loop.py`; tests in `TestTreeAndNote`; see `PLAN.md` Notes). Update the +closing files in place as before, and say in `FOLLOW-UPS.md` whether #3613's re-run condition +now holds. + +**Fifth re-close note (2026-11-26).** The fifth close recorded `not_met` on #3614: the retry +note's path list missed renames, mode-only changes and non-ASCII names. Fixed on the branch by +comparing each path's state at the start and end of the attempt (`snapshot_dirty_tree`, +`attempt_own_paths` in `loop.py`; tests in `TestTreeAndNote`; see `PLAN.md` Notes). The +`git add -N` crash on a new non-ASCII file predates this feature and is outside clause 4. Update +the closing files in place as before, and say in `FOLLOW-UPS.md` whether #3614's re-run +condition now holds. + +**Sixth re-close note (2026-11-26).** The sixth close recorded `not_met` on #3617, #3618 and +#3619. #3618 (the retry note dropped an agent's own `docs/events.jsonl` or `docs/PROGRESS.md` +because it matched driver bookkeeping by base name) is fixed on the branch: it now matches the +unit file, `events.jsonl` and `PROGRESS.md` by full path in the unit's feature folder (tests in +`TestTreeAndNote`; see `PLAN.md` Notes). For #3617 and #3619 the operator amended `GATE-01.md` +clause 5: the warning stays silent when the body names the path's parent directory (narrowed +under `PLAN.md` decision 7), and T04's measurement is recorded there with its evidence. Update +the closing files in place as before, and say in `FOLLOW-UPS.md` whether each of #3617, #3618 +and #3619's re-run conditions now holds. diff --git a/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/events.jsonl b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/events.jsonl new file mode 100644 index 00000000..d6f1f1e8 --- /dev/null +++ b/.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/events.jsonl @@ -0,0 +1,320 @@ +{"timestamp": "2026-11-25T23:21:07.164784+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "driver_build_pinned", "source": "driver", "source_version": "0.33.2", "payload": {"tree": "bd7e508193941835916c63053cc2ec0293e35acc", "path": "/private/var/folders/zc/rgq11x850d78dx_kf1fd4vx80000gn/T/specfuse-pins/bd7e508193941835916c63053cc2ec0293e35acc/specfuse/loop"}} +{"timestamp": "2026-11-25T23:21:07.458481+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T01", "event_type": "task_started", "source": "driver", "source_version": "0.33.2", "payload": {"type": "implementation", "model": "sonnet", "re_arm_count": 0}} +{"timestamp": "2026-11-25T23:27:12.901760+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T01", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "tests", "ok": true, "skipped": false, "duration_seconds": 2.015, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:27:12.901785+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T01", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "lint", "ok": true, "skipped": false, "duration_seconds": 0.017, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:27:12.901788+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T01", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "changelog-fragments", "ok": true, "skipped": false, "duration_seconds": 0.05, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:27:12.901789+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T01", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "agent-policy-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.109, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:27:12.901792+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T01", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "event-type-gate", "ok": true, "skipped": false, "duration_seconds": 0.159, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:27:12.901793+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T01", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "roadmap-link-gate", "ok": true, "skipped": false, "duration_seconds": 0.055, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:27:12.901795+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T01", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "arm-sweep-gate", "ok": true, "skipped": false, "duration_seconds": 0.388, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:27:12.901796+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T01", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "monitoring-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.046, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:27:12.901798+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T01", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "feature_oracle", "ok": true, "skipped": false, "duration_seconds": 1.895, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:27:13.019786+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T01", "event_type": "attempt_outcome", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "outcome": "passed", "duration_seconds": 365.44, "agent_seconds": 360.6176762500545, "verify_seconds": 4.786691167042591, "cost_usd": 0.8759794, "input_tokens": 26, "output_tokens": 19488, "cache_read_input_tokens": 1166154, "cache_creation_input_tokens": 141108, "model": "sonnet", "effort": "medium", "failure_class": null, "failure_signature": null, "failure_excerpt": null, "files_touched": [".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-01-produces-before-verify.md", "specfuse/loop/loop.py", "tests/test_fail_fast_deliverables.py", "tests/test_files_changed_auto_repair.py"], "agent_status": "complete", "agent_blocked_reason": null, "re_arm_count": 0, "failing_tests": []}} +{"timestamp": "2026-11-25T23:27:13.019947+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T01", "event_type": "task_completed", "source": "driver", "source_version": "0.33.2", "payload": {"attempts": 1, "attempts_usage": [{"attempt": 1, "duration_seconds": 365.44, "cost_usd": 0.8759794, "input_tokens": 26, "output_tokens": 19488, "cache_read_input_tokens": 1166154, "cache_creation_input_tokens": 141108, "agent_seconds": 360.6176762500545, "verify_seconds": 4.786691167042591}], "type": "implementation", "re_arm_count": 0, "cost_usd": 0.875979, "cumulative_cost_usd": 0.875979, "attempts_lifetime": 1, "planned_cost_usd": 2.0}} +{"timestamp": "2026-11-25T23:27:13.026375+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "driver_staleness_detected", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "wu_id": "FEAT-LOOP-2026-0251/T01", "driver_paths": ["specfuse/loop/loop.py"], "halted": false, "reason": "driver_restart_required", "pinned_tree": "bd7e508193941835916c63053cc2ec0293e35acc", "next_pin_tree": "95e978bf461a377cb81a6a5d648852cbc50d6b45"}} +{"timestamp": "2026-11-25T23:27:13.112169+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T02", "event_type": "task_started", "source": "driver", "source_version": "0.33.2", "payload": {"type": "implementation", "model": "sonnet", "re_arm_count": 0}} +{"timestamp": "2026-11-25T23:32:32.402772+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T02", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "tests", "ok": true, "skipped": false, "duration_seconds": 5.409, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:32:32.402788+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T02", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "lint", "ok": true, "skipped": false, "duration_seconds": 0.016, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:32:32.402790+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T02", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "changelog-fragments", "ok": true, "skipped": false, "duration_seconds": 0.048, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:32:32.402791+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T02", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "agent-policy-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.106, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:32:32.402794+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T02", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "event-type-gate", "ok": true, "skipped": false, "duration_seconds": 0.143, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:32:32.402796+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T02", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "roadmap-link-gate", "ok": true, "skipped": false, "duration_seconds": 0.051, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:32:32.402797+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T02", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "arm-sweep-gate", "ok": true, "skipped": false, "duration_seconds": 0.386, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:32:32.402799+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T02", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "monitoring-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.045, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:32:32.402801+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T02", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "feature_oracle", "ok": true, "skipped": false, "duration_seconds": 5.388, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:32:32.525060+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T02", "event_type": "attempt_outcome", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "outcome": "passed", "duration_seconds": 319.321, "agent_seconds": 307.57132304203697, "verify_seconds": 11.663945541949943, "cost_usd": 0.7711942999999999, "input_tokens": 40, "output_tokens": 19169, "cache_read_input_tokens": 1599923, "cache_creation_input_tokens": 104858, "model": "sonnet", "effort": "medium", "failure_class": null, "failure_signature": null, "failure_excerpt": null, "files_touched": [".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-02-presence-and-opt-out.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/events.jsonl", ".specfuse/verification.yml.example", "specfuse/loop/data/verification.yml.example", "specfuse/loop/loop.py", "tests/test_arm_wiring.py", "tests/test_deterministic_refusal_repeat.py", "tests/test_fail_fast_deliverables.py", "tests/test_guard_repair_e2e.py", "tests/test_loop_files_changed_guard.py", "tests/test_replan_end_to_end.py", "tests/test_replan_event_emission.py", "tests/test_replan_note_collision.py", "tests/test_replan_trigger.py"], "agent_status": "complete", "agent_blocked_reason": null, "re_arm_count": 0, "failing_tests": []}} +{"timestamp": "2026-11-25T23:32:32.525227+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T02", "event_type": "task_completed", "source": "driver", "source_version": "0.33.2", "payload": {"attempts": 1, "attempts_usage": [{"attempt": 1, "duration_seconds": 319.321, "cost_usd": 0.7711942999999999, "input_tokens": 40, "output_tokens": 19169, "cache_read_input_tokens": 1599923, "cache_creation_input_tokens": 104858, "agent_seconds": 307.57132304203697, "verify_seconds": 11.663945541949943}], "type": "implementation", "re_arm_count": 0, "cost_usd": 0.771194, "cumulative_cost_usd": 0.771194, "attempts_lifetime": 1, "planned_cost_usd": 1.5}} +{"timestamp": "2026-11-25T23:32:32.532219+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "driver_staleness_detected", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "wu_id": "FEAT-LOOP-2026-0251/T02", "driver_paths": ["specfuse/loop/loop.py"], "halted": false, "reason": "driver_restart_required", "pinned_tree": "bd7e508193941835916c63053cc2ec0293e35acc", "next_pin_tree": "d1b228b61649ec8083cf4d9f8dacabeb2334aa0f"}} +{"timestamp": "2026-11-25T23:32:32.586154+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T03", "event_type": "task_started", "source": "driver", "source_version": "0.33.2", "payload": {"type": "implementation", "model": "sonnet", "re_arm_count": 0}} +{"timestamp": "2026-11-25T23:34:48.422437+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T03", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "tests", "ok": true, "skipped": false, "duration_seconds": 10.542, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:34:48.422452+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T03", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "lint", "ok": true, "skipped": false, "duration_seconds": 0.017, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:34:48.422455+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T03", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "changelog-fragments", "ok": true, "skipped": false, "duration_seconds": 0.049, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:34:48.422458+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T03", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "agent-policy-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.105, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:34:48.422460+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T03", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "event-type-gate", "ok": true, "skipped": false, "duration_seconds": 0.146, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:34:48.422462+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T03", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "roadmap-link-gate", "ok": true, "skipped": false, "duration_seconds": 0.05, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:34:48.422464+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T03", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "arm-sweep-gate", "ok": true, "skipped": false, "duration_seconds": 0.384, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:34:48.422465+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T03", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "monitoring-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.05, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:34:48.422467+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T03", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "feature_oracle", "ok": true, "skipped": false, "duration_seconds": 10.271, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:34:48.546625+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T03", "event_type": "attempt_outcome", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "outcome": "passed", "duration_seconds": 135.836, "agent_seconds": 114.14820829196833, "verify_seconds": 21.66602841706481, "cost_usd": 0.5533203999999999, "input_tokens": 32, "output_tokens": 10935, "cache_read_input_tokens": 1133504, "cache_creation_input_tokens": 82639, "model": "sonnet", "effort": "medium", "failure_class": null, "failure_signature": null, "failure_excerpt": null, "files_touched": [".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-03-retry-note-paths.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/events.jsonl", "specfuse/loop/loop.py", "tests/test_fail_fast_deliverables.py"], "agent_status": "complete", "agent_blocked_reason": null, "re_arm_count": 0, "failing_tests": []}} +{"timestamp": "2026-11-25T23:34:48.546793+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T03", "event_type": "task_completed", "source": "driver", "source_version": "0.33.2", "payload": {"attempts": 1, "attempts_usage": [{"attempt": 1, "duration_seconds": 135.836, "cost_usd": 0.5533203999999999, "input_tokens": 32, "output_tokens": 10935, "cache_read_input_tokens": 1133504, "cache_creation_input_tokens": 82639, "agent_seconds": 114.14820829196833, "verify_seconds": 21.66602841706481}], "type": "implementation", "re_arm_count": 0, "cost_usd": 0.55332, "cumulative_cost_usd": 0.55332, "attempts_lifetime": 1, "planned_cost_usd": 1.0}} +{"timestamp": "2026-11-25T23:34:48.553880+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "driver_staleness_detected", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "wu_id": "FEAT-LOOP-2026-0251/T03", "driver_paths": ["specfuse/loop/loop.py"], "halted": false, "reason": "driver_restart_required", "pinned_tree": "bd7e508193941835916c63053cc2ec0293e35acc", "next_pin_tree": "eabc9c7d809a47e5af3be10b4bc1068ef01cca52"}} +{"timestamp": "2026-11-25T23:34:48.608940+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T04", "event_type": "task_started", "source": "driver", "source_version": "0.33.2", "payload": {"type": "implementation", "model": "sonnet", "re_arm_count": 0}} +{"timestamp": "2026-11-25T23:38:36.621867+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T04", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "tests", "ok": true, "skipped": false, "duration_seconds": 10.235, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:38:36.621884+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T04", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "lint", "ok": true, "skipped": false, "duration_seconds": 0.016, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:38:36.621887+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T04", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "changelog-fragments", "ok": true, "skipped": false, "duration_seconds": 0.049, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:38:36.621890+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T04", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "agent-policy-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.109, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:38:36.621892+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T04", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "event-type-gate", "ok": true, "skipped": false, "duration_seconds": 0.171, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:38:36.621893+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T04", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "roadmap-link-gate", "ok": true, "skipped": false, "duration_seconds": 0.052, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:38:36.621895+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T04", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "arm-sweep-gate", "ok": true, "skipped": false, "duration_seconds": 0.384, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:38:36.621896+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T04", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "monitoring-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.047, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:38:36.621898+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T04", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "feature_oracle", "ok": true, "skipped": false, "duration_seconds": 10.447, "phase": "attempt"}} +{"timestamp": "2026-11-25T23:38:36.733953+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T04", "event_type": "attempt_outcome", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "outcome": "passed", "duration_seconds": 228.013, "agent_seconds": 206.41850266698748, "verify_seconds": 21.561221707961522, "cost_usd": 0.47442840000000003, "input_tokens": 34, "output_tokens": 12969, "cache_read_input_tokens": 1045464, "cache_creation_input_tokens": 60031, "model": "sonnet", "effort": "medium", "failure_class": null, "failure_signature": null, "failure_excerpt": null, "files_touched": [".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-04-arm-time-lint-and-docs.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/events.jsonl", "docs/methodology.md", "specfuse/loop/data/docs/methodology.md", "specfuse/loop/lint_plan.py", "tests/test_fail_fast_deliverables.py"], "agent_status": "complete", "agent_blocked_reason": null, "re_arm_count": 0, "failing_tests": []}} +{"timestamp": "2026-11-25T23:38:36.734113+00:00", "correlation_id": "FEAT-LOOP-2026-0251/T04", "event_type": "task_completed", "source": "driver", "source_version": "0.33.2", "payload": {"attempts": 1, "attempts_usage": [{"attempt": 1, "duration_seconds": 228.013, "cost_usd": 0.47442840000000003, "input_tokens": 34, "output_tokens": 12969, "cache_read_input_tokens": 1045464, "cache_creation_input_tokens": 60031, "agent_seconds": 206.41850266698748, "verify_seconds": 21.561221707961522}], "type": "implementation", "re_arm_count": 0, "cost_usd": 0.474428, "cumulative_cost_usd": 0.474428, "attempts_lifetime": 1, "planned_cost_usd": 1.5}} +{"timestamp": "2026-11-25T23:38:36.742148+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "driver_staleness_detected", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "wu_id": "FEAT-LOOP-2026-0251/T04", "driver_paths": ["specfuse/loop/lint_plan.py"], "halted": false, "reason": "driver_restart_required", "pinned_tree": "bd7e508193941835916c63053cc2ec0293e35acc", "next_pin_tree": "08c93348147dd5bb8705262aa0073adba4cbbb29"}} +{"timestamp": "2026-11-25T23:44:20.150756+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "broad_run_result", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "tree": "07bbf72d1e7af3c1a03af605f40e5563dc3a18db:0ec7c6da6e74f0b56753f09657b654a6d289b91b:12064a6191eeb830a9826d911a8543fbaba3da75:27968248a450a842ccd187b7dce0fb0ded934866:287efde8f90320baffac08f5f3287b9456a65cb9:2e29b2f7e073a0cbe290f01d3b397e1cdd10c81c:35c75a1cedaa1c6f5d86de48a37ee0ed7f5a40c7:42796ea0e0a6c03811b0e4bc9dbd3b5ee62dd2e4:4acc6dfc5e8cece358c167d876515eba4a39a500:834d9d9c16094a386cd9b5a6f9ced9a3a9b4e7fb:a094f79b3e937804a653ff632027c895c6aa1c4b:bbd1aea514612d76722a18c7aece7c767cf1a076:c23b62e87f1ae3890c6f9e3d8c7ca7ec9225ed81:caffe2d63ceacde448842a91bc7a12c206a67523:d74b7d113b844e84f0009098f576fd28477f072d:e1aa20b9c08a5ebe036da74f16e28c751f18f6fa:e3b0de29b81a6c8e0abeacb3898519b98014b9ef:f7cc7e015d02e9c4c7c56b31e4f2f910d044d732:fa2f4f88657587b6e3b560977858810846b1d366", "ok": false, "failing": [{"gate": "tests", "failure_class": "tests", "failure_signature": "(failures=2,"}, {"gate": "coverage", "failure_class": "other", "failure_signature": "no_gate_marker"}]}} +{"timestamp": "2026-11-25T23:44:20.150783+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "tests", "ok": false, "skipped": false, "duration_seconds": 306.85, "phase": "broad"}} +{"timestamp": "2026-11-25T23:44:20.150789+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "lint", "ok": true, "skipped": false, "duration_seconds": 0.051, "phase": "broad"}} +{"timestamp": "2026-11-25T23:44:20.150791+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "security", "ok": true, "skipped": false, "duration_seconds": 1.607, "phase": "broad"}} +{"timestamp": "2026-11-25T23:44:20.150793+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "coverage", "ok": false, "skipped": true, "duration_seconds": 0, "phase": "broad"}} +{"timestamp": "2026-11-25T23:44:20.150796+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "leak-scan", "ok": true, "skipped": false, "duration_seconds": 16.978, "phase": "broad"}} +{"timestamp": "2026-11-25T23:44:20.150798+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "changelog-fragments", "ok": true, "skipped": false, "duration_seconds": 0.048, "phase": "broad"}} +{"timestamp": "2026-11-25T23:44:20.150800+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "agent-policy-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.106, "phase": "broad"}} +{"timestamp": "2026-11-25T23:44:20.150802+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "event-type-gate", "ok": true, "skipped": false, "duration_seconds": 0.146, "phase": "broad"}} +{"timestamp": "2026-11-25T23:44:20.150804+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "roadmap-link-gate", "ok": true, "skipped": false, "duration_seconds": 0.051, "phase": "broad"}} +{"timestamp": "2026-11-25T23:44:20.150805+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "arm-sweep-gate", "ok": true, "skipped": false, "duration_seconds": 0.39, "phase": "broad"}} +{"timestamp": "2026-11-25T23:44:20.150806+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "monitoring-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.049, "phase": "broad"}} +{"timestamp": "2026-11-25T23:44:20.150807+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "leak-scan-hook", "ok": true, "skipped": false, "duration_seconds": 0.847, "phase": "broad"}} +{"timestamp": "2026-11-25T23:44:20.150808+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "pre-push-hook", "ok": true, "skipped": false, "duration_seconds": 3.364, "phase": "broad"}} +{"timestamp": "2026-11-25T23:44:20.150810+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "sync-scaffold-bats", "ok": true, "skipped": false, "duration_seconds": 9.878, "phase": "broad"}} +{"timestamp": "2026-11-25T23:44:20.150811+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "sync-scaffold-symlinks-bats", "ok": true, "skipped": false, "duration_seconds": 1.519, "phase": "broad"}} +{"timestamp": "2026-11-25T23:44:20.150812+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "init-sh-shim-bats", "ok": true, "skipped": false, "duration_seconds": 0.839, "phase": "broad"}} +{"timestamp": "2026-11-25T23:44:20.150813+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "init-skills-bats", "ok": true, "skipped": false, "duration_seconds": 0.118, "phase": "broad"}} +{"timestamp": "2026-11-25T23:44:20.150814+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "hookspath-conflict-bats", "ok": true, "skipped": false, "duration_seconds": 0.536, "phase": "broad"}} +{"timestamp": "2026-11-25T23:44:20.151234+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "human_escalation", "source": "driver", "source_version": "0.33.2", "payload": {"reason": "broad_run_gate_failure", "gate": 1, "failing_gates": [{"gate": "tests", "failure_class": "tests", "failure_signature": "(failures=2,"}, {"gate": "coverage", "failure_class": "other", "failure_signature": "no_gate_marker"}], "message": "Gate 1 is blocked: the full `code` gate set failed on the once-per-gate broad run this gate's closing sequence requires before it may dispatch (FEAT-2026-0109/T06).\n\nTree measured: 07bbf72d1e7af3c1a03af605f40e5563dc3a18db:0ec7c6da6e74f0b56753f09657b654a6d289b91b:12064a6191eeb830a9826d911a8543fbaba3da75:27968248a450a842ccd187b7dce0fb0ded934866:287efde8f90320baffac08f5f3287b9456a65cb9:2e29b2f7e073a0cbe290f01d3b397e1cdd10c81c:35c75a1cedaa1c6f5d86de48a37ee0ed7f5a40c7:42796ea0e0a6c03811b0e4bc9dbd3b5ee62dd2e4:4acc6dfc5e8cece358c167d876515eba4a39a500:834d9d9c16094a386cd9b5a6f9ced9a3a9b4e7fb:a094f79b3e937804a653ff632027c895c6aa1c4b:bbd1aea514612d76722a18c7aece7c767cf1a076:c23b62e87f1ae3890c6f9e3d8c7ca7ec9225ed81:caffe2d63ceacde448842a91bc7a12c206a67523:d74b7d113b844e84f0009098f576fd28477f072d:e1aa20b9c08a5ebe036da74f16e28c751f18f6fa:e3b0de29b81a6c8e0abeacb3898519b98014b9ef:f7cc7e015d02e9c4c7c56b31e4f2f910d044d732:fa2f4f88657587b6e3b560977858810846b1d366\n\nFailing check(s):\n - tests: tests (signature: (failures=2,)\n - coverage: other (signature: no_gate_marker)\n\nNo work unit's attempt count was charged for this: every unit in this gate already passed its own per-attempt verification. The per-attempt narrow tier (FEAT-2026-0109/T04, T05) scopes checks to changed files as a speed optimization \u2014 this full-set run is the safety net that catches what that narrowing missed.\n\nWhat to do next:\n 1. Reproduce the failing check(s) above locally and fix them on this branch.\n 2. Re-run the driver \u2014 the closing sequence dispatches once the broad run is clean at the current tree.", "tree": "07bbf72d1e7af3c1a03af605f40e5563dc3a18db:0ec7c6da6e74f0b56753f09657b654a6d289b91b:12064a6191eeb830a9826d911a8543fbaba3da75:27968248a450a842ccd187b7dce0fb0ded934866:287efde8f90320baffac08f5f3287b9456a65cb9:2e29b2f7e073a0cbe290f01d3b397e1cdd10c81c:35c75a1cedaa1c6f5d86de48a37ee0ed7f5a40c7:42796ea0e0a6c03811b0e4bc9dbd3b5ee62dd2e4:4acc6dfc5e8cece358c167d876515eba4a39a500:834d9d9c16094a386cd9b5a6f9ced9a3a9b4e7fb:a094f79b3e937804a653ff632027c895c6aa1c4b:bbd1aea514612d76722a18c7aece7c767cf1a076:c23b62e87f1ae3890c6f9e3d8c7ca7ec9225ed81:caffe2d63ceacde448842a91bc7a12c206a67523:d74b7d113b844e84f0009098f576fd28477f072d:e1aa20b9c08a5ebe036da74f16e28c751f18f6fa:e3b0de29b81a6c8e0abeacb3898519b98014b9ef:f7cc7e015d02e9c4c7c56b31e4f2f910d044d732:fa2f4f88657587b6e3b560977858810846b1d366"}} +{"timestamp": "2026-11-25T23:44:20.165001+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "arm_predicate_evaluated", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "would_arm": true, "predicate_version": "v1", "classes": {"budget_projection": {"status": "clean", "reason": "projected spend $7.67 within 2.0x baseline planned total $11.00 (cap $22.00)"}, "judge_editing": {"status": "clean", "reason": "no drafted WU touches judge-path surfaces"}, "decision_class_paths": {"status": "clean", "reason": "no drafted WU touches a recognised dependency manifest (pyproject.toml, package.json, pom.xml, build.gradle, build.gradle.kts, Cargo.toml, go.mod, Gemfile, composer.json, requirements*.txt, *.csproj)"}, "retroactive_edits": {"status": "clean", "reason": "no passed-gate baseline WU altered or removed"}, "drift_caps": {"status": "clean", "reason": "added WUs and gates within drift caps"}, "missing_provenance": {"status": "clean", "reason": "no added WUs"}, "open_questions_human_only": {"status": "clean", "reason": "terminal gate: no drafted successor"}, "plan_next_lint": {"status": "clean", "reason": "plan-next lint: no findings"}}}} +{"timestamp": "2026-11-25T23:50:21.876989+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "driver_build_pinned", "source": "driver", "source_version": "0.33.2", "payload": {"tree": "cddc418a1eb5a10d2178a4b9a170e7fe490faa97", "path": "/private/var/folders/zc/rgq11x850d78dx_kf1fd4vx80000gn/T/specfuse-pins/cddc418a1eb5a10d2178a4b9a170e7fe490faa97/specfuse/loop"}} +{"timestamp": "2026-11-25T23:56:19.765279+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "broad_run_result", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "tree": "07bbf72d1e7af3c1a03af605f40e5563dc3a18db:0ec7c6da6e74f0b56753f09657b654a6d289b91b:11d31821bf4e32b3e962bbd52e61b97af3897c63:12064a6191eeb830a9826d911a8543fbaba3da75:27968248a450a842ccd187b7dce0fb0ded934866:287efde8f90320baffac08f5f3287b9456a65cb9:2e29b2f7e073a0cbe290f01d3b397e1cdd10c81c:35c75a1cedaa1c6f5d86de48a37ee0ed7f5a40c7:42796ea0e0a6c03811b0e4bc9dbd3b5ee62dd2e4:4acc6dfc5e8cece358c167d876515eba4a39a500:834d9d9c16094a386cd9b5a6f9ced9a3a9b4e7fb:a094f79b3e937804a653ff632027c895c6aa1c4b:bbd1aea514612d76722a18c7aece7c767cf1a076:c23b62e87f1ae3890c6f9e3d8c7ca7ec9225ed81:caffe2d63ceacde448842a91bc7a12c206a67523:d74b7d113b844e84f0009098f576fd28477f072d:e1aa20b9c08a5ebe036da74f16e28c751f18f6fa:e3b0de29b81a6c8e0abeacb3898519b98014b9ef:fa2f4f88657587b6e3b560977858810846b1d366", "ok": true, "failing": []}} +{"timestamp": "2026-11-25T23:56:19.765302+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "tests", "ok": true, "skipped": false, "duration_seconds": 319.495, "phase": "broad"}} +{"timestamp": "2026-11-25T23:56:19.765306+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "lint", "ok": true, "skipped": false, "duration_seconds": 0.059, "phase": "broad"}} +{"timestamp": "2026-11-25T23:56:19.765308+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "security", "ok": true, "skipped": false, "duration_seconds": 1.56, "phase": "broad"}} +{"timestamp": "2026-11-25T23:56:19.765312+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "coverage", "ok": true, "skipped": false, "duration_seconds": 1.224, "phase": "broad"}} +{"timestamp": "2026-11-25T23:56:19.765314+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "leak-scan", "ok": true, "skipped": false, "duration_seconds": 17.379, "phase": "broad"}} +{"timestamp": "2026-11-25T23:56:19.765316+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "changelog-fragments", "ok": true, "skipped": false, "duration_seconds": 0.07, "phase": "broad"}} +{"timestamp": "2026-11-25T23:56:19.765318+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "agent-policy-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.119, "phase": "broad"}} +{"timestamp": "2026-11-25T23:56:19.765319+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "event-type-gate", "ok": true, "skipped": false, "duration_seconds": 0.162, "phase": "broad"}} +{"timestamp": "2026-11-25T23:56:19.765320+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "roadmap-link-gate", "ok": true, "skipped": false, "duration_seconds": 0.05, "phase": "broad"}} +{"timestamp": "2026-11-25T23:56:19.765321+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "arm-sweep-gate", "ok": true, "skipped": false, "duration_seconds": 0.388, "phase": "broad"}} +{"timestamp": "2026-11-25T23:56:19.765323+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "monitoring-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.049, "phase": "broad"}} +{"timestamp": "2026-11-25T23:56:19.765325+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "leak-scan-hook", "ok": true, "skipped": false, "duration_seconds": 0.835, "phase": "broad"}} +{"timestamp": "2026-11-25T23:56:19.765326+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "pre-push-hook", "ok": true, "skipped": false, "duration_seconds": 3.613, "phase": "broad"}} +{"timestamp": "2026-11-25T23:56:19.765329+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "sync-scaffold-bats", "ok": true, "skipped": false, "duration_seconds": 9.959, "phase": "broad"}} +{"timestamp": "2026-11-25T23:56:19.765331+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "sync-scaffold-symlinks-bats", "ok": true, "skipped": false, "duration_seconds": 1.431, "phase": "broad"}} +{"timestamp": "2026-11-25T23:56:19.765332+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "init-sh-shim-bats", "ok": true, "skipped": false, "duration_seconds": 0.819, "phase": "broad"}} +{"timestamp": "2026-11-25T23:56:19.765333+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "init-skills-bats", "ok": true, "skipped": false, "duration_seconds": 0.116, "phase": "broad"}} +{"timestamp": "2026-11-25T23:56:19.765335+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "hookspath-conflict-bats", "ok": true, "skipped": false, "duration_seconds": 0.534, "phase": "broad"}} +{"timestamp": "2026-11-25T23:56:19.829550+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "terminal_judge_editing_evaluated", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "status": "fired", "reason": "FEAT-LOOP-2026-0251/T01 produces specfuse/loop/loop.py; FEAT-LOOP-2026-0251/T01 declares produces_driver_helper ['execute_unit_attempt']; FEAT-LOOP-2026-0251/T02 produces specfuse/loop/loop.py; FEAT-LOOP-2026-0251/T02 produces .specfuse/verification.yml.example; FEAT-LOOP-2026-0251/T02 produces specfuse/loop/data/verification.yml.example; FEAT-LOOP-2026-0251/T02 declares produces_driver_helper ['execute_unit_attempt']; FEAT-LOOP-2026-0251/T03 produces specfuse/loop/loop.py; FEAT-LOOP-2026-0251/T04 produces specfuse/loop/lint_plan.py"}} +{"timestamp": "2026-11-25T23:56:19.832342+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "human_escalation", "source": "driver", "source_version": "0.33.2", "payload": {"reason": "judge_editing_terminal", "gate": 1, "hits": ["FEAT-LOOP-2026-0251/T01 produces specfuse/loop/loop.py", "FEAT-LOOP-2026-0251/T01 declares produces_driver_helper ['execute_unit_attempt']", "FEAT-LOOP-2026-0251/T02 produces specfuse/loop/loop.py", "FEAT-LOOP-2026-0251/T02 produces .specfuse/verification.yml.example", "FEAT-LOOP-2026-0251/T02 produces specfuse/loop/data/verification.yml.example", "FEAT-LOOP-2026-0251/T02 declares produces_driver_helper ['execute_unit_attempt']", "FEAT-LOOP-2026-0251/T03 produces specfuse/loop/loop.py", "FEAT-LOOP-2026-0251/T04 produces specfuse/loop/lint_plan.py"], "message": "ESCALATED \u2014 FEAT-LOOP-2026-0251/G1-CLOSE (G1-CLOSE \u2014 terminal close)\n\n## What has been done so far\nGate 1 is the last gate and its work is finished. Work units done: FEAT-LOOP-2026-0251/T01, FEAT-LOOP-2026-0251/T02, FEAT-LOOP-2026-0251/T03, FEAT-LOOP-2026-0251/T04. Nothing has been closed, flipped or archived yet.\n\n## What this issue is about\nOne or more finished units changed files that the judge relies on to grade this feature. Unit and path: FEAT-LOOP-2026-0251/T01 produces specfuse/loop/loop.py; FEAT-LOOP-2026-0251/T01 declares produces_driver_helper ['execute_unit_attempt']; FEAT-LOOP-2026-0251/T02 produces specfuse/loop/loop.py; FEAT-LOOP-2026-0251/T02 produces .specfuse/verification.yml.example; FEAT-LOOP-2026-0251/T02 produces specfuse/loop/data/verification.yml.example; FEAT-LOOP-2026-0251/T02 declares produces_driver_helper ['execute_unit_attempt']; FEAT-LOOP-2026-0251/T03 produces specfuse/loop/loop.py; FEAT-LOOP-2026-0251/T04 produces specfuse/loop/lint_plan.py.\n\n## What decision is needed, and why\nSomeone must decide whether those judge-surface edits are sound before the feature closes, because the close verdict would otherwise be written by the same model that made the edits.\n\n## Why it did not, or could not, close automatically\nThe safety catch fired as designed, nothing broke: the gate's own units change the code or config that grades it, so a model-authored verdict over those edits cannot be trusted to close the feature unreviewed. It stops the close however the feature was started and whatever its autonomy level.\n\n## Options, each with pros and cons\n1. **Acknowledge the edits** \u2014 review the paths above, then write `judge_edit_acknowledged` (the paths and your own reason) in the frontmatter of FEAT-LOOP-2026-0251/G1-CLOSE, then run `/unblock-wu`. Pros: the close proceeds and your reason is on the record. Cons: you must read the edits first; the acknowledgement covers only the paths it names, so a path added later stops the close again. A `produces_driver_helper` hit is covered by that literal entry, not by a file path.\n\nPaste into the frontmatter of the close unit, with your own reason:\n\n```yaml\njudge_edit_acknowledged:\n paths:\n - .specfuse/verification.yml.example\n - produces_driver_helper\n - specfuse/loop/data/verification.yml.example\n - specfuse/loop/lint_plan.py\n - specfuse/loop/loop.py\n reason: \"\"\n```\n2. **Reject the edits** \u2014 fix or revert them in the producing units. Pros: the judge stays independent. Cons: reopens finished work.\n\n## A recommendation\nOption 1 once you have read the edits and they are sound; option 2 if any of them weakens the check that grades this feature.\n\nReply with the number of your choice, or prose if none fit:\n1. Acknowledge the edits\n2. Reject the edits\n\nResume after deciding:\n python3 -m specfuse.loop.loop --feature FEAT-LOOP-2026-0251\n\n"}} +{"timestamp": "2026-11-26T13:30:16.649695+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "driver_build_pinned", "source": "driver", "source_version": "0.33.2", "payload": {"tree": "eb3075573964adbe5b7a9de58f97ce8ec6ad9124", "path": "/private/var/folders/zc/rgq11x850d78dx_kf1fd4vx80000gn/T/specfuse-pins/eb3075573964adbe5b7a9de58f97ce8ec6ad9124/specfuse/loop"}} +{"timestamp": "2026-11-26T13:36:49.017427+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "broad_run_result", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "tree": "07bbf72d1e7af3c1a03af605f40e5563dc3a18db:0ec7c6da6e74f0b56753f09657b654a6d289b91b:12064a6191eeb830a9826d911a8543fbaba3da75:27968248a450a842ccd187b7dce0fb0ded934866:287efde8f90320baffac08f5f3287b9456a65cb9:2e29b2f7e073a0cbe290f01d3b397e1cdd10c81c:42796ea0e0a6c03811b0e4bc9dbd3b5ee62dd2e4:4acc6dfc5e8cece358c167d876515eba4a39a500:641be9742f9a620d6209e7c786d1ff6f6664ef20:834d9d9c16094a386cd9b5a6f9ced9a3a9b4e7fb:a90788bb48ee6cdb0fa8b0f867c80a4643acd35d:bbd1aea514612d76722a18c7aece7c767cf1a076:c23b62e87f1ae3890c6f9e3d8c7ca7ec9225ed81:caffe2d63ceacde448842a91bc7a12c206a67523:d261cc7cb35eba19cd0f077fa66e995cd61b02b4:d74b7d113b844e84f0009098f576fd28477f072d:e1aa20b9c08a5ebe036da74f16e28c751f18f6fa:e3b0de29b81a6c8e0abeacb3898519b98014b9ef:fa2f4f88657587b6e3b560977858810846b1d366", "ok": true, "failing": []}} +{"timestamp": "2026-11-26T13:36:49.017457+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "tests", "ok": true, "skipped": false, "duration_seconds": 351.828, "phase": "broad"}} +{"timestamp": "2026-11-26T13:36:49.017461+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "lint", "ok": true, "skipped": false, "duration_seconds": 0.079, "phase": "broad"}} +{"timestamp": "2026-11-26T13:36:49.017464+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "security", "ok": true, "skipped": false, "duration_seconds": 1.629, "phase": "broad"}} +{"timestamp": "2026-11-26T13:36:49.017466+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "coverage", "ok": true, "skipped": false, "duration_seconds": 1.3, "phase": "broad"}} +{"timestamp": "2026-11-26T13:36:49.017468+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "leak-scan", "ok": true, "skipped": false, "duration_seconds": 17.683, "phase": "broad"}} +{"timestamp": "2026-11-26T13:36:49.017471+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "changelog-fragments", "ok": true, "skipped": false, "duration_seconds": 0.075, "phase": "broad"}} +{"timestamp": "2026-11-26T13:36:49.017472+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "agent-policy-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.117, "phase": "broad"}} +{"timestamp": "2026-11-26T13:36:49.017475+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "event-type-gate", "ok": true, "skipped": false, "duration_seconds": 0.168, "phase": "broad"}} +{"timestamp": "2026-11-26T13:36:49.017477+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "roadmap-link-gate", "ok": true, "skipped": false, "duration_seconds": 0.051, "phase": "broad"}} +{"timestamp": "2026-11-26T13:36:49.017479+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "arm-sweep-gate", "ok": true, "skipped": false, "duration_seconds": 0.411, "phase": "broad"}} +{"timestamp": "2026-11-26T13:36:49.017480+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "monitoring-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.052, "phase": "broad"}} +{"timestamp": "2026-11-26T13:36:49.017481+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "leak-scan-hook", "ok": true, "skipped": false, "duration_seconds": 0.863, "phase": "broad"}} +{"timestamp": "2026-11-26T13:36:49.017482+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "pre-push-hook", "ok": true, "skipped": false, "duration_seconds": 3.492, "phase": "broad"}} +{"timestamp": "2026-11-26T13:36:49.017485+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "sync-scaffold-bats", "ok": true, "skipped": false, "duration_seconds": 11.233, "phase": "broad"}} +{"timestamp": "2026-11-26T13:36:49.017487+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "sync-scaffold-symlinks-bats", "ok": true, "skipped": false, "duration_seconds": 1.663, "phase": "broad"}} +{"timestamp": "2026-11-26T13:36:49.017488+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "init-sh-shim-bats", "ok": true, "skipped": false, "duration_seconds": 0.851, "phase": "broad"}} +{"timestamp": "2026-11-26T13:36:49.017489+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "init-skills-bats", "ok": true, "skipped": false, "duration_seconds": 0.124, "phase": "broad"}} +{"timestamp": "2026-11-26T13:36:49.017490+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "hookspath-conflict-bats", "ok": true, "skipped": false, "duration_seconds": 0.583, "phase": "broad"}} +{"timestamp": "2026-11-26T13:36:49.116308+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "terminal_judge_editing_evaluated", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "status": "clean", "reason": "acknowledged by operator: .specfuse/verification.yml.example, produces_driver_helper, specfuse/loop/data/verification.yml.example, specfuse/loop/lint_plan.py, specfuse/loop/loop.py"}} +{"timestamp": "2026-11-26T13:36:49.118957+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "terminal_judge_editing_acknowledged", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "close_unit": "FEAT-LOOP-2026-0251/G1-CLOSE", "paths": [".specfuse/verification.yml.example", "produces_driver_helper", "specfuse/loop/data/verification.yml.example", "specfuse/loop/lint_plan.py", "specfuse/loop/loop.py"], "reason": "Review fixes tested, full suite green, accept the generator risk"}} +{"timestamp": "2026-11-26T13:36:49.213996+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "task_started", "source": "driver", "source_version": "0.33.2", "payload": {"type": "close", "model": "sonnet", "re_arm_count": 1}} +{"timestamp": "2026-11-26T13:36:49.214001+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "re_arm_dispatched", "source": "driver", "source_version": "0.33.2", "payload": {"re_arm_count": 1, "reason": "Review fixes tested, full suite green, accept the generator risk"}} +{"timestamp": "2026-11-26T13:41:40.647444+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "plan-lint", "ok": true, "skipped": false, "duration_seconds": 0.127, "phase": "attempt"}} +{"timestamp": "2026-11-26T13:41:40.647474+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "feature_oracle", "ok": true, "skipped": false, "duration_seconds": 14.017, "phase": "attempt"}} +{"timestamp": "2026-11-26T13:42:57.817022+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "judged", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "close_verdict": "not_met", "close_model": "sonnet", "judge_verdict": "not_met", "verdict": "not_met", "lowered": false, "disagreed": false, "findings": 4, "reason": null, "diff_base": "a89373d119f8e2d8003a8956dbd4bd27dde8057f", "diff_base_source": "merge-base of HEAD with main", "usage": {"cost_usd": 0.436352, "input_tokens": 14, "output_tokens": 6804, "cache_read_input_tokens": 462080, "cache_creation_input_tokens": 80519}, "judge_cost_usd": 0.436352}} +{"timestamp": "2026-11-26T13:42:57.818204+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "attempt_outcome", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "outcome": "passed", "duration_seconds": 291.43, "agent_seconds": 277.10579370788764, "verify_seconds": 14.151980416034348, "cost_usd": 1.69295, "input_tokens": 70, "output_tokens": 36654, "cache_read_input_tokens": 3808540, "cache_creation_input_tokens": 236354, "model": "sonnet", "effort": "high", "failure_class": null, "failure_signature": null, "failure_excerpt": null, "files_touched": [".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/FOLLOW-UPS.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/LEARNINGS-pending.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/RETROSPECTIVE.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-90-gate-1-close.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/events.jsonl", "changelog.d/FEAT-LOOP-2026-0251-defaults-fail-fast-deliverables-in-verif.md", "changelog.d/FEAT-LOOP-2026-0251-specfuse-lint-prints-a-warn-for-a-dispat.md", "changelog.d/FEAT-LOOP-2026-0251-the-produces-not-in-diff-deliverable-mis.md", "changelog.d/FEAT-LOOP-2026-0251-the-retry-note-for-the-three-deliverable.md"], "agent_status": "complete", "agent_blocked_reason": null, "re_arm_count": 0, "failing_tests": []}} +{"timestamp": "2026-11-26T13:42:57.818353+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "task_completed", "source": "driver", "source_version": "0.33.2", "payload": {"attempts": 1, "attempts_usage": [{"attempt": 1, "duration_seconds": 291.43, "cost_usd": 1.69295, "input_tokens": 70, "output_tokens": 36654, "cache_read_input_tokens": 3808540, "cache_creation_input_tokens": 236354, "agent_seconds": 277.10579370788764, "verify_seconds": 14.151980416034348}], "type": "close", "re_arm_count": 1, "cost_usd": 1.69295, "cumulative_cost_usd": 1.69295, "attempts_lifetime": 1, "planned_cost_usd": 5.0}} +{"timestamp": "2026-11-26T13:42:57.836279+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_reached", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1}} +{"timestamp": "2026-11-26T13:42:57.836271+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "arm_predicate_evaluated", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "would_arm": true, "predicate_version": "v1", "classes": {"budget_projection": {"status": "clean", "reason": "projected spend $4.37 within 2.0x baseline planned total $11.00 (cap $22.00)"}, "judge_editing": {"status": "clean", "reason": "no drafted WU touches judge-path surfaces"}, "decision_class_paths": {"status": "clean", "reason": "no drafted WU touches a recognised dependency manifest (pyproject.toml, package.json, pom.xml, build.gradle, build.gradle.kts, Cargo.toml, go.mod, Gemfile, composer.json, requirements*.txt, *.csproj)"}, "retroactive_edits": {"status": "clean", "reason": "no passed-gate baseline WU altered or removed"}, "drift_caps": {"status": "clean", "reason": "added WUs and gates within drift caps"}, "missing_provenance": {"status": "clean", "reason": "no added WUs"}, "open_questions_human_only": {"status": "clean", "reason": "terminal gate: no drafted successor"}, "plan_next_lint": {"status": "clean", "reason": "plan-next lint: no findings"}}}} +{"timestamp": "2026-11-26T13:43:02.496391+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "followups_recorded", "source": "driver", "source_version": "0.33.2", "payload": {"filed": 2, "unfiled": 0, "already_tracked": 0, "issue_numbers": ["3608", "3609"], "written_back": ["FOLLOW-UPS.md"]}} +{"timestamp": "2026-11-26T13:51:06.744598+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "driver_build_pinned", "source": "driver", "source_version": "0.33.2", "payload": {"tree": "b2513b4b90ea629561419494ccfffdd53b5055e5", "path": "/private/var/folders/zc/rgq11x850d78dx_kf1fd4vx80000gn/T/specfuse-pins/b2513b4b90ea629561419494ccfffdd53b5055e5/specfuse/loop"}} +{"timestamp": "2026-11-26T13:59:19.221960+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "broad_run_result", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "tree": "07bbf72d1e7af3c1a03af605f40e5563dc3a18db:0ec7c6da6e74f0b56753f09657b654a6d289b91b:12064a6191eeb830a9826d911a8543fbaba3da75:27968248a450a842ccd187b7dce0fb0ded934866:287efde8f90320baffac08f5f3287b9456a65cb9:2e29b2f7e073a0cbe290f01d3b397e1cdd10c81c:42796ea0e0a6c03811b0e4bc9dbd3b5ee62dd2e4:4acc6dfc5e8cece358c167d876515eba4a39a500:834d9d9c16094a386cd9b5a6f9ced9a3a9b4e7fb:a90788bb48ee6cdb0fa8b0f867c80a4643acd35d:bbd1aea514612d76722a18c7aece7c767cf1a076:c23b62e87f1ae3890c6f9e3d8c7ca7ec9225ed81:cab62f76bd04445beb1bf0786c2ee8df617496bb:caffe2d63ceacde448842a91bc7a12c206a67523:d74b7d113b844e84f0009098f576fd28477f072d:e1aa20b9c08a5ebe036da74f16e28c751f18f6fa:e3b0de29b81a6c8e0abeacb3898519b98014b9ef:f52cfa168d3517ad5d14d0c2b706e13ec571268e:fa2f4f88657587b6e3b560977858810846b1d366", "ok": true, "failing": []}} +{"timestamp": "2026-11-26T13:59:19.222005+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "tests", "ok": true, "skipped": false, "duration_seconds": 450.393, "phase": "broad"}} +{"timestamp": "2026-11-26T13:59:19.222009+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "lint", "ok": true, "skipped": false, "duration_seconds": 0.069, "phase": "broad"}} +{"timestamp": "2026-11-26T13:59:19.222011+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "security", "ok": true, "skipped": false, "duration_seconds": 1.69, "phase": "broad"}} +{"timestamp": "2026-11-26T13:59:19.222013+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "coverage", "ok": true, "skipped": false, "duration_seconds": 1.3, "phase": "broad"}} +{"timestamp": "2026-11-26T13:59:19.222021+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "leak-scan", "ok": true, "skipped": false, "duration_seconds": 18.877, "phase": "broad"}} +{"timestamp": "2026-11-26T13:59:19.222023+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "changelog-fragments", "ok": true, "skipped": false, "duration_seconds": 0.071, "phase": "broad"}} +{"timestamp": "2026-11-26T13:59:19.222025+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "agent-policy-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.12, "phase": "broad"}} +{"timestamp": "2026-11-26T13:59:19.222027+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "event-type-gate", "ok": true, "skipped": false, "duration_seconds": 0.174, "phase": "broad"}} +{"timestamp": "2026-11-26T13:59:19.222028+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "roadmap-link-gate", "ok": true, "skipped": false, "duration_seconds": 0.056, "phase": "broad"}} +{"timestamp": "2026-11-26T13:59:19.222029+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "arm-sweep-gate", "ok": true, "skipped": false, "duration_seconds": 0.426, "phase": "broad"}} +{"timestamp": "2026-11-26T13:59:19.222030+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "monitoring-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.055, "phase": "broad"}} +{"timestamp": "2026-11-26T13:59:19.222033+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "leak-scan-hook", "ok": true, "skipped": false, "duration_seconds": 0.9, "phase": "broad"}} +{"timestamp": "2026-11-26T13:59:19.222039+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "pre-push-hook", "ok": true, "skipped": false, "duration_seconds": 3.505, "phase": "broad"}} +{"timestamp": "2026-11-26T13:59:19.222041+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "sync-scaffold-bats", "ok": true, "skipped": false, "duration_seconds": 11.327, "phase": "broad"}} +{"timestamp": "2026-11-26T13:59:19.222043+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "sync-scaffold-symlinks-bats", "ok": true, "skipped": false, "duration_seconds": 1.737, "phase": "broad"}} +{"timestamp": "2026-11-26T13:59:19.222044+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "init-sh-shim-bats", "ok": true, "skipped": false, "duration_seconds": 0.867, "phase": "broad"}} +{"timestamp": "2026-11-26T13:59:19.222045+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "init-skills-bats", "ok": true, "skipped": false, "duration_seconds": 0.135, "phase": "broad"}} +{"timestamp": "2026-11-26T13:59:19.222047+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "hookspath-conflict-bats", "ok": true, "skipped": false, "duration_seconds": 0.596, "phase": "broad"}} +{"timestamp": "2026-11-26T13:59:19.293600+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "terminal_judge_editing_evaluated", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "status": "clean", "reason": "acknowledged by operator: .specfuse/verification.yml.example, produces_driver_helper, specfuse/loop/data/verification.yml.example, specfuse/loop/lint_plan.py, specfuse/loop/loop.py"}} +{"timestamp": "2026-11-26T13:59:19.296802+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "terminal_judge_editing_acknowledged", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "close_unit": "FEAT-LOOP-2026-0251/G1-CLOSE", "paths": [".specfuse/verification.yml.example", "produces_driver_helper", "specfuse/loop/data/verification.yml.example", "specfuse/loop/lint_plan.py", "specfuse/loop/loop.py"], "reason": "Review fixes tested, full suite green, accept the generator risk"}} +{"timestamp": "2026-11-26T13:59:19.394823+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "task_started", "source": "driver", "source_version": "0.33.2", "payload": {"type": "close", "model": "sonnet", "re_arm_count": 2}} +{"timestamp": "2026-11-26T13:59:19.394829+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "re_arm_dispatched", "source": "driver", "source_version": "0.33.2", "payload": {"re_arm_count": 2, "reason": "A for both, go ahead"}} +{"timestamp": "2026-11-26T14:03:38.823723+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "plan-lint", "ok": true, "skipped": false, "duration_seconds": 0.128, "phase": "attempt"}} +{"timestamp": "2026-11-26T14:03:38.823755+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "feature_oracle", "ok": true, "skipped": false, "duration_seconds": 13.236, "phase": "attempt"}} +{"timestamp": "2026-11-26T14:10:17.023134+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "judged", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "close_verdict": "not_met", "close_model": "sonnet", "judge_verdict": "not_met", "verdict": "not_met", "lowered": false, "disagreed": false, "findings": 1, "reason": null, "diff_base": "a89373d119f8e2d8003a8956dbd4bd27dde8057f", "diff_base_source": "merge-base of HEAD with main", "usage": {"cost_usd": 0.47994549999999997, "input_tokens": 12, "output_tokens": 7567, "cache_read_input_tokens": 396235, "cache_creation_input_tokens": 91157}, "judge_cost_usd": 0.479945}} +{"timestamp": "2026-11-26T14:10:17.024701+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "attempt_outcome", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "outcome": "passed", "duration_seconds": 259.427, "agent_seconds": 245.9689366670791, "verify_seconds": 13.369104042067192, "cost_usd": 1.4890017, "input_tokens": 48, "output_tokens": 34844, "cache_read_input_tokens": 2269217, "cache_creation_input_tokens": 228386, "model": "sonnet", "effort": "high", "failure_class": null, "failure_signature": null, "failure_excerpt": null, "files_touched": [".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/FOLLOW-UPS.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/LEARNINGS-pending.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/RETROSPECTIVE.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-90-gate-1-close.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/events.jsonl", "changelog.d/FEAT-LOOP-2026-0251-the-produces-not-in-diff-deliverable-mis.md"], "agent_status": "complete", "agent_blocked_reason": null, "re_arm_count": 0, "failing_tests": []}} +{"timestamp": "2026-11-26T14:10:17.024880+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "task_completed", "source": "driver", "source_version": "0.33.2", "payload": {"attempts": 1, "attempts_usage": [{"attempt": 1, "duration_seconds": 259.427, "cost_usd": 1.4890017, "input_tokens": 48, "output_tokens": 34844, "cache_read_input_tokens": 2269217, "cache_creation_input_tokens": 228386, "agent_seconds": 245.9689366670791, "verify_seconds": 13.369104042067192}], "type": "close", "re_arm_count": 2, "cost_usd": 1.489002, "cumulative_cost_usd": 3.181952, "attempts_lifetime": 2, "planned_cost_usd": 5.0}} +{"timestamp": "2026-11-26T14:10:17.046100+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_reached", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1}} +{"timestamp": "2026-11-26T14:10:17.046089+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "arm_predicate_evaluated", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "would_arm": true, "predicate_version": "v1", "classes": {"budget_projection": {"status": "clean", "reason": "projected spend $5.86 within 2.0x baseline planned total $11.00 (cap $22.00)"}, "judge_editing": {"status": "clean", "reason": "no drafted WU touches judge-path surfaces"}, "decision_class_paths": {"status": "clean", "reason": "no drafted WU touches a recognised dependency manifest (pyproject.toml, package.json, pom.xml, build.gradle, build.gradle.kts, Cargo.toml, go.mod, Gemfile, composer.json, requirements*.txt, *.csproj)"}, "retroactive_edits": {"status": "clean", "reason": "no passed-gate baseline WU altered or removed"}, "drift_caps": {"status": "clean", "reason": "added WUs and gates within drift caps"}, "missing_provenance": {"status": "clean", "reason": "no added WUs"}, "open_questions_human_only": {"status": "clean", "reason": "terminal gate: no drafted successor"}, "plan_next_lint": {"status": "clean", "reason": "plan-next lint: no findings"}}}} +{"timestamp": "2026-11-26T14:10:19.728537+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "followups_recorded", "source": "driver", "source_version": "0.33.2", "payload": {"filed": 1, "unfiled": 0, "already_tracked": 0, "issue_numbers": ["3610"], "written_back": ["FOLLOW-UPS.md"]}} +{"timestamp": "2026-11-26T15:22:53.630315+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "driver_build_pinned", "source": "driver", "source_version": "0.33.2", "payload": {"tree": "a3f9d0cef2b2ca5ff6b069cdba9ab76e4f691df2", "path": "/private/var/folders/zc/rgq11x850d78dx_kf1fd4vx80000gn/T/specfuse-pins/a3f9d0cef2b2ca5ff6b069cdba9ab76e4f691df2/specfuse/loop"}} +{"timestamp": "2026-11-26T15:32:03.990356+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "broad_run_result", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "tree": "07bbf72d1e7af3c1a03af605f40e5563dc3a18db:0ec7c6da6e74f0b56753f09657b654a6d289b91b:12064a6191eeb830a9826d911a8543fbaba3da75:1a8258cf8dd2af85aa66b31c9d341781000b1229:27968248a450a842ccd187b7dce0fb0ded934866:287efde8f90320baffac08f5f3287b9456a65cb9:2e29b2f7e073a0cbe290f01d3b397e1cdd10c81c:42796ea0e0a6c03811b0e4bc9dbd3b5ee62dd2e4:4acc6dfc5e8cece358c167d876515eba4a39a500:56ae45adcc17a1292977c436fd195ef8c61cc9e4:5a3f321ad3cdb33ab16e1356d0f149be66301b74:834d9d9c16094a386cd9b5a6f9ced9a3a9b4e7fb:bbd1aea514612d76722a18c7aece7c767cf1a076:c23b62e87f1ae3890c6f9e3d8c7ca7ec9225ed81:cab62f76bd04445beb1bf0786c2ee8df617496bb:caffe2d63ceacde448842a91bc7a12c206a67523:d74b7d113b844e84f0009098f576fd28477f072d:e3b0de29b81a6c8e0abeacb3898519b98014b9ef:fa2f4f88657587b6e3b560977858810846b1d366", "ok": true, "failing": []}} +{"timestamp": "2026-11-26T15:32:03.990406+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "tests", "ok": true, "skipped": false, "duration_seconds": 485.06, "phase": "broad"}} +{"timestamp": "2026-11-26T15:32:03.990414+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "lint", "ok": true, "skipped": false, "duration_seconds": 0.81, "phase": "broad"}} +{"timestamp": "2026-11-26T15:32:03.990420+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "security", "ok": true, "skipped": false, "duration_seconds": 3.244, "phase": "broad"}} +{"timestamp": "2026-11-26T15:32:03.990426+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "coverage", "ok": true, "skipped": false, "duration_seconds": 1.573, "phase": "broad"}} +{"timestamp": "2026-11-26T15:32:03.990428+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "leak-scan", "ok": true, "skipped": false, "duration_seconds": 29.266, "phase": "broad"}} +{"timestamp": "2026-11-26T15:32:03.990433+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "changelog-fragments", "ok": true, "skipped": false, "duration_seconds": 0.137, "phase": "broad"}} +{"timestamp": "2026-11-26T15:32:03.990436+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "agent-policy-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.167, "phase": "broad"}} +{"timestamp": "2026-11-26T15:32:03.990439+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "event-type-gate", "ok": true, "skipped": false, "duration_seconds": 0.424, "phase": "broad"}} +{"timestamp": "2026-11-26T15:32:03.990446+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "roadmap-link-gate", "ok": true, "skipped": false, "duration_seconds": 0.074, "phase": "broad"}} +{"timestamp": "2026-11-26T15:32:03.990448+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "arm-sweep-gate", "ok": true, "skipped": false, "duration_seconds": 0.996, "phase": "broad"}} +{"timestamp": "2026-11-26T15:32:03.990449+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "monitoring-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.076, "phase": "broad"}} +{"timestamp": "2026-11-26T15:32:03.990453+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "leak-scan-hook", "ok": true, "skipped": false, "duration_seconds": 1.463, "phase": "broad"}} +{"timestamp": "2026-11-26T15:32:03.990460+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "pre-push-hook", "ok": true, "skipped": false, "duration_seconds": 4.643, "phase": "broad"}} +{"timestamp": "2026-11-26T15:32:03.990462+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "sync-scaffold-bats", "ok": true, "skipped": false, "duration_seconds": 16.37, "phase": "broad"}} +{"timestamp": "2026-11-26T15:32:03.990463+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "sync-scaffold-symlinks-bats", "ok": true, "skipped": false, "duration_seconds": 2.985, "phase": "broad"}} +{"timestamp": "2026-11-26T15:32:03.990465+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "init-sh-shim-bats", "ok": true, "skipped": false, "duration_seconds": 1.328, "phase": "broad"}} +{"timestamp": "2026-11-26T15:32:03.990471+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "init-skills-bats", "ok": true, "skipped": false, "duration_seconds": 0.239, "phase": "broad"}} +{"timestamp": "2026-11-26T15:32:03.990472+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "hookspath-conflict-bats", "ok": true, "skipped": false, "duration_seconds": 1.02, "phase": "broad"}} +{"timestamp": "2026-11-26T15:32:04.195877+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "terminal_judge_editing_evaluated", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "status": "clean", "reason": "acknowledged by operator: .specfuse/verification.yml.example, produces_driver_helper, specfuse/loop/data/verification.yml.example, specfuse/loop/lint_plan.py, specfuse/loop/loop.py"}} +{"timestamp": "2026-11-26T15:32:04.199854+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "terminal_judge_editing_acknowledged", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "close_unit": "FEAT-LOOP-2026-0251/G1-CLOSE", "paths": [".specfuse/verification.yml.example", "produces_driver_helper", "specfuse/loop/data/verification.yml.example", "specfuse/loop/lint_plan.py", "specfuse/loop/loop.py"], "reason": "Review fixes tested, full suite green, accept the generator risk"}} +{"timestamp": "2026-11-26T15:32:04.469750+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "task_started", "source": "driver", "source_version": "0.33.2", "payload": {"type": "close", "model": "sonnet", "re_arm_count": 3}} +{"timestamp": "2026-11-26T15:32:04.469767+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "re_arm_dispatched", "source": "driver", "source_version": "0.33.2", "payload": {"re_arm_count": 3, "reason": "1, go ahead"}} +{"timestamp": "2026-11-26T15:38:24.018279+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "plan-lint", "ok": true, "skipped": false, "duration_seconds": 0.131, "phase": "attempt"}} +{"timestamp": "2026-11-26T15:38:24.018307+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "feature_oracle", "ok": true, "skipped": false, "duration_seconds": 13.607, "phase": "attempt"}} +{"timestamp": "2026-11-26T15:45:06.916821+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "judged", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "close_verdict": "met", "close_model": "sonnet", "judge_verdict": "not_met", "verdict": "not_met", "lowered": true, "disagreed": true, "findings": 1, "reason": "judge lowered the verdict on 1 finding(s) (T03#1); the judge's own words are in features/FEAT-LOOP-2026-0251-fail-fast-deliverables/FOLLOW-UPS.md", "diff_base": "3bc8bef37e1903f18b2a48f78a44fb9a63600864", "diff_base_source": "merge-base of HEAD with main", "usage": {"cost_usd": 0.5717669000000001, "input_tokens": 16, "output_tokens": 8944, "cache_read_input_tokens": 631469, "cache_creation_input_tokens": 104787}, "findings_path": "features/FEAT-LOOP-2026-0251-fail-fast-deliverables/FOLLOW-UPS.md", "finding_criteria": ["T03#1"], "judge_cost_usd": 0.571767}} +{"timestamp": "2026-11-26T15:45:06.918509+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "attempt_outcome", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "outcome": "passed", "duration_seconds": 379.569, "agent_seconds": 365.70307041693013, "verify_seconds": 13.744761209003627, "cost_usd": 1.7330835000000002, "input_tokens": 56, "output_tokens": 43124, "cache_read_input_tokens": 2877115, "cache_creation_input_tokens": 253505, "model": "sonnet", "effort": "high", "failure_class": null, "failure_signature": null, "failure_excerpt": null, "files_touched": [".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/FOLLOW-UPS.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/LEARNINGS-pending.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/RETROSPECTIVE.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-90-gate-1-close.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/events.jsonl", "changelog.d/FEAT-LOOP-2026-0251-the-produces-not-in-diff-deliverable-mis.md"], "agent_status": "complete", "agent_blocked_reason": null, "re_arm_count": 0, "failing_tests": []}} +{"timestamp": "2026-11-26T15:45:06.918733+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "task_completed", "source": "driver", "source_version": "0.33.2", "payload": {"attempts": 1, "attempts_usage": [{"attempt": 1, "duration_seconds": 379.569, "cost_usd": 1.7330835000000002, "input_tokens": 56, "output_tokens": 43124, "cache_read_input_tokens": 2877115, "cache_creation_input_tokens": 253505, "agent_seconds": 365.70307041693013, "verify_seconds": 13.744761209003627}], "type": "close", "re_arm_count": 3, "cost_usd": 1.733084, "cumulative_cost_usd": 4.915036, "attempts_lifetime": 3, "planned_cost_usd": 5.0}} +{"timestamp": "2026-11-26T15:45:06.944080+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_reached", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1}} +{"timestamp": "2026-11-26T15:45:06.944069+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "arm_predicate_evaluated", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "would_arm": true, "predicate_version": "v1", "classes": {"budget_projection": {"status": "clean", "reason": "projected spend $7.59 within 2.0x baseline planned total $11.00 (cap $22.00)"}, "judge_editing": {"status": "clean", "reason": "no drafted WU touches judge-path surfaces"}, "decision_class_paths": {"status": "clean", "reason": "no drafted WU touches a recognised dependency manifest (pyproject.toml, package.json, pom.xml, build.gradle, build.gradle.kts, Cargo.toml, go.mod, Gemfile, composer.json, requirements*.txt, *.csproj)"}, "retroactive_edits": {"status": "clean", "reason": "no passed-gate baseline WU altered or removed"}, "drift_caps": {"status": "clean", "reason": "added WUs and gates within drift caps"}, "missing_provenance": {"status": "clean", "reason": "no added WUs"}, "open_questions_human_only": {"status": "clean", "reason": "terminal gate: no drafted successor"}, "plan_next_lint": {"status": "clean", "reason": "plan-next lint: no findings"}}}} +{"timestamp": "2026-11-26T15:45:09.936641+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "followups_recorded", "source": "driver", "source_version": "0.33.2", "payload": {"filed": 1, "unfiled": 0, "already_tracked": 0, "issue_numbers": ["3612"], "written_back": ["FOLLOW-UPS.md"]}} +{"timestamp": "2026-11-26T16:08:15.852478+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "driver_build_pinned", "source": "driver", "source_version": "0.33.2", "payload": {"tree": "ffb4d96678f486c0a32f6e79d42017df2eea2eef", "path": "/private/var/folders/zc/rgq11x850d78dx_kf1fd4vx80000gn/T/specfuse-pins/ffb4d96678f486c0a32f6e79d42017df2eea2eef/specfuse/loop"}} +{"timestamp": "2026-11-26T16:17:14.529321+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "broad_run_result", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "tree": "07bbf72d1e7af3c1a03af605f40e5563dc3a18db:0ec7c6da6e74f0b56753f09657b654a6d289b91b:12064a6191eeb830a9826d911a8543fbaba3da75:27968248a450a842ccd187b7dce0fb0ded934866:287efde8f90320baffac08f5f3287b9456a65cb9:2e29b2f7e073a0cbe290f01d3b397e1cdd10c81c:39af52f10c10bdafeeb3c29122f2cd7398be4e88:42796ea0e0a6c03811b0e4bc9dbd3b5ee62dd2e4:4acc6dfc5e8cece358c167d876515eba4a39a500:56ae45adcc17a1292977c436fd195ef8c61cc9e4:834d9d9c16094a386cd9b5a6f9ced9a3a9b4e7fb:9969252df1bf38a0eb154eff3019a39c7c2e20fa:bbd1aea514612d76722a18c7aece7c767cf1a076:c23b62e87f1ae3890c6f9e3d8c7ca7ec9225ed81:caffe2d63ceacde448842a91bc7a12c206a67523:d74b7d113b844e84f0009098f576fd28477f072d:e3b0de29b81a6c8e0abeacb3898519b98014b9ef:ee0bd0a3eced139daf2fde311af364799729b48d:fa2f4f88657587b6e3b560977858810846b1d366", "ok": true, "failing": []}} +{"timestamp": "2026-11-26T16:17:14.529434+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "tests", "ok": true, "skipped": false, "duration_seconds": 472.148, "phase": "broad"}} +{"timestamp": "2026-11-26T16:17:14.529441+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "lint", "ok": true, "skipped": false, "duration_seconds": 0.155, "phase": "broad"}} +{"timestamp": "2026-11-26T16:17:14.529444+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "security", "ok": true, "skipped": false, "duration_seconds": 2.785, "phase": "broad"}} +{"timestamp": "2026-11-26T16:17:14.529454+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "coverage", "ok": true, "skipped": false, "duration_seconds": 2.234, "phase": "broad"}} +{"timestamp": "2026-11-26T16:17:14.529457+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "leak-scan", "ok": true, "skipped": false, "duration_seconds": 32.726, "phase": "broad"}} +{"timestamp": "2026-11-26T16:17:14.529459+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "changelog-fragments", "ok": true, "skipped": false, "duration_seconds": 0.115, "phase": "broad"}} +{"timestamp": "2026-11-26T16:17:14.529463+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "agent-policy-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.182, "phase": "broad"}} +{"timestamp": "2026-11-26T16:17:14.529465+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "event-type-gate", "ok": true, "skipped": false, "duration_seconds": 0.278, "phase": "broad"}} +{"timestamp": "2026-11-26T16:17:14.529470+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "roadmap-link-gate", "ok": true, "skipped": false, "duration_seconds": 0.119, "phase": "broad"}} +{"timestamp": "2026-11-26T16:17:14.529473+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "arm-sweep-gate", "ok": true, "skipped": false, "duration_seconds": 0.638, "phase": "broad"}} +{"timestamp": "2026-11-26T16:17:14.529475+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "monitoring-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.074, "phase": "broad"}} +{"timestamp": "2026-11-26T16:17:14.529476+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "leak-scan-hook", "ok": true, "skipped": false, "duration_seconds": 1.419, "phase": "broad"}} +{"timestamp": "2026-11-26T16:17:14.529480+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "pre-push-hook", "ok": true, "skipped": false, "duration_seconds": 5.255, "phase": "broad"}} +{"timestamp": "2026-11-26T16:17:14.529482+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "sync-scaffold-bats", "ok": true, "skipped": false, "duration_seconds": 16.655, "phase": "broad"}} +{"timestamp": "2026-11-26T16:17:14.529483+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "sync-scaffold-symlinks-bats", "ok": true, "skipped": false, "duration_seconds": 2.045, "phase": "broad"}} +{"timestamp": "2026-11-26T16:17:14.529484+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "init-sh-shim-bats", "ok": true, "skipped": false, "duration_seconds": 0.897, "phase": "broad"}} +{"timestamp": "2026-11-26T16:17:14.529485+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "init-skills-bats", "ok": true, "skipped": false, "duration_seconds": 0.148, "phase": "broad"}} +{"timestamp": "2026-11-26T16:17:14.529487+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "hookspath-conflict-bats", "ok": true, "skipped": false, "duration_seconds": 0.615, "phase": "broad"}} +{"timestamp": "2026-11-26T16:17:14.636298+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "terminal_judge_editing_evaluated", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "status": "clean", "reason": "acknowledged by operator: .specfuse/verification.yml.example, produces_driver_helper, specfuse/loop/data/verification.yml.example, specfuse/loop/lint_plan.py, specfuse/loop/loop.py"}} +{"timestamp": "2026-11-26T16:17:14.640024+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "terminal_judge_editing_acknowledged", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "close_unit": "FEAT-LOOP-2026-0251/G1-CLOSE", "paths": [".specfuse/verification.yml.example", "produces_driver_helper", "specfuse/loop/data/verification.yml.example", "specfuse/loop/lint_plan.py", "specfuse/loop/loop.py"], "reason": "Review fixes tested, full suite green, accept the generator risk"}} +{"timestamp": "2026-11-26T16:17:14.747481+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "task_started", "source": "driver", "source_version": "0.33.2", "payload": {"type": "close", "model": "sonnet", "re_arm_count": 4}} +{"timestamp": "2026-11-26T16:17:14.747494+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "re_arm_dispatched", "source": "driver", "source_version": "0.33.2", "payload": {"re_arm_count": 4, "reason": "Trying to fix the last issue"}} +{"timestamp": "2026-11-26T16:25:13.721635+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "plan-lint", "ok": true, "skipped": false, "duration_seconds": 0.098, "phase": "attempt"}} +{"timestamp": "2026-11-26T16:25:13.721756+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "feature_oracle", "ok": true, "skipped": false, "duration_seconds": 34.01, "phase": "attempt"}} +{"timestamp": "2026-11-26T16:28:24.161713+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "judged", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "close_verdict": "not_met", "close_model": "sonnet", "judge_verdict": "not_met", "verdict": "not_met", "lowered": false, "disagreed": false, "findings": 2, "reason": null, "diff_base": "3bc8bef37e1903f18b2a48f78a44fb9a63600864", "diff_base_source": "merge-base of HEAD with main", "usage": {"cost_usd": 0.3560795, "input_tokens": 14, "output_tokens": 5381, "cache_read_input_tokens": 409895, "cache_creation_input_tokens": 65313}, "judge_cost_usd": 0.356079}} +{"timestamp": "2026-11-26T16:28:24.163557+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "attempt_outcome", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "outcome": "passed", "duration_seconds": 478.949, "agent_seconds": 444.6934201249387, "verify_seconds": 34.12231654196512, "cost_usd": 1.4354375, "input_tokens": 62, "output_tokens": 35593, "cache_read_input_tokens": 2919635, "cache_creation_input_tokens": 196855, "model": "sonnet", "effort": "high", "failure_class": null, "failure_signature": null, "failure_excerpt": null, "files_touched": [".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/FOLLOW-UPS.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/LEARNINGS-pending.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/RETROSPECTIVE.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-90-gate-1-close.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/events.jsonl", "changelog.d/FEAT-LOOP-2026-0251-the-retry-note-for-the-three-deliverable.md"], "agent_status": "complete", "agent_blocked_reason": null, "re_arm_count": 0, "failing_tests": []}} +{"timestamp": "2026-11-26T16:28:24.163798+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "task_completed", "source": "driver", "source_version": "0.33.2", "payload": {"attempts": 1, "attempts_usage": [{"attempt": 1, "duration_seconds": 478.949, "cost_usd": 1.4354375, "input_tokens": 62, "output_tokens": 35593, "cache_read_input_tokens": 2919635, "cache_creation_input_tokens": 196855, "agent_seconds": 444.6934201249387, "verify_seconds": 34.12231654196512}], "type": "close", "re_arm_count": 4, "cost_usd": 1.435437, "cumulative_cost_usd": 6.350473, "attempts_lifetime": 4, "planned_cost_usd": 5.0}} +{"timestamp": "2026-11-26T16:28:24.189676+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_reached", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1}} +{"timestamp": "2026-11-26T16:28:24.189660+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "arm_predicate_evaluated", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "would_arm": true, "predicate_version": "v1", "classes": {"budget_projection": {"status": "clean", "reason": "projected spend $9.03 within 2.0x baseline planned total $11.00 (cap $22.00)"}, "judge_editing": {"status": "clean", "reason": "no drafted WU touches judge-path surfaces"}, "decision_class_paths": {"status": "clean", "reason": "no drafted WU touches a recognised dependency manifest (pyproject.toml, package.json, pom.xml, build.gradle, build.gradle.kts, Cargo.toml, go.mod, Gemfile, composer.json, requirements*.txt, *.csproj)"}, "retroactive_edits": {"status": "clean", "reason": "no passed-gate baseline WU altered or removed"}, "drift_caps": {"status": "clean", "reason": "added WUs and gates within drift caps"}, "missing_provenance": {"status": "clean", "reason": "no added WUs"}, "open_questions_human_only": {"status": "clean", "reason": "terminal gate: no drafted successor"}, "plan_next_lint": {"status": "clean", "reason": "plan-next lint: no findings"}}}} +{"timestamp": "2026-11-26T16:28:27.526095+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "followups_recorded", "source": "driver", "source_version": "0.33.2", "payload": {"filed": 1, "unfiled": 0, "already_tracked": 0, "issue_numbers": ["3613"], "written_back": ["FOLLOW-UPS.md"]}} +{"timestamp": "2026-11-26T16:44:24.283766+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "driver_build_pinned", "source": "driver", "source_version": "0.33.2", "payload": {"tree": "5295bce9df8476766d94353c24b2f4b209ca8a38", "path": "/private/var/folders/zc/rgq11x850d78dx_kf1fd4vx80000gn/T/specfuse-pins/5295bce9df8476766d94353c24b2f4b209ca8a38/specfuse/loop"}} +{"timestamp": "2026-11-26T16:51:24.472683+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "broad_run_result", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "tree": "07bbf72d1e7af3c1a03af605f40e5563dc3a18db:0ec7c6da6e74f0b56753f09657b654a6d289b91b:12064a6191eeb830a9826d911a8543fbaba3da75:1335b4a33bdabb0f79b5cefbbb3a895f1a6070d9:20d5146c893abcac47015a30987b44b2a3dc7c03:27968248a450a842ccd187b7dce0fb0ded934866:287efde8f90320baffac08f5f3287b9456a65cb9:2e29b2f7e073a0cbe290f01d3b397e1cdd10c81c:42796ea0e0a6c03811b0e4bc9dbd3b5ee62dd2e4:4acc6dfc5e8cece358c167d876515eba4a39a500:56ae45adcc17a1292977c436fd195ef8c61cc9e4:834d9d9c16094a386cd9b5a6f9ced9a3a9b4e7fb:91772e5b1214def7917a34e770c1485cd953efe3:bbd1aea514612d76722a18c7aece7c767cf1a076:c23b62e87f1ae3890c6f9e3d8c7ca7ec9225ed81:caffe2d63ceacde448842a91bc7a12c206a67523:d74b7d113b844e84f0009098f576fd28477f072d:e3b0de29b81a6c8e0abeacb3898519b98014b9ef:fa2f4f88657587b6e3b560977858810846b1d366", "ok": true, "failing": []}} +{"timestamp": "2026-11-26T16:51:24.472715+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "tests", "ok": true, "skipped": false, "duration_seconds": 376.235, "phase": "broad"}} +{"timestamp": "2026-11-26T16:51:24.472720+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "lint", "ok": true, "skipped": false, "duration_seconds": 0.06, "phase": "broad"}} +{"timestamp": "2026-11-26T16:51:24.472723+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "security", "ok": true, "skipped": false, "duration_seconds": 1.686, "phase": "broad"}} +{"timestamp": "2026-11-26T16:51:24.472727+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "coverage", "ok": true, "skipped": false, "duration_seconds": 1.314, "phase": "broad"}} +{"timestamp": "2026-11-26T16:51:24.472730+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "leak-scan", "ok": true, "skipped": false, "duration_seconds": 18.675, "phase": "broad"}} +{"timestamp": "2026-11-26T16:51:24.472733+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "changelog-fragments", "ok": true, "skipped": false, "duration_seconds": 0.063, "phase": "broad"}} +{"timestamp": "2026-11-26T16:51:24.472736+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "agent-policy-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.121, "phase": "broad"}} +{"timestamp": "2026-11-26T16:51:24.472739+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "event-type-gate", "ok": true, "skipped": false, "duration_seconds": 0.176, "phase": "broad"}} +{"timestamp": "2026-11-26T16:51:24.472741+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "roadmap-link-gate", "ok": true, "skipped": false, "duration_seconds": 0.058, "phase": "broad"}} +{"timestamp": "2026-11-26T16:51:24.472742+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "arm-sweep-gate", "ok": true, "skipped": false, "duration_seconds": 0.412, "phase": "broad"}} +{"timestamp": "2026-11-26T16:51:24.472745+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "monitoring-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.05, "phase": "broad"}} +{"timestamp": "2026-11-26T16:51:24.472749+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "leak-scan-hook", "ok": true, "skipped": false, "duration_seconds": 0.863, "phase": "broad"}} +{"timestamp": "2026-11-26T16:51:24.472751+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "pre-push-hook", "ok": true, "skipped": false, "duration_seconds": 3.712, "phase": "broad"}} +{"timestamp": "2026-11-26T16:51:24.472752+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "sync-scaffold-bats", "ok": true, "skipped": false, "duration_seconds": 12.785, "phase": "broad"}} +{"timestamp": "2026-11-26T16:51:24.472753+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "sync-scaffold-symlinks-bats", "ok": true, "skipped": false, "duration_seconds": 2.106, "phase": "broad"}} +{"timestamp": "2026-11-26T16:51:24.472754+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "init-sh-shim-bats", "ok": true, "skipped": false, "duration_seconds": 0.906, "phase": "broad"}} +{"timestamp": "2026-11-26T16:51:24.472756+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "init-skills-bats", "ok": true, "skipped": false, "duration_seconds": 0.146, "phase": "broad"}} +{"timestamp": "2026-11-26T16:51:24.472758+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "hookspath-conflict-bats", "ok": true, "skipped": false, "duration_seconds": 0.617, "phase": "broad"}} +{"timestamp": "2026-11-26T16:51:24.597739+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "terminal_judge_editing_evaluated", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "status": "clean", "reason": "acknowledged by operator: .specfuse/verification.yml.example, produces_driver_helper, specfuse/loop/data/verification.yml.example, specfuse/loop/lint_plan.py, specfuse/loop/loop.py"}} +{"timestamp": "2026-11-26T16:51:24.601972+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "terminal_judge_editing_acknowledged", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "close_unit": "FEAT-LOOP-2026-0251/G1-CLOSE", "paths": [".specfuse/verification.yml.example", "produces_driver_helper", "specfuse/loop/data/verification.yml.example", "specfuse/loop/lint_plan.py", "specfuse/loop/loop.py"], "reason": "Review fixes tested, full suite green, accept the generator risk"}} +{"timestamp": "2026-11-26T16:51:24.710228+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "task_started", "source": "driver", "source_version": "0.33.2", "payload": {"type": "close", "model": "sonnet", "re_arm_count": 5}} +{"timestamp": "2026-11-26T16:51:24.710233+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "re_arm_dispatched", "source": "driver", "source_version": "0.33.2", "payload": {"re_arm_count": 5, "reason": "Fixed the deleted-file edge case, re-close it"}} +{"timestamp": "2026-11-26T17:01:41.389812+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "plan-lint", "ok": true, "skipped": false, "duration_seconds": 0.113, "phase": "attempt"}} +{"timestamp": "2026-11-26T17:01:41.389891+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "feature_oracle", "ok": true, "skipped": false, "duration_seconds": 40.919, "phase": "attempt"}} +{"timestamp": "2026-11-26T17:03:17.123709+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "judged", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "close_verdict": "not_met", "close_model": "sonnet", "judge_verdict": "not_met", "verdict": "not_met", "lowered": false, "disagreed": false, "findings": 2, "reason": null, "diff_base": "3bc8bef37e1903f18b2a48f78a44fb9a63600864", "diff_base_source": "merge-base of HEAD with main", "usage": {"cost_usd": 0.47485830000000007, "input_tokens": 14, "output_tokens": 5358, "cache_read_input_tokens": 525903, "cache_creation_input_tokens": 92165}, "judge_cost_usd": 0.474858}} +{"timestamp": "2026-11-26T17:03:17.125461+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "attempt_outcome", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "outcome": "passed", "duration_seconds": 616.642, "agent_seconds": 575.434865709045, "verify_seconds": 41.05921195796691, "cost_usd": 1.3475906, "input_tokens": 44, "output_tokens": 31539, "cache_read_input_tokens": 1981046, "cache_creation_input_tokens": 208502, "model": "sonnet", "effort": "high", "failure_class": null, "failure_signature": null, "failure_excerpt": null, "files_touched": [".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/FOLLOW-UPS.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/LEARNINGS-pending.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/RETROSPECTIVE.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-90-gate-1-close.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/events.jsonl", "changelog.d/FEAT-LOOP-2026-0251-the-retry-note-for-the-three-deliverable.md"], "agent_status": "complete", "agent_blocked_reason": null, "re_arm_count": 0, "failing_tests": []}} +{"timestamp": "2026-11-26T17:03:17.125721+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "task_completed", "source": "driver", "source_version": "0.33.2", "payload": {"attempts": 1, "attempts_usage": [{"attempt": 1, "duration_seconds": 616.642, "cost_usd": 1.3475906, "input_tokens": 44, "output_tokens": 31539, "cache_read_input_tokens": 1981046, "cache_creation_input_tokens": 208502, "agent_seconds": 575.434865709045, "verify_seconds": 41.05921195796691}], "type": "close", "re_arm_count": 5, "cost_usd": 1.347591, "cumulative_cost_usd": 7.698064, "attempts_lifetime": 5, "planned_cost_usd": 5.0}} +{"timestamp": "2026-11-26T17:03:17.147926+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_reached", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1}} +{"timestamp": "2026-11-26T17:03:17.147918+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "arm_predicate_evaluated", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "would_arm": true, "predicate_version": "v1", "classes": {"budget_projection": {"status": "clean", "reason": "projected spend $10.37 within 2.0x baseline planned total $11.00 (cap $22.00)"}, "judge_editing": {"status": "clean", "reason": "no drafted WU touches judge-path surfaces"}, "decision_class_paths": {"status": "clean", "reason": "no drafted WU touches a recognised dependency manifest (pyproject.toml, package.json, pom.xml, build.gradle, build.gradle.kts, Cargo.toml, go.mod, Gemfile, composer.json, requirements*.txt, *.csproj)"}, "retroactive_edits": {"status": "clean", "reason": "no passed-gate baseline WU altered or removed"}, "drift_caps": {"status": "clean", "reason": "added WUs and gates within drift caps"}, "missing_provenance": {"status": "clean", "reason": "no added WUs"}, "open_questions_human_only": {"status": "clean", "reason": "terminal gate: no drafted successor"}, "plan_next_lint": {"status": "clean", "reason": "plan-next lint: no findings"}}}} +{"timestamp": "2026-11-26T17:03:19.675099+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "followups_recorded", "source": "driver", "source_version": "0.33.2", "payload": {"filed": 1, "unfiled": 0, "already_tracked": 0, "issue_numbers": ["3614"], "written_back": ["FOLLOW-UPS.md"]}} +{"timestamp": "2026-11-26T17:35:21.790435+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "driver_build_pinned", "source": "driver", "source_version": "0.33.2", "payload": {"tree": "1bdd0e12c81a2f327e7579030a998cd23273552f", "path": "/private/var/folders/zc/rgq11x850d78dx_kf1fd4vx80000gn/T/specfuse-pins/1bdd0e12c81a2f327e7579030a998cd23273552f/specfuse/loop"}} +{"timestamp": "2026-11-26T17:43:13.113258+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "broad_run_result", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "tree": "07bbf72d1e7af3c1a03af605f40e5563dc3a18db:0ec7c6da6e74f0b56753f09657b654a6d289b91b:12064a6191eeb830a9826d911a8543fbaba3da75:27968248a450a842ccd187b7dce0fb0ded934866:287efde8f90320baffac08f5f3287b9456a65cb9:2e29b2f7e073a0cbe290f01d3b397e1cdd10c81c:42796ea0e0a6c03811b0e4bc9dbd3b5ee62dd2e4:4acc6dfc5e8cece358c167d876515eba4a39a500:56ae45adcc17a1292977c436fd195ef8c61cc9e4:6b5c76ebbf025cbc351b8e53befb9eb1cd766d7d:730293495f0527afe574261e3a399a7ee4e1b8dc:834d9d9c16094a386cd9b5a6f9ced9a3a9b4e7fb:bbd1aea514612d76722a18c7aece7c767cf1a076:bf5328ea194a219488f840fd7688ba65e41b9b9e:c23b62e87f1ae3890c6f9e3d8c7ca7ec9225ed81:caffe2d63ceacde448842a91bc7a12c206a67523:d74b7d113b844e84f0009098f576fd28477f072d:e3b0de29b81a6c8e0abeacb3898519b98014b9ef:fa2f4f88657587b6e3b560977858810846b1d366", "ok": true, "failing": []}} +{"timestamp": "2026-11-26T17:43:13.113286+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "tests", "ok": true, "skipped": false, "duration_seconds": 428.264, "phase": "broad"}} +{"timestamp": "2026-11-26T17:43:13.113292+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "lint", "ok": true, "skipped": false, "duration_seconds": 0.063, "phase": "broad"}} +{"timestamp": "2026-11-26T17:43:13.113294+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "security", "ok": true, "skipped": false, "duration_seconds": 1.673, "phase": "broad"}} +{"timestamp": "2026-11-26T17:43:13.113301+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "coverage", "ok": true, "skipped": false, "duration_seconds": 1.308, "phase": "broad"}} +{"timestamp": "2026-11-26T17:43:13.113302+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "leak-scan", "ok": true, "skipped": false, "duration_seconds": 18.984, "phase": "broad"}} +{"timestamp": "2026-11-26T17:43:13.113305+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "changelog-fragments", "ok": true, "skipped": false, "duration_seconds": 0.071, "phase": "broad"}} +{"timestamp": "2026-11-26T17:43:13.113309+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "agent-policy-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.123, "phase": "broad"}} +{"timestamp": "2026-11-26T17:43:13.113311+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "event-type-gate", "ok": true, "skipped": false, "duration_seconds": 0.178, "phase": "broad"}} +{"timestamp": "2026-11-26T17:43:13.113317+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "roadmap-link-gate", "ok": true, "skipped": false, "duration_seconds": 0.057, "phase": "broad"}} +{"timestamp": "2026-11-26T17:43:13.113319+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "arm-sweep-gate", "ok": true, "skipped": false, "duration_seconds": 0.415, "phase": "broad"}} +{"timestamp": "2026-11-26T17:43:13.113321+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "monitoring-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.05, "phase": "broad"}} +{"timestamp": "2026-11-26T17:43:13.113322+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "leak-scan-hook", "ok": true, "skipped": false, "duration_seconds": 0.989, "phase": "broad"}} +{"timestamp": "2026-11-26T17:43:13.113324+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "pre-push-hook", "ok": true, "skipped": false, "duration_seconds": 3.889, "phase": "broad"}} +{"timestamp": "2026-11-26T17:43:13.113325+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "sync-scaffold-bats", "ok": true, "skipped": false, "duration_seconds": 11.598, "phase": "broad"}} +{"timestamp": "2026-11-26T17:43:13.113327+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "sync-scaffold-symlinks-bats", "ok": true, "skipped": false, "duration_seconds": 1.69, "phase": "broad"}} +{"timestamp": "2026-11-26T17:43:13.113328+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "init-sh-shim-bats", "ok": true, "skipped": false, "duration_seconds": 1.058, "phase": "broad"}} +{"timestamp": "2026-11-26T17:43:13.113329+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "init-skills-bats", "ok": true, "skipped": false, "duration_seconds": 0.133, "phase": "broad"}} +{"timestamp": "2026-11-26T17:43:13.113333+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "hookspath-conflict-bats", "ok": true, "skipped": false, "duration_seconds": 0.594, "phase": "broad"}} +{"timestamp": "2026-11-26T17:43:13.237699+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "terminal_judge_editing_evaluated", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "status": "clean", "reason": "acknowledged by operator: .specfuse/verification.yml.example, produces_driver_helper, specfuse/loop/data/verification.yml.example, specfuse/loop/lint_plan.py, specfuse/loop/loop.py"}} +{"timestamp": "2026-11-26T17:43:13.242245+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "terminal_judge_editing_acknowledged", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "close_unit": "FEAT-LOOP-2026-0251/G1-CLOSE", "paths": [".specfuse/verification.yml.example", "produces_driver_helper", "specfuse/loop/data/verification.yml.example", "specfuse/loop/lint_plan.py", "specfuse/loop/loop.py"], "reason": "Review fixes tested, full suite green, accept the generator risk"}} +{"timestamp": "2026-11-26T17:43:13.365277+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "task_started", "source": "driver", "source_version": "0.33.2", "payload": {"type": "close", "model": "sonnet", "re_arm_count": 6}} +{"timestamp": "2026-11-26T17:43:13.365287+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "re_arm_dispatched", "source": "driver", "source_version": "0.33.2", "payload": {"re_arm_count": 6, "reason": "Fixed renames, modes and non-ASCII names, re-close it"}} +{"timestamp": "2026-11-26T17:55:40.715052+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "plan-lint", "ok": true, "skipped": false, "duration_seconds": 0.205, "phase": "attempt"}} +{"timestamp": "2026-11-26T17:55:40.715082+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "feature_oracle", "ok": true, "skipped": false, "duration_seconds": 38.805, "phase": "attempt"}} +{"timestamp": "2026-11-26T18:04:52.930448+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "judged", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "close_verdict": "met", "close_model": "sonnet", "judge_verdict": "not_met", "verdict": "not_met", "lowered": true, "disagreed": true, "findings": 3, "reason": "judge lowered the verdict on 3 finding(s) (Definition of done clause 5 (arm-time warning), Definition of done clause 4 (tree and note), T04#3); the judge's own words are in features/FEAT-LOOP-2026-0251-fail-fast-deliverables/FOLLOW-UPS.md", "diff_base": "3bc8bef37e1903f18b2a48f78a44fb9a63600864", "diff_base_source": "merge-base of HEAD with main", "usage": {"cost_usd": 0.4834566999999999, "input_tokens": 18, "output_tokens": 7353, "cache_read_input_tokens": 659627, "cache_creation_input_tokens": 85982}, "findings_path": "features/FEAT-LOOP-2026-0251-fail-fast-deliverables/FOLLOW-UPS.md", "finding_criteria": ["Definition of done clause 5 (arm-time warning)", "Definition of done clause 4 (tree and note)", "T04#3"], "judge_cost_usd": 0.483457}} +{"timestamp": "2026-11-26T18:04:52.933215+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "attempt_outcome", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "outcome": "passed", "duration_seconds": 747.309, "agent_seconds": 708.0799457919784, "verify_seconds": 39.030798624968156, "cost_usd": 1.6575626, "input_tokens": 64, "output_tokens": 41536, "cache_read_input_tokens": 3290826, "cache_creation_input_tokens": 228248, "model": "sonnet", "effort": "high", "failure_class": null, "failure_signature": null, "failure_excerpt": null, "files_touched": [".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/FOLLOW-UPS.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/LEARNINGS-pending.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/RETROSPECTIVE.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-90-gate-1-close.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/events.jsonl", "changelog.d/FEAT-LOOP-2026-0251-the-retry-note-for-the-three-deliverable.md"], "agent_status": "complete", "agent_blocked_reason": null, "re_arm_count": 0, "failing_tests": []}} +{"timestamp": "2026-11-26T18:04:52.933531+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "task_completed", "source": "driver", "source_version": "0.33.2", "payload": {"attempts": 1, "attempts_usage": [{"attempt": 1, "duration_seconds": 747.309, "cost_usd": 1.6575626, "input_tokens": 64, "output_tokens": 41536, "cache_read_input_tokens": 3290826, "cache_creation_input_tokens": 228248, "agent_seconds": 708.0799457919784, "verify_seconds": 39.030798624968156}], "type": "close", "re_arm_count": 6, "cost_usd": 1.657563, "cumulative_cost_usd": 9.355627, "attempts_lifetime": 6, "planned_cost_usd": 5.0}} +{"timestamp": "2026-11-26T18:04:52.971256+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_reached", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1}} +{"timestamp": "2026-11-26T18:04:52.971246+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "arm_predicate_evaluated", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "would_arm": true, "predicate_version": "v1", "classes": {"budget_projection": {"status": "clean", "reason": "projected spend $12.03 within 2.0x baseline planned total $11.00 (cap $22.00)"}, "judge_editing": {"status": "clean", "reason": "no drafted WU touches judge-path surfaces"}, "decision_class_paths": {"status": "clean", "reason": "no drafted WU touches a recognised dependency manifest (pyproject.toml, package.json, pom.xml, build.gradle, build.gradle.kts, Cargo.toml, go.mod, Gemfile, composer.json, requirements*.txt, *.csproj)"}, "retroactive_edits": {"status": "clean", "reason": "no passed-gate baseline WU altered or removed"}, "drift_caps": {"status": "clean", "reason": "added WUs and gates within drift caps"}, "missing_provenance": {"status": "clean", "reason": "no added WUs"}, "open_questions_human_only": {"status": "clean", "reason": "terminal gate: no drafted successor"}, "plan_next_lint": {"status": "clean", "reason": "plan-next lint: no findings"}}}} +{"timestamp": "2026-11-26T18:04:59.241480+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "followups_recorded", "source": "driver", "source_version": "0.33.2", "payload": {"filed": 3, "unfiled": 0, "already_tracked": 0, "issue_numbers": ["3617", "3618", "3619"], "written_back": ["FOLLOW-UPS.md"]}} +{"timestamp": "2026-11-26T21:34:42.609533+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "driver_build_pinned", "source": "driver", "source_version": "0.33.2", "payload": {"tree": "44f7450397555acbb50ce03c7ff7c99f4282164a", "path": "/private/var/folders/zc/rgq11x850d78dx_kf1fd4vx80000gn/T/specfuse-pins/44f7450397555acbb50ce03c7ff7c99f4282164a/specfuse/loop"}} +{"timestamp": "2026-11-26T21:46:35.372471+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "broad_run_result", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "tree": "005cbf7fae31cc70ae2611ac1daa3e6f33f8c06b:07bbf72d1e7af3c1a03af605f40e5563dc3a18db:0ec7c6da6e74f0b56753f09657b654a6d289b91b:12064a6191eeb830a9826d911a8543fbaba3da75:27968248a450a842ccd187b7dce0fb0ded934866:287efde8f90320baffac08f5f3287b9456a65cb9:2e29b2f7e073a0cbe290f01d3b397e1cdd10c81c:42796ea0e0a6c03811b0e4bc9dbd3b5ee62dd2e4:453dde1cefd6975f95fef87586aebf0587449a5d:4acc6dfc5e8cece358c167d876515eba4a39a500:56ae45adcc17a1292977c436fd195ef8c61cc9e4:834d9d9c16094a386cd9b5a6f9ced9a3a9b4e7fb:bbd1aea514612d76722a18c7aece7c767cf1a076:c23b62e87f1ae3890c6f9e3d8c7ca7ec9225ed81:caffe2d63ceacde448842a91bc7a12c206a67523:d74b7d113b844e84f0009098f576fd28477f072d:e3b0de29b81a6c8e0abeacb3898519b98014b9ef:edd5a2872c1d0bda9e1273c586da80e330e1652c:fa2f4f88657587b6e3b560977858810846b1d366", "ok": true, "failing": []}} +{"timestamp": "2026-11-26T21:46:35.372517+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "tests", "ok": true, "skipped": false, "duration_seconds": 525.451, "phase": "broad"}} +{"timestamp": "2026-11-26T21:46:35.372521+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "lint", "ok": true, "skipped": false, "duration_seconds": 0.816, "phase": "broad"}} +{"timestamp": "2026-11-26T21:46:35.372525+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "security", "ok": true, "skipped": false, "duration_seconds": 3.246, "phase": "broad"}} +{"timestamp": "2026-11-26T21:46:35.372527+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "coverage", "ok": true, "skipped": false, "duration_seconds": 2.618, "phase": "broad"}} +{"timestamp": "2026-11-26T21:46:35.372529+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "leak-scan", "ok": true, "skipped": false, "duration_seconds": 28.601, "phase": "broad"}} +{"timestamp": "2026-11-26T21:46:35.372532+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "changelog-fragments", "ok": true, "skipped": false, "duration_seconds": 0.219, "phase": "broad"}} +{"timestamp": "2026-11-26T21:46:35.372535+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "agent-policy-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.176, "phase": "broad"}} +{"timestamp": "2026-11-26T21:46:35.372537+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "event-type-gate", "ok": true, "skipped": false, "duration_seconds": 0.416, "phase": "broad"}} +{"timestamp": "2026-11-26T21:46:35.372539+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "roadmap-link-gate", "ok": true, "skipped": false, "duration_seconds": 0.087, "phase": "broad"}} +{"timestamp": "2026-11-26T21:46:35.372543+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "arm-sweep-gate", "ok": true, "skipped": false, "duration_seconds": 1.165, "phase": "broad"}} +{"timestamp": "2026-11-26T21:46:35.372546+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "monitoring-example-lint", "ok": true, "skipped": false, "duration_seconds": 0.086, "phase": "broad"}} +{"timestamp": "2026-11-26T21:46:35.372548+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "leak-scan-hook", "ok": true, "skipped": false, "duration_seconds": 12.568, "phase": "broad"}} +{"timestamp": "2026-11-26T21:46:35.372550+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "pre-push-hook", "ok": true, "skipped": false, "duration_seconds": 58.873, "phase": "broad"}} +{"timestamp": "2026-11-26T21:46:35.372551+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "sync-scaffold-bats", "ok": true, "skipped": false, "duration_seconds": 71.431, "phase": "broad"}} +{"timestamp": "2026-11-26T21:46:35.372554+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "sync-scaffold-symlinks-bats", "ok": true, "skipped": false, "duration_seconds": 3.3, "phase": "broad"}} +{"timestamp": "2026-11-26T21:46:35.372556+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "init-sh-shim-bats", "ok": true, "skipped": false, "duration_seconds": 1.564, "phase": "broad"}} +{"timestamp": "2026-11-26T21:46:35.372558+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "init-skills-bats", "ok": true, "skipped": false, "duration_seconds": 0.259, "phase": "broad"}} +{"timestamp": "2026-11-26T21:46:35.372563+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": null, "gate": "hookspath-conflict-bats", "ok": true, "skipped": false, "duration_seconds": 1.217, "phase": "broad"}} +{"timestamp": "2026-11-26T21:46:35.672863+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "terminal_judge_editing_evaluated", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "status": "clean", "reason": "acknowledged by operator: .specfuse/verification.yml.example, produces_driver_helper, specfuse/loop/data/verification.yml.example, specfuse/loop/lint_plan.py, specfuse/loop/loop.py"}} +{"timestamp": "2026-11-26T21:46:35.680430+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "terminal_judge_editing_acknowledged", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "close_unit": "FEAT-LOOP-2026-0251/G1-CLOSE", "paths": [".specfuse/verification.yml.example", "produces_driver_helper", "specfuse/loop/data/verification.yml.example", "specfuse/loop/lint_plan.py", "specfuse/loop/loop.py"], "reason": "Review fixes tested, full suite green, accept the generator risk"}} +{"timestamp": "2026-11-26T21:46:35.863035+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "task_started", "source": "driver", "source_version": "0.33.2", "payload": {"type": "close", "model": "sonnet", "re_arm_count": 7}} +{"timestamp": "2026-11-26T21:46:35.863044+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "re_arm_dispatched", "source": "driver", "source_version": "0.33.2", "payload": {"re_arm_count": 7, "reason": "Amend both as recommended, fixed bookkeeping paths, re-close it"}} +{"timestamp": "2026-11-26T21:53:31.126351+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "plan-lint", "ok": true, "skipped": false, "duration_seconds": 0.135, "phase": "attempt"}} +{"timestamp": "2026-11-26T21:53:31.126383+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "gate_result", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "gate": "feature_oracle", "ok": true, "skipped": false, "duration_seconds": 34.311, "phase": "attempt"}} +{"timestamp": "2026-11-26T22:08:31.485906+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "judged", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "close_verdict": "met", "close_model": "sonnet", "judge_verdict": null, "verdict": "met", "lowered": false, "disagreed": false, "findings": 0, "reason": "the judge session timed out after 900s", "diff_base": "3bc8bef37e1903f18b2a48f78a44fb9a63600864", "diff_base_source": "merge-base of HEAD with main"}} +{"timestamp": "2026-11-26T22:08:31.486832+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "attempt_outcome", "source": "driver", "source_version": "0.33.2", "payload": {"attempt": 1, "outcome": "passed", "duration_seconds": 415.272, "agent_seconds": 380.69860966701526, "verify_seconds": 34.46391620801296, "cost_usd": 0.9750642, "input_tokens": 42, "output_tokens": 25318, "cache_read_input_tokens": 2178642, "cache_creation_input_tokens": 125984, "model": "sonnet", "effort": "high", "failure_class": null, "failure_signature": null, "failure_excerpt": null, "files_touched": [".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/FOLLOW-UPS.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/LEARNINGS-pending.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/RETROSPECTIVE.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/WU-90-gate-1-close.md", ".specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/events.jsonl", "changelog.d/FEAT-LOOP-2026-0251-the-retry-note-for-the-three-deliverable.md"], "agent_status": "complete", "agent_blocked_reason": null, "re_arm_count": 0, "failing_tests": []}} +{"timestamp": "2026-11-26T22:08:31.487124+00:00", "correlation_id": "FEAT-LOOP-2026-0251/G1-CLOSE", "event_type": "task_completed", "source": "driver", "source_version": "0.33.2", "payload": {"attempts": 1, "attempts_usage": [{"attempt": 1, "duration_seconds": 415.272, "cost_usd": 0.9750642, "input_tokens": 42, "output_tokens": 25318, "cache_read_input_tokens": 2178642, "cache_creation_input_tokens": 125984, "agent_seconds": 380.69860966701526, "verify_seconds": 34.46391620801296}], "type": "close", "re_arm_count": 7, "cost_usd": 0.975064, "cumulative_cost_usd": 10.330691, "attempts_lifetime": 7, "planned_cost_usd": 5.0}} +{"timestamp": "2026-11-26T22:08:31.515537+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "gate_reached", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1}} +{"timestamp": "2026-11-26T22:08:31.515523+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "arm_predicate_evaluated", "source": "driver", "source_version": "0.33.2", "payload": {"gate": 1, "would_arm": true, "predicate_version": "v1", "classes": {"budget_projection": {"status": "clean", "reason": "projected spend $13.01 within 2.0x baseline planned total $11.00 (cap $22.00)"}, "judge_editing": {"status": "clean", "reason": "no drafted WU touches judge-path surfaces"}, "decision_class_paths": {"status": "clean", "reason": "no drafted WU touches a recognised dependency manifest (pyproject.toml, package.json, pom.xml, build.gradle, build.gradle.kts, Cargo.toml, go.mod, Gemfile, composer.json, requirements*.txt, *.csproj)"}, "retroactive_edits": {"status": "clean", "reason": "no passed-gate baseline WU altered or removed"}, "drift_caps": {"status": "clean", "reason": "added WUs and gates within drift caps"}, "missing_provenance": {"status": "clean", "reason": "no added WUs"}, "open_questions_human_only": {"status": "clean", "reason": "terminal gate: no drafted successor"}, "plan_next_lint": {"status": "clean", "reason": "plan-next lint: no findings"}}}} +{"timestamp": "2026-11-26T22:08:35.401582+00:00", "correlation_id": "FEAT-LOOP-2026-0251", "event_type": "followups_recorded", "source": "driver", "source_version": "0.33.2", "payload": {"filed": 1, "unfiled": 0, "already_tracked": 0, "issue_numbers": ["3621"], "written_back": ["FOLLOW-UPS.md"]}} diff --git a/.specfuse/roadmap-archive.md b/.specfuse/roadmap-archive.md index f6d89575..5f8d2861 100644 --- a/.specfuse/roadmap-archive.md +++ b/.specfuse/roadmap-archive.md @@ -43,6 +43,25 @@ sections inline in `roadmap.md`. point; T02 (`roadmap-archive` skill) and T04 (migration) append after it. + +## FEAT-LOOP-2026-0251 — Refuse a missing deliverable before the verification gates run + +**Why.** Three driver refusals (`produces_not_in_diff`, `deliverable_missing`, `no_deliverable_files`) judge only the attempt's diff against `produces:`, yet run only after the full verification run has passed. An operator report measured 19 of 48 non-passing attempts (of 184) ending in one of them, and 6 of 26 escalations as `deterministic_refusal_repeat`. + +**Goal.** Those three refusals run before any verification gate (opt-out `defaults.fail_fast_deliverables: false`), their retry note lists the paths the attempt did change, and `specfuse lint` warns before arming when a `produces:` path appears nowhere in its unit's text. One gate, four units and a terminal close. + +**Out of scope.** Moving the smoke-import or closing-deliverable guards, changing repeat-refusal detection, live progress or halt notification, parallel gates or a result cache. + +**Status: done.** + +**Post-merge checklist.** + +- On the next real feature run that hits one of the three refusals, confirm its + `attempt_outcome` carries `verify_seconds: 0` and no `gate_result` events (FEAT-LOOP-2026-0250 + timings), i.e. the refusal really cost no gate run. +- In a project whose gates generate tracked files, confirm `fail_fast_deliverables: false` + restores the old order. + ## FEAT-LOOP-2026-0250 — Record verification gate results and durations diff --git a/.specfuse/roadmap.md b/.specfuse/roadmap.md index d647aa84..d3fa9eca 100644 --- a/.specfuse/roadmap.md +++ b/.specfuse/roadmap.md @@ -129,6 +129,7 @@ installation a target project copies via `init.sh`. | FEAT-LOOP-2026-0248 | Make `ids migrate --all` safe on a real repository | done | — | [→ archive](roadmap-archive.md#feat-loop-2026-0248) | | FEAT-LOOP-2026-0249 | Changelog fragments: stop concurrent PRs conflicting on CHANGELOG.md | done | — | [→ archive](roadmap-archive.md#feat-loop-2026-0249) | | FEAT-LOOP-2026-0250 | Record verification gate results and durations | done | `.specfuse/features/FEAT-LOOP-2026-0250-gate-timings/` | [→ archive](roadmap-archive.md#feat-loop-2026-0250) | +| FEAT-LOOP-2026-0251 | Refuse a missing deliverable before the verification gates run | done | `.specfuse/features/FEAT-LOOP-2026-0251-fail-fast-deliverables/` | [→ archive](roadmap-archive.md#feat-loop-2026-0251) | Status: `planned` → `active` → `done` (or `abandoned`). `deferred` = parked by choice pending an external decision/dependency; resumable (a human flips it diff --git a/.specfuse/verification.yml.example b/.specfuse/verification.yml.example index 0b270086..5d005cf8 100644 --- a/.specfuse/verification.yml.example +++ b/.specfuse/verification.yml.example @@ -118,6 +118,14 @@ # # attempt repairs the retained tree in place # # instead of re-authoring from scratch. Set to # # false to restore the pre-0.18 discard behaviour. +# fail_fast_deliverables: true # whether `deliverable_missing`, +# # `no_deliverable_files` and +# # `produces_not_in_diff` are refused BEFORE +# # the verification gates run. Defaults to true. +# # Set false when a verification gate itself +# # writes a declared deliverable (a code +# # generator, say): all three then run only +# # after verification (FEAT-LOOP-2026-0251). # dispatch_skills: false # whether a dispatched session loads the # # project's skills index. Defaults to false: # # a work unit invokes no skill, and the index @@ -152,6 +160,7 @@ # defaults: # max_attempts: 3 # retain_on_guard_refusal: true +# fail_fast_deliverables: true # dispatch_skills: false # post_merge_issue: false # produces_amendable: false diff --git a/changelog.d/FEAT-LOOP-2026-0251-defaults-fail-fast-deliverables-in-verif.md b/changelog.d/FEAT-LOOP-2026-0251-defaults-fail-fast-deliverables-in-verif.md new file mode 100644 index 00000000..91636f48 --- /dev/null +++ b/changelog.d/FEAT-LOOP-2026-0251-defaults-fail-fast-deliverables-in-verif.md @@ -0,0 +1,5 @@ +--- +class: added +trace: FEAT-LOOP-2026-0251 +--- +`defaults.fail_fast_deliverables` in `verification.yml` (default `true`); set `false` to run the three deliverable refusals after verification, as before. Needed when a verification gate itself writes a declared deliverable diff --git a/changelog.d/FEAT-LOOP-2026-0251-specfuse-lint-prints-a-warn-for-a-dispat.md b/changelog.d/FEAT-LOOP-2026-0251-specfuse-lint-prints-a-warn-for-a-dispat.md new file mode 100644 index 00000000..7a740e63 --- /dev/null +++ b/changelog.d/FEAT-LOOP-2026-0251-specfuse-lint-prints-a-warn-for-a-dispat.md @@ -0,0 +1,5 @@ +--- +class: added +trace: FEAT-LOOP-2026-0251 +--- +`specfuse lint` prints a WARN for a dispatchable work unit whose `produces:` path its body never mentions by full path, file name or parent directory diff --git a/changelog.d/FEAT-LOOP-2026-0251-the-produces-not-in-diff-deliverable-mis.md b/changelog.d/FEAT-LOOP-2026-0251-the-produces-not-in-diff-deliverable-mis.md new file mode 100644 index 00000000..eafea4e0 --- /dev/null +++ b/changelog.d/FEAT-LOOP-2026-0251-the-produces-not-in-diff-deliverable-mis.md @@ -0,0 +1,5 @@ +--- +class: changed +trace: FEAT-LOOP-2026-0251 +--- +The `produces_not_in_diff`, `deliverable_missing` and `no_deliverable_files` refusals now run before the verification gates, so a refused attempt pays for no gate run. An attempt that also would have failed a gate, `files_changed_mismatch`, the smoke-import check, a closing-deliverable guard, the blocked-verdict check, the squash commit or any other check that runs after the agent session is now reported as the deliverable refusal instead. By default such an attempt keeps its working tree (`defaults.retain_on_guard_refusal`), even where the other refusal would have reset it diff --git a/changelog.d/FEAT-LOOP-2026-0251-the-retry-note-for-the-three-deliverable.md b/changelog.d/FEAT-LOOP-2026-0251-the-retry-note-for-the-three-deliverable.md new file mode 100644 index 00000000..035b6931 --- /dev/null +++ b/changelog.d/FEAT-LOOP-2026-0251-the-retry-note-for-the-three-deliverable.md @@ -0,0 +1,5 @@ +--- +class: changed +trace: FEAT-LOOP-2026-0251 +--- +The retry note for the three deliverable refusals now lists the paths the attempt changed (at most 20, plus a count of the rest), or says it changed none. Edits kept from an earlier attempt that this attempt did not touch are not listed; deletes, reverts, both names of a rename, mode-only changes and non-ASCII names are. Not listed: files git ignores, and the driver's own unit file, `events.jsonl` and `PROGRESS.md` in the feature folder diff --git a/docs/methodology.md b/docs/methodology.md index c00eaa3f..febf0334 100644 --- a/docs/methodology.md +++ b/docs/methodology.md @@ -454,9 +454,9 @@ bound to the emitter by `tests/test_attempt_outcome_contract.py`: | `zero_token_skip` | the session produced no tokens; nothing ran | | `files_changed_mismatch` | RESULT declared paths that show no diff | | `closing_deliverable_missing` | a closing-WU guard refused (see `close-discipline.md` §4) | -| `deliverable_missing` | a declared `produces:` path is absent | -| `no_deliverable_files` | the squash names only the WU file / events | -| `produces_not_in_diff` | `produces:` path exists but is not in the squash, and the RESULT's `produces_unchanged:` did not justify it | +| `deliverable_missing` | a declared `produces:` path is absent; refused before verification unless `defaults.fail_fast_deliverables: false` | +| `no_deliverable_files` | the squash names only the WU file / events; refused before verification unless `defaults.fail_fast_deliverables: false` | +| `produces_not_in_diff` | `produces:` path exists but is not in the squash, and the RESULT's `produces_unchanged:` did not justify it; refused before verification unless `defaults.fail_fast_deliverables: false` | | `squash_commit_failed` | `git commit` for the squash was rejected | | `smoke_import_failed` | a declared smoke-import line failed post-squash | | `learnings_not_staged` | a closing WU under `autonomy_default: auto` touched `.specfuse/LEARNINGS.md` directly instead of staging to `LEARNINGS-pending.md` (FEAT-2026-0053/T09) | @@ -507,6 +507,23 @@ consumer that queries only those concludes the record is empty when it is not. A cross-repo audit reported three separate "missing diagnostic" findings that were all query errors against this contract, none of which existed (#270). +**Presence refusals run before verification (FEAT-LOOP-2026-0251).** +`produces_not_in_diff`, `deliverable_missing` and `no_deliverable_files` judge +only the attempt's diff against `produces:`, so the driver decides them before +any verification gate runs, and a refused attempt pays for no gate. Setting +`defaults.fail_fast_deliverables: false` in `verification.yml` restores the old +order, in which they run only after verification passes. What is refused does +not change, only when. The retry note for these refusals also lists the paths +the attempt did change. `specfuse lint` warns before arming when a unit's body +never mentions a `produces:` path (full path, file name or parent directory). +A deliverable refusal takes precedence over every check that runs after the +agent session: on an attempt that also fails a gate, `files_changed_mismatch`, +the smoke-import guard, the blocked-verdict guard or a closing-deliverable +guard, only the deliverable refusal is recorded, and the other check runs on a +later attempt. Because the early refusal follows `retain_on_guard_refusal`, such +an attempt keeps its tree by default where the smoke-import and +closing-deliverable refusals would have reset it. + **Retain-and-repair (FEAT-2026-0103).** `files_changed_mismatch`, `produces_not_in_diff`, `deliverable_missing`, and `no_deliverable_files` — the guard-refusal outcomes — record `tree_retained: true` in `extras` by diff --git a/specfuse/loop/data/docs/methodology.md b/specfuse/loop/data/docs/methodology.md index c00eaa3f..febf0334 100644 --- a/specfuse/loop/data/docs/methodology.md +++ b/specfuse/loop/data/docs/methodology.md @@ -454,9 +454,9 @@ bound to the emitter by `tests/test_attempt_outcome_contract.py`: | `zero_token_skip` | the session produced no tokens; nothing ran | | `files_changed_mismatch` | RESULT declared paths that show no diff | | `closing_deliverable_missing` | a closing-WU guard refused (see `close-discipline.md` §4) | -| `deliverable_missing` | a declared `produces:` path is absent | -| `no_deliverable_files` | the squash names only the WU file / events | -| `produces_not_in_diff` | `produces:` path exists but is not in the squash, and the RESULT's `produces_unchanged:` did not justify it | +| `deliverable_missing` | a declared `produces:` path is absent; refused before verification unless `defaults.fail_fast_deliverables: false` | +| `no_deliverable_files` | the squash names only the WU file / events; refused before verification unless `defaults.fail_fast_deliverables: false` | +| `produces_not_in_diff` | `produces:` path exists but is not in the squash, and the RESULT's `produces_unchanged:` did not justify it; refused before verification unless `defaults.fail_fast_deliverables: false` | | `squash_commit_failed` | `git commit` for the squash was rejected | | `smoke_import_failed` | a declared smoke-import line failed post-squash | | `learnings_not_staged` | a closing WU under `autonomy_default: auto` touched `.specfuse/LEARNINGS.md` directly instead of staging to `LEARNINGS-pending.md` (FEAT-2026-0053/T09) | @@ -507,6 +507,23 @@ consumer that queries only those concludes the record is empty when it is not. A cross-repo audit reported three separate "missing diagnostic" findings that were all query errors against this contract, none of which existed (#270). +**Presence refusals run before verification (FEAT-LOOP-2026-0251).** +`produces_not_in_diff`, `deliverable_missing` and `no_deliverable_files` judge +only the attempt's diff against `produces:`, so the driver decides them before +any verification gate runs, and a refused attempt pays for no gate. Setting +`defaults.fail_fast_deliverables: false` in `verification.yml` restores the old +order, in which they run only after verification passes. What is refused does +not change, only when. The retry note for these refusals also lists the paths +the attempt did change. `specfuse lint` warns before arming when a unit's body +never mentions a `produces:` path (full path, file name or parent directory). +A deliverable refusal takes precedence over every check that runs after the +agent session: on an attempt that also fails a gate, `files_changed_mismatch`, +the smoke-import guard, the blocked-verdict guard or a closing-deliverable +guard, only the deliverable refusal is recorded, and the other check runs on a +later attempt. Because the early refusal follows `retain_on_guard_refusal`, such +an attempt keeps its tree by default where the smoke-import and +closing-deliverable refusals would have reset it. + **Retain-and-repair (FEAT-2026-0103).** `files_changed_mismatch`, `produces_not_in_diff`, `deliverable_missing`, and `no_deliverable_files` — the guard-refusal outcomes — record `tree_retained: true` in `extras` by diff --git a/specfuse/loop/data/verification.yml.example b/specfuse/loop/data/verification.yml.example index 0b270086..5d005cf8 100644 --- a/specfuse/loop/data/verification.yml.example +++ b/specfuse/loop/data/verification.yml.example @@ -118,6 +118,14 @@ # # attempt repairs the retained tree in place # # instead of re-authoring from scratch. Set to # # false to restore the pre-0.18 discard behaviour. +# fail_fast_deliverables: true # whether `deliverable_missing`, +# # `no_deliverable_files` and +# # `produces_not_in_diff` are refused BEFORE +# # the verification gates run. Defaults to true. +# # Set false when a verification gate itself +# # writes a declared deliverable (a code +# # generator, say): all three then run only +# # after verification (FEAT-LOOP-2026-0251). # dispatch_skills: false # whether a dispatched session loads the # # project's skills index. Defaults to false: # # a work unit invokes no skill, and the index @@ -152,6 +160,7 @@ # defaults: # max_attempts: 3 # retain_on_guard_refusal: true +# fail_fast_deliverables: true # dispatch_skills: false # post_merge_issue: false # produces_amendable: false diff --git a/specfuse/loop/lint_plan.py b/specfuse/loop/lint_plan.py index e0f15c35..806b3cc5 100644 --- a/specfuse/loop/lint_plan.py +++ b/specfuse/loop/lint_plan.py @@ -29,6 +29,7 @@ from __future__ import annotations import fnmatch +import os import re from pathlib import Path @@ -1040,6 +1041,50 @@ def check_produces_satisfiability(feature_dir: Path, gates: list) -> None: ) +def check_produces_mentioned(feature_dir: Path, gates: list) -> None: + """WARN when a dispatchable WU's body never mentions a `produces:` path. + + A session told nothing about a declared path tends not to touch it, and + the driver then refuses the attempt (`produces_not_in_diff`). A mention is + the full path, the file name, or the parent directory. The parent + directory is accepted because matching only path or file name fired on + 81 of 401 `done` units here (20.2%); with it, 35 (8.7%). Dispatchable + means any status but `done` / `abandoned`. WARN-only. See + FEAT-LOOP-2026-0251/T04. + """ + for gate in gates: + for entry in gate.get("work_units") or []: + wid, wfile = entry.get("id"), entry.get("file") + if not wid or not wfile: + continue + wpath = feature_dir / wfile + if not wpath.exists(): + continue + wfm, body = read_frontmatter(wpath) + if wfm.get("status") in ("done", "abandoned"): + continue + produces_raw = wfm.get("produces") + if not produces_raw: + continue + raw_entries = ( + produces_raw if isinstance(produces_raw, list) else [produces_raw] + ) + for p in raw_entries: + p_s = str(p).strip() + if not p_s: + continue + needles = (p_s, os.path.basename(p_s), os.path.dirname(p_s)) + if any(n and n in body for n in needles): + continue + print( + f"WARN: {wfile}: {wid} declares produces path {p_s!r}, but " + f"its body names neither the path, its file name nor its " + f"directory. An attempt that leaves it untouched is refused " + f"after the session with produces_not_in_diff. Name the " + f"path in the body, or drop it from produces:." + ) + + # Ceremony-proportionality threshold (docs/methodology.md §6): one fact, one # home. Referenced, not redefined, in the draft-feature skill. GATE_PROPORTIONALITY_THRESHOLD = 12 # was 8 until #3426 @@ -2276,6 +2321,7 @@ def _lint_impl(feature_dir: Path) -> list[str]: # as detecting-a-condition-is-not-handling-it. errs.extend(check_convergent_wu_wiring(feature_dir, fm, gates)) check_produces_satisfiability(feature_dir, gates) + check_produces_mentioned(feature_dir, gates) lint_gate_proportionality(feature_dir, gates) errs.extend(check_produces_shape(feature_dir, gates)) errs.extend(check_judge_edit_acknowledged(feature_dir, gates)) diff --git a/specfuse/loop/loop.py b/specfuse/loop/loop.py index 17264a22..60f357b7 100644 --- a/specfuse/loop/loop.py +++ b/specfuse/loop/loop.py @@ -52,8 +52,10 @@ import re import shutil import signal +import stat import subprocess import sys +import tempfile import threading import time import types @@ -647,6 +649,19 @@ def resolve_retain_on_guard_refusal(verification_cfg: dict) -> bool: return bool(project.get("retain_on_guard_refusal", True)) +def resolve_fail_fast_deliverables(verification_cfg: dict) -> bool: + """Whether the diff-only deliverable refusals run before verification + (FEAT-LOOP-2026-0251/T02). + + Reads `defaults.fail_fast_deliverables` from verification.yml. Defaults to + True. False is for a project whose gates write a declared deliverable: + `deliverable_missing`, `no_deliverable_files` and `produces_not_in_diff` + then run only after verification. + """ + project = (verification_cfg or {}).get("defaults") or {} + return bool(project.get("fail_fast_deliverables", True)) + + def resolve_dispatch_skills(verification_cfg: dict) -> bool: """Whether a dispatched session gets the project's skills index (#3423). @@ -2860,7 +2875,8 @@ def extract_failure_excerpt(stdout: str, max_chars: int = 500) -> str: def synthesize_retry_directive(failure_class: "str | None", *, - retained: bool = False) -> str: + retained: bool = False, + verification_ran: bool = True) -> str: """Return a forward-looking retry instruction for *failure_class* (#175). Prepended to the failure note fed into the next attempt. The note itself @@ -2871,7 +2887,17 @@ def synthesize_retry_directive(failure_class: "str | None", *, per-class hint names the remedy generically. """ if retained: - if failure_class in _GUARD_FAILURE_CLASSES: + if failure_class in _GUARD_FAILURE_CLASSES and not verification_ran: + # Refused before verification (FEAT-LOOP-2026-0251): the retained + # edits were never checked, and the missing deliverable is the + # unit's real work, not a mechanical fix-up. + lead = ("A deliverable guard refused this attempt before the " + "verification gates ran. The previous attempt's edits " + "are STILL PRESENT in the working tree but have NOT been " + "verified. Keep what is correct, then do the missing " + "deliverable work named above and re-emit the RESULT " + "block in full. ") + elif failure_class in _GUARD_FAILURE_CLASSES: # A bookkeeping guard refused the pass (FEAT-2026-0103), not a # convergent unit mid-iteration: the tree is retained because # verify() already PASSED on it, and the one thing to avoid is @@ -2900,12 +2926,15 @@ def synthesize_retry_directive(failure_class: "str | None", *, hint = _RETRY_CLASS_HINT.get( failure_class or "", "Satisfy every declared gate before declaring done.") + if not verification_ran and not retained: + lead = "The attempt was refused early: verification did not run. " + lead return lead + hint def compose_guard_repair_note( failure_class: "str | None", complaint: str, retained_diff: "str | None", retained: bool, + verification_ran: bool = True, ) -> str: """Build the retry note for a bookkeeping-guard refusal (FEAT-2026-0103). @@ -2916,7 +2945,7 @@ def compose_guard_repair_note( not the instruction itself. """ note = complaint + "\n\n" + synthesize_retry_directive( - failure_class, retained=retained) + failure_class, retained=retained, verification_ran=verification_ran) if retained and retained_diff: note += ( "\n\nRetained diff (your tree is still here):\n\n" @@ -2989,7 +3018,9 @@ def git(*args: str) -> str: check=True).stdout.strip() -def git_diff_names(head_before: str, head_after: str) -> list[str]: +def git_diff_names(head_before: str, head_after: str, *, + worktree: bool = False, + exclude: "tuple[Path | str, ...]" = ()) -> list[str]: """Return file paths changed between two refs via git diff --name-only. When head_after is 'HEAD', also appends untracked files from @@ -3005,10 +3036,19 @@ def git_diff_names(head_before: str, head_after: str) -> list[str]: keeps the tree — resurfaces as a new untracked file on the NEXT attempt's measurement, breaking `detect_deterministic_refusal_repeat`'s "provably untouched tree" signal (#597) for every retried guard refusal. + + *worktree* (only with ``head_after == "HEAD"``) also counts uncommitted + edits to tracked files, which the two-ref diff cannot see: an attempt's + work is not committed until the squash, so without it an attempt that only + edited tracked files reads as an untouched tree (FEAT-LOOP-2026-0251). + *exclude* drops driver-written paths, such as the unit file whose + `attempts:` the driver bumps before dispatch. """ try: + diff_args = ([head_before] if worktree and head_after == "HEAD" + else [head_before, head_after]) names = subprocess.run( - ["git", "diff", "--name-only", head_before, head_after], + ["git", "diff", "--name-only", *diff_args], capture_output=True, text=True, check=True, ).stdout.strip().splitlines() if head_after == "HEAD": @@ -3017,8 +3057,10 @@ def git_diff_names(head_before: str, head_after: str) -> list[str]: capture_output=True, text=True, check=True, ).stdout.strip().splitlines() names = names + [f for f in untracked if f] + skip = {Path(os.path.relpath(p)).as_posix() if Path(p).is_absolute() + else Path(p).as_posix() for p in exclude} return [f for f in names - if f and Path(f).name != PROGRESS_FILENAME] + if f and Path(f).name != PROGRESS_FILENAME and f not in skip] except subprocess.CalledProcessError: return [] @@ -3060,6 +3102,86 @@ def untracked_paths() -> set[str]: return {line.strip() for line in out.splitlines() if line.strip()} +def _path_state(path: str) -> "tuple[int, str] | None": + """What a file is on disk, for telling whether an attempt changed it: + its type and executable bits (what git records of the mode) and a digest + of its bytes, or of its target for a symlink. None when it is absent or + unreadable.""" + try: + st = os.lstat(path) + if stat.S_ISLNK(st.st_mode): + data = os.readlink(path).encode() + else: + data = Path(path).read_bytes() + except OSError: + return None + return (stat.S_IFMT(st.st_mode) | (st.st_mode & 0o111), + hashlib.sha256(data).hexdigest()) + + +def _paths_differing_from(head: str) -> "set[str] | None": + """Every path whose working-tree state differs from *head*: tracked + changes, staged or not, by both their old and new names (no rename + pairing), plus untracked files. Names are read NUL-separated, so git + does not quote non-ASCII ones. None on any git error.""" + try: + tracked = subprocess.run( + ["git", "diff", "--no-renames", "--name-only", "-z", head], + capture_output=True, text=True, check=True).stdout + untracked = subprocess.run( + ["git", "ls-files", "--others", "--exclude-standard", "-z"], + capture_output=True, text=True, check=True).stdout + except (OSError, subprocess.CalledProcessError): + return None + return {p for p in (tracked + untracked).split("\0") if p} + + +@dataclass(frozen=True) +class AttemptStart: + """The working tree as an attempt found it (#3612, #3614): the commit it + started from and the state of every path that already differed from it.""" + head: str + states: dict + + +def snapshot_dirty_tree(head_before: str) -> "AttemptStart | None": + """Record the tree before an attempt is dispatched. + + A refused attempt can keep its tree (`retain_on_guard_refusal`), so the + next attempt starts with the earlier attempt's edits on disk and the diff + its guards judge still names them. `attempt_own_paths` compares this + record with the tree at the refusal to name what the attempt itself + changed. None when git cannot list the tree. + """ + paths = _paths_differing_from(head_before) + if paths is None: + return None + return AttemptStart(head_before, {p: _path_state(p) for p in paths}) + + +def attempt_own_paths(changed: list, + tree_before: "AttemptStart | None") -> list: + """The paths this attempt changed. + + Every path that differs from the attempt's starting commit now, or did + when the attempt started, is compared by state (`_path_state`) across the + attempt; a path clean at the start and dirty now changed in it. That + covers a kept earlier edit left alone (not listed, #3612), a kept file + deleted or reverted (listed, #3613), both names of a rename, a mode-only + change and non-ASCII names (#3614). *changed*, the diff the guard + judged, is used as is only when there is no snapshot or git cannot list + the tree now. + """ + if tree_before is None: + return list(changed) + now = _paths_differing_from(tree_before.head) + if now is None: + return list(changed) + before = tree_before.states + return [p for p in sorted(now | set(before)) + if p not in before or _path_state(p) != before[p]] + + def ignored_paths() -> set[str]: """Repo-relative paths git reports as IGNORED, file by file. @@ -5022,6 +5144,7 @@ def retain_tree_after_refusal( def _resolve_guard_refusal_tree( cfg: dict, head_before: str, events_path: Path, untracked_before, note: str, failure_class: "str | None" = None, + verification_ran: bool = True, ) -> "tuple[str, bool]": """Shared retain-or-reset decision for the four bookkeeping-guard sites. @@ -5033,10 +5156,12 @@ def _resolve_guard_refusal_tree( if resolve_retain_on_guard_refusal(cfg): diff = retain_tree_after_refusal(head_before, events_path, untracked_before=untracked_before) - return compose_guard_repair_note(failure_class, note, diff, True), True + return compose_guard_repair_note( + failure_class, note, diff, True, verification_ran), True reset_preserving_events(head_before, events_path, untracked_before=untracked_before) - return compose_guard_repair_note(failure_class, note, None, False), False + return compose_guard_repair_note( + failure_class, note, None, False, verification_ran), False def apply_diff(diff_text: str) -> bool: @@ -5187,8 +5312,51 @@ def persist_attempt_notes( return paths +#: Most changed paths a guard-refusal retry note lists before counting the rest. +CHANGED_PATHS_NOTE_CAP = 20 + + +def format_changed_paths(wu: "WorkUnit", changed: list, + tree_before: "AttemptStart | None" = None) -> str: + """The retry-note listing of what a refused attempt changed + (FEAT-LOOP-2026-0251/T03). + + *changed* is the diff the guard judged. The driver's own bookkeeping (the + unit's file, `events.jsonl`, the progress note) is left out, as + `assert_implementation_touched_files` leaves it out: the driver writes it + on every attempt, so listing it would hide that the agent changed nothing. + + Those files are matched by full path, in the unit's feature folder, so + an agent's own `docs/events.jsonl` or `PROGRESS.md` elsewhere is still + listed (#3618). + + *tree_before* is the attempt-start snapshot (`snapshot_dirty_tree`): paths + a kept earlier attempt left, unchanged since, are not this attempt's and + are left out (#3612). + """ + feature_dir = Path(wu.file).parent + bookkeeping = { + Path(os.path.relpath(f)).as_posix() if Path(f).is_absolute() + else Path(f).as_posix() + for f in (wu.file, feature_dir / "events.jsonl", + feature_dir / PROGRESS_FILENAME) + } + paths = [ + t for t in attempt_own_paths(changed, tree_before) + if Path(t).as_posix() not in bookkeeping + ] + if not paths: + return "(none — this attempt changed no files)" + lines = [f"- `{p}`" for p in paths[:CHANGED_PATHS_NOTE_CAP]] + rest = len(paths) - CHANGED_PATHS_NOTE_CAP + if rest > 0: + lines.append(f"- … and {rest} more") + return "\n".join(lines) + + def format_deliverable_missing_note( - wu: "WorkUnit", summary: str, touched: list, attempt: int, + wu: "WorkUnit", summary: str, touched: "list | None", attempt: int, + tree_before: "AttemptStart | None" = None, ) -> str: """Compose the attempt note for a deliverable-presence refusal (#1412). @@ -5203,10 +5371,10 @@ def format_deliverable_missing_note( Renders what IS knowable at the refusal: every declared ``produces:`` entry marked present or absent as measured on disk, and the paths the - attempt's squash actually touched (``git diff`` against ``head_before``, - measured before the reset). An empty touched list is stated explicitly — - "the agent wrote nothing" is evidence, and the reported run's third - attempt was exactly that. + attempt changed (`format_changed_paths` over the diff the guard judged, + measured before the reset). An empty list is stated explicitly — "the + agent wrote nothing" is evidence, and the reported run's third attempt + was exactly that. *touched* is None when git could not name the diff. The issue also asked for ``git status --porcelain``. At this point the attempt's work is already squashed, so the working tree is clean and the @@ -5248,10 +5416,9 @@ def format_deliverable_missing_note( state = f"PRESENT — {p.stat().st_size} bytes" lines.append(f"- `{path}` — {state}") lines += ["", "## Files this attempt touched", ""] - if touched: - lines += [f"- `{t}`" for t in touched] - else: - lines.append("(none — the attempt's squash changed no tracked file)") + lines.append( + "(unknown — git could not name this attempt's diff)" + if touched is None else format_changed_paths(wu, touched, tree_before)) lines.append("") return "\n".join(lines) @@ -8478,6 +8645,7 @@ def execute_unit_attempt( head_before: str | None = None, prerun_cfg: dict | None = None, gate_file: "Path | None" = None, + untracked_before: "set[str] | frozenset[str]" = frozenset(), ) -> tuple[str, object, dict | None]: """Pre-dispatch + dispatch + parse + (if not blocked) verify cycle. @@ -8493,6 +8661,10 @@ def execute_unit_attempt( "zero_token" — usage reports input_tokens=0 (agent never ran); payload is None "blocked" — agent explicitly emitted status: blocked + "produces_not_in_diff" — a declared `produces:` path is untouched + and unjustified; verify() was NOT called; + payload is {"remaining", "touched"} + (FEAT-LOOP-2026-0251/T01) "passed" — verify() passed AND the files_changed guard found nothing to flag, or found only paths outside `produces:` that @@ -8511,8 +8683,9 @@ def execute_unit_attempt( Backward-compatible dispatch_fn contract: stubs may return either a plain `str` (treated as text-only, usage=None) or `(str, dict|None)`. - `head_before` is the pre-attempt HEAD SHA the files_changed guard - diffs against. None disables the guard — preserved for unit tests that + `head_before` is the pre-attempt HEAD SHA the files_changed guard and the + early produces check diff against; `untracked_before` is the snapshot + `squash_commit` takes. None disables both — preserved for unit tests that exercise this function in isolation without a git working tree. `prerun_cfg` is a `verification.yml`-shaped dict injectable for testing; @@ -8579,6 +8752,15 @@ def execute_unit_attempt( # deciding whether to insert a fix unit instead of escalating. wu.result_block = parse_result_block(stdout or "") return "blocked", reason, usage + # Fail fast (FEAT-LOOP-2026-0251/T01): a refusal that judges only the + # attempt's diff must not first pay for a verification run. + if head_before is not None and resolve_fail_fast_deliverables(cfg): + early_block = parse_result_block(stdout or "") + refusal = early_produces_refusal( + wu, head_before, untracked_before, early_block, cfg) + if refusal is not None: + wu.result_block = early_block + return refusal["outcome"], refusal, usage _verify_t0 = time.monotonic() try: if _accepts_gate_file(verify_fn): @@ -11525,6 +11707,245 @@ def resolve_produces_amendable(verification_cfg: dict) -> bool: return bool(project.get("produces_amendable", True)) +def decide_produces_in_diff( + wu: WorkUnit, touched: list[str], result_block: "dict | None", cfg: dict, +) -> "tuple[list[str], list[dict], list[dict]]": + """The produces-in-diff decision, shared by the early (pre-verify) and + late (post-squash) call sites (FEAT-LOOP-2026-0251/T01). + + Returns ``(remaining, justified, amended)``. A non-empty *remaining* is a + refusal naming exactly those entries. *amended* is the + ``produces_amended:`` drop the caller may apply with + `apply_produces_amendment`. Pure: nothing is written here, because an + amendment applied before verification passed would outlive the reset of a + failed attempt in `wu.produces`. + """ + remaining, justified = resolve_produces_refusal(wu, touched, result_block) + if not remaining: + return remaining, justified, [] + # Produces-amendment escape hatch (FEAT-2026-0114/T01): a still-unmatched + # entry the RESULT drops under `produces_amended:` with a non-blank reason + # is accepted ONLY when every remaining unmatched entry is covered — a + # partial amendment still refuses so the still-unjustified path's name + # reaches the retry note unchanged. + amendments = produces_amendments(result_block) + dropped = [ + {"path": entry, "reason": amendments[entry.removeprefix("./")]} + for entry in remaining if entry.removeprefix("./") in amendments + ] + if not dropped or len(dropped) != len(remaining): + return remaining, justified, [] + drop_keys = {d["path"].removeprefix("./") for d in dropped} + kept = [p for p in wu.produces + if str(p).removeprefix("./") not in drop_keys] + would_be_empty = wu.type == "implementation" and not kept + if would_be_empty or not resolve_produces_amendable(cfg): + return remaining, justified, [] + return [], justified, dropped + + +def format_produces_refusal(remaining: list[str]) -> "tuple[str, str, str]": + """``(summary, note, failure_signature)`` of a `produces_not_in_diff` + refusal naming *remaining*.""" + summary = ("declared produces path(s) not in this WU's squash diff: " + + ", ".join(remaining)) + note = ( + summary + + "\n\nTwo escape hatches: `produces_unchanged:` " + "— the deliverable already holds at HEAD; " + "`produces_amended:` — the plan named a path " + "this solution did not need." + + "\n\nEach listed path is a deliverable this WU " + "declared in `produces:` but did not change. " + "Either make the declared change this attempt, " + "or — if the deliverable already holds at HEAD — " + "say so in the RESULT block under " + "`produces_unchanged:` with the command and " + "output that show it (result-contract.md, " + "closing obligation 1). Do not declare done " + "while a deliverable is untouched and " + "unjustified." + + "\n\n" + + PRODUCES_REPAIR_EXAMPLE.format(path=remaining[0]) + ) + signature = ", ".join(sorted( + Path(p).name for p in remaining + ))[:100] or "produces_unchanged" + return summary, note, signature + + +def pending_squash_names( + head_before: str, + untracked_before: "set[str] | frozenset[str]" = frozenset(), +) -> "list[str] | None": + """The paths `squash_commit` would put in this attempt's diff, computed + without committing and without touching the real index. + + Mirrors `squash_commit` (`add -A`, then unstage the operator's + pre-existing untracked files) on a throwaway copy of the index, and + filters as `git_diff_names` does. None when git cannot answer. + """ + def run_git(*args: str) -> str: + return subprocess.run( + ["git", *args], capture_output=True, text=True, check=True, + env=env, + ).stdout.strip() + + env = dict(os.environ) + try: + index = Path(run_git("rev-parse", "--git-path", "index")).resolve() + with tempfile.TemporaryDirectory() as tmp: + scratch = Path(tmp) / "index" + if index.exists(): + # copy2 keeps the mtime git's racy-index check relies on. + shutil.copy2(index, scratch) + env["GIT_INDEX_FILE"] = str(scratch) + run_git("add", "-A") + stale = sorted(p for p in untracked_before if Path(p).exists()) + if stale: + run_git("reset", "-q", head_before, "--", *stale) + names = run_git("diff", "--cached", "--name-only", + head_before).splitlines() + except (subprocess.CalledProcessError, OSError) as exc: + print(f" early produces check skipped — {exc}") + return None + return [f for f in names if f and Path(f).name != PROGRESS_FILENAME] + + +def early_produces_refusal( + wu: WorkUnit, head_before: str, + untracked_before: "set[str] | frozenset[str]", + result_block: "dict | None", cfg: dict, +) -> "dict | None": + """The deliverable refusal decidable before verification; None when + verification should run. + + Checks in the post-squash guards' order, so the same one wins: + ``{"outcome": "deliverable_missing", "summary", "touched"}``, + ``{"outcome": "no_deliverable_files", "summary", "touched"}``, or + ``{"outcome": "produces_not_in_diff", "remaining", "touched"}``; + ``touched`` is the pending diff (None if git cannot name it). + The last two stay silent when git cannot name the pending diff. + """ + present, summary = assert_declared_deliverables(wu) + touched = pending_squash_names(head_before, untracked_before) + if not present: + return {"outcome": "deliverable_missing", "summary": summary, + "touched": touched} + if touched is None: + return None + touched_ok, summary = assert_implementation_touched_files(wu, touched) + if not touched_ok: + return {"outcome": "no_deliverable_files", "summary": summary, + "touched": touched} + if not wu.produces: + return None + remaining = decide_produces_in_diff(wu, touched, result_block, cfg)[0] + if not remaining: + return None + return {"outcome": "produces_not_in_diff", "remaining": remaining, + "touched": touched} + + +_NOT_VERIFIED_NOTE = ( + "\n\nRefused before the verification gates: verification did not run.") + + +def refuse_deliverable_missing( + wu: WorkUnit, attempt: int, usage: dict, summary: str, + touched: list[str], *, cfg: dict, head_before: str, events_path: Path, + untracked_before, verification_ran: bool, changed: "list[str] | None", + tree_before: "AttemptStart | None" = None, +) -> "tuple[str, dict]": + """Settle the tree and build the record of a `deliverable_missing` + refusal for either call site. Returns ``(note, event)``. + + *changed* is the diff the note lists; *touched* is the event's + `files_touched`.""" + # Composed BEFORE the reset. The reset rolls the attempt back, so + # afterwards every declared path reads ABSENT and the note would lose the + # one distinction it exists to record — which of the declared + # deliverables the attempt did land (#1412). + note = format_deliverable_missing_note(wu, summary, changed, attempt, + tree_before=tree_before) + if not verification_ran: + note += _NOT_VERIFIED_NOTE + note, retained = _resolve_guard_refusal_tree( + cfg, head_before, events_path, untracked_before, note, + failure_class="guard_refusal", verification_ran=verification_ran, + ) + event = emit_attempt_outcome( + wu, attempt, "deliverable_missing", usage, + failure_class="guard_refusal", + failure_signature="assert_declared_deliverables", + failure_excerpt=extract_failure_excerpt(summary), + files_touched=touched, + extras={"summary": summary, + "missing": summary.split(": ", 1)[-1], + "tree_retained": retained}, + ) + return note, event + + +def refuse_no_deliverable_files( + wu: WorkUnit, attempt: int, usage: dict, summary: str, + touched: list[str], *, cfg: dict, head_before: str, events_path: Path, + untracked_before, verification_ran: bool, changed: "list[str] | None", + tree_before: "AttemptStart | None" = None, +) -> "tuple[str, dict]": + """Settle the tree and build the record of a `no_deliverable_files` + refusal for either call site. Returns ``(note, event)``.""" + note = summary + if changed is not None: + note += ("\n\nPaths this attempt changed:\n" + + format_changed_paths(wu, changed, tree_before)) + if not verification_ran: + note += _NOT_VERIFIED_NOTE + note, retained = _resolve_guard_refusal_tree( + cfg, head_before, events_path, untracked_before, note, + failure_class="guard_refusal", verification_ran=verification_ran, + ) + event = emit_attempt_outcome( + wu, attempt, "no_deliverable_files", usage, + failure_class="guard_refusal", + failure_signature="assert_implementation_touched_files", + failure_excerpt=extract_failure_excerpt(summary), + files_touched=touched, + extras={"summary": summary, "tree_retained": retained}, + ) + return note, event + + +def refuse_produces_not_in_diff( + wu: WorkUnit, attempt: int, usage: dict, remaining: list[str], + touched: list[str], *, cfg: dict, head_before: str, events_path: Path, + untracked_before, verification_ran: bool, + tree_before: "AttemptStart | None" = None, +) -> "tuple[str, str, dict]": + """Settle the tree and build the record of a `produces_not_in_diff` + refusal for either call site. Returns ``(summary, note, event)``.""" + summary, note, signature = format_produces_refusal(remaining) + if not verification_ran: + note += _NOT_VERIFIED_NOTE + excerpt = extract_failure_excerpt(note) + note += ("\n\nPaths this attempt changed:\n" + + format_changed_paths(wu, touched, tree_before)) + note, retained = _resolve_guard_refusal_tree( + cfg, head_before, events_path, untracked_before, note, + failure_class="produces_not_in_diff", + verification_ran=verification_ran, + ) + event = emit_attempt_outcome( + wu, attempt, "produces_not_in_diff", usage, + failure_class="produces_not_in_diff", + failure_signature=signature, + failure_excerpt=excerpt, + files_touched=touched, + extras={"summary": summary, "tree_retained": retained}, + ) + return summary, note, event + + def apply_produces_amendment(wu: WorkUnit, dropped: list[dict]) -> None: """Rewrite *wu*'s `produces:` on disk, dropping *dropped* paths, and record why under `produces_dropped:` (FEAT-2026-0114/T01). @@ -11837,6 +12258,97 @@ def _downstream_line(cause_id: str, others: "list[WorkUnit]", +def refusal_history_repeats(refusal_history: "list[tuple[str, list]]") -> bool: + """#597's halt condition on the newest two guard refusals.""" + return len(refusal_history) >= 2 and detect_deterministic_refusal_repeat( + refusal_history[-1][0], refusal_history[-2][0], + refusal_history[-1][1], + prior_files_touched=refusal_history[-2][1]) + + +def replan_before_last_attempt( + wu: WorkUnit, attempt: int, *, wu_max_attempts: int, + replan_history: list[dict], attempt_notes: list, cum_usage: dict, + attempts_usage: list, attempt_outcomes: list, wu_events: list, + replanned_this_wu: bool, backend, work_dir: Path, feature_dir: Path, + events_path: Path, units: list, done_ids, gate, feature_id: str, +) -> "tuple[str | None, WorkUnit]": + """Re-plan ahead of a unit's last permitted attempt (FEAT-2026-0104/T02). + + Returns ``(status, wu)``: status is "blocked" when the re-plan escalated, + "replanned" when the body was rewritten (*wu* is then the reloaded unit), + and None when the trigger does not apply. Shared by `run()`'s + failed-verification path and its early deliverable refusals + (FEAT-LOOP-2026-0251), which otherwise never reach the trigger. + """ + if should_replan_instead_of_retry(wu, attempt, wu_max_attempts): + try: + replan_result = run_replan_turn(wu, replan_history) + except ReplanUnchangedError: + note_paths = persist_attempt_notes( + work_dir, wu.wu_id, attempt_notes) + backend.set_wu(wu, "status", "blocked_human") + backend.set_wu(wu, "escalation_reason", + "replan_unchanged_body") + write_cost_to_wu(backend, wu, cum_usage) + _unchanged_message = escalate_unit( + wu, gate.number, sorted(done_ids), + [w.wu_id for w in units + if w.wu_id != wu.wu_id + and w.status not in (DONE, "abandoned")], + "replan_unchanged_body", + resume_command_for(feature_id), + wu_max_attempts, attempt_outcomes, + replanned_this_wu, + ) + wu_events.append(build_event( + "human_escalation", wu.wu_id, { + "reason": "replan_unchanged_body", + "attempts": attempt, + "attempts_usage": attempts_usage, + "message": _unchanged_message, + })) + flush_events(events_path, wu_events) + _progress_path = record_progress_entry( + feature_dir, wu, attempt, "replan_unchanged_body") + commit_bookkeeping( + [wu.file, events_path, _progress_path, *note_paths], + f"chore(loop): {wu.wu_id} blocked_human " + f"(replan_unchanged_body, attempt {attempt})" + f"\n\nFeature: {wu.wu_id}", + ) + print(f" BLOCKED — re-plan turn at attempt " + f"{attempt}/{wu_max_attempts} returned a " + f"body identical to its input; refusing to " + f"dispatch an attempt that cannot differ " + f"from the one before it") + return "blocked", wu + # The dispatched session's transcript IS the rewrite + # (T03): fold it into this unit's own attempt-note + # record so it rides with the evidence any later + # escalation for this unit persists to disk. + attempt_notes.append(( + attempt, + "## Re-plan turn transcript\n\n" + + replan_result["transcript"] + )) + write_wu_body(wu.file, replan_result["body"]) + wu = reload_unit_after_replan(units, feature_dir, wu) + # gate_eval.py's evaluate_auto_close reads this as + # check 2 (a WU that needed a re-plan disqualifies + # its gate from auto-close) — the consumer predates + # this emitter by two years (FEAT-2026-0018/T02). + wu_events.append(build_event("replan", wu.wu_id, { + "attempt": attempt, + "max_attempts": wu_max_attempts, + })) + print(f" RE-PLANNED {wu.wu_id} after attempt " + f"{attempt}/{wu_max_attempts} — next dispatch " + f"uses a rewritten body") + return "replanned", wu + return None, wu + + def run( feature_arg: str | None, dry_run: bool, @@ -12504,9 +13016,9 @@ def run( replanned_this_wu = False # Per-failed-attempt (class, signature, full note) — the raw # material `synthesize_replan_brief` reads (FEAT-2026-0104/T03). - # Only the "failed" outcome branch below reaches the re-plan - # trigger check (every other outcome `continue`s earlier), so - # this only needs populating there. + # Populated by the two outcome paths that reach the re-plan + # trigger: a failed verification and an early deliverable + # refusal (FEAT-LOOP-2026-0251). replan_history: list[dict] = [] # Cost accumulators: per-attempt list goes to events.jsonl, # cumulative sum to WU frontmatter at outcome time. @@ -12546,10 +13058,7 @@ def run( # agent cannot edit its own frontmatter. Checked BEFORE the # attempt counter is bumped and before dispatch, so the # session that would buy nothing is never paid for. - if len(refusal_history) >= 2 and detect_deterministic_refusal_repeat( - refusal_history[-1][0], refusal_history[-2][0], - refusal_history[-1][1], - prior_files_touched=refusal_history[-2][1]): + if refusal_history_repeats(refusal_history): _rsum = refusal_history[-1][0] note_paths = persist_attempt_notes( work_dir, wu.wu_id, attempt_notes) @@ -12600,12 +13109,16 @@ def run( if attempt > 1 and failure_note: reason = failure_note.strip().splitlines()[0][:200] print(f" retry reason: {reason}") + # What a kept earlier attempt left on disk, so this + # attempt's retry note lists only its own changes (#3612). + tree_before = snapshot_dirty_tree(head_before) t0 = time.monotonic() wu.last_gate_results = [] outcome, payload, usage = execute_unit_attempt( wu, feature_dir, failure_note, cost_tracking=cost_tracking, head_before=head_before, prerun_cfg=cfg, gate_file=gate.file, + untracked_before=untracked_before, ) wu_events.extend(build_attempt_gate_events(wu, attempt)) duration = round(time.monotonic() - t0, 3) @@ -12624,7 +13137,12 @@ def run( # reset_preserving_events -- afterwards the evidence is # gone and files_touched would read empty by construction, # which is what made #597's second condition vacuous. - _refusal_touched = git_diff_names(head_before, "HEAD") + # `worktree=True`: uncommitted tracked edits count too, + # or an attempt that only edited tracked files would read + # as an untouched tree (FEAT-LOOP-2026-0251). + _refusal_touched = git_diff_names( + head_before, "HEAD", worktree=True, + exclude=(wu.file,)) if outcome == "zero_token": # Agent never produced output (input_tokens=0). Skip @@ -12832,6 +13350,98 @@ def run( blocked = True break + if outcome == "produces_not_in_diff": + # Refused before verify() (FEAT-LOOP-2026-0251/T01). + _prod_summary, _prod_note, _prod_event = ( + refuse_produces_not_in_diff( + wu, attempt, attempts_usage[-1], + payload["remaining"], payload["touched"], + cfg=cfg, head_before=head_before, + events_path=events_path, + untracked_before=untracked_before, + tree_before=tree_before, + verification_ran=False, + )) + wu_events.append(_prod_event) + # `+=` for the reason given at the late site. + refusal_history += [(_prod_summary, _refusal_touched)] + attempt_notes.append((attempt, _prod_note)) + failure_note = _prod_note + print( + f" PRODUCES NOT IN DIFF attempt " + f"{attempt}/{wu_max_attempts} — {_prod_summary}" + ) + _early_refusal = (_prod_event, _prod_note) + + if outcome in ("no_deliverable_files", + "deliverable_missing"): + # Refused before verify() (FEAT-LOOP-2026-0251/T02). + _refuse = ( + refuse_deliverable_missing + if outcome == "deliverable_missing" + else refuse_no_deliverable_files) + _early_note, _early_event = _refuse( + wu, attempt, attempts_usage[-1], + payload["summary"], _refusal_touched, + cfg=cfg, head_before=head_before, + events_path=events_path, + untracked_before=untracked_before, + tree_before=tree_before, + verification_ran=False, + changed=payload["touched"], + ) + wu_events.append(_early_event) + # `+=` for the reason given at the late + # `produces_not_in_diff` site: the `.append(` count + # tracks one late site per guard. + refusal_history += [ + (payload["summary"], _refusal_touched)] + attempt_notes.append((attempt, _early_note)) + failure_note = _early_note + print( + f" {outcome.replace('_', ' ').upper()} attempt " + f"{attempt}/{wu_max_attempts} — " + f"{payload['summary']}" + ) + _early_refusal = (_early_event, _early_note) + + if outcome in ("produces_not_in_diff", + "no_deliverable_files", + "deliverable_missing"): + # An early refusal replaces the failed verification a + # missing deliverable used to cause, so it keeps that + # path's re-plan (FEAT-LOOP-2026-0251). A repeat on an + # unmoved tree is left to #597's halt at the top of + # the next attempt, as the failed path leaves a + # spinning signature to its own halt. + _ev_payload = _early_refusal[0]["payload"] + replan_history.append({ + "attempt": attempt, + "failure_class": _ev_payload.get("failure_class"), + "failure_signature": _ev_payload.get( + "failure_signature"), + "note": _early_refusal[1], + }) + if not refusal_history_repeats(refusal_history): + _replan, wu = replan_before_last_attempt( + wu, attempt, wu_max_attempts=wu_max_attempts, + replan_history=replan_history, + attempt_notes=attempt_notes, cum_usage=cum_usage, + attempts_usage=attempts_usage, + attempt_outcomes=attempt_outcomes, + wu_events=wu_events, + replanned_this_wu=replanned_this_wu, backend=backend, + work_dir=work_dir, feature_dir=feature_dir, + events_path=events_path, units=units, + done_ids=done_ids, gate=gate, feature_id=feature_id) + if _replan == "blocked": + blocked = True + break + if _replan == "replanned": + replanned_this_wu = True + failure_note = None + continue + if outcome == "passed": # Flip status to DONE BEFORE the squash so the flip is # included in the commit content — survives the next WU's @@ -12988,32 +13598,19 @@ def run( # every current WU is unchanged. deliv_ok, deliv_summary = assert_declared_deliverables(wu) if not deliv_ok: - # Composed BEFORE the reset. The reset rolls the - # squash back, so afterwards every declared path - # reads ABSENT and the note would lose the one - # distinction it exists to record — which of the - # declared deliverables the attempt did land (#1412). - _deliv_note = format_deliverable_missing_note( - wu, deliv_summary, _refusal_touched, attempt, - ) - _deliv_note, _deliv_retained = ( - _resolve_guard_refusal_tree( - cfg, head_before, events_path, - untracked_before, _deliv_note, - failure_class="guard_refusal", + _deliv_note, _deliv_event = ( + refuse_deliverable_missing( + wu, attempt, attempts_usage[-1], + deliv_summary, _refusal_touched, + cfg=cfg, head_before=head_before, + events_path=events_path, + untracked_before=untracked_before, + tree_before=tree_before, + verification_ran=True, + changed=(git_diff_names(head_before, sha) + if sha else []), )) - missing = deliv_summary.split(": ", 1)[-1] - wu_events.append(emit_attempt_outcome( - wu, attempt, "deliverable_missing", - attempts_usage[-1], - failure_class="guard_refusal", - failure_signature="assert_declared_deliverables", - failure_excerpt=extract_failure_excerpt(deliv_summary), - files_touched=_refusal_touched, - extras={"summary": deliv_summary, - "missing": missing, - "tree_retained": _deliv_retained}, - )) + wu_events.append(_deliv_event) refusal_history.append( (deliv_summary, _refusal_touched)) attempt_notes.append((attempt, _deliv_note)) @@ -13041,22 +13638,18 @@ def run( wu, touched, ) if not impl_ok: - _impl_note, _impl_retained = ( - _resolve_guard_refusal_tree( - cfg, head_before, events_path, - untracked_before, impl_summary, - failure_class="guard_refusal", + _impl_note, _impl_event = ( + refuse_no_deliverable_files( + wu, attempt, attempts_usage[-1], + impl_summary, _refusal_touched, + cfg=cfg, head_before=head_before, + events_path=events_path, + untracked_before=untracked_before, + tree_before=tree_before, + verification_ran=True, + changed=touched, )) - wu_events.append(emit_attempt_outcome( - wu, attempt, "no_deliverable_files", - attempts_usage[-1], - failure_class="guard_refusal", - failure_signature="assert_implementation_touched_files", - failure_excerpt=extract_failure_excerpt(impl_summary), - files_touched=_refusal_touched, - extras={"summary": impl_summary, - "tree_retained": _impl_retained}, - )) + wu_events.append(_impl_event) refusal_history.append( (impl_summary, _refusal_touched)) attempt_notes.append((attempt, _impl_note)) @@ -13079,96 +13672,26 @@ def run( # read (#3268). Only the still-unjustified entries # refuse; the accepted ones are recorded on the # passed event. - _prod_remaining, _produces_justified = resolve_produces_refusal( - wu, touched, wu.result_block, - ) + _prod_remaining, _produces_justified, _produces_amended = ( + decide_produces_in_diff( + wu, touched, wu.result_block, cfg)) for _pj in _produces_justified: print(f" produces: {_pj['path']} unchanged, " f"justified — {_pj['justification'][:120]}") - # Produces-amendment escape hatch (FEAT-2026-0114/T01): - # a still-unmatched entry the RESULT drops under - # `produces_amended:` with a non-blank reason is - # applied ONLY when every remaining unmatched entry - # is covered — a partial amendment still refuses so - # the still-unjustified path's name reaches the - # retry note unchanged. - _produces_amended: list = [] + if _produces_amended: + apply_produces_amendment(wu, _produces_amended) if _prod_remaining: - _amendments = produces_amendments(wu.result_block) - _amend_dropped = [] - _amend_remaining = [] - for _entry in _prod_remaining: - _key = _entry.removeprefix("./") - if _key in _amendments: - _amend_dropped.append( - {"path": _entry, - "reason": _amendments[_key]}) - else: - _amend_remaining.append(_entry) - if _amend_dropped and not _amend_remaining: - _drop_keys = { - d["path"].removeprefix("./") - for d in _amend_dropped - } - _kept_after_drop = [ - p for p in wu.produces - if str(p).removeprefix("./") - not in _drop_keys - ] - _would_be_empty = ( - wu.type == "implementation" - and not _kept_after_drop - ) - if not _would_be_empty and resolve_produces_amendable(cfg): - apply_produces_amendment(wu, _amend_dropped) - _produces_amended = _amend_dropped - _prod_remaining = [] - prod_ok = not _prod_remaining - prod_summary = "" if prod_ok else ( - "declared produces path(s) not in this WU's squash diff: " - + ", ".join(_prod_remaining) - ) - if not prod_ok: - _prod_note = ( - prod_summary - + "\n\nTwo escape hatches: `produces_unchanged:` " - "— the deliverable already holds at HEAD; " - "`produces_amended:` — the plan named a path " - "this solution did not need." - + "\n\nEach listed path is a deliverable this WU " - "declared in `produces:` but did not change. " - "Either make the declared change this attempt, " - "or — if the deliverable already holds at HEAD — " - "say so in the RESULT block under " - "`produces_unchanged:` with the command and " - "output that show it (result-contract.md, " - "closing obligation 1). Do not declare done " - "while a deliverable is untouched and " - "unjustified." - + "\n\n" - + PRODUCES_REPAIR_EXAMPLE.format( - path=_prod_remaining[0]) - ) - _prod_sig = ", ".join(sorted( - Path(p).name for p in _prod_remaining - ))[:100] or "produces_unchanged" - _prod_excerpt = extract_failure_excerpt(_prod_note) - _prod_note, _prod_retained = ( - _resolve_guard_refusal_tree( - cfg, head_before, events_path, - untracked_before, _prod_note, - failure_class="produces_not_in_diff", + prod_summary, _prod_note, _prod_event = ( + refuse_produces_not_in_diff( + wu, attempt, attempts_usage[-1], + _prod_remaining, touched, + cfg=cfg, head_before=head_before, + events_path=events_path, + untracked_before=untracked_before, + tree_before=tree_before, + verification_ran=True, )) - wu_events.append(emit_attempt_outcome( - wu, attempt, "produces_not_in_diff", - attempts_usage[-1], - failure_class="produces_not_in_diff", - failure_signature=_prod_sig, - failure_excerpt=_prod_excerpt, - files_touched=touched, - extras={"summary": prod_summary, - "tree_retained": _prod_retained}, - )) + wu_events.append(_prod_event) # `+=`, not the `.` `append(` call other guard # sites use: that exact call shape is what # test_every_guard_refusal_records_into_the_refusal_ledger @@ -13735,73 +14258,23 @@ def run( # declined to `break` this attempt loop — a repeated # guard refusal or spinning signature escalates there and # never reaches this trigger. - if should_replan_instead_of_retry(wu, attempt, wu_max_attempts): - try: - replan_result = run_replan_turn(wu, replan_history) - except ReplanUnchangedError: - note_paths = persist_attempt_notes( - work_dir, wu.wu_id, attempt_notes) - backend.set_wu(wu, "status", "blocked_human") - backend.set_wu(wu, "escalation_reason", - "replan_unchanged_body") - write_cost_to_wu(backend, wu, cum_usage) - _unchanged_message = escalate_unit( - wu, gate.number, sorted(done_ids), - [w.wu_id for w in units - if w.wu_id != wu.wu_id - and w.status not in (DONE, "abandoned")], - "replan_unchanged_body", - resume_command_for(feature_id), - wu_max_attempts, attempt_outcomes, - replanned_this_wu, - ) - wu_events.append(build_event( - "human_escalation", wu.wu_id, { - "reason": "replan_unchanged_body", - "attempts": attempt, - "attempts_usage": attempts_usage, - "message": _unchanged_message, - })) - flush_events(events_path, wu_events) - _progress_path = record_progress_entry( - feature_dir, wu, attempt, "replan_unchanged_body") - commit_bookkeeping( - [wu.file, events_path, _progress_path, *note_paths], - f"chore(loop): {wu.wu_id} blocked_human " - f"(replan_unchanged_body, attempt {attempt})" - f"\n\nFeature: {wu.wu_id}", - ) - print(f" BLOCKED — re-plan turn at attempt " - f"{attempt}/{wu_max_attempts} returned a " - f"body identical to its input; refusing to " - f"dispatch an attempt that cannot differ " - f"from the one before it") - blocked = True - break - # The dispatched session's transcript IS the rewrite - # (T03): fold it into this unit's own attempt-note - # record so it rides with the evidence any later - # escalation for this unit persists to disk. - attempt_notes.append(( - attempt, - "## Re-plan turn transcript\n\n" - + replan_result["transcript"] - )) - write_wu_body(wu.file, replan_result["body"]) - wu = reload_unit_after_replan(units, feature_dir, wu) - # gate_eval.py's evaluate_auto_close reads this as - # check 2 (a WU that needed a re-plan disqualifies - # its gate from auto-close) — the consumer predates - # this emitter by two years (FEAT-2026-0018/T02). - wu_events.append(build_event("replan", wu.wu_id, { - "attempt": attempt, - "max_attempts": wu_max_attempts, - })) + _replan, wu = replan_before_last_attempt( + wu, attempt, wu_max_attempts=wu_max_attempts, + replan_history=replan_history, + attempt_notes=attempt_notes, cum_usage=cum_usage, + attempts_usage=attempts_usage, + attempt_outcomes=attempt_outcomes, + wu_events=wu_events, + replanned_this_wu=replanned_this_wu, backend=backend, + work_dir=work_dir, feature_dir=feature_dir, + events_path=events_path, units=units, + done_ids=done_ids, gate=gate, feature_id=feature_id) + if _replan == "blocked": + blocked = True + break + if _replan == "replanned": replanned_this_wu = True failure_note = None - print(f" RE-PLANNED {wu.wu_id} after attempt " - f"{attempt}/{wu_max_attempts} — next dispatch " - f"uses a rewritten body") continue failure_note = ( synthesize_retry_directive(_fc, retained=_retained) diff --git a/tests/test_arm_wiring.py b/tests/test_arm_wiring.py index 7784e81d..13d810d3 100644 --- a/tests/test_arm_wiring.py +++ b/tests/test_arm_wiring.py @@ -27,7 +27,7 @@ from specfuse.loop.plan_baseline import load_plan_graph, write_baseline_if_absent from tests._loop_loader import load_loop -from tests._workspace import integration_workspace +from tests._workspace import integration_workspace, with_deliverable loop = load_loop() @@ -391,7 +391,7 @@ def test_resumed_gate_halt_message_blames_the_branch_not_main(self): def fake_dispatch(wu, failure_note, cost_tracking=True): return "```result\nstatus: complete\n```\n" - self._patch("dispatch", fake_dispatch) + self._patch("dispatch", with_deliverable(fake_dispatch)) self._patch("verify", lambda wu, fd, cfg=None: (False, "FAIL")) self._patch( "probe_baseline", @@ -430,7 +430,7 @@ def test_preexisting_gate_failure_does_not_arm_even_if_would_arm_true(self): def fake_dispatch(wu, failure_note, cost_tracking=True): return "```result\nstatus: complete\n```\n" - self._patch("dispatch", fake_dispatch) + self._patch("dispatch", with_deliverable(fake_dispatch)) self._patch("verify", lambda wu, fd, cfg=None: (False, "FAIL")) self._patch( "probe_baseline", diff --git a/tests/test_deterministic_refusal_repeat.py b/tests/test_deterministic_refusal_repeat.py index 9d4b5616..52b144da 100644 --- a/tests/test_deterministic_refusal_repeat.py +++ b/tests/test_deterministic_refusal_repeat.py @@ -100,7 +100,7 @@ def test_deliverable_missing_retry_carries_the_present_absent_split(self): # that is what the next attempt is handed. import inspect src = inspect.getsource(loop_module.run) - branch = src[src.index('"deliverable_missing",'):] + branch = src[src.index("if not deliv_ok:"):] branch = branch[:branch.index("continue")] self.assertIn("failure_note = _deliv_note", branch) self.assertNotIn("failure_note = deliv_summary", branch) diff --git a/tests/test_fail_fast_deliverables.py b/tests/test_fail_fast_deliverables.py new file mode 100644 index 00000000..d3e0e6ab --- /dev/null +++ b/tests/test_fail_fast_deliverables.py @@ -0,0 +1,790 @@ +# +# Copyright 2026 Specfuse contributors +# Licensed under the Apache License, Version 2.0. See LICENSE. +# +"""FEAT-LOOP-2026-0251 gate 1 oracle — a missing deliverable is refused before +the verification gates run. One class per Definition-of-done clause in +GATE-01.md. +""" + +from __future__ import annotations + +import contextlib +import io +import json +import os +import subprocess +import tempfile +import unittest +from pathlib import Path + +from specfuse.loop import lint_plan +from tests._loop_loader import load_loop +from tests._workspace import integration_workspace + +loop = load_loop() + +FEATURE_ID = "FEAT-2026-9251" +T01 = f"{FEATURE_ID}/T01" + +_BODY = ( + "\n\n**Context.** test\n\n**Acceptance criteria.** test\n\n" + "**Do not touch.** test\n\n**Verification.** test\n\n" + "**Escalation triggers.** test\n" +) +_COMPLETE = "```result\nstatus: complete\n```\n" + + +def _git(*args: str) -> str: + return subprocess.run(["git", *args], check=True, capture_output=True, + text=True).stdout.strip() + + +def _write_feature(root: Path) -> Path: + fdir = root / f".specfuse/features/{FEATURE_ID}-fail-fast" + fdir.mkdir(parents=True) + close_id = f"{FEATURE_ID}/G1-CLOSE" + (fdir / "PLAN.md").write_text( + f"---\nfeature_id: {FEATURE_ID}\ntitle: Fixture\nslug: fail-fast\n" + "branch: feat/fail-fast\nroadmap_goal: test\nstatus: active\n---\n\n" + "# Plan\n\n```yaml\ngates:\n - gate: 1\n file: GATE-01.md\n" + " work_units:\n" + f" - id: {T01}\n file: WU-T01.md\n depends_on: []\n" + f" - id: {close_id}\n file: WU-close.md\n" + f" depends_on: [{T01}]\n```\n" + ) + (fdir / "GATE-01.md").write_text("---\ngate: 1\nstatus: open\n---\n\n# G\n") + (fdir / "WU-T01.md").write_text( + f"---\nid: {T01}\ntype: implementation\nmodel: sonnet\n" + "status: pending\nattempts: 0\nproduces:\n - src/rule.py\n---\n\n" + f"# T01{_BODY}") + (fdir / "WU-close.md").write_text( + f"---\nid: {close_id}\ntype: close\nmodel: opus\n" + f"status: pending\nattempts: 0\n---\n\n# Close{_BODY}") + Path(root, "src").mkdir(exist_ok=True) + Path(root, "src/rule.py").write_text("SEVERITY = 'WARNING'\n") + _git("add", ".") + _git("commit", "-q", "-m", "scaffold") + return fdir + + +class _Case(unittest.TestCase): + + def setUp(self): + self._cwd = os.getcwd() + self._patches = [] + + def tearDown(self): + os.chdir(self._cwd) + for name, original in reversed(self._patches): + setattr(loop, name, original) + + def _patch(self, name, replacement): + self._patches.append((name, getattr(loop, name))) + setattr(loop, name, replacement) + + def _workspace(self): + ws = integration_workspace() + root = ws.__enter__() + self.addCleanup(ws.__exit__, None, None, None) + os.chdir(root) + return root, _write_feature(root) + + +class TestProducesNotInDiffEarly(_Case): + """Clause 1 — refused before `verify_fn`, same record as the late path.""" + + def _attempt(self, touch: str, stdout: str = _COMPLETE): + _, fdir = self._workspace() + wu = loop.load_wu(fdir, {"id": T01, "file": "WU-T01.md", + "depends_on": []}) + head = _git("rev-parse", "HEAD") + calls = [] + + def dispatch_fn(w, note): + Path(touch).parent.mkdir(exist_ok=True) + Path(touch).write_text("changed\n") + return stdout + + def verify_fn(w, fd): + calls.append(w.wu_id) + return True, "(stub)" + + outcome, payload, usage = loop.execute_unit_attempt( + wu, fdir, None, dispatch_fn=dispatch_fn, verify_fn=verify_fn, + cost_tracking=False, head_before=head, prerun_cfg={}, + untracked_before=loop.untracked_paths()) + return wu, outcome, payload, usage, calls + + def test_untouched_path_is_refused_without_verifying(self): + wu, outcome, payload, usage, calls = self._attempt("docs/notes.md") + self.assertEqual(outcome, "produces_not_in_diff") + self.assertEqual(payload["remaining"], ["src/rule.py"]) + self.assertIn("docs/notes.md", payload["touched"]) + self.assertEqual(calls, []) + self.assertEqual(usage["verify_seconds"], 0) + self.assertEqual(loop.build_attempt_gate_events(wu, 1), []) + + def test_changed_path_verifies_once_and_passes(self): + _, outcome, _, _, calls = self._attempt("src/rule.py") + self.assertEqual(outcome, "passed") + self.assertEqual(calls, [T01]) + + def test_deliverable_refusal_outranks_files_changed_mismatch(self): + """GATE-01.md precedence (#3608): a RESULT that claims an untouched + declared path trips both guards; the default order names the + deliverable refusal, the opt-out keeps the old post-verify name.""" + claim = ("```result\nstatus: complete\nfiles_changed:\n" + " - docs/notes.md\n - src/rule.py\n```\n") + _, outcome, _, _, calls = self._attempt("docs/notes.md", claim) + self.assertEqual(outcome, "produces_not_in_diff") + self.assertEqual(calls, []) + os.chdir(self._cwd) + + _, fdir = self._workspace() + wu = loop.load_wu(fdir, {"id": T01, "file": "WU-T01.md", + "depends_on": []}) + head = _git("rev-parse", "HEAD") + late_calls = [] + + def dispatch_fn(w, note): + Path("docs").mkdir(exist_ok=True) + Path("docs/notes.md").write_text("changed\n") + return claim + + def verify_fn(w, fd): + late_calls.append(w.wu_id) + return True, "(stub)" + + outcome, _, _ = loop.execute_unit_attempt( + wu, fdir, None, dispatch_fn=dispatch_fn, verify_fn=verify_fn, + cost_tracking=False, head_before=head, + prerun_cfg={"defaults": {"fail_fast_deliverables": False}}, + untracked_before=loop.untracked_paths()) + self.assertEqual(outcome, "files_changed_mismatch") + self.assertEqual(late_calls, [T01]) + + def test_justified_path_still_verifies(self): + _, outcome, _, _, calls = self._attempt( + "docs/notes.md", + "```result\nstatus: complete\nproduces_unchanged:\n" + " - path: src/rule.py\n justification: already holds\n```\n") + self.assertEqual(outcome, "passed") + self.assertEqual(calls, [T01]) + + def test_index_is_left_alone(self): + self._attempt("docs/notes.md") + self.assertEqual(_git("diff", "--cached", "--name-only"), "") + + def _run_driver(self, early: bool): + """`loop.run()` over an attempt that never touches `src/rule.py`. + `early=False` silences the pre-verify check, leaving the late site.""" + _, fdir = self._workspace() + verified = [] + + def dispatch(wu, note, ct=True): + if wu.wu_id == T01: + Path("docs").mkdir(exist_ok=True) + Path("docs/notes.md").write_text("notes\n") + return _COMPLETE + + def verify(wu, fd, cfg=None): + verified.append(wu.wu_id) + return True, "(stub)" + + self._patch("dispatch", dispatch) + self._patch("verify", verify) + if not early: + self._patch("early_produces_refusal", lambda *a, **k: None) + self.assertEqual(loop.run(None, dry_run=False), 1) + events = [json.loads(line) for line in + (fdir / "events.jsonl").read_text().splitlines() if line] + refusals = [ + e["payload"] for e in events + if e["event_type"] == "attempt_outcome" + and e["payload"]["outcome"] == "produces_not_in_diff"] + self.assertTrue(refusals) + self.assertEqual( + [e for e in events if e["event_type"] == "gate_result" + and e["correlation_id"] == T01 + and e["payload"]["phase"] == "attempt"], []) + return refusals[0], verified + + def test_early_record_equals_late_record(self): + early, early_verified = self._run_driver(early=True) + late, late_verified = self._run_driver(early=False) + self.assertEqual(early_verified, []) + self.assertIn(T01, late_verified) + self.assertEqual(early["verify_seconds"], 0) + for key in ("failure_class", "failure_signature", "summary"): + self.assertEqual(early[key], late[key], key) + + +def _delete_rule(fdir: Path) -> None: + Path("src/rule.py").unlink(missing_ok=True) + + +def _empty_rule(fdir: Path) -> None: + Path("src/rule.py").write_text("") + + +def _bookkeeping_only(fdir: Path) -> None: + for name in ("WU-T01.md", "events.jsonl"): + with (fdir / name).open("a") as handle: + handle.write("\n") + + +def _notes_only(fdir: Path) -> None: + Path("docs").mkdir(exist_ok=True) + Path("docs/notes.md").write_text("notes\n") + + +class TestPresenceEarly(_Case): + """Clause 2 — `deliverable_missing` / `no_deliverable_files` early.""" + + def _assert_early(self, act, expected: str): + _, fdir = self._workspace() + wu = loop.load_wu(fdir, {"id": T01, "file": "WU-T01.md", + "depends_on": []}) + head = _git("rev-parse", "HEAD") + calls = [] + + def dispatch_fn(w, note): + act(fdir) + return _COMPLETE + + def verify_fn(w, fd): + calls.append(w.wu_id) + return True, "(stub)" + + outcome, payload, usage = loop.execute_unit_attempt( + wu, fdir, None, dispatch_fn=dispatch_fn, verify_fn=verify_fn, + cost_tracking=False, head_before=head, prerun_cfg={}, + untracked_before=loop.untracked_paths()) + self.assertEqual(outcome, expected) + self.assertTrue(payload["summary"]) + self.assertEqual(calls, []) + self.assertEqual(usage["verify_seconds"], 0) + + def test_absent_path_is_refused_without_verifying(self): + self._assert_early(_delete_rule, "deliverable_missing") + + def test_empty_path_is_refused_without_verifying(self): + self._assert_early(_empty_rule, "deliverable_missing") + + def test_bookkeeping_only_diff_is_refused_without_verifying(self): + self._assert_early(_bookkeeping_only, "no_deliverable_files") + + +class TestOptOut(_Case): + """Clause 3 — `defaults.fail_fast_deliverables: false`.""" + + _REFUSALS = ("deliverable_missing", "no_deliverable_files", + "produces_not_in_diff") + + def test_key_defaults_to_true(self): + self.assertTrue(loop.resolve_fail_fast_deliverables({})) + self.assertFalse(loop.resolve_fail_fast_deliverables( + {"defaults": {"fail_fast_deliverables": False}})) + + def _first_refusal(self, act, fail_fast: bool): + """`loop.run()`; returns the first refusal record and how many times + the unit was verified before the second dispatch.""" + _, fdir = self._workspace() + seen = [] + load = loop.load_verification + + def load_cfg(*args, **kwargs): + cfg = dict(load(*args, **kwargs)) + if not fail_fast: + cfg["defaults"] = {"fail_fast_deliverables": False} + return cfg + + def dispatch(wu, note, ct=True): + if wu.wu_id == T01: + seen.append("dispatch") + act(fdir) + return _COMPLETE + + def verify(wu, fd, cfg=None): + if wu.wu_id == T01: + seen.append("verify") + return True, "(stub)" + + self._patch("load_verification", load_cfg) + self._patch("dispatch", dispatch) + self._patch("verify", verify) + self.assertEqual(loop.run(None, dry_run=False), 1) + for name, original in reversed(self._patches): + setattr(loop, name, original) + self._patches.clear() + refusals = [ + e["payload"] for e in map( + json.loads, + filter(None, (fdir / "events.jsonl").read_text().splitlines())) + if e["event_type"] == "attempt_outcome" + and e["payload"]["outcome"] in self._REFUSALS] + self.assertTrue(refusals) + first_attempt = seen[1:] + if "dispatch" in first_attempt: + first_attempt = first_attempt[:first_attempt.index("dispatch")] + return refusals[0], first_attempt.count("verify") + + def _assert_opt_out(self, act, expected: str): + default, default_verified = self._first_refusal(act, fail_fast=True) + late, late_verified = self._first_refusal(act, fail_fast=False) + self.assertEqual(default_verified, 0) + self.assertEqual(late_verified, 1) + self.assertEqual(late["outcome"], expected) + for key in ("outcome", "failure_class", "failure_signature", + "summary"): + self.assertEqual(default[key], late[key], key) + + def test_deliverable_missing_verifies_first(self): + self._assert_opt_out(_delete_rule, "deliverable_missing") + + def test_no_deliverable_files_verifies_first(self): + self._assert_opt_out(_bookkeeping_only, "no_deliverable_files") + + def test_produces_not_in_diff_verifies_first(self): + self._assert_opt_out(_notes_only, "produces_not_in_diff") + + +class TestTreeAndNote(_Case): + """Clause 4 — tree handling and retry note.""" + + def _retry_note(self, act, retain: bool = True, + fail_fast: bool = True): + """`loop.run()`; returns the note handed to the second T01 attempt and + whether the first attempt's work was still on disk at that point.""" + self._workspace() + notes, kept = [], [] + load = loop.load_verification + + def load_cfg(*args, **kwargs): + cfg = dict(load(*args, **kwargs)) + cfg["defaults"] = {"retain_on_guard_refusal": retain, + "fail_fast_deliverables": fail_fast} + return cfg + + def dispatch(wu, note, cost_tracking=True): + if wu.body.startswith(loop._REPLAN_BRIEF_MARKER): + # An early refusal re-plans before the last attempt too. + return "# T01\n\nRe-planned body.\n" + if wu.wu_id == T01: + notes.append(note) + if len(notes) == 1: + act() + elif len(notes) == 2: + kept.append(Path("docs/notes.md").exists()) + return _COMPLETE + + self._patch("load_verification", load_cfg) + self._patch("dispatch", dispatch) + self._patch("verify", lambda wu, fd, cfg=None: (True, "(stub)")) + self.assertEqual(loop.run(None, dry_run=False), 1) + for name, original in reversed(self._patches): + setattr(loop, name, original) + self._patches.clear() + self.assertGreaterEqual(len(notes), 2) + return notes[1], kept[0] + + @staticmethod + def _two_files(): + Path("docs").mkdir(exist_ok=True) + Path("docs/notes.md").write_text("notes\n") + Path("docs/other.md").write_text("other\n") + + def _assert_note(self, note): + self.assertIn("src/rule.py", note) + self.assertIn("- `docs/notes.md`", note) + self.assertIn("- `docs/other.md`", note) + self.assertIn("verification did not run", note) + self.assertNotIn("verification already PASSED", note) + + def test_retained_tree_and_note(self): + note, kept = self._retry_note(self._two_files, retain=True) + self._assert_note(note) + self.assertTrue(kept) + + def test_reset_tree_and_note(self): + note, kept = self._retry_note(self._two_files, retain=False) + self._assert_note(note) + self.assertFalse(kept) + + def test_attempt_that_changed_nothing_says_so(self): + note, _ = self._retry_note(lambda: None) + self.assertIn("this attempt changed no files", note) + + def test_presence_refusals_list_changed_paths_early_and_late(self): + def delete_rule_and_write(): + self._two_files() + Path("src/rule.py").unlink() + + for fail_fast in (True, False): + with self.subTest("deliverable_missing", fail_fast=fail_fast): + note, _ = self._retry_note(delete_rule_and_write, + fail_fast=fail_fast) + self.assertIn("- `docs/notes.md`", note) + self.assertIn("- `docs/other.md`", note) + with self.subTest("no_deliverable_files", fail_fast=fail_fast): + note, _ = self._retry_note(lambda: None, fail_fast=fail_fast) + self.assertIn("this attempt changed no files", note) + + def test_late_produces_refusal_lists_changed_paths(self): + note, _ = self._retry_note(self._two_files, fail_fast=False) + self.assertIn("- `docs/notes.md`", note) + self.assertIn("- `docs/other.md`", note) + self.assertNotIn("verification did not run", note) + + @staticmethod + def _write_notes(): + Path("docs").mkdir(exist_ok=True) + Path("docs/notes.md").write_text("notes\n") + + def _second_attempt_note(self, second_act, fail_fast: bool = True, + first_act=None, tracked=None) -> str: + """`loop.run()` with a kept tree: attempt 1 runs *first_act* (default: + write `docs/notes.md`), attempt 2 runs *second_act*. *tracked* maps + paths to content committed before the run. Returns the note recorded + for attempt 2 (`work//attempt-2.md`, written when the unit + halts).""" + root, fdir = self._workspace() + first_act = first_act or self._write_notes + for rel, text in (tracked or {}).items(): + (root / rel).parent.mkdir(parents=True, exist_ok=True) + (root / rel).write_text(text) + subprocess.run(["git", "add", rel], check=True) + if tracked: + subprocess.run(["git", "commit", "-q", "-m", "tracked fixture"], + check=True) + dispatched = [] + load = loop.load_verification + + def load_cfg(*args, **kwargs): + cfg = dict(load(*args, **kwargs)) + cfg["defaults"] = {"retain_on_guard_refusal": True, + "fail_fast_deliverables": fail_fast} + return cfg + + def dispatch(wu, note, cost_tracking=True): + if wu.body.startswith(loop._REPLAN_BRIEF_MARKER): + return "# T01\n\nRe-planned body.\n" + if wu.wu_id == T01: + dispatched.append(note) + if len(dispatched) == 1: + first_act() + elif len(dispatched) == 2: + second_act() + return _COMPLETE + + self._patch("load_verification", load_cfg) + self._patch("dispatch", dispatch) + self._patch("verify", lambda wu, fd, cfg=None: (True, "(stub)")) + self.assertEqual(loop.run(None, dry_run=False), 1) + for name, original in reversed(self._patches): + setattr(loop, name, original) + self._patches.clear() + return (fdir / "work" / T01.replace("/", "_") / + "attempt-2.md").read_text() + + @staticmethod + def _path_list(note: str) -> str: + """The note's "Paths this attempt changed" list, without the retained + diff that follows it.""" + return (note.split("Paths this attempt changed:\n", 1)[1] + .split("\n\n", 1)[0]) + + def test_kept_edits_of_an_earlier_attempt_are_not_listed(self): + # #3612: with the tree kept, the diff the guard judges still holds + # attempt 1's `docs/notes.md`; the note must list only what attempt 2 + # itself changed. + def write_second(): + Path("docs/second.md").write_text("second\n") + + for fail_fast in (True, False): + with self.subTest(fail_fast=fail_fast): + note = self._second_attempt_note(write_second, + fail_fast=fail_fast) + listed = self._path_list(note) + self.assertIn("- `docs/second.md`", listed) + self.assertNotIn("docs/notes.md", listed) + + def test_later_attempt_that_changed_nothing_says_so(self): + for fail_fast in (True, False): + with self.subTest(fail_fast=fail_fast): + note = self._second_attempt_note(lambda: None, + fail_fast=fail_fast) + listed = self._path_list(note) + self.assertIn("this attempt changed no files", listed) + self.assertNotIn("docs/notes.md", listed) + + def test_editing_a_kept_file_again_lists_it(self): + def rewrite_notes(): + Path("docs/notes.md").write_text("notes, revised\n") + + note = self._second_attempt_note(rewrite_notes) + listed = self._path_list(note) + self.assertIn("- `docs/notes.md`", listed) + + def test_deleting_a_kept_file_lists_it(self): + # #3613: a deleted kept file has left the diff the guard judged. + for fail_fast in (True, False): + with self.subTest(fail_fast=fail_fast): + listed = self._path_list(self._second_attempt_note( + lambda: Path("docs/notes.md").unlink(), + fail_fast=fail_fast)) + self.assertIn("- `docs/notes.md`", listed) + self.assertNotIn("changed no files", listed) + + def test_reverting_a_kept_tracked_edit_lists_it(self): + def edit(): + Path("docs/tracked.md").write_text("edited\n") + + def revert(): + Path("docs/tracked.md").write_text("original\n") + + for fail_fast in (True, False): + with self.subTest(fail_fast=fail_fast): + listed = self._path_list(self._second_attempt_note( + revert, fail_fast=fail_fast, first_act=edit, + tracked={"docs/tracked.md": "original\n"})) + self.assertIn("- `docs/tracked.md`", listed) + self.assertNotIn("changed no files", listed) + + def test_deleting_a_kept_file_and_writing_another_lists_both(self): + def swap(): + Path("docs/notes.md").unlink() + Path("docs/second.md").write_text("second\n") + + for fail_fast in (True, False): + with self.subTest(fail_fast=fail_fast): + listed = self._path_list( + self._second_attempt_note(swap, fail_fast=fail_fast)) + self.assertIn("- `docs/notes.md`", listed) + self.assertIn("- `docs/second.md`", listed) + + # #3614: the list compares each path's state (content and mode) at the + # start and end of the attempt, reading git's names unquoted, so renames, + # mode-only changes and non-ASCII names are listed too. + CAFE = "docs/caf\u00e9.md" + + def _listed(self, second_act, **kwargs) -> dict: + """The path list for attempt 2, per fail-fast setting.""" + return {ff: self._path_list(self._second_attempt_note( + second_act, fail_fast=ff, **kwargs)) + for ff in (True, False)} + + def test_rename_lists_both_names(self): + def rename(): + os.rename("docs/old.md", "docs/new.md") + + for ff, listed in self._listed( + rename, tracked={"docs/old.md": "old\n"}).items(): + with self.subTest(fail_fast=ff): + self.assertIn("- `docs/old.md`", listed) + self.assertIn("- `docs/new.md`", listed) + + def test_writing_back_a_renamed_file_lists_it(self): + def rename(): + os.rename("docs/old.md", "docs/new.md") + + def write_back(): + Path("docs/old.md").write_text("old\n") + + for ff, listed in self._listed( + write_back, first_act=rename, + tracked={"docs/old.md": "old\n"}).items(): + with self.subTest(fail_fast=ff): + self.assertIn("- `docs/old.md`", listed) + self.assertNotIn("docs/new.md", listed) + + def test_mode_only_change_lists_it(self): + def make_executable(): + os.chmod("docs/notes.md", 0o755) + + for ff, listed in self._listed(make_executable).items(): + with self.subTest(fail_fast=ff): + self.assertIn("- `docs/notes.md`", listed) + + def _edit_cafe(self, text): + return lambda: Path(self.CAFE).write_text(text) + + def test_non_ascii_name_edited_again_is_listed(self): + for ff, listed in self._listed( + self._edit_cafe("second\n"), first_act=self._edit_cafe("first\n"), + tracked={self.CAFE: "original\n"}).items(): + with self.subTest(fail_fast=ff): + self.assertIn(f"- `{self.CAFE}`", listed) + + def test_non_ascii_name_restored_is_listed(self): + for ff, listed in self._listed( + self._edit_cafe("original\n"), + first_act=self._edit_cafe("first\n"), + tracked={self.CAFE: "original\n"}).items(): + with self.subTest(fail_fast=ff): + self.assertIn(f"- `{self.CAFE}`", listed) + + def test_non_ascii_name_left_alone_is_not_listed(self): + for ff, listed in self._listed( + lambda: None, first_act=self._edit_cafe("first\n"), + tracked={self.CAFE: "original\n"}).items(): + with self.subTest(fail_fast=ff): + self.assertIn("this attempt changed no files", listed) + + def test_agent_files_named_like_driver_bookkeeping_are_listed(self): + # #3618: only the driver's own files are left out, by full path; an + # agent's `docs/events.jsonl` or `docs/PROGRESS.md` is listed. + def write_lookalikes(): + Path("docs/events.jsonl").write_text("{}\n") + Path("docs/PROGRESS.md").write_text("progress\n") + + for ff, listed in self._listed(write_lookalikes).items(): + with self.subTest(fail_fast=ff): + self.assertIn("- `docs/events.jsonl`", listed) + self.assertIn("- `docs/PROGRESS.md`", listed) + self.assertNotIn("WU-T01.md", listed) + self.assertNotIn(".specfuse/features/", listed) + + def test_list_is_capped_at_twenty(self): + def thirty(): + Path("docs").mkdir(exist_ok=True) + for i in range(30): + Path(f"docs/f{i:02}.md").write_text("x\n") + + note, _ = self._retry_note(thirty, retain=False) + self.assertEqual(note.count("- `docs/f"), 20) + self.assertIn("and 10 more", note) + + +class TestArmTimeWarning(_Case): + """Clause 5 — arm-time WARN for an unmentioned `produces:` path.""" + + PATH = "docs/guides/widget-notes.md" + + def _lint(self, status: str, body: str) -> str: + with tempfile.TemporaryDirectory() as tmp: + fdir = Path(tmp) + (fdir / "WU-T01.md").write_text( + f"---\nid: {T01}\nstatus: {status}\nproduces:\n" + f" - {self.PATH}\n---\n\n{body}\n" + ) + gates = [{"gate": 1, "work_units": [ + {"id": T01, "file": "WU-T01.md"}]}] + out = io.StringIO() + with contextlib.redirect_stdout(out): + lint_plan.check_produces_mentioned(fdir, gates) + return out.getvalue() + + def test_pending_unmentioned_warns(self): + out = self._lint("pending", "Write the notes.") + self.assertIn("WARN:", out) + self.assertIn(T01, out) + self.assertIn(self.PATH, out) + self.assertIn("produces_not_in_diff", out) + + def test_file_name_mention_is_silent(self): + self.assertEqual(self._lint("pending", "Write widget-notes.md."), "") + + def test_full_path_mention_is_silent(self): + self.assertEqual(self._lint("pending", f"Write {self.PATH}."), "") + + def test_parent_directory_mention_is_silent(self): + self.assertEqual(self._lint("pending", "Add under docs/guides."), "") + + def test_done_and_abandoned_are_silent(self): + for status in ("done", "abandoned"): + with self.subTest(status=status): + self.assertEqual(self._lint(status, "Write the notes."), "") + + def test_lint_runs_the_check(self): + _, fdir = self._workspace() + wu = fdir / "WU-T01.md" + wu.write_text(wu.read_text().replace( + "src/rule.py", "zzz/unnamed-thing.md")) + out = io.StringIO() + with contextlib.redirect_stdout(out): + lint_plan.lint(fdir) + self.assertIn("zzz/unnamed-thing.md", out.getvalue()) + + +class TestEarlyRefusalRecovery(_Case): + """Review follow-up: an early refusal keeps the recovery paths a failed + verification had — re-planning before the last attempt, and the + repeated-refusal halt firing only on a tree that really did not move.""" + + def _run(self, act): + """`loop.run()` with T01 calling *act(n)* on its n-th attempt and never + touching `src/rule.py`. Returns (attempt count, re-plan turns, T01 + frontmatter text).""" + _, fdir = self._workspace() + Path("a.py").write_text("A = 0\n") + Path("b.py").write_text("B = 0\n") + _git("add", ".") + _git("commit", "-q", "-m", "tracked files") + attempts, replans = [], [] + + def dispatch(wu, note, cost_tracking=True): + if wu.body.startswith(loop._REPLAN_BRIEF_MARKER): + replans.append(wu.wu_id) + return "# T01\n\nRe-planned body: write src/rule.py.\n" + if wu.wu_id == T01: + attempts.append(note) + act(len(attempts)) + return _COMPLETE + + self._patch("dispatch", dispatch) + self._patch("verify", lambda wu, fd, cfg=None: (True, "(stub)")) + with contextlib.redirect_stdout(io.StringIO()): + self.assertEqual(loop.run(None, dry_run=False), 1) + return len(attempts), replans, (fdir / "WU-T01.md").read_text() + + def test_early_refusal_replans_before_the_last_attempt(self): + def new_note(n): + Path("docs").mkdir(exist_ok=True) + Path(f"docs/notes-{n}.md").write_text(f"{n}\n") + + count, replans, _ = self._run(new_note) + self.assertEqual(replans, [T01]) + self.assertEqual(count, 3) + + def test_tracked_edits_are_not_an_untouched_tree(self): + def edit_tracked(n): + Path("a.py" if n == 1 else "b.py").write_text(f"X = {n}\n") + + count, _, wu_text = self._run(edit_tracked) + self.assertNotIn("deterministic_refusal_repeat", wu_text) + self.assertEqual(count, 3) + + def test_untouched_tree_still_halts_without_replanning(self): + count, replans, wu_text = self._run(lambda n: None) + self.assertIn("escalation_reason: deterministic_refusal_repeat", + wu_text) + self.assertEqual(count, 2) + self.assertEqual(replans, []) + + +class TestEarlyRetainedNoteWording(unittest.TestCase): + """Review follow-up: a retained tree that was never verified is not + 'correct work to leave alone' — the missing deliverable IS the work.""" + + def test_early_retained_note_asks_for_the_missing_work(self): + for fc in ("produces_not_in_diff", "guard_refusal"): + with self.subTest(failure_class=fc): + lead = loop.synthesize_retry_directive( + fc, retained=True, verification_ran=False) + self.assertIn("NOT been verified", lead) + self.assertIn("missing deliverable", lead) + self.assertNotIn("re-authoring them is the one thing", lead) + self.assertNotIn("only the mechanical fix", lead) + self.assertNotIn("refused this attempt's pass", lead) + + def test_late_retained_note_is_unchanged(self): + lead = loop.synthesize_retry_directive( + "produces_not_in_diff", retained=True, verification_ran=True) + self.assertIn("verification already PASSED", lead) + self.assertIn("only the mechanical fix", lead) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/test_files_changed_auto_repair.py b/tests/test_files_changed_auto_repair.py index 576a94ce..20141884 100644 --- a/tests/test_files_changed_auto_repair.py +++ b/tests/test_files_changed_auto_repair.py @@ -152,8 +152,10 @@ def test_untouched_deliverable_still_refuses(self): " - kept.py\n - extra.py\n```\n" ) outcome, payload, _usage = self._run(wu, stdout) - self.assertEqual(outcome, "files_changed_mismatch") - self.assertEqual(payload, ["extra.py"]) + # FEAT-LOOP-2026-0251/T01: the untouched deliverable is now refused + # before verify(), so it never reaches the post-verify guard. + self.assertEqual(outcome, "produces_not_in_diff") + self.assertEqual(payload["remaining"], ["extra.py"]) self.assertIsNone(wu.auto_repaired_files_changed) def test_nothing_to_repair_is_a_plain_pass(self): diff --git a/tests/test_guard_repair_e2e.py b/tests/test_guard_repair_e2e.py index b5f2f298..b624f1f4 100644 --- a/tests/test_guard_repair_e2e.py +++ b/tests/test_guard_repair_e2e.py @@ -170,6 +170,9 @@ def fake_dispatch(wu, failure_note, cost_tracking=True): self._patch("dispatch", fake_dispatch) self._patch("verify", lambda wu, fd, cfg=None: (True, "(stub)")) + # The absent `src/extra.py` would otherwise be refused early as + # `deliverable_missing`, before the guard under test here. + self._patch("early_produces_refusal", lambda *a, **k: None) loop.run(None, dry_run=False) diff --git a/tests/test_loop_files_changed_guard.py b/tests/test_loop_files_changed_guard.py index 5c974d73..8e21187a 100644 --- a/tests/test_loop_files_changed_guard.py +++ b/tests/test_loop_files_changed_guard.py @@ -308,7 +308,7 @@ def fake_verify(wu, feature_dir, cfg=None): # trigger 3 case (sentinel path the agent never touched). return True, "(stub verify pass)" - self._patch("dispatch", fake_dispatch) + self._patch("dispatch", with_deliverable(fake_dispatch)) self._patch("verify", fake_verify) rc = loop.run(None, dry_run=False) diff --git a/tests/test_produces_shape.py b/tests/test_produces_shape.py index fc9ec765..1558ad2d 100644 --- a/tests/test_produces_shape.py +++ b/tests/test_produces_shape.py @@ -93,12 +93,12 @@ def test_the_error_names_the_guard_it_preempts(self): def test_file_produces_is_not_flagged(self): self.assertEqual( - [f for f in self._lint("src/Regression.java") if "directory" in f], [], + [f for f in self._lint("src/Regression.java") if "assert_declared_deliverables" in f], [], ) def test_glob_produces_is_not_flagged(self): self.assertEqual( - [f for f in self._lint("src/**/*.java") if "directory" in f], [], + [f for f in self._lint("src/**/*.java") if "assert_declared_deliverables" in f], [], ) diff --git a/tests/test_replan_end_to_end.py b/tests/test_replan_end_to_end.py index c7a30c96..3b12458c 100644 --- a/tests/test_replan_end_to_end.py +++ b/tests/test_replan_end_to_end.py @@ -39,7 +39,7 @@ from pathlib import Path from tests._loop_loader import load_loop -from tests._workspace import integration_workspace +from tests._workspace import integration_workspace, with_deliverable loop = load_loop() @@ -156,7 +156,7 @@ def fake_verify(wu, feature_dir, gate_file=None): with integration_workspace() as root: os.chdir(root) feature_dir = _scaffold(root) - self._patch("dispatch", fake_dispatch) + self._patch("dispatch", with_deliverable(fake_dispatch)) self._patch("verify", fake_verify) rc = loop.run(None, dry_run=False) diff --git a/tests/test_replan_event_emission.py b/tests/test_replan_event_emission.py index a8c648e7..75877975 100644 --- a/tests/test_replan_event_emission.py +++ b/tests/test_replan_event_emission.py @@ -32,7 +32,7 @@ from specfuse.loop import gate_eval, validate_event from tests._loop_loader import load_loop -from tests._workspace import integration_workspace +from tests._workspace import integration_workspace, with_deliverable loop = load_loop() @@ -141,7 +141,7 @@ def fake_verify(wu, feature_dir, gate_file=None): with integration_workspace() as root: os.chdir(root) feature_dir = _scaffold(root) - self._patch("dispatch", fake_dispatch) + self._patch("dispatch", with_deliverable(fake_dispatch)) self._patch("verify", fake_verify) rc = loop.run(None, dry_run=False) diff --git a/tests/test_replan_note_collision.py b/tests/test_replan_note_collision.py index ce3a9b3c..1d0e0bb8 100644 --- a/tests/test_replan_note_collision.py +++ b/tests/test_replan_note_collision.py @@ -27,7 +27,7 @@ from pathlib import Path from tests._loop_loader import load_loop -from tests._workspace import integration_workspace +from tests._workspace import integration_workspace, with_deliverable loop = load_loop() @@ -110,7 +110,7 @@ def fake_verify(wu, feature_dir, gate_file=None): with integration_workspace() as root: os.chdir(root) feature_dir = _scaffold(root) - self._patch("dispatch", fake_dispatch) + self._patch("dispatch", with_deliverable(fake_dispatch)) self._patch("verify", fake_verify) rc = loop.run(None, dry_run=False) diff --git a/tests/test_replan_trigger.py b/tests/test_replan_trigger.py index 91ce3d36..f148d052 100644 --- a/tests/test_replan_trigger.py +++ b/tests/test_replan_trigger.py @@ -183,6 +183,9 @@ def fake_dispatch(wu, failure_note, cost_tracking=True): f"unit loop is spinning instead of terminating (a " f"re-plan must spend the remaining attempt slot, not " f"buy a new budget)") + # A deliverable, so each attempt reaches verify() rather than the + # early `no_deliverable_files` refusal. + Path("deliverable.txt").write_text(f"{dispatch_count['n']}\n") return "```result\nstatus: complete\n```\n" def fake_verify(wu, feature_dir, gate_file=None): @@ -234,9 +237,9 @@ def test_refusal_repeat_escalates_and_the_replanned_attempt_never_dispatches(sel # the pass identically every time ("no_deliverable_files"), which # appends to `refusal_history` with empty `files_touched`. That is a # guard refusal, a structurally distinct code path from a real - # verify() failure: `should_replan_instead_of_retry` is only ever - # consulted on the "outcome == failed" path, so it is never reached - # here at all — the refusal-repeat check owns the outcome outright. + # verify() failure. An early refusal does consult the re-plan trigger + # (FEAT-LOOP-2026-0251), but only when it is not a repeat on an + # unmoved tree — so the refusal-repeat check owns the outcome outright. # `detect_deterministic_refusal_repeat` fires at the top of attempt 3 # once 2 identical refusals (from attempts 1 and 2) exist, blocking # BEFORE attempt 3 is ever dispatched: proven directly by