Harden SSH and profile resolution boundaries
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:
tegwick 2026-08-23 12:53:05 +02:00
parent 60564fda68
commit 695438019c
8 changed files with 176 additions and 10 deletions

View file

@ -22,6 +22,7 @@ def _profile(
profile_id: str = "harness.test",
version: str = "1.0.0",
contract: str = "1.0",
status: str = "enabled",
rein: str = "rein-test",
required: str = "session_style: unattended",
extra: str = "",
@ -30,7 +31,7 @@ def _profile(
id: {profile_id}
version: \"{version}\"
contract_version: \"{contract}\"
status: enabled
status: {status}
rein:
id: {rein}
required_capabilities:
@ -150,6 +151,26 @@ def test_unpinned_multi_version_profile_is_ambiguous(tmp_path) -> None:
ProfileCatalog(profiles, reins).resolve("harness.test")
def test_disabled_revision_still_requires_pinned_selection(tmp_path) -> None:
profiles = tmp_path / "profiles"
reins = tmp_path / "reins"
profiles.mkdir()
reins.mkdir()
_write(profiles, "enabled.yaml", _profile(version="1.0.0"))
_write(
profiles,
"disabled.yaml",
_profile(version="2.0.0", status="disabled"),
)
_write(reins, "rein.yaml", _rein())
catalog = ProfileCatalog(profiles, reins)
with pytest.raises(AmbiguousProfileError, match="pin one of"):
catalog.resolve("harness.test")
with pytest.raises(IncompatibleProfileError, match="profile disabled"):
catalog.resolve("harness.test@2.0.0")
@pytest.mark.parametrize(
("profile_text", "match"),
[