Repository navigation
Description
Overview
Milestone task M3.6d of the autonomous-orchestrators epic. In shift 2026-11-16-pm a worker's op: write edits to existing Mind drafts were set aside while its complete/ record committed, so Mind recorded the task shipped with the drafts unchanged (PyAutoMind#579 still open); five workers also hit table-append failing on autonomy_log.md. This gives the Mind writer an edit op, makes a task's ops land together, refuses bad ops at queue time, and stops mechanical set-asides raising NEEDS YOU. Build first, in chat: a shift never changes its own writer.
Plan
writestays create-only; a neweditop replaces an expected old text that must appear exactly once (so it cannot clobber a concurrent change).- Worker ops carry their task; a task's closing ops (
complete/record,drop-section, retire) apply last and are withheld if any sibling op was set aside for a human. shift_ledgerrefuses at queue time awriteto an existing path, aneditwhose base is missing, and atable-appendwith no heading, so the worker can switch while still running.- A mechanical set-aside (already true on main) is a digest line, not a NEEDS YOU; human set-asides give one NEEDS YOU per task.
- PyAutoMind: a
## Calibration runsheading above the firstautonomy_log.mdtable (and the matchingspawn.pytemplate), sotable-appendreaches it. - Tier: glance — merge mode: human /prm (the human's instruction for this sitting; no auto-merge)
Detailed implementation plan
Affected Repositories
- PyAutoBrain (primary)
- PyAutoMind
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-ledger-edit-op (worktree ~/Code/PyAutoLabs-wt/shift-ledger-edit-op/). Parallel with M3.6a/M3.6e.
Implementation Steps
_mind_writer.py:OPSgainsedit;class MechanicalError(MindWriteError);validate_op(edit needs non-emptyold,new!=old; optional one-linetask);apply_opedit branch (exactly once → replace; 0 or >1 →MindWriteError; old absent and new present →MechanicalError);writeof identical text andremoveof a missing path →MechanicalError;is_critical: a taggedtable-appendis not critical; new_main_text(git show origin/main:<path>, no fetch) andqueue_refusals(mind, op, ledger_dir)(fail-open to apply time when git is unreadable);_closing(op);_set_asiderecordstaskandneeds(mechanical | human);commit_ledgerstable-partitions closing ops last and withholds a blocked task's closing ops intoset_aside/aswithheld.bin/shift_ledger.py:--task(required whenPYAUTO_SHIFT_WORKER=1);edit <path> --old/--old-file --new/--new-file; fixtable-append <path> "<## heading>" --text "<row>" [--unique](heading/row are never set today); Mind lookup--mind→$PYAUTO_MIND→ sibling organs layout;validate_opthenqueue_refusals, exit 1 without queueing on refusal._events.py:_impaired: skipneeds == "mechanical"; group human set-aside/conflict/withheld by task into one eventimpaired:ledger:task:<task>; untagged ops unchanged._digest.py:withheldand mechanical wording in_REPORT_WORDS/report_line.worker_template.md,closeout_template.md:{shift_ledger} --task {task} …;writecreates,editchanges; queue edits first and the complete record last; calibration row viatable-append autonomy_log.md "## Calibration runs". Op lists in batchAGENTS.md; heading named inskills/ship_library/reference.md,ship_library.md,ship_workspace.md._orchestrator.py: not touched.- PyAutoMind PR:
autonomy_log.md## Calibration runsbetween the intro and the first table;scripts/spawn.pyAUTONOMY_LOG_TEMPLATEsame insertion (test_spawn_privacy.pychecks the live log starts with it). Merge this Mind PR first.
Witness mapping (tests/test_orchestrator_mind_writer.py)
test_a_write_on_a_path_on_main_is_refused_at_queue_timetest_the_edit_op_applies_on_a_matching_base_and_is_set_aside_on_a_moved_onetest_a_worker_with_an_op_set_aside_has_its_complete_record_heldtest_shift_ledger_table_append_reaches_the_first_autonomy_log_tabletest_a_mechanical_set_aside_is_a_digest_line_not_a_needs_you_event(+ two human set-asides for one task → one NEEDS YOU)
Key Files
agents/conductors/batch/_mind_writer.py,bin/shift_ledger.py,_events.py,_digest.py, the two templates- PyAutoMind
autonomy_log.md,scripts/spawn.py
Original Prompt
Click to expand starting prompt
M3.6d A shift worker's edit to an existing Mind file is set aside, but its completion record still commits
Type: bug
Target: PyAutoBrain
Repos:
- PyAutoBrain
- PyAutoMind
Difficulty: medium
Autonomy: supervised
Priority: high
Status: draft
Filed: 2026-11-16
Epic: autonomous-orchestrators
Phase: 10
Consequence: glance
Witness:python -m pytest tests/test_orchestrator_mind_writer.py -qpasses with new tests that fail on today's main: (1) queueingop: writeon a path that exists on Mind origin/main is refused at queue time and the worker is told; (2) the new edit op applies when the expected base matches and is set aside when it does not; (3) a worker with one op set aside has itscomplete/record held (no completion commit lands); (4)shift_ledger table-appendreaches the first table ofautonomy_log.mdonce the heading is there; (5) a mechanical set-aside gives one digest line and no NEEDS YOU event
Lane: any
Unattended: never
Seen in shift 2026-11-16-pm (18:21Z). Worker dashboard_titles_two_drafts_by_their_filed_line shipped as Mind ledger ops. Its three op: write edits to existing drafts were set aside ("write: already exists", ledger set_aside/), raised as three NEEDS YOU lines, but its complete/2026/11/dashboard-titles-filed-line.md write committed. So Mind recorded the task shipped while the drafts were unchanged. The human applied the set-aside text by hand (cockpit, 2026-11-16).
- Give the Mind writer an op that edits an existing file (a replace with an expected-base check, so it cannot clobber a concurrent change), and have the worker contract use it for edits; keep
writecreate-only. - Make a worker's ledger ops land together: if any op is set aside, hold back its completion record (or mark the task not shipped) instead of committing it alone.
- One NEEDS YOU line per worker for set-aside ops, naming the task, not one per file.
Added 2026-11-17 (M3.6d, from the shift 2026-11-16-pm review)
This prompt is now milestone task M3.6d of the autonomous-orchestrators epic. Further
evidence from the same shift: four more write ops were set aside the same way (the record's
warnings list sibson_serial_kernel_loses_allocation_hoisting.md,
delaunay_nn_numba_optimal_remeasure_after_677.md,
tutorial_correctness_and_howtogalaxy_parity.md and complete/2026/11/seed-samplers-byte-stable.md).
PyAutoMind#579 is still open because of it. Five workers hit table-append failing on
autonomy_log.md, so no calibration row was queued for the shift's merges. The cockpit chat
applied four "needs you" events without waiting for the human, because they were mechanical
refusals.
- Refuse at queue time. A
writeon a path that already exists on Mind origin/main is
refused when the worker queues it, so the worker can switch to the edit op while it is
still running, instead of the set-aside surfacing after the worker has ended. - The edit op in item 1 is part of this task, not a follow-up.
- A heading above the first
autonomy_log.mdtable, soshift_ledger table-appendcan
reach it (it needs a##heading). This is a Mind data change and goes in this task's
Mind PR. - A mechanical set-aside is not a "needs you" event. It is a digest line (and, after
M3.3 slice 2, an entry in the decisions block). Item 3 then applies only to set-asides that
need a human choice.
Out of scope: the one network write path to Mind main (M4.3), and the auto-mode classifier
denying Mind lifecycle commands inside workers (infrastructure review).
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.test: split the real autonomy_log check; skip until Mind has the heading
Jammy2211 commentedon Nov 17, 2026
Shipped
Merged by the human's
/prm(2026-11-17): PyAutoBrain#663 (419c15c), PyAutoMind#581 (cf57daefa). CI green on the merged heads; the Heart RED development override covered shipping only, and the merge was this separate human command.Mind writer: create-only
writeplus aneditop with an expected-base check; a task's closing ops land together (withheld on a human set-aside, pending beside a held sibling); queue-time refusals; mechanical set-asides are digest notes; one NEEDS YOU per task;## Calibration runsheading sotable-appendreaches the first autonomy_log table.Close-out: completion record in PyAutoMind
complete/2026/11/,active.mdrow released, dashboard regenerated.