Evidence export of closed runs and rtut seal (RBT-WP-0009-T04)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Assistant: claude-code
Assistant-Model: sonnet
Assistant-Process: 295952@bnt-lap001
Assistant-Session: e93f64ad-516c-46eb-9666-aad8d300c477
This commit is contained in:
tegwick 2026-09-29 21:35:03 +02:00
parent e021fd979f
commit 6d70f4d97d
12 changed files with 149 additions and 19 deletions

View file

@ -118,3 +118,24 @@ def test_the_schemas_ship_inside_the_package(repo):
from rtut import pack, v2, attrs
for path in (pack.SCHEMA_PATH, v2.SCHEMA_PATH, attrs.SCHEMA_DIR / "project.schema.json", attrs.SCHEMA_DIR / "attribute-set.schema.json"):
assert path.exists() and "rtut/schema" in str(path)
def test_seal_command_reports_sealed_broken_open_and_unsealed(repo, capsys, tmp_path):
import json
from rtut import pack as P, run as R1
pack = P.load(repo / "runbooks/v1/pack.yaml")
r = R1.create(pack, "bernd")
f = tmp_path / "rec.json"
f.write_text(r.path.read_text())
code, out, _ = run(capsys, "seal", f)
assert code == 2 and out.strip() == "open" # nothing to check yet
R1.finalize(r, "abandoned")
f.write_text(r.path.read_text())
code, out, _ = run(capsys, "seal", f)
assert code == 0 and out.strip() == "sealed"
d = json.loads(f.read_text()); d["operator"] = "forged"; f.write_text(json.dumps(d))
assert run(capsys, "seal", f)[:2] == (1, "broken\n")
d = json.loads(r.path.read_text()); d.pop("seal"); f.write_text(json.dumps(d))
assert run(capsys, "seal", f)[:2] == (2, "unsealed\n")
code, _, err = run(capsys, "seal", tmp_path / "missing.json")
assert code == 1 and "error" in err