chore(consistency): sync task status from DB [auto]

Updated by fix-consistency on 2026-09-04:
  - update .custodian-brief.md for rein-aharness

Assistant: codex
Assistant-Model: gpt-5.6-sol
Assistant-Session: 01a06ba0-10aa-7ea0-b20a-4f3fac39efe9
This commit is contained in:
custodian-sync 2026-09-04 11:00:20 +02:00
parent 7641fcde40
commit f01b765668
20 changed files with 1027 additions and 165 deletions

View file

@ -127,3 +127,48 @@ def test_profiled_actor_validates_against_real_glas_and_sandboxer(tmp_path: Path
assert captured["request"].actor == "agt"
assert captured["sandbox_request"].consumer.actor == sandbox_models.ActorType.AGT
assert captured["sandbox_request"].consumer.run_id == "run-1"
def test_profiled_run_does_not_invoke_gateway_when_already_cancelled(
tmp_path: Path,
) -> None:
from rein_aharness.execution_cancel import ExecutionCancel, ExecutionCancelled
repo = _repo(tmp_path)
cancel = ExecutionCancel()
cancel.cancel("lease-loss")
called = []
with pytest.raises(ExecutionCancelled, match="lease-loss"):
execute_profiled_run(
_run(repo),
OpsRunConfig(repo_roots=(str(tmp_path),)),
request_factory=lambda **kwargs: kwargs,
gateway=lambda request: called.append(request) or {
"ok": True,
"evidence": {"outcome": "succeeded"},
},
cancel=cancel,
)
assert called == []
def test_profiled_run_refuses_success_if_cancelled_during_gateway(
tmp_path: Path,
) -> None:
from rein_aharness.execution_cancel import ExecutionCancel, ExecutionCancelled
repo = _repo(tmp_path)
cancel = ExecutionCancel()
def gateway(request):
cancel.cancel("timeout")
return {"ok": True, "evidence": {"outcome": "succeeded"}}
with pytest.raises(ExecutionCancelled, match="timeout"):
execute_profiled_run(
_run(repo),
OpsRunConfig(repo_roots=(str(tmp_path),)),
request_factory=lambda **kwargs: kwargs,
gateway=gateway,
cancel=cancel,
)