Harden SSH and profile resolution boundaries
Some checks failed
ci / validate (push) Has been cancelled
Some checks failed
ci / validate (push) Has been cancelled
Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a0233b-178d-7162-b92f-31a31ea8ca9b
This commit is contained in:
parent
60564fda68
commit
695438019c
8 changed files with 176 additions and 10 deletions
|
|
@ -161,6 +161,45 @@ def test_run_execution_refuses_unknown_profile_before_sandbox() -> None:
|
|||
manager.create.assert_not_called()
|
||||
|
||||
|
||||
def test_run_execution_refuses_disabled_profile_before_sandbox() -> None:
|
||||
manager = MagicMock()
|
||||
catalog = ProfileCatalog()
|
||||
profile, _ = catalog.resolve(PROFILE)
|
||||
catalog.profiles()[(profile.id, profile.version)] = profile.model_copy(
|
||||
update={"status": "disabled"}
|
||||
)
|
||||
|
||||
result = run_execution(_request(), catalog=catalog, rein=_FakeRein(), manager=manager)
|
||||
|
||||
assert result.ok is False
|
||||
assert result.evidence.outcome == "refused"
|
||||
assert result.evidence.failure_stage == "resolution"
|
||||
assert "profile disabled" in (result.evidence.error or "")
|
||||
manager.create.assert_not_called()
|
||||
|
||||
|
||||
def test_run_execution_refuses_ambiguous_profile_before_sandbox() -> None:
|
||||
manager = MagicMock()
|
||||
catalog = ProfileCatalog()
|
||||
profile, _ = catalog.resolve(PROFILE)
|
||||
catalog.profiles()[(profile.id, "2.0.0")] = profile.model_copy(
|
||||
update={"version": "2.0.0"}
|
||||
)
|
||||
|
||||
result = run_execution(
|
||||
_request(profile=profile.id),
|
||||
catalog=catalog,
|
||||
rein=_FakeRein(),
|
||||
manager=manager,
|
||||
)
|
||||
|
||||
assert result.ok is False
|
||||
assert result.evidence.outcome == "refused"
|
||||
assert result.evidence.failure_stage == "resolution"
|
||||
assert "pin one of" in (result.evidence.error or "")
|
||||
manager.create.assert_not_called()
|
||||
|
||||
|
||||
def test_run_execution_refuses_blocked_profile_before_sandbox() -> None:
|
||||
manager = MagicMock()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue