fix: reject broken runtime launchers and preserve failed proof evidence
Some checks failed
Governed runtime contract / contract (push) Failing after 16s
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:
parent
4e666d6fa3
commit
43e621439a
26 changed files with 1367 additions and 3 deletions
|
|
@ -535,6 +535,34 @@ def test_profile_refusal_fails_terminally_without_legacy_fallback(
|
|||
execute.assert_not_called()
|
||||
|
||||
|
||||
def test_spend_refusal_closes_with_gateway_cleanup_evidence(tmp_path: Path) -> None:
|
||||
from rein_aharness.glas_execution import GlasSpendError
|
||||
|
||||
_repo, run, client = _profiled_case(tmp_path)
|
||||
client.fail.return_value = OpsRun(
|
||||
id=run.id, activity_definition_id="def", idempotency_key="k",
|
||||
target_repo=run.target_repo, title=run.title, description="", state="failed",
|
||||
)
|
||||
refusal = GlasSpendError(
|
||||
"spend accounting refused: execution accounting requires reconciliation",
|
||||
execution_evidence={
|
||||
"outcome": "failed", "failure_stage": "execution",
|
||||
"session_cleanup": "succeeded", "sandbox_destroy": "succeeded",
|
||||
"error": "private response", "provider_response": "private payload",
|
||||
},
|
||||
)
|
||||
with patch("rein_aharness.claim_loop.execute_profiled_run", side_effect=refusal):
|
||||
result = process_one(client)
|
||||
assert result.ok is False
|
||||
assert client.fail.call_args.kwargs["reopen"] is False
|
||||
evidence = client.fail.call_args.kwargs["result"]["execution_evidence"]
|
||||
assert evidence == {
|
||||
"outcome": "failed", "failure_stage": "execution",
|
||||
"session_cleanup": "succeeded", "sandbox_destroy": "succeeded",
|
||||
}
|
||||
client.complete.assert_not_called()
|
||||
|
||||
|
||||
def test_profiled_signal_cancellation_releases_lock_and_durably_fails(
|
||||
tmp_path: Path,
|
||||
) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue