Skip to content

Phase 3 (Q12): no-progress give-up via a monotonic failing-check floor#3

Merged
petemoore merged 1 commit into
mainfrom
rework/phase3-q12-no-progress-metric
Jun 15, 2026
Merged

Phase 3 (Q12): no-progress give-up via a monotonic failing-check floor#3
petemoore merged 1 commit into
mainfrom
rework/phase3-q12-no-progress-metric

Conversation

@petemoore

Copy link
Copy Markdown
Collaborator

Phase 3 sub-item Q12 (docs/WORKPLAN.md; resolves T10). Self-contained and independent of the analyser-removal rework — see the within-Phase-3 sequencing note in docs/questions.md.

Problem (T10)

The old no-progress guard gave up only when the exact same blocking-check set recurred across N consecutive turns. Any change reset the counter, so a worker that thrashes — fix A breaks B, fix B re-breaks A — kept changing the set and never tripped it, running to the global MaxImplIterations (30) / MaxImplTime cap. Oscillation is precisely the expensive-flailing mode the guard was meant to catch.

Fix (Q12 → a, K=8, monotonic floor)

decideNoProgress now tracks:

  • floor — the lowest blocking-check count seen so far, and
  • stall — consecutive settled attempts since floor last improved.

It gives up once stall reaches MaxNoProgressIterations. A monotonic floor (not a sliding window over raw counts) can't be gamed by up-down oscillation: 5→4→5→4 never lowers the floor below 4, so the stall keeps climbing and the loop terminates. Subsumes both the stationary-stuck-set and oscillating-thrash cases.

  • Default 3 → 8, now exposed as --max-no-progress-iterations (was effectively hardcoded), with >0 validation and a WithMaxNoProgressIterations option.
  • Removed the now-unused sameSet helper.
  • The metric counts whatever AcceptableGiven deems blocking, so it automatically scopes to required checks once Q7 lands — no coupling.

Tests

  • TestDecideNoProgress — the floor/stall transitions (first call sets floor, equal/worse stalls, new low resets, reaches maxStall).
  • TestDecideNoProgressSequences — whole sequences: stationary → give up attempt 9; oscillation 5,4,5,4 → attempt 10 (the old guard never fired); strict progress → never; progress-then-stall → attempt 12.

Local: go build/vet/test ./..., gofmt, staticcheck all clean.

🤖 Generated with Claude Code

petemoore added a commit that referenced this pull request Jun 15, 2026
… plan

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the exact-set no-progress guard with a progress metric (T10/Q12). The
old guard reset its counter on ANY change to the blocking-check set, so a worker
that thrashed — fix A breaks B, fix B re-breaks A — oscillated the set forever
and only the global MaxImplIterations (30) / MaxImplTime cap stopped it.

decideNoProgress now tracks the lowest blocking-check count seen so far (a
monotonic floor) and the number of consecutive settled attempts since that floor
last improved; it gives up once that stall reaches MaxNoProgressIterations. A
floor (not a sliding window over raw counts) cannot be gamed by up-down
oscillation: 5→4→5→4 never lowers the floor below 4, so the stall keeps climbing.
This subsumes both the stationary-stuck-set and the oscillating-thrash cases.

- Default raised 3 → 8 and now exposed as `--max-no-progress-iterations`
  (was effectively hardcoded), with a >0 validation check and a WithX option.
- Removed the now-unused exact-set helper `sameSet`.
- The metric counts whatever AcceptableGiven deems blocking, so it automatically
  scopes to required checks once Q7 lands — no coupling to that change.

Tests: rewrote TestDecideNoProgress for the floor transitions and added
TestDecideNoProgressSequences driving whole sequences (stationary → attempt 9,
oscillation → attempt 10 [the old guard never fired], strict progress → never,
progress-then-stall → attempt 12).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@petemoore petemoore marked this pull request as ready for review June 15, 2026 18:32
@petemoore petemoore force-pushed the rework/phase3-q12-no-progress-metric branch from d35996f to 7a5d226 Compare June 15, 2026 18:32
@petemoore petemoore merged commit c405ea2 into main Jun 15, 2026
1 check passed
@petemoore petemoore deleted the rework/phase3-q12-no-progress-metric branch June 15, 2026 18:33
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