Skip to content

fix: sweep fail streak resets on a new shift; digest row names the sweep wait (M3.7e follow-ups) - #695

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/sweep-followups
Nov 19, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
feature/sweep-followups

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

The two M3.7e review follow-ups (closes #694), filed as drafts and approved by the human on 2026-11-19.

  • Sweep fail streak. The workspace sweep's failing-read streak now starts fresh on a new shift (the slot name is stored with the last read), when no shift is stored, or after a gap of more than 2 hours (SWEEP_STREAK_GAP_S = 7200). A failure left over from the previous shift no longer makes the next shift's first failed read "unknown" at once. Slow ticks inside one shift (gh calls hanging to their timeouts) no longer restart the streak, so 30 minutes of continuous failures still hold PRs.
  • Digest row. A PR held by an unknown sweep reads "waiting: workspace sweep unknown since " in its own per-PR row (plain headline "Waiting — workspace sweep unknown"), beside the merge-order wait.
  • One sentence each in AUTONOMY.md S4 and batch AGENTS.md.

API Changes

None — internal changes only (_sweep.observe gains a shift argument; new SWEEP_STREAK_GAP_S; _digest.sweep_wait_state).

Test Plan

  • Tests first in tests/test_shift_end_sweep.py (43 tests): the new-shift reset, the no-stored-shift reset, slow 12-minute ticks still holding after 30 minutes, the digest row and its fallback all failed on the earlier code; the 2-hour gap test guards existing behaviour.
  • Full Brain suite: 2527 passed, 1 skipped.
  • bin/check_skill_line_counts.sh 200 PyAutoBrain, tenant firewall, install.sh --check-project-discovery: OK.
  • Independent review (fresh Opus 5.5 session): round 1 FINDINGS (medium: a 10-minute gap rule measured between tick starts let a hanging outage restart the streak every tick, so the hold never fired; nit: the digest fallback never fired), fixed as suggested (reset on a new shift, 2-hour backstop).
  • Heart scoped dev-ship verdict for PyAutoBrain: green.

🤖 Generated with Claude Code

Jammy2211 and others added 2 commits November 19, 2026 17:13
…ames the sweep wait

- _sweep.observe: a failed run-list read more than SWEEP_STREAK_GAP_S (600 s)
  after the previous read attempt starts a fresh streak, so the 30-minute
  unknown rule counts only continuous failures inside one run of ticks.
- _digest: a PR in counters["sweep_waits"] reads "waiting: workspace sweep
  unknown since <t>" in its own row (plain word "Waiting — workspace sweep
  unknown"), beside the merge-order wait. Workspace sweep section unchanged.
- AUTONOMY.md S4 and batch AGENTS.md record the gap rule.
- Tests: LateLibs spawner; streak-gap, continuous-hold and digest-row tests;
  r1_2/r2_1 tests now tick a few minutes apart.

Refs #694

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

- _sweep.observe takes the shift (slot name) and stores it as read_shift.
  A failed read starts a fresh streak when the previous read was another
  shift's (or none is recorded) or is over SWEEP_STREAK_GAP_S = 7200 s old.
  Slow ticks inside one shift (gh calls hanging to their timeouts) no longer
  restart the streak, so the 30-minute hold still fires.
- _orchestrator passes slot.name to both observe calls.
- _digest.sweep_wait_state: partition(" since "), falling back to the
  wait's own `since` when the separator is missing.
- AUTONOMY.md S4 and batch AGENTS.md updated to the new rule.
- Tests: new-shift fresh streak (stored shift differs / none stored),
  12-minute ticks still hold, 2 h gap resets, digest fallback; the r1_2 and
  r2_1 tests are back to their original tick spacing.

Refs #694

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit ff9a0d3 into main Nov 19, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/sweep-followups branch November 19, 2026 18:03
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.

fix: sweep fail streak resets across shift gaps; digest row names the sweep wait (M3.7e follow-ups)

1 participant