Repository navigation
feat: shift launch preflight — issue, login probe, brief discovery (M3.6a) - #664
Merged
Merged
Conversation
…finds the open brief M3.6a (#659). Shift 2026-11-16-pm lost launch time to a missing shift issue, an expired CLI login read as "blocked on a person", a stale brief in the watcher's env file, and a watcher that never stopped. - `batch brief --new --out` makes one `gh issue create` on the Mind's origin repo and writes `- issue:` (reuses an existing one; `--issue <url>` or PYAUTO_BRIEF_ISSUE=off skips; writes nothing if gh fails). - `batch brief --check` adds `_brief.launch_errors` (a live brief needs its issue) and the login probe (`_login.probe`: `claude auth status --json`, no model call): refuses an expired login or one lapsing before review-at. `_brief.check` is unchanged for the watcher. - The watcher holds every spawn on an expired login (`_login_hold`, probed on the first spawning tick, after an expiry, and when a worker shows blocked) and records its own `login-expired` needs-you event. - `orchestrator_watch.py` finds the brief itself on Mind origin/main (`shift_briefs`/`find_briefs`/`watch`; local git ls-tree/show, no fetch): the one open brief plus late ones; two open briefs idle; a pushed brief the checkout lacks idles; `--brief`/PYAUTO_SHIFT_BRIEF is an override honoured only inside its window. The systemd unit no longer passes --brief. - After review-at + 45 min with the digest posted, a tick returns idle before the lock: no reap, no lease renewal, no log line (`_late_closed`). - AUTONOMY.md: launch preflight under "Shift brief = launch", and the two human-approved 2026-11-17 amendments (login probe; brief --new's one gh issue create). Docs in batch AGENTS.md and skills/batch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n, after the watcher's Refs PyAutoBrain#659 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pen brief, late catch-up, issue before write Review of M3.6a (#659): - find_briefs: an override takes the open brief's place only while it is open itself; in its late window it is one more late brief ticked beside the open one, so a stale PYAUTO_SHIFT_BRIEF never displaces the next shift. - A brief past review-at + 45 min is still ticked (up to CATCH_UP_S, 24 h) while its slot owes something (`late_owed`: digest unclaimed, a digest or correction post retry due, a queued Mind op); the late-window stop in `_tick` now waits for the same, so a laptop that was off catches up. - brief --new makes the shift issue after the heart-green lane, just before the write; a write that fails after it prints the URL to re-run with `--issue <url>`. - skills/batch: discovery reads the Mind checkout's origin/main ref without fetching; fetch or push from it before launch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… it silently Re-review of M3.6a (#659): a slot still owing its digest (or a post retry, or a queued Mind op) past CATCH_UP_S was dropped with only "no open brief". `find_briefs` now adds, once per slot (claimed by an `abandoned.noted` marker), "abandoned: <slot> past catch-up (<what it owes>; N leases) — run `batch digest --record …` and close it by hand". The cap value is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The batch skill's primary files were 210 lines against the 200-line budget (CI `Skill line-count budget`). The launch-preflight paragraph moves to reference.md "Launching a shift brief"; batch.md keeps a one-line pointer. Now 199 lines (SKILL.md 17 + batch.md 182). Refs #659. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…in and _merge_slots imports) Refs PyAutoBrain#659 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
M3.6a of the autonomous-orchestrators epic (PyAutoBrain#659). Shift 2026-11-16-pm lost launch time to four things the launch could have checked. This adds them:
batch brief --new --outcreates the shift issue on PyAutoMind and writesissue:;brief --checkrefuses a live brief without one, and refuses an expired login or one that expires beforereview-at.claude auth status --json): an expired login is its ownlogin-expiredevent and holds spawning, never "blocked on a person".origin/mainitself (no fetch): two open briefs → idle with that reason; a pushed brief missing from the checkout → idle "checkout behind";--brief/PYAUTO_SHIFT_BRIEFbecome an override honoured only inside its own window.review-at+ 45 min the watcher stops ticking and renewing leases, once nothing is owed (digest posted, no post retry due, no queued Mind op); it catches up a missed digest for up to 24 h and then names the abandoned slot once.brief --new's onegh issue createas the fourth exception to "The Brain reads no network").API Changes
CLI only:
batch brief --newgains--issue <url>and creates the shift issue with--out;orchestrator_watch.py --briefis now optional (discovery on origin/main); the systemd unit no longer passes--brief. New moduleagents/conductors/batch/_login.py; new event kindlogin-expired.See full details below.
Test Plan
tests/test_batch_brief.py(new issue, refuse without issue, expired login) andtests/test_orchestrator_preflight.py(login-expired not blocked, one open brief ticked, two open idle, late window no tick + lease mtimes unchanged), plus review-round tests (stale override, past-window catch-up, due retry, queued op, write-failure hint, abandoned slot named once)test_grouped_organ_consumers::test_hygiene_map_and_heart_board_find_grouped_checkoutsis environmental (fails on origin/main under activate.sh's PYAUTO_MIND)_orchestrator.py(keep both)Full API Changes (for automation & release notes)
Added
_login.probe(run=None)→{state: ok|expired|unknown|skipped, detail, expires_at};PYAUTO_LOGIN_PROBE=off_brief.LATE_WINDOW_S,_brief.launch_errors(top, brief)_batch.create_shift_issue(...);batch brief --issue URL;PYAUTO_BRIEF_ISSUE=off_orchestrator.find_briefs,watch,late_owed,_login_hold,_late_closedlogin-expiredChanged Behaviour
orchestrator_watch.py:--briefoptional, an in-window override onlybrief --check: refuses a live brief withoutissue:and an expired/expiring loginMind half: PyAutoMind PR on the same branch (
batches/AGENTS.md,policy/shift_watcher.md).Refs PyAutoBrain#659. Merge order suggested: M3.6d, then this, then M3.6e.
Heart RED override (development only)
pyauto-heart readiness --dev --repos PyAutoBrain,PyAutoMind):PyAutoMind: Tenant Firewall Gate failure on main— pre-existing generated-hook drift from PyAutoMind#575 (run 43881901227, 2026-11-16); this branch does not touch those hooks and does not claim to fix Heart./prmwith every required check green. No release.🤖 Generated with Claude Code