Skip to content

feat(loop): refuse a missing deliverable before the verification gates run (FEAT-LOOP-2026-0251) - #3624

Merged
clabonte merged 70 commits into
mainfrom
feat/FEAT-LOOP-2026-0251-fail-fast-deliverables
Nov 26, 2026
Merged

clabonte merged 70 commits into
mainfrom
feat/FEAT-LOOP-2026-0251-fail-fast-deliverables

Conversation

@clabonte

Copy link
Copy Markdown
Contributor

FEAT-LOOP-2026-0251. The three diff-only deliverable refusals (produces_not_in_diff, deliverable_missing, no_deliverable_files) now run before any verification gate. defaults.fail_fast_deliverables: false restores the old order. The retry note lists the paths the attempt itself changed, or says it changed none. specfuse lint warns when a produces: path appears nowhere in its unit's text (by full path, file name or parent directory).

Close

  • The terminal close passed on its seventh run, with verdict met.
  • The six earlier closes were lowered to not_met by the judge. Each finding was fixed on this branch or settled by an operator amendment to GATE-01.md.
  • On the seventh run the judge session timed out (900s), so the close's own met stands unjudged. The operator accepted it. The timeout behaviour is tracked in Judge timeout lets an unjudged terminal met fire terminal flips without notice #3623.
  • See RETROSPECTIVE.md and FOLLOW-UPS.md in the feature folder.

Closes #3608, closes #3609, closes #3610, closes #3612, closes #3613, closes #3614, closes #3617, closes #3618, closes #3619.

Pending learnings (needs promotion)

  • [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.

To promote: read each entry above, copy the accepted ones into .specfuse/LEARNINGS.md, and leave each rejected one in LEARNINGS-pending.md with a note. Planning never reads LEARNINGS-pending.md directly.

🤖 Generated with Claude Code

Test and others added 30 commits November 26, 2026 08:30
…rification gates run

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uces_shape and reopen gate 1

The new produces-mentioned WARN contains the word 'directory', which the two
not-flagged shape tests used as their filter. Filter on the guard name the
shape ERROR carries instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Feature: FEAT-LOOP-2026-0251
… early refusals

Review follow-ups before the gate 1 close:

- An early deliverable refusal now consults the re-plan trigger, through
  replan_before_last_attempt (extracted from the failed-verification path),
  unless it repeats on an unmoved tree, which stays #597's halt.
- The refusal measurement counts uncommitted edits to tracked files
  (git_diff_names(..., worktree=True), excluding the unit file), so an
  attempt that only edited tracked files no longer reads as an untouched tree.
- 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.

Tests: tests/test_fail_fast_deliverables.py TestEarlyRefusalRecovery,
TestEarlyRetainedNoteWording (red before, green after). scripts/smoke-test.sh:
5130 tests OK (skipped=4).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dged judge edits)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Feature: FEAT-LOOP-2026-0251
Feature: FEAT-LOOP-2026-0251/G1-CLOSE
Feature: FEAT-LOOP-2026-0251
…and #3609, re-arm the close

Operator decision after the first close recorded not_met: state that a
deliverable refusal outranks files_changed_mismatch under the default order
(#3608), asserted by a new test on both sides of the opt-out; widen clause 6
to cover test edits forced by a shared-helper refactor or new lint wording,
none of which removes an assertion (#3609).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Feature: FEAT-LOOP-2026-0251
Feature: FEAT-LOOP-2026-0251/G1-CLOSE
Feature: FEAT-LOOP-2026-0251
…verable refusals (#3610), re-arm the close

The second close recorded not_met on #3610: the early deliverable refusal
also outranks the smoke-import, blocked-verdict and closing-deliverable
checks. Operator chose to state one general rule. GATE-01.md, the close
unit's escalation trigger and docs/methodology.md (plus the packaged copy)
now say a deliverable refusal outranks every check that runs after the
agent session, and record the kept-tree side effect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Test and others added 26 commits November 26, 2026 11:36
#3613)

A file an earlier, kept attempt left that this attempt deleted, or
reverted to its committed content, is no longer in the diff the guard
judged, so the note missed it and could claim 'this attempt changed no
files'. attempt_own_paths now also lists every attempt-start snapshot path
that has left the diff and whose content has changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Feature: FEAT-LOOP-2026-0251
Feature: FEAT-LOOP-2026-0251/G1-CLOSE
Feature: FEAT-LOOP-2026-0251
…3614)

Each earlier fix filtered the diff the guard judged, so renames (only the
new name), mode-only changes and non-ASCII names (quoted by git) were
still missed or reported as 'changed no files'. The list 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,
NUL-separated) is compared by state (file type, executable bits, content
digest) across the attempt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Feature: FEAT-LOOP-2026-0251
Feature: FEAT-LOOP-2026-0251/G1-CLOSE
…t_met

Feature: FEAT-LOOP-2026-0251/G1-CLOSE
Feature: FEAT-LOOP-2026-0251
… base name (#3618)

An agent's own docs/events.jsonl or docs/PROGRESS.md was dropped from the
note's path list because the driver's bookkeeping was matched by base
name. The unit file, events.jsonl and PROGRESS.md are now matched by full
path in the unit's feature folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…arm G1-CLOSE

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Feature: FEAT-LOOP-2026-0251
Feature: FEAT-LOOP-2026-0251/G1-CLOSE
Feature: FEAT-LOOP-2026-0251
@clabonte
clabonte merged commit 4d24144 into main Nov 26, 2026
6 checks passed
@clabonte
clabonte deleted the feat/FEAT-LOOP-2026-0251-fail-fast-deliverables branch November 26, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment