search-with-proof group 4 + image: board, spend reservation, coordinator, search-task image

Board as immutable versioned blobs (coordinator sole writer); budget reserve/settle
before model calls; per-task and run caps; coordinator loop over an injected
executor; batch.py accepts a fixed allow-list of search variables; XSS browser
oracle; ousast-search-task image (Python, Node/TypeScript, PHP, Java 17, sqlite,
bwrap, chromium) built by CI. 103 tests on the host.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Marius Ciepluch
2026-10-05 14:26:43 +02:00
co-authored by Claude Opus 5.5
parent 6394ee473d
commit 4b38239f68
17 changed files with 1120 additions and 20 deletions
+39
View File
@@ -0,0 +1,39 @@
import json
import pytest
from openultrasast.plane.memory import FileStore
from openultrasast.search.board import Board
def test_versions_provenance_claims_and_resume(tmp_path):
store = FileStore(tmp_path)
board = Board(store, "search-1", coordinator="host")
first = board.commit(
writer="host", facts=[dict(id="f1", text="sink", evidence_refs=["engine:1"], from_intents=[], step="triage", task_id="seed")]
)
second = board.commit(
writer="host",
intents=[dict(id="i1", description="trace input", from_facts=["f1"], status="open", claimant=None, step="reason", task_id="r1")],
)
assert first != second
assert json.loads(store.get_blob(board.prefix, first))["intents"] == []
assert Board.resume(store, "search-1", second, coordinator="host").state == board.state
with pytest.raises(PermissionError):
board.commit(writer="worker", hints=[])
state = board.state
state["facts"].clear()
assert board.state["facts"]
assert len(board.snapshot(max_bytes=256).encode()) <= 256
with pytest.raises(ValueError):
board.commit(writer="host", end_reason="clean")
def test_bad_references_and_oversize_are_atomic(tmp_path):
board = Board(FileStore(tmp_path), "one", coordinator="host", max_bytes=1024)
before = board.head
with pytest.raises(ValueError):
board.commit(writer="host", facts=[dict(id="f", text="x", evidence_refs=[], from_intents=["missing"], step="explore", task_id="t")])
with pytest.raises(ValueError):
board.commit(writer="host", hints=[dict(id="h", text="x" * 2048, step="human", task_id="operator")])
assert board.head == before