test_gfg_d2_fail_closed.py
python
sha256:106ef9e12cca7f3be3ffb2a6bd3abfa76f032dce453c9e5010d732a8d86f2e14
Reconcile reviewed credential compatibility 32254cd939885d9…
Human
patch
8 days ago
| 1 | """Security: fail-closed on missing muse_commit_id; no optimistic aligned (§D2F.9).""" |
| 2 | |
| 3 | from __future__ import annotations |
| 4 | |
| 5 | from pathlib import Path |
| 6 | |
| 7 | from adapters.errors import ReadError |
| 8 | from tests.support import adapter_for, make_runner |
| 9 | |
| 10 | |
| 11 | def test_missing_muse_commit_id_is_read_error_not_git_sha( |
| 12 | muse_git_mirror_config, repo_root: Path |
| 13 | ) -> None: |
| 14 | muse = repo_root / ".muse" |
| 15 | muse.mkdir(parents=True) |
| 16 | (muse / "git-bridge.toml").write_text( |
| 17 | '[last_export]\ngit_sha = "' + ("a" * 40) + '"\n', |
| 18 | encoding="utf-8", |
| 19 | ) |
| 20 | adapter = adapter_for(muse_git_mirror_config, repo_root, make_runner({})) |
| 21 | result = adapter.read_canonical_anchor() |
| 22 | assert isinstance(result, ReadError) |
| 23 | assert "muse_commit_id" in str(result) |
| 24 | # Must not silently treat git_sha as aligned anchor |
| 25 | assert not hasattr(result, "anchor_sha") or getattr(result, "anchor_sha", None) is None |
File History
2 commits
sha256:106ef9e12cca7f3be3ffb2a6bd3abfa76f032dce453c9e5010d732a8d86f2e14
Reconcile reviewed credential compatibility 32254cd939885d9…
Human
patch
8 days ago
sha256:c87cf2c2f03da507f66f93922cb339a2cbebb33ad6372a6039032fb09a20da12
Reconcile reviewed Overseer recovery d47291d5d9030de5ebef71…
Human
minor
⚠
9 days ago