feat(runtime): enforce governed mutation boundaries
Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a06ba0-10aa-7ea0-b20a-4f3fac39efe9
This commit is contained in:
parent
e3c6124e22
commit
20e6f381f6
28 changed files with 1068 additions and 154 deletions
|
|
@ -8,6 +8,7 @@ import pytest
|
|||
import yaml
|
||||
|
||||
from rein_aharness.manifest import HARNESS_MAJOR
|
||||
from rein_aharness.repository_transaction import RepositoryTransaction
|
||||
from rein_aharness.runner import RunResult, run_task
|
||||
from rein_aharness.taskspec import TaskSpec, TaskSpecError
|
||||
|
||||
|
|
@ -148,6 +149,26 @@ def test_run_task_records_bounded_cancellation_without_session_output(tmp_path)
|
|||
assert result.reason == "execution cancelled (lease-loss)"
|
||||
|
||||
|
||||
def test_run_task_timeout_releases_repository_lock(tmp_path) -> None:
|
||||
repo = _make_repo(tmp_path)
|
||||
|
||||
class TimingOutAdapter:
|
||||
def execute_prompt(self, prompt, config):
|
||||
raise TimeoutError("adapter deadline elapsed")
|
||||
|
||||
result = run_task(
|
||||
_spec(repo),
|
||||
adapter=TimingOutAdapter(),
|
||||
report_to_hub=False,
|
||||
write_metrics=False,
|
||||
)
|
||||
|
||||
assert result.ok is False
|
||||
assert result.reason == "session failed: adapter deadline elapsed"
|
||||
with RepositoryTransaction(repo) as retry:
|
||||
assert retry.locked is True
|
||||
|
||||
|
||||
def test_run_task_refuses_unknown_tool_profile(tmp_path) -> None:
|
||||
repo = _make_repo(tmp_path)
|
||||
_write_manifest(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue