feat(routing): Phase-2 aggregate reclaim — verify_target (slice 3) #21
+404
−8
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.
Phase 2, Slice 3 — aggregate reclaim (
verify_target)Required before any routed target can be reclaimed: a size-routed target ships as many
objects, so reclaim's per-log
verify()sees only the newest object's few files and wouldperpetually false-DRIFT every routed target. This makes reclaim reconstruct the whole
target from its manifest. Based directly on
main(not stacked). Suite 196 → 209 green.verify_target(manifest, holds, …)— expected set = ⋃ objects' arcnames, archived =Σ
n_files, archived_bytes = Σsource_bytes; every object tar must be present(
hsi_existsper object); newer-than-run is per-object (a live member drifts iff newerthan the run of the object that owns it). Same verdict vocabulary + INV-E exclusion
re-gate as
verify()(the manifest carries the sameexclusionblock, sorecheck_exclusionsworks on it directly). Returns the standard result dict +all_tars.find_manifests(log_dir)— loads{log_dir}/_vault/*.manifest.json.main()—--scanskips routed object logs (routed_objectmarker) and verifieseach manifest via
verify_target;--configwithsize_routingresolves badge → manifest;--matchfilters manifests too. Legacy / non-routed logs flow throughverify()unchanged.
delete_source— guarded re-confirm of all object tars beforerm, not just one.Tests —
tests/test_routing_reclaim.py(13)SAFE • count-drift (extra file) • newer-drift • bytes-drift • missing-tar → FAILED •
no-objects → FAILED • GONE • HOLD • INV-E no-longer-covered → DRIFTED • INV-E still-covered
subtraction → SAFE •
find_manifests• multi-tar delete ABORT. Existing 196 unchanged.Phase 2 status after this
Slices 1+2 in
main; this is slice 3. Remaining: slice 4 (reship-monitor), slice 5 (fullrestore). With 1–3, a routed target archives (append) and reclaims correctly.
🤖 Generated with Claude Code