Skip to content

chore(ariba): retire ariba_batch.py, unused by the capture path (#186) - #196

Merged
alexwolson merged 1 commit into
mainfrom
fix-186-retire-ariba-batch
Jul 28, 2026
Merged

chore(ariba): retire ariba_batch.py, unused by the capture path (#186)#196
alexwolson merged 1 commit into
mainfrom
fix-186-retire-ariba-batch

Conversation

@alexwolson

Copy link
Copy Markdown
Collaborator

Closes #186.

What this removes

ariba_batch.py implemented the batched-bundle capture: split an oversized picker selection into
sub-500 MB groups, download each as a zip, merge them. capture_event has gone through
ariba_files.capture_files since #174 (per-file download, canonical zip built locally), so
nothing on the live capture path has called it since.

It was deliberately left in place at the time — "deleting the old mechanism in the same change
that introduces its replacement is how you end up with neither." Per-file capture has since
archived a real event end to end (37 documents, 178 leaves, valid zip, #182), so that condition
is met.

The checklist, verified before deleting

The issue asked to confirm three inherited lessons live in ariba_files.py independently before
the file goes:

  • Atomic bundle write.tmp + os.replace, in build_bundle. ✅
  • A corrupt/missing manifest discards partials rather than adopting them positionally
    capture_files's manifest is None branch (shutil.rmtree + restart). ✅
  • The gap record is written before the bundle, never afterwrite_omittedbuild_bundle
    clear_omitted_when_complete, in that order. ✅

ariba_batch.py's own batching-specific lesson — a batch's identity is its on-disk sidecar,
never an in-memory count — does not port over: per-file capture builds one canonical zip
directly from individually-downloaded files, with no batch-splitting/merging step to have that
identity problem in the first place. Confirmed by reading the module before deleting it, not
assumed.

What's NOT touched here

The issue also asked to check AribaPicker, noting it "is shared with expected_count(), so it
stays regardless (and see #185, which may remove that caller too)." #185 has since landed and did
remove that caller — AribaPicker and _select_all_attachments are unused by the live capture
path now, same as ariba_batch.py was. Per your explicit request in the #185 PR discussion, that
retirement is tracked separately as #195, not folded into this change. Both are left exactly
as #185 left them.

Cleanup

Removed sources/ariba_batch.py and tests/test_ariba_batch.py together (929 lines, ~63 tests).
Updated the historical comments referencing ariba_batch across ariba_files.py,
ariba_attachments.py, and CLAUDE.md — past tense, with a #186 pointer — rather than leaving
them describe a module that no longer exists as though it still does.

Verification

  • Confirmed via grep that no import of ariba_batch remains anywhere in toronto_bids/ or
    tests/, and confirmed via direct importlib that the module is genuinely gone.
  • 781 tests passing (844 − 63 deleted with the retired module).

🤖 Generated with Claude Code

https://claude.ai/code/session_01W53WHx8mm2UHuLFAQWeF62

`ariba_batch.py` implemented the batched-bundle capture: split an oversized
picker selection into sub-500 MB groups, download each as a zip, merge
them. `capture_event` has gone through `ariba_files.capture_files` since
#174 — per-file download, canonical zip built locally — so nothing on the
live capture path has called it since.

It was deliberately left in place at the time: deleting the old mechanism
in the same change that introduces its replacement is how you end up with
neither. Per-file capture has since archived a real event end to end (37
documents, 178 leaves, valid zip, per #182), so that condition is met.

Confirmed each of the three lessons the issue asked to check lives in
ariba_files.py independently before deleting:
- atomic bundle write (`.tmp` + `os.replace`, `build_bundle`)
- a corrupt/missing manifest discards partials rather than adopting them
  positionally (`capture_files`'s `manifest is None` branch)
- the gap record is written before the bundle, never after
  (`write_omitted` then `build_bundle` then `clear_omitted_when_complete`)

`ariba_batch.py`'s own batching-specific lesson (a batch's identity is its
on-disk sidecar, never an in-memory count) does not port over: per-file
capture builds one canonical zip directly, with no batch-splitting/merging
step to have that problem in the first place.

Removed `sources/ariba_batch.py` and `tests/test_ariba_batch.py` (929
lines, ~63 tests) together. `AribaPicker` and `_select_all_attachments` —
unused since #185 removed their last caller, and originally built to
satisfy `ariba_batch.py`'s own Picker protocol — are NOT touched here;
their retirement is tracked separately (#195), per the user's explicit
request to split that out rather than fold it into this change.

Updated the historical comments referencing `ariba_batch` across
`ariba_files.py`/`ariba_attachments.py`/CLAUDE.md to past tense with the
#186 pointer, rather than leaving them describing a module that no longer
exists as though it still does.

781 tests passing (844 - 63 deleted with the retired module).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W53WHx8mm2UHuLFAQWeF62
@alexwolson
alexwolson merged commit 60b9534 into main Jul 28, 2026
1 check passed
@alexwolson
alexwolson deleted the fix-186-retire-ariba-batch branch July 28, 2026 15:36
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.

ariba: retire ariba_batch.py, now unused by the capture path

1 participant