Repository navigation
Description
Overview
Milestone task M3.6e of the autonomous-orchestrators epic. In shift 2026-11-16-pm (merge-cap: 1) two workers merged notify PRs in-turn while a third, on the same bug · safe · notify header, left its PR for /prm, and the snapshot read "2 merged of merge-cap 1". Human ruling R3 (2026-11-17) settles it: the bug cap does not stop a notify self-merge under --auto, and it counts against merge-cap. This makes every in-shift merge take a slot from one counter, writes R3 into AUTONOMY.md, has start_dev print the effective level and merge mode, and fixes lifecycle.py close row matching. Build first, in chat.
Plan
- One merge-slot counter per shift (
pyauto-brain merge-slot take|release|status, file-locked, fails closed); a worker takes a slot before its baregh pr mergeand leaves the PR for /prm when refused or paused; watcher close-outs take from the same count. - The watcher's "only glance merges unattended" refusal for
notifygoes: it closes out anotifyPR a worker left open on the same terms asglance(free slot, witness run by the close-out session, Heart not RED, nothing never-auto-merged).judge, undeclared anddecision-takenstill go to /prm. - The digest says whether each merge was in-turn by the worker or a close-out.
pyauto-brain merge-mode <prompt> [--auto]printseffective level: <level>; merge mode: <mode>;start_devstep 3 uses it.- R3 written into AUTONOMY.md as a dated H3 inside "Merge authority follows Consequence" (wording approved by the human 2026-11-17), with pointers from "Levels × checkpoints" and Decide-and-flag.
- PyAutoMind:
lifecycle.py closefinds theactive.mdrow by slug, then prompt path, then issue URL. - Tier: judge — merge mode: human /prm
Detailed implementation plan
Affected Repositories
- PyAutoBrain (primary)
- PyAutoMind (added:
scripts/lifecycle.pylives there)
Branch Survey
| Repository | Current Branch | Dirty? |
|---|---|---|
| PyAutoBrain (canonical) | main, 6 behind origin | untracked .worktrees/ only |
| PyAutoMind (canonical) | main, behind origin | another session's uncommitted batches/2026-11-16-pm.md (left alone) |
Suggested branch: feature/shift-notify-merge-cap (worktree ~/Code/PyAutoLabs-wt/shift-notify-merge-cap/). Parallel with M3.6a/M3.6d.
Implementation Steps
- New
agents/conductors/batch/_merge_slots.py:merge_slots.jsonper slot underfcntl.flock, atomicos.replace;publish(slot, cap, paused),take(slot, pr, by, task) -> (ok, why)(idempotent per PR; refusals recorded; no published cap or paused → refuse),release,used,why_unmerged. - New
bin/merge_slot.pywired aspyauto-brain merge-slot take|release|status <pr>; exit 0 taken or not in a shift, 1 refused, 2 cannot tell. _orchestrator.py(only): imports;_closeoutspublishes the cap;reap_closeoutsreleases the watcher's slot on a refused close-out;_start_closeouts: notify admitted under R3 terms, judge/no tier "never merged unattended",takejust before spawn (replacing the counter check), release on spawn failure;_cmd_capcounts via_merge_slots.used._digest.py: "merged in-turn by the worker (merge slot)" vs close-out.agents/faculties/sizing/_sizing.py:merge_mode(p, level, *, auto, in_shift)besideeffective_autonomy; newbin/merge_mode.pywired aspyauto-brain merge-mode.- Skill text:
start_dev.mdstep 3 andreference.md--auto;prm/reference.md"Tiered merge" (in a shift,merge-slot takefirst; R3 witness condition);ship_library.md,ship_workspace.mdpointers;worker_template.mdtake a slot before merging. - AUTONOMY.md: R3 H3 plus two pointer lines.
- Update
test_a_non_glance_task_is_never_closed_out(notify reason; add a judge case). - PyAutoMind PR:
scripts/lifecycle.pyclose_registriesreturns (reg, heading) matched by slug →prompt:path →issue:(from new--issueor the prompt'sIssue:; only when exactly one row matches);cmd_closeprunes by the matched heading and prints it.
Witness (amended: tests/test_closeout*.py matched no file)
python -m pytest tests/test_orchestrator_*.py tests/test_closeout_merge_slots.py -q in PyAutoBrain, and python -m pytest tests/test_lifecycle_close.py -q in PyAutoMind:
tests/test_closeout_merge_slots.py::test_merge_cap_1_refuses_second_in_turn_notify_mergetests/test_orchestrator_merge_slots.py::test_auto_safe_notify_bug_with_witness_merges_and_countstests/test_orchestrator_merge_slots.py::test_merge_mode_prints_effective_level_line- Mind
tests/test_lifecycle_close.py::test_close_drops_active_row_by_prompt_path,..._by_issue_url
plusgrep -n "2026-11-17" AUTONOMY.md.
Key Files
agents/conductors/batch/_orchestrator.py, new_merge_slots.py,_digest.py,agents/faculties/sizing/_sizing.pyskills/prm/reference.md,skills/start_dev/, AUTONOMY.md- PyAutoMind
scripts/lifecycle.py
Original Prompt
Click to expand starting prompt
M3.6e Shift workers merge notify-tier PRs in-turn past the shift's merge-cap, and inconsistently
Type: bug
Target: PyAutoBrain
Repos:
- PyAutoBrain
Difficulty: small
Autonomy: supervised
Priority: high
Status: draft
Filed: 2026-11-16
Epic: autonomous-orchestrators
Phase: 10
Consequence: judge
Witness:python -m pytest tests/test_orchestrator_*.py tests/test_closeout*.py -qpasses with new tests that fail on today's main: (1) in a shift withmerge-cap: 1, a second in-turnnotifymerge is refused and left for /prm (the fakeghlogs one merge call); (2) under--autoa bug prompt withAutonomy: safe,Consequence: notifyand a held witness merges in-turn and the snapshot shows "1 merged of merge-cap 1"; (3)start_devprints one line "effective level: ; merge mode: " for that prompt; (4)lifecycle.py closefinds theactive.mdrow by prompt path or issue URL when the heading does not match the slug; andgrep -n "2026-11-17" AUTONOMY.mdshows the R3 ruling
Lane: any
Unattended: never
Seen in shift 2026-11-16-pm (brief merge-cap: 1). Events, from ~/Code/PyAutoLabs-wt/.orchestrator/2026-11-16-pm/events.jsonl:
- 18:33Z
dashboard_recent_lists_planned_tasks_twiceopened PyAutoBrain#654 (notify): the watcher said "Not merging: tier notify — only glance merges unattended. Left for your /prm." - 18:44Z
dashboard_md_epic_ledger_backticks_render_literallymerged PyAutoBrain#655 in-turn (notify), andseed_samplers_for_byte_stable_rerendersmerged autofit_visualization#8 in-turn (notify), both as the human's login at 18:41Z. - The next snapshot read "2 merged of merge-cap 1".
- Cap: a worker's in-turn tiered merge (ship_* → /prm "Tiered merge", AUTONOMY.md "Merge authority follows Consequence") does not consult the shift's merge-cap. Inside a shift, every merge (in-turn or close-out) should take a merge slot from the watcher first, and refuse when none is left, leaving the PR for /prm.
- Consistency: same tier, two outcomes (fix: dashboard Recent lists a planned task once, not as row + draft #654 left for /prm, fix(intake): render epic ledger paths as <code> in dashboard.md #655 and PyAutoBrain: full Stages 0-3 release-validation orchestrator (M4) #8 merged in-turn). Decide which is the rule for notify inside a shift (the watcher's "only glance merges unattended" or the worker's in-turn merge) and make the worker contract and the watcher agree; the digest should say which path each merge took.
- Close-out row match (seen in the /prm close-out after the shift):
lifecycle.py closefound noactive.mdrow to drop forvalidation_wall_estimates_miss_eval_count_and_sampler_flooranddashboard_recent_lists_planned_tasks_twice, because the row headings did not match the task slug; the rows were removed by hand. Make the match use the prompt path or issue URL, not only the slug. - Tests for each.
Added 2026-11-17 (M3.6e, from the shift 2026-11-16-pm review)
This prompt is now milestone task M3.6e of the autonomous-orchestrators epic. The #654 worker
recorded why it did not merge: "effective level supervised (header safe, bug cap supervised)
→ --auto ship sign-off is decide-and-flag". The #655 worker, on the same bug · safe · notify header, merged. The doctrine did not say which was right.
Human ruling R3 (2026-11-17): the bug work-type cap does not stop a notify self-merge
under --auto. A notify bug with a held witness merges, and it counts against
merge-cap. That settles item 2: the worker's in-turn merge is the rule, and the watcher's
"only glance merges unattended" refusal for notify changes to match.
start_devprints the effective level and merge mode in one line before work starts,
so a worker and a reader see the same answer.- Write R3 into AUTONOMY.md with its date, beside "Merge authority follows Consequence",
and make the worker contract and the watcher read it the same way.
Out of scope: the unattended glance grant itself (the M3 gate), and any change to which
tiers merge outside a shift.
Activity
Jammy2211 commentedon Nov 17, 2026
Library PRs created
Built test-first (new tests fail on origin/main, pass on the branch), independently reviewed by Fable 5.2 (author Opus 5.5): FINDINGS → fixed → CLEAN. Workspace impact: none (organ-only change). Merge: human
/prm. Suggested order across M3.6: M3.6d (#660, Mind PR first), then M3.6a (#659), then M3.6e (#661, which needs a one-line import resolution in_orchestrator.pyafter M3.6a: keep both imports).Heart RED override (development only), recorded
PyAutoMind: Tenant Firewall Gate failure on main(pre-existing generated-hook drift, PyAutoMind#575, run 43881901227). This branch does not touch it and does not claim to fix Heart.test_grouped_organ_consumers(also fails on origin/main); independent review CLEAN./prmwith every required check green. No release.docs: move start_dev's tier + merge mode detail into reference.md
Jammy2211 commentedon Nov 17, 2026
Shipped
Merged by the human's
/prm(2026-11-17): PyAutoMind#583 (f7b4986f3), PyAutoBrain#665 (c2dce4e). CI green on the merged heads; the Heart RED development override covered shipping only, and the merge was this separate human command.One merge-slot count per shift (
merge-slot take|release <pr-url> --task), shared by worker in-turn merges and watcher close-outs; the watcher closes outnotifyon R3 terms; digest labels merges from slot evidence;merge-modeprints the effective level and merge mode; R3 in AUTONOMY.md;lifecycle.py closematches rows by prompt path or issue.Close-out: completion record in PyAutoMind
complete/2026/11/,active.mdrow released, dashboard regenerated.