Skip to content

feat(batch): M3.6c shift throughput — carry-over, in-shift restart, first: glance, session cap - #670

Merged
Jammy2211 merged 3 commits into
mainfrom
feature/shift-throughput-carryover
Nov 17, 2026
Merged

Jammy2211 merged 3 commits into
mainfrom
feature/shift-throughput-carryover

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Closes #669. M3.6c of the autonomous-orchestrators epic; prompt PyAutoMind/active/shift_throughput_carryover_and_order.md. Design choices approved by the human on 2026-11-17.

What changes

  • Carry-over at the first tick (carry_in).
    • Source: the newest earlier dated slot that ran something.
    • Carried: glance/notify PRs that were never closed out, or were refused only by the close-out cutoff, closed out under the new shift's grant (merge-cap, CI, the close-out session's checks).
    • Never carried: PRs refused for tier, CI or /drop; any task the human /dropped; a task parked on a question.
    • A carried PR is closed out only if GitHub reads it OPEN, so a merge the human made is never counted as unattended.
    • The digest says "Carried over from : N late PR(s)".
  • A task an answer released passes the brief's scope and the backlog-dip gates, as a named task does.
  • In-shift restart.
    • A task this shift parked on a question restarts this shift when the inbox answers it with more than 30 minutes left.
    • The release waits in inshift_pending until the task actually spawns; only then are its answer ids used. A release that never spawns leaves the park for the next shift.
    • It happens once per answer, and the digest names each restart.
    • Network-surface amendment (human-approved; AUTONOMY.md "The watcher's network surface"): the writer's own git fetch repeats only while such a park is open and more than 30 minutes remain, at most every 10 minutes.
  • first: glance. An optional brief line, validated by brief --check. Ready glance work starts before named judge tasks; it changes spawn order only, not what the plan selects.
  • Session cap from the budget. With no max-sessions: and a token-budget:, the cap is max(2 × max-workers, ceil(token-budget / 150k)). An explicit value wins. The snapshot shows "N of M (from token-budget)".
  • Docs: AUTONOMY.md (the network-surface line and "Shift throughput — 2026-11-17") and agents/conductors/batch/AGENTS.md.

Changed test

test_batch_watch: a brief with token-budget: 5000, 3 workers and no max-sessions now reads "4 of 6 (from token-budget)" instead of "4 of 8". That is the approved formula; a small budget gives 2 × max-workers.

Checks

  • Witness: tests/test_orchestrator_throughput.py. The four clauses on a fake clock failed on main 2ca1bd3 (the halves that should stay unchanged passed there, as they should). 23 tests now, including one per review fix.
  • Full Brain suite: 2332 passed, 3 skipped. bin/check_skill_line_counts.sh 200 PyAutoBrain and the tenant firewall check (repos_sync.py --check --only "tenant firewall (organ code)") both pass.
  • Independent review (Fable 5.2): two rounds.
    • Round 1, FINDINGS: a high (an in-shift release was used up even when the spawn was refused) plus five medium; all fixed.
    • Round 2, FINDINGS: one high (a dropped task's late PR could be carried and merged); fixed, using the reviewer's own one-line suggestion, with a test reproducing it. That fix was not reviewed again.

Known lows, not fixed

  • A carried PR a human merged before the shift is still counted in the digest's merges line (actor unknown), not in glance-auto-merges.
  • A PR landing in shift A after shift B's first tick is never carried (C reads only B).
  • A restarted task that parks again on the same answered question keeps the bounded fetch going for the rest of the shift.
  • With the login expired and only a pending release waiting, the login is not re-probed; the park stays, so this is safe.

Merge mode: human /prm (tier judge).


Generated by Claude Code

…irst: glance, session cap

- The first tick of a shift carries the newest earlier slot's late glance/
  notify PRs (never closed out, or refused only by the close-out cutoff)
  into its close-out path under its own grant; the digest names them.
- A task an answer released is admitted whatever the brief's backlog scope.
- A task parked this shift restarts this shift when the inbox answers it
  with more than 30 minutes left, once per answer; the writer's fetch
  repeats for that only while such a park is open, at most every 10 min
  (network-surface amendment, human-approved 2026-11-17).
- first: glance sorts ready glance work before named judge tasks.
- With no max-sessions: and a token-budget:, the cap is
  max(2 x max-workers, ceil(token-budget / 150k)); the snapshot says so.

Closes #669

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nhQ8QyUpAfUVYByA1UgVc
…s, first: glance spawn order only

- an in-shift release waits in inshift_pending until its task spawns (then
  its ids are used): a refused spawn keeps it for the next tick, and one
  that never spawns leaves the park for the next shift; idempotent across
  plan() reruns; once per answer (a new answered question releases again);
- carry-over skips a task parked on a question, reads only dated slots and
  the newest one that ran something, and closes out only a PR GitHub reads
  OPEN (a human's merge is never counted unattended); a carried task is not
  planned nor this shift's own for the claim gate;
- first: glance orders the spawn only; the plan's selection is unchanged;
- a released task passes the backlog-dip gates, as a named task does.

Refs #669

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nhQ8QyUpAfUVYByA1UgVc
…d over

- carry_in skips a task the previous shift /drop'ped, whatever close-out
  record it has (a late or paused one has none);
- an empty pr_state read is unreadable, never a refusal;
- a pending in-shift release the inbox reopened or dropped is withdrawn;
- the digest names each in-shift restart and its answer ids.

Refs #669

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nhQ8QyUpAfUVYByA1UgVc
@Jammy2211
Jammy2211 merged commit 07db03a into main Nov 17, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/shift-throughput-carryover branch November 17, 2026 21:56
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(batch): M3.6c shift throughput — carry-over, in-shift restart, first: glance, session cap

2 participants