Repository navigation
Description
Overview
A refactor review of PyAutoBrain (2026-11-22) found the code is not bloated by copy-paste: the size that can go is superseded features plus scattered dead code, and the test suite can shrink by consolidation. The human approved the scope below in chat on 2026-11-22. The work is implemented on branch ccr-8b5cfeb8-q3j117.
Plan
- Remove the August
batch collectflow (hand-dispatched batch record, collect scoring, review packet,--integration), superseded by the shift orchestrator. - Remove the per-worker @mention path, unreachable since the questions inbox replaced it; keep the retry for needs-you event comments.
- Remove the one-off
batch questions --backfill. - Remove the caller-less board overnight functions and their tests.
- Sweep confirmed dead code and unused imports.
- Move dated incident history out of code comments and docstrings (comment-only).
- Consolidate duplicated test setup, parametrize same-body tests, drop strictly redundant tests.
- Tier:
judge— merge mode: human/prm.
Not in scope (not approved): doctrine and prompt-wording pin tests, and "tombstone" absence tests.
Removing batch collect and batch questions removes CLI surface, so this is not a pure refactor; nothing else changes CLI behaviour.
Detailed implementation plan
Affected Repositories
- PyAutoBrain (primary)
Branch Survey
| Repository | Current Branch | Dirty? |
|---|---|---|
| ./PyAutoBrain | ccr-8b5cfeb8-q3j117 | clean |
Branch: ccr-8b5cfeb8-q3j117
Implementation Steps
agents/conductors/batch/_batch.py: delete the 118 symbols reachable only from_main_collect, thecollectverb and its flags (--slot,--evidence,--integration,--push,--stamp); delete_integration.py,packet.js,tests/test_batch_collect.py,test_batch_integration.py,test_batch_freeze.py; keep the live record readers in a smalltests/test_batch_records.py. Updatebatch.sh, the batchAGENTS.md,skills/batch/*.md,skills/COMMANDS.md, the registry description._orchestrator.py: delete_mention_triggers,mention_body,_note_mention,_mentions;_retry_mentionshandles event markers only._digest.py: drop the "mentioned" suffix, the self-mention warning and the pushes finding._questions.py/_batch.py: deletebackfilland thequestionsverb.board/_board.py: deletecollect_overnight,_overnight_line,_overnight_state_item,review_runs; re-point the injected-GitHub-data test at the upkeep leg.- Dead names across
agents/,bin/,board/and four shell files; hygiene scanners share_hygiene_scan.py; three identical intake/cortex helpers move toboard/_theme.py. - Comment/docstring pass over all Python source; verified by AST equality with docstrings stripped. Docstrings printed as
--helpkeep their wording. tests/_helpers.pyandtests/_shift_fixtures.py; parametrize; remove redundant tests after moving unique asserts.
Key Files
agents/conductors/batch/_batch.py— 4,173 → ~1,900 linesagents/conductors/batch/_orchestrator.py— mention path removedtests/_helpers.py,tests/_shift_fixtures.py— shared test setup
Witness
Full suite passes; batch collect and batch questions exit 2; the surviving batch verbs print byte-identical output before and after against a real Mind; the pre-change orchestrator tests pass against the new source.
Original Prompt
Click to expand starting prompt
PyAutoBrain size reduction: retire superseded batch paths, dead code, test consolidation
Type: refactor
Target: PyAutoBrain
Repos:
- PyAutoBrain
Difficulty: medium
Autonomy: supervised
Consequence: judge
Priority: medium
Status: draft
Filed: 2026-11-22
Lane: any
A refactor review of @PyAutoBrain (2026-11-22) found the code is not bloated by
copy-paste; the size that can go is superseded features plus scattered dead
code, and the test suite can shrink by consolidation. The human approved, in
chat on 2026-11-22:
- Remove the August
batch collectflow (the hand-dispatched batch record,
collectscoring, the review packet and--integration), superseded by the
shift orchestrator: the collect code in_batch.py,_integration.py,
packet.js, their tests and docs. - Remove the per-worker @mention path, unreachable since M3.5
(_mention_triggersreturned[]); keep the event-comment retry. - Remove the one-off
batch questions --backfill. - Remove the caller-less board overnight functions and their tests.
- Sweep confirmed dead code and unused imports.
- Move dated incident history out of code comments and docstrings.
- Consolidate duplicated test setup, parametrize same-body tests, and drop
tests that are strictly redundant.
Not approved, so untouched: doctrine and prompt-wording pin tests, and the
"tombstone" absence tests.
Items 1 to 4 remove CLI surface (batch collect, batch questions), so this
is not a pure refactor; nothing else changes CLI behaviour.
Witness: the full suite passes; bin/pyauto-brain batch collect and batch questions exit 2 (unknown verb); for the comment-only pass, every touched
file's AST with docstrings stripped equals its AST before the pass.
Activity
Jammy2211 commentedon Nov 22, 2026
Shipped in #701 (merged 2026-11-22, merge commit
428fe1e).batch collect, the per-worker @mention path,batch questions --backfilland the caller-less board overnight functions are removed.Follow-ups not done here: the dashboard batch status box and
plan's "carried" read still reference collect-written record keys; PyAutoMind and PyAutoHeart docs still mentionbatch collect.Generated by Claude Code