chore(ariba): retire ariba_batch.py, unused by the capture path (#186) - #196
Merged
Conversation
`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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #186.
What this removes
ariba_batch.pyimplemented the batched-bundle capture: split an oversized picker selection intosub-500 MB groups, download each as a zip, merge them.
capture_eventhas gone throughariba_files.capture_filessince #174 (per-file download, canonical zip built locally), sonothing 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.pyindependently beforethe file goes:
.tmp+os.replace, inbuild_bundle. ✅capture_files'smanifest is Nonebranch (shutil.rmtree+ restart). ✅write_omitted→build_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 withexpected_count(), so itstays regardless (and see #185, which may remove that caller too)." #185 has since landed and did
remove that caller —
AribaPickerand_select_all_attachmentsare unused by the live capturepath now, same as
ariba_batch.pywas. Per your explicit request in the #185 PR discussion, thatretirement is tracked separately as #195, not folded into this change. Both are left exactly
as #185 left them.
Cleanup
Removed
sources/ariba_batch.pyandtests/test_ariba_batch.pytogether (929 lines, ~63 tests).Updated the historical comments referencing
ariba_batchacrossariba_files.py,ariba_attachments.py, and CLAUDE.md — past tense, with a#186pointer — rather than leavingthem describe a module that no longer exists as though it still does.
Verification
grepthat no import ofariba_batchremains anywhere intoronto_bids/ortests/, and confirmed via directimportlibthat the module is genuinely gone.🤖 Generated with Claude Code
https://claude.ai/code/session_01W53WHx8mm2UHuLFAQWeF62