Skip to content

refactor: retire superseded batch paths, sweep dead code, consolidate tests - #701

Merged
Jammy2211 merged 6 commits into
mainfrom
ccr-8b5cfeb8-q3j117
Nov 22, 2026
Merged

Jammy2211 merged 6 commits into
mainfrom
ccr-8b5cfeb8-q3j117

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Closes #700.

Summary

Size reduction approved by the human on 2026-11-22 after a refactor review. Net: 10,791 lines deleted, 3,217 added across 160 files.

Before After
Python source lines 46,657 42,971
Test lines 40,294 37,314
Test functions 2,106 1,899
Collected cases 2,560 2,451

What changed

  • batch collect removed — the August hand-dispatched batch flow, superseded by the shift orchestrator. _batch.py 4,173 → ~1,900 lines; _integration.py, packet.js and three test files deleted; batch AGENTS.md and skills/batch describe the brief-only flow.
  • Per-worker @mention path removed — unreachable since the questions inbox replaced it. Event-comment retries stay; the human's login still controls steering.
  • batch questions --backfill removed, and with it the questions verb.
  • Board overnight functions removed (no production caller).
  • Dead code sweep across Python and shell; three small duplications merged.
  • Comments: dated incident history moved out of comments and docstrings. Comment-only.
  • Tests: tests/_helpers.py and tests/_shift_fixtures.py hold shared setup; same-body tests parametrized; redundant tests removed after moving their unique asserts.

CLI changes

batch collect and batch questions are no longer verbs (exit 2). The "flag does not belong to plan" message no longer names collect. The digest loses the "N pushes this shift" finding and the "mention will not notify" warning, both only reachable from the removed path. Nothing else changes.

Verification

  • Full suite: 2,448 passed, 3 skipped.
  • 13 runs of the surviving batch verbs (plan, brief --check, brief --new, digest, watch --once, ready, green, premise, slice) print byte-identical output before and after against a real PyAutoMind.
  • The pre-change orchestrator, close-out, digest, steering, sweep and intake tests pass against the new source (1,192 passed; the only failures were the 12 tests of the removed mention code).
  • Comment pass: for all 80 Python source files, the AST with docstrings stripped is identical before and after.
  • Not verified: a live watcher tick with real claude and gh.

Left for follow-up

  • The dashboard's batch status box still keys its review button on collected:, which nothing stamps now; plan still reads a "carried" outcomes block only collect wrote.
  • PyAutoMind (batches/AGENTS.md, REFERENCE.md, packet template) and PyAutoHeart (bin/pyauto-heart help) still mention batch collect.
  • About 18 docstrings printed as --help still carry history.

Generated by Claude Code

…estions backfill

The August batch flow (a hand-dispatched record scored by `batch collect`
into a review packet, with an optional integration preview) is superseded by
the shift orchestrator. Remove the collect verb and its code, _integration.py,
packet.js and their tests; the per-worker @mention path, unreachable since the
questions inbox replaced it (event-comment retries stay); the one-off
`batch questions --backfill`; and names left dead by these removals.

Every surviving batch verb prints the same output as before against a real
Mind, and the pre-change orchestrator tests pass against this source.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nhQ8NtYMv2K9yt336CnGn
Comments and docstrings in the batch conductor now say what the code does and
why, in the present tense; dates, milestone tags and incident narratives are
left to git history. Comment-only: each file's AST with docstrings stripped is
unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nhQ8NtYMv2K9yt336CnGn
Remove unused functions, constants and imports outside the batch conductor,
the caller-less board overnight functions, and the test of the deleted
integration module. Start consolidating test setup into shared helper
modules and collapsing same-body tests into parametrized ones. Work in
progress; the full suite passes at this commit.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nhQ8NtYMv2K9yt336CnGn
Work in progress; the full suite passes at this commit.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nhQ8NtYMv2K9yt336CnGn
…redundant ones

A new tests/_shift_fixtures.py holds the bare-remote Mind setup and git
helpers that were repeated across the orchestrator tests, and one loaded
_batch module. Same-body tests are parametrized with the case count kept;
twelve strictly redundant cases are removed after moving their unique
asserts to the surviving test.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nhQ8NtYMv2K9yt336CnGn
…nductor

Comment-only: each file's AST with docstrings stripped is unchanged.
Docstrings printed as --help keep their wording.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nhQ8NtYMv2K9yt336CnGn
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.

refactor: size reduction — retire superseded batch paths, dead code, test consolidation

2 participants