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:
tegwick 2026-09-04 11:25:07 +02:00
parent e3c6124e22
commit 20e6f381f6
28 changed files with 1068 additions and 154 deletions

View file

@ -2,6 +2,8 @@
from __future__ import annotations
from datetime import date
from rein_aharness.approaches import (
APPROACH_AGENT_SESSION,
APPROACH_BRIEF_DAILY,
@ -9,6 +11,8 @@ from rein_aharness.approaches import (
APPROACH_FI_RESEARCH_BRIEF,
APPROACH_MAIL_PIPELINE,
APPROACH_UNMATCHED,
execute_approach,
legacy_approaches_enabled,
select_approach,
)
from rein_aharness.ops_run_client import OpsRun
@ -113,3 +117,26 @@ def test_fi_before_generic_automated() -> None:
assert (
select_approach(_run(labels=["research-brief"])) == APPROACH_FI_RESEARCH_BRIEF
)
def test_legacy_approaches_require_non_expired_explicit_date() -> None:
today = date(2026, 9, 4)
assert legacy_approaches_enabled("2026-09-04", today=today) is True
assert legacy_approaches_enabled("2026-09-03", today=today) is False
assert legacy_approaches_enabled("true", today=today) is False
assert legacy_approaches_enabled("", today=today) is False
def test_execute_approach_refuses_profile_absent_route_without_flag(
monkeypatch,
) -> None:
monkeypatch.delenv("AGENT_HARNESS_LEGACY_APPROACHES_UNTIL")
result = execute_approach(
_run(labels=["research-brief"], target_repo="not-resolved"),
report_to_hub=False,
)
assert result.ok is False
assert result.reopen is False
assert "compatibility routing is disabled" in result.reason