feat(incremental): level-decision + manifest engine (PR 2) #9
+617
−1
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.
PR 2 of the leveled-incremental plan (
docs/RFC_incremental_v2.md§2–3), stacked on #8. The engine core — the level-decision logic + manifest + per-level catalogs — all LOCAL and fully unit-tested.Gated + unwired by design. A new config key
incremental(defaultfalse) is added and validated, but nothing in__main__calls the engine yet, so the existing non-incremental archive path is byte-for-byte unchanged. The__main__wiring (decide_level call site, NO-OP/deletions exit paths, level-aware resume guard,flock,--globusrefusal) lands as PR 2b — it touches the live archive path and gets its own review + a Negishi staging run beforeincrementalis enabled anywhere.Adds to
archive.py:classify_delta,decide_level,effective_catalog,load/update_manifest,write/read_level_catalog,make_zip_files(only_arcnames=…), theincrementalconfig gate.Hardened by an adversarial review workflow (3 dimensions → verify pass) before opening:
_vault/(were written tolog_dir→ would show as spuriousFAILEDentries in reclaim's--scan);update_manifestnow preserves a corrupt manifest aside and refuses instead of silently truncating the chain;tmp+fsync+os.replace;decide_levelre-baselines to a full L0 instead of crashing when the prior catalog is unreadable;rebaselinebranch (byte-sum is redundant at per-file granularity) and documented the real same-size+same-mtime blind spot honestly.Tests:
tests/test_incremental_engine.py. Full suite 87 passing (was 54).🤖 Generated with Claude Code