Bound semantic worker storage and add verified evidence closeout

This commit is contained in:
DCCONSTRUCTIONS
2026-11-07 18:53:56 +03:00
parent 43148a8769
commit ab5766df6a
15 changed files with 1201 additions and 40 deletions
+16
View File
@@ -168,3 +168,19 @@ def test_complete_collection_receipt_keeps_identity_and_terminal_invariants(tmp_
assert edits.get(world)["learning"]["state"] == "draft-ready"
with pytest.raises(RuntimeError):
edits.receipt(world, saved["revision"], {**receipt, "sample_count": 212})
def test_research_and_dataset_budgets_are_separate_and_bounded(tmp_path):
worker = ds.Store(tmp_path / "worker", quota=65536, reserve=0, research_quota=1024)
(worker.root / "experiments").mkdir()
(worker.root / "experiments/history.bin").write_bytes(b"x" * 1024)
worker.capacity(0)
(worker.root / "experiments/history.bin").write_bytes(b"x" * 1025)
with pytest.raises(RuntimeError, match="research storage"):
worker.capacity(0)
(worker.root / "experiments/history.bin").unlink()
(worker.root / "unknown-new-directory").mkdir()
(worker.root / "unknown-new-directory/data.bin").write_bytes(b"x" * 65536)
with pytest.raises(RuntimeError, match="learning storage"):
worker.capacity(0)
worker.db.close()