feat(skip-unchanged): don't re-archive an unchanged target (incremental archiving Phase 1a) #5
+341
−0
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 1a of incremental archiving — skip an unchanged target
Implements Mechanism 1 of the PR #4 RFC plan. The repository backup re-zipped + re-htar'd every target on every run; a target whose live source is the same set as its last successful archive now skips — writing no new tar and no new run-log, so the prior success log stays the canonical record
reclaim/coverageread. (This is the engine's own "overlap detection" gap.)How
Before any preflight,
archive.py:skippable_prior_log(log_dir, project)→ the latest successful run-log, selected by parsed run_timestamp (not file mtime), returned only if it's the newest run overall.source_matches_log(log, source, pattern)→ unchanged iff same file count, nothing newer than the archive ran, same total bytes, same file_pattern, same source_folder — reusingreclaim.scan_source/run_datetime, so the skip decision can't disagree with reclaim's no-drift definition. One metadata-only walk; reads no bytes.skip_unchangedconfig flag, default false → measure-and-log only (free redundancy measurement); skipping is opt-in. Bypassed by--fresh/--force-resume. No run-log schema change; reclaim/coverage untouched.Hardened by an adversarial review (findings folded in)
coverage.classify; immune to out-of-order log mtimes (FS migration /cpwithout-p).running/failedrun blocks the skip, so a retry can re-establish success.file_patternor re-pointedsource_folderforces re-archive.fs-checksum-sweep's job (florasense-tools #60), the backstop for that pathological case.Tests
stdlib
unittest, suite 37 → 52 green:skippable_prior_log(newest success; newer failure/running blocks skip; run_timestamp-not-mtime ordering; prefix-sibling; no-success);source_matches_log(unchanged match; count/byte/newer-mtime/pattern-change/source-folder-change/missing-source/unparseable-ts → no match); end-to-end subprocess test that a skip exits 0 and writes no new run-log.Rollout (measure-first)
Default-off ships safely. Deploy → run one repository-backup cycle in measure-only mode (logs which targets would skip) → confirm
fs-coverage-audit/fs-reclaim-reportstill read every target as COVERED → then enableskip_unchanged. Mechanism 2 (keep churning metadata out of bulk targets) + Mechanism 3 (size-bundling) are follow-up PRs.Known generic-engine interactions noted for later (not live in this deployment):
reclaim --scan --days Nfilters by log mtime, so a long-quiescent skipped target ages out of that windowed view;log_dirdefaulting totmp_diris a foreign-log hazard for ad-hoc configs.🤖 Generated with Claude Code