fix(evidence): reconcile generations safely
This commit is contained in:
@@ -97,3 +97,14 @@ def test_generation_inventory_is_validated_and_sorted(tmp_path):
|
||||
second = store.stage(CorpusManifest(), {}, generation="gen:" + "2" * 32)
|
||||
(store.root / "unrelated").mkdir()
|
||||
assert store.list_generations() == [first, second]
|
||||
|
||||
|
||||
def test_published_inventory_excludes_staged_and_invalid_newer_directories(tmp_path):
|
||||
store = CorpusStore(tmp_path / "corpus")
|
||||
first = store.stage(CorpusManifest(), {}, generation="gen:" + "1" * 32)
|
||||
store.publish(first)
|
||||
store.stage(CorpusManifest(), {}, generation="gen:" + "2" * 32)
|
||||
invalid = store.generation_path("gen:" + "3" * 32)
|
||||
invalid.mkdir()
|
||||
(invalid / "PUBLISHED").write_text("2026-01-01T00:00:00Z\n")
|
||||
assert store.published_generations() == [first]
|
||||
|
||||
Reference in New Issue
Block a user