fix: reject broken runtime launchers and preserve failed proof evidence
Some checks failed
Governed runtime contract / contract (push) Failing after 16s

Assistant: codex
Assistant-Model: gpt-6-astra
Assistant-Session: 01a0e387-534d-70e3-ad53-4ea05676db8c
This commit is contained in:
tegwick 2026-09-27 23:19:50 +02:00
parent 4e666d6fa3
commit 43e621439a
26 changed files with 1367 additions and 3 deletions

View file

@ -419,6 +419,29 @@ def test_uncertain_gateway_never_imports_and_blocks_next_claim(dispatch_case, fa
store.preflight()
def test_accounting_refusal_preserves_stage_and_cleanup_without_raw_error(dispatch_case):
from rein_aharness.glas_execution import GlasSpendError, execute_profiled_run
store, config, _catalog, transfer = dispatch_case
result = success(store, run(), None)
result["ok"] = False
result["evidence"].update(
outcome="failed", failure_stage="execution", sandbox_id="fixture-sandbox",
error="private provider response", provider_response="private payload",
)
with pytest.raises(GlasSpendError) as caught:
execute_profiled_run(run(), config, gateway=lambda *a, **k: result, report_to_hub=False)
evidence = caught.value.execution_evidence
assert evidence["failure_stage"] == "execution"
assert evidence["sandbox_destroy"] == evidence["session_cleanup"] == "succeeded"
assert "private" not in json.dumps(evidence)
assert "error" not in evidence and "cost_usd" not in evidence
transfer.import_after_teardown.assert_not_called()
assert store.status()["reservations"][0]["state"] == "held"
with pytest.raises(SpendAdmissionError):
store.preflight()
def test_cli_reconciliation_requires_termination_attestation(ledger, capsys):
from rein_aharness.cli import main