Skip to content

feat(loop): show a running unit's progress, and notify when the driver stops (FEAT-LOOP-2026-0252) - #3627

Merged
clabonte merged 25 commits into
mainfrom
feat/FEAT-LOOP-2026-0252-run-progress
Nov 27, 2026
Merged

clabonte merged 25 commits into
mainfrom
feat/FEAT-LOOP-2026-0252-run-progress

Conversation

@clabonte

Copy link
Copy Markdown
Contributor

FEAT-LOOP-2026-0252. While specfuse-loop runs, an operator can now see which unit, attempt, phase and verification gate is running and for how long, and is notified once when the run stops.

  • Phase events: agent_session_started, agent_session_finished, gate_started and gate_finished are appended to events.jsonl as they happen, and the driver prints one plain line for each (no \r, no ANSI).
  • Status file: a live <feature>/work/STATUS.json (never committed) is refreshed by a heartbeat (defaults.heartbeat_seconds, default 30). It carries the unit, attempt, phase, gate, elapsed time and files touched.
  • specfuse-loop --watch [--feature F]: follows a run from another terminal and reports a stale status.
  • Stop notification: exactly one per stop (halted, awaiting_review, complete, error or stopped), sent through the existing webhook and through the new escalation.notify_command. The command runs as an argument list with SPECFUSE_* environment variables and a 30 s timeout; a failing command never changes the run's exit code.

dispatch() and the attempt_outcome payload are unchanged.

Close

  • The first close recorded not_met on [FEAT-LOOP-2026-0252 follow-up] Definition of done clause 6 (stop reason when the event log changes during run()) #3626: the stop reason was read past a byte offset taken before the run's branch checkout. That is fixed on this branch by selecting events by timestamp, and tested with a real checkout in both directions.
  • The re-close recorded met, and the judge agreed.
  • The operator acknowledged the judge-surface edits (loop.py, arm_eval.py, agent_policy.py, the driver-event schema, the verification.yml examples).
  • See RETROSPECTIVE.md and FOLLOW-UPS.md in the feature folder.

Closes #3626.

Pending learnings (needs promotion)

  • [FEAT-LOOP-2026-0252/G1-CLOSE] A position remembered in a tracked file is not valid
    across a branch checkout.
    "What this run wrote" was read as everything in events.jsonl
    after the byte size taken at the start of run(). run() can then switch to the feature
    branch, which holds a different log, so older lines counted as new ones and new ones were
    skipped. The test for "earlier runs are not read" kept one file for the whole run. When a
    unit reads "only what this run wrote", list what can replace the file between the two
    reads (checkout, reset, merge), and test at least one of them.
  • [FEAT-LOOP-2026-0252/G1-CLOSE] Show that a regression test fails with the old code
    put back.
    For [FEAT-LOOP-2026-0252 follow-up] Definition of done clause 6 (stop reason when the event log changes during run()) #3626 the re-close restored the byte-offset reader in a temporary copy
    and ran the new real-checkout tests there: both failed, with the same two wrong stop
    reasons the first close had seen. A green run alone would not have shown that the
    fixture's checkout really changed the log. Selecting a run's records by a value each
    record carries (here its timestamp) held across the checkout, but it relies on the
    clock, so state that limit.

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 25 commits November 26, 2026 22:04
… driver lines

Feature: FEAT-LOOP-2026-0252/T01
Feature: FEAT-LOOP-2026-0252/T02
Feature: FEAT-LOOP-2026-0252/T03
Feature: FEAT-LOOP-2026-0252
… re-arm G1-CLOSE

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Feature: FEAT-LOOP-2026-0252/G1-CLOSE
Feature: FEAT-LOOP-2026-0252
…e-checkout byte offset (#3626)

The offset into events.jsonl was taken before run() checks out the feature
branch, so a checkout to a branch with a different log either counted an
older run's escalation or skipped this run's own lines. Select the events
stamped at or after the run's start instead. Two tests drive loop.main()
through a real checkout in each direction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Feature: FEAT-LOOP-2026-0252
Feature: FEAT-LOOP-2026-0252/G1-CLOSE
Feature: FEAT-LOOP-2026-0252
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@clabonte
clabonte merged commit ce1c7ae into main Nov 27, 2026
7 checks passed
@clabonte
clabonte deleted the feat/FEAT-LOOP-2026-0252-run-progress branch November 27, 2026 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT-LOOP-2026-0252 follow-up] Definition of done clause 6 (stop reason when the event log changes during run())

1 participant