Repository navigation
feat: shift-end cloud workspace sweep, red blocks unattended merges (M3.7e) - #693
Merged
Merged
Conversation
…ck on red (#692) Ruling S4 and the red handling (AUTONOMY.md "Shift speed — 2026-11-19"): - finish_shift dispatches workspace-smoke.yml once (no inputs, marker sweep.dispatched) when GitHub confirmed a library or workspace PR merged this shift; never in a shadow or fake shift; a failed dispatch is reported in the digest and never retried. - One gh run list a shift tick; each run's artifacts downloaded once per run id (at most 3 tries), cached in <home>/sweep/ across shifts. - A red latest run blocks unattended close-outs on its failing workspaces' install chains (Heart config/repos.yaml smoke:) and workspace repos; unmapped or unreadable means every library repo. Running close-outs get a .sweep-red marker the close-out template checks before merging. - A later green run or the new /clear-sweep steer command clears it. - One bug draft per red run through the one Mind writer, with failing scripts and suspect PRs from one compare read per affected repo. - Digest: dispatch state, verified-through SHA per library, red line. - All sweep calls under the human's gh login (decision b); repo and workflow from config/policy.yaml shift_watcher: sweep_*. - AUTONOMY.md network-surface amendment, batch AGENTS.md, cockpit skill. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…692) 1. The fallback block (unmapped workspace, unreadable report or Heart maps) covers every library, chain and workspace repo, Nerves included. 2. A run list never read, or unread for 30 minutes, blocks the same set: "workspace sweep unknown: run list unreadable since <t> → /prm", in the digest too. 3. Heart chain repos count as flow repos: their merges dispatch, they get a verified-through line and can be the bug draft's target. 4. Failing scripts are named from /<directory>/ on in `file` (else after /workspace/); tested on a trimmed real report. 5. A cancelled run is no verdict: the run before it on main counts. 6. late_sweep makes the shift's one dispatch when a close-out merged after the close and none was made (same sweep.dispatched marker). 7. A .sweep-red marker the current block does not cover is removed. 8. The bug draft is filed from the latest red run, cleared or not. Tests default the sweep off (conftest); AUTONOMY.md and batch AGENTS.md updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1. The unknown state starts 30 minutes after the first failure of the
current failing streak (fail_since, reset on a good read), so one 502
after a long gap blocks nothing. Unknown is a wait, not a refusal: PRs
are held in counters["sweep_waits"] (no session, no slot), re-judged
each tick, and the shift does not close early while it lasts. A red
block stays a refusal. Running close-outs still get the marker.
2. The .sweep-red marker holds one complete reason line (red or unknown);
the close-out refuses with it verbatim, then "→ /prm".
3. A test of the real _sweep_cfg against config/policy.yaml, and {} in
fake mode.
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.7e of the autonomous-orchestrators epic, the last M3.7 task (closes #692). Ruling S4 (human, 2026-11-19) and the human's plan decisions:
/clear-sweepas a new steer command; the one dispatch per shift under the human's ownghlogin (decision b); the artifact downloads and compare reads approved.dispatched:) runsgh workflow run workspace-smoke.ymlon Heart once at close, early close or review-at, or in the late window when a close-out merged after the close. An exclusivesweep.dispatchedmarker is claimed before the call; a failed dispatch is reported in the digest and never retried. Noforce, no--ref; shadow and fake-mode shifts never dispatch.gh run listof the sweep onmaina tick. Per run id, once (at most 3 tries, cached in the orchestrator home across shifts): the M3.7dworkspace-smoke-shasrecord and, for a red run,workspace-validation-report. A cancelled run is not a verdict; the run before it counts.smoke.workspaces.<name>.chain, plus the workspace repo;sweep_siblingsmaps the HowTo and test projects) is refused for/prmwithworkspace sweep red: <run url>, with no session or slot. Anything unmappable blocks every library, chain and workspace repo. Running close-outs get a.sweep-redmarker they check just before merging. A run list that has failed continuously for 30 minutes makes PRs wait (not refused) and keeps the shift from closing early.main, or/clear-sweepon the shift issue (the human's login; clears the latest red run id; carries to later shifts; a newer red run blocks again).workspace-smoke-pinned.yml. Nothing reverts or bisects unattended.<sha>" per repo from the latest green record; "sweep running: " or "dispatched at , not yet listed"; the red block, refused PRs and the draft path; or the unknown state and the PRs waiting.API Changes
None to any library. Brain internals: new
agents/conductors/batch/_sweep.py;/clear-sweepsteer command;config/policy.yamlshift_watcher:gainssweep_repo,sweep_workflow,sweep_siblings. See full details below.Risks and known gaps
main(run 44521331980) predates M3.7d and has no SHA record, so until a newer green run exists the digest has no "verified through" line and a red run's draft names no suspect PRs. Tonight's nightly run should provide it.ghlogin cannot dispatch, the digest says so; the nightly covers it.fail_sincesurvives the gap between shifts (now only a wait that one good read releases); the digest's per-PR row does not name the sweep wait (the "Workspace sweep" section does).Test Plan
tests/test_shift_end_sweep.py(36 tests, with a trimmed realworkspace-validation-reportfixture). Round-0 tests failed or errored with the feature absent; each review-round test failed before its fix.bin/check_skill_line_counts.sh 200 PyAutoBrain(cockpit at 200), tenant firewall,install.sh --check-project-discovery: OK.pyauto-heart tick; it read stale while main CI for feat: shift watcher 60 s tick, early close, decision-taken refused at PR-open (M3.7c) #691 was finishing).Full API Changes (for automation & release notes)
Added
agents/conductors/batch/_sweep.py— config, dispatch, run list, artifact downloads, chain map, block,/clear-sweep, compare reads, bug draft./clear-sweep.config/policy.yamlshift_watcher: sweep_repo,sweep_workflow,sweep_siblings.Changed Behaviour
finish_shiftandlate_sweepdispatch the sweep (once per shift);_tick_bodyreads it each tick._start_closeoutsrefuses PRs on red-blocked repos and holds them while the sweep state is unknown.early_close_readystays open while the sweep state is unknown.closeout_template.mdchecks<task>.sweep-redbefore merging.🤖 Generated with Claude Code