Skip to content

fix: M3.1 live-shift findings + backlog-reach ruling (#637) - #638

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/m31-findings
Nov 16, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
feature/m31-findings

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

Closes #637. These are fixes from the M3.1 live shifts (PyAutoLabs/PyAutoMind#570 and #571), made before the M3.2 shifts.

  1. Re-dispatch: goes first in the spawn order and may exceed max-sessions by 1, once per shift (REDISPATCH_LIMIT=1).
  2. Killed and not re-dispatched: reads "Crashed — not re-dispatched: ". A gated task says why it was skipped.
  3. Parked-on-question tasks: can't start until a later shift finishes them or a brief names them. A malformed counters.json reads as no hold, with a note.
  4. Repo claims: a task is skipped when a claim on Mind origin/main holds one of its declared repos, unless the claim records coordination: / conflict-override:. An unreadable active.md fails closed.
  5. Calibration gate: also reads the local origin/main ref, so a check-in pushed from a linked worktree counts within one tick. The 16-minute gap on 2026-11-14 was in the lead, not the gate. That was the latent fault.
  6. Human ruling 2026-11-16, recorded in AUTONOMY.md: a scoped dip takes queue.md first, then only small single-repo backlog tasks.
  7. Organ excludes: a dip never takes a PyAutoBrain, PyAutoMind or PyAutoHands target.
  8. Token reservation: the median spend of finished workers, from shifts with a comparable budget. It is capped at budget/2 and never below the even share.
  9. PR keys: a bare pr: key is refused, and the worker template states library-pr: / workspace-pr:.
  10. Clean-up: an unattended close-out removes the worktree and branch, or reports why in the digest.
  11. Queue retirement: an in-turn merge retires its queue.md entry.

Witness

  • 15 new offline tests, each failing on the base.
  • Brain suite: 2031 passed. The 1 failure is environmental (test_grouped_organ_consumers, which also fails on the base).
  • Tenant firewall and skill line counts: OK.
  • Dry run of the 11-14 scenario, branch against base (Science/scratch/m3_1_prep/findings_637/dryrun.md):
    • re-dispatch after an early dip;
    • no re-pick of a parked task;
    • a repo-claimed task is skipped;
    • the medium multi-repo dip is refused;
    • B opens on the same tick as A's check-in.

Review

An independent Opus review returned FINDINGS (an uncapped token reserve could freeze a shift; a crash on a malformed counters file; fail-open on an unreadable active.md). All three were fixed in c0e4d72. Follow-ups: answering a question on the issue does not clear the hold by itself, and M3.5 (the questions inbox) owns that. A coordination: claim opens its repos to every dip.

🤖 Generated with Claude Code

Jammy2211 and others added 2 commits November 16, 2026 09:59
…sks, repo claims, backlog reach (#637)

Eleven fixes from the 2026-11-14 pm2/pm3 shifts, one offline test each
(tests/test_m31_live_shift_findings.py, all failing on 421ef0f):

1. A re-dispatch goes first and may pass max-sessions by one.
2. Killed and never re-dispatched reads "Crashed — not re-dispatched" with
   the last refusal, never "Not started"; a gated task names its gate.
3. A task an earlier shift parked on a question is not startable until a
   later shift finishes it or a brief names it (local counters, no network).
4. A task whose declared repo a claim in active.md on Mind origin/main holds
   is skipped, unless the claim records coordination/conflict-override.
5. The calibration gate also reads the previous record on Mind's local
   origin/main ref (no fetch): a check-in pushed from a linked worktree
   counts on the next tick even if the canonical tree is not fast-forwarded.
6. backlog: scoped dips beyond queue.md take only small single-repo tasks;
   one dated AUTONOMY.md sentence records the 2026-11-16 ruling.
7. A shift never dips a Brain, Mind or Hands target (by rule).
8. The token reservation is max(even share, mean spend of finished workers
   in this and the last three shifts), so the cap can bind first.
9. The writer refuses an active.md row with a non-schema PR key (bare pr:);
   the worker template states the keys.
10. worktree_remove's stale-claim guard counts a release queued in the shift
    ledger; the close-out removes the worktree and branch or says why in a
    `cleanup` field the digest shows.
11. An in-turn merge queues its queue.md retirement.

Test fixtures that dipped a PyAutoBrain target now use PyAutoHeart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on bad reads (#637)

1. The reservation estimate is the median spend of finished workers in
   shifts whose token-budget is within 2x of this one (recorded as
   `token_budget` in counters.json, else read from the brief record), and
   it is clamped to budget//2, never below the even share: one past 450k
   worker in a 400k shift no longer refuses the first spawn.
2. A counters.json with the wrong shape (e.g. {"outcomes": {"t": null}})
   reads as no hold and no measure, with a note on stderr, never a planner
   crash.
3. An active.md on Mind origin/main that cannot be read fails closed, as an
   unreadable draft/ tree does; a ref with no active.md still claims nothing.

Tests: an outlier/median case, a malformed-counters case and a lost-blob
active.md case, each failing on 1ae5d5f.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 9a7072a into main Nov 16, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/m31-findings branch November 16, 2026 10:31
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: M3.1 live-shift findings — re-dispatch reserve, parked tasks, repo claims, backlog reach ruling, close-out clean-up

1 participant