Skip to content

fix(batch): a shift worker's update of its own claim is not a Mind-writer conflict - #682

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/mind-writer-own-claim-update
Nov 18, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/mind-writer-own-claim-update

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

A shift worker that updates its own active.md claim at PR-open queues drop-section active.md <slug> then append the new ## slug section. The Mind writer classed every drop-section as a closing op, applied after the task's other ops, so the append ran first against the still-present section, was set aside as "not this shift's own claim — conflict", and the drop was withheld with it — a NEEDS YOU on every PR-open claim update. Seen in shift 2026-11-18-pm2 (PyAutoGalaxy#726); repaired by hand in Mind d5fb06628.

Now a task's drop-section paired with its append re-adding the same ## slug to the same path is an update: applied drop-then-append as one unit, not a close — and only when main's section is this shift's own (a section this shift committed earlier, or a - session: naming shift worker <this slot> (<id>), short id or full UUID). Anything else is still a conflict, set aside. A lone drop-section stays closing; re-dispatch repeat-skips are unchanged.

Closes #681

API Changes

None — internal changes only. SHIFT_WORKER_SESSION_RE now lives in _mind_writer and _orchestrator re-exports it (unchanged regex).
See full details below.

Test Plan

  • tests/test_orchestrator_mind_writer.py: 5 new tests (6 cases) — PR-open update commits (fails on main, reproduces the 2026-11-18-pm2 set-aside); session-line route; foreign-slot and human-written sections stay conflicts; lone drop still withheld beside a failed sibling; re-dispatch repeat still skipped
  • tests/test_orchestrator_*.py tests/test_batch_*.py: 670 passed, 1 skipped
  • full suite: 2384 passed, 1 skipped, 1 failed — test_questions_inbox.py::test_the_question_add_op_lands_through_minds_own_add_text, which fails identically on unmodified main locally (sys.path temp-path assertion; local-env), while main's CI is green
  • skill line budget OK; tenant firewall OK
  • Deploy: fast-forward the watcher's Brain checkout only after shift 2026-11-18-pm2's late window closes (22:15Z)
Full API Changes (for automation & release notes)

Added

  • _mind_writer._update_pairs(ops), _mind_writer._own_section(tree, op, lm, ctx); ctx["slot"] in commit_ledger.

Changed Behaviour

  • commit_ledger: a paired drop-section + append of the same task's ## slug applies as one update unit (not closing), behind the own-section guard.

Notes for review

  • Pairing does not check queue order (an append queued before its drop also pairs); each drop takes its task's first matching unpaired append.

Heart (dev-ship gate for PyAutoBrain; reasons shown, not blocking)

  • manifest drift ×2 (yellow); release validation incomplete: no rehearsal for current source

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

A drop-section paired with an append of the same task re-adding that
## slug to the same path is an update of the worker's claim, not a closing
op: the drop applies directly before its append as one unit, guarded so
main's section must be this shift's own (committed earlier this shift, or
its session line names this slot's shift worker). A lone drop-section
stays closing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit f16c663 into main Nov 18, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/mind-writer-own-claim-update branch November 18, 2026 20:52
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.

fix(batch): a shift worker's update of its own claim is not a Mind-writer conflict

1 participant