Skip to content

feat(FEAT-LOOP-2026-0250): record verification gate results and durations - #3598

Merged
clabonte merged 23 commits into
mainfrom
feat/FEAT-LOOP-2026-0250-gate-timings
Nov 25, 2026
Merged

clabonte merged 23 commits into
mainfrom
feat/FEAT-LOOP-2026-0250-gate-timings

Conversation

@clabonte

Copy link
Copy Markdown
Contributor

Implements FEAT-LOOP-2026-0250: record verification gate results and durations.

What changes

attempt_outcome.duration_seconds was one timer covering the agent session and every verification gate together, so nobody could tell where attempt time went. This feature measures it; it speeds nothing up.

  • New gate_result driver event, one per gate per run, for all three phases (attempt, baseline, broad): gate, ok, skipped, duration_seconds, phase, and attempt (null outside the attempt phase). Registered in driver-event.schema.json. A gate skipped because a dependency failed records ok: false, skipped: true, duration_seconds: 0.
  • attempt_outcome gains agent_seconds and verify_seconds. duration_seconds keeps its meaning (the total); the remainder is driver overhead. An attempt that never reached verification records verify_seconds: 0.
  • specfuse stats (text and --json) reports the agent/verify split per feature and the slowest gates (runs, total, median, max). A corpus without the new fields reads "not recorded", never zeros.
  • docs/methodology.md gains a short Timings paragraph (packaged copy synced).

Pass/fail logic is unchanged: _run_gate_set() computes ok exactly as before and only adds keys beside it; verify() still decides on all(g["ok"]); gate_result is read only by events_stats.py. The terminal judge-editing stop fired on loop.py and the event schema, and was acknowledged by the operator on G1-CLOSE.

Verification

  • Feature oracle python3 -m unittest tests.test_gate_timings -v -b green, no surviving unittest.skip.
  • Gate-1 broad run (full code gate set) clean; full suite passed locally.
  • Close judge agreed: met.

Not verified in-loop (see RETROSPECTIVE.md)

  1. Real agent sessions: the oracle stubs the session, so agent_seconds on a real claude -p dispatch is unobserved (post-merge checklist).
  2. specfuse stats on the external corpus that motivated the feature (post-merge checklist).
  3. The run() wiring of attempt- and baseline-phase events has no test; only the broad-phase events were observed live (18 events in this feature's events.jsonl).
  4. No dedicated assertion that duration_seconds keeps its meaning; events from killed attempts are lost (out of scope by plan).

Pending learnings (needs promotion)

From .specfuse/features/FEAT-LOOP-2026-0250-gate-timings/LEARNINGS-pending.md:

  • [FEAT-LOOP-2026-0250/T04] A unit that edits docs/*.md must also refresh that file's packaged copy under specfuse/loop/data/docs/ in the same unit. T04 edited docs/methodology.md and not its packaged copy; its narrow tier selected no docs-sync test, so it passed, and three docs-sync tests went red only in the gate's broad run. Run scripts/sync-scaffold.sh before reporting, and list the packaged copy in produces: so the diff guard sees it.

  • [FEAT-LOOP-2026-0250/T01] A test that validates events through validate_event must pin the real packaged schemas and clear the validator's module caches. test_emitted_events_validate passed alone and failed in the full suite because an earlier test left _DRIVER_EVENT_TYPES_CACHE empty, dropping every driver event type from the enum. Copy the pinning from tests/test_event_gate_full_envelope.py when writing the test, not after the broad run fails.

Promotion is a step for the reviewer: read each entry, copy the accepted ones into .specfuse/LEARNINGS.md, leave rejected ones in the pending file with a note, and remember planning never reads LEARNINGS-pending.md directly, so an unpromoted entry is lost.

🤖 Generated with Claude Code

Test and others added 23 commits November 25, 2026 10:15
…ions

Draft the feature: one gate, four units and a terminal close. Each
verification gate run (attempt, baseline probe, broad run) emits a
gate_result event with its outcome and duration, attempt_outcome gains
agent_seconds and verify_seconds, and `specfuse stats` reports the
agent/verify split per feature and the slowest gates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…2026-0250/T01 — awaiting_review

Feature: FEAT-LOOP-2026-0250
…te 1

The drafted detail section had no `<a id="feat-loop-2026-0250">` anchor,
so the row's `[→ detail]` link did not resolve. roadmap-link-gate and the
two real-tree roadmap tests failed on every run, which the baseline probe
read as a pre-existing failure and halted gate 1 after T01's first
attempt. T01's code was not at fault; it is back at attempts 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pen it

The broad run before G1-CLOSE failed four tests the per-unit narrow tier
never ran:

- test_gate_timings.TestNothingExistingChanges.test_emitted_events_validate
  passed alone but failed in the full suite: validate_event caches driver
  event types at module level, and an earlier test left the cache empty.
  Pin the real packaged schemas and reset the caches, as
  test_event_gate_full_envelope does, and drain the phase-result global.
- Three docs-sync tests: T04 edited docs/methodology.md without its
  packaged copy. Ran scripts/sync-scaffold.sh.

scripts/smoke-test.sh OK: 5101 tests (4 skipped), lint, security, coverage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Feature: FEAT-LOOP-2026-0250
… operator, re-armed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Feature: FEAT-LOOP-2026-0250/G1-CLOSE
Feature: FEAT-LOOP-2026-0250
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@clabonte
clabonte merged commit 582d4bd into main Nov 25, 2026
7 checks passed
@clabonte
clabonte deleted the feat/FEAT-LOOP-2026-0250-gate-timings branch November 25, 2026 18:13
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.

1 participant