diff --git a/tests/package_contract/test_agent_handoff_1_12.py b/tests/package_contract/test_agent_handoff_1_12.py index 9f484340..9ad87ffb 100644 --- a/tests/package_contract/test_agent_handoff_1_12.py +++ b/tests/package_contract/test_agent_handoff_1_12.py @@ -152,9 +152,9 @@ def test_agent_handoff_1_12__launcher_and_projection__preserve_package_bytes() - def test_agent_handoff_1_12__mutable_navigation__names_the_new_authority() -> None: expected_links = { - _FAMILY / "README.md": "versions/1.16/README.md", - _FAMILY / "adopt.md": "versions/1.16/adopt.md", - _FAMILY / "agent-summary.md": "versions/1.16/agent-summary.md", + _FAMILY / "README.md": "versions/1.17/README.md", + _FAMILY / "adopt.md": "versions/1.17/adopt.md", + _FAMILY / "agent-summary.md": "versions/1.17/agent-summary.md", } for path, expected_link in expected_links.items(): content = path.read_text(encoding="utf-8") diff --git a/tests/package_contract/test_agent_handoff_1_15.py b/tests/package_contract/test_agent_handoff_1_15.py index 3d3013f1..07c3c91f 100644 --- a/tests/package_contract/test_agent_handoff_1_15.py +++ b/tests/package_contract/test_agent_handoff_1_15.py @@ -139,7 +139,7 @@ def test_agent_handoff_1_15__identity__is_complete_and_current() -> None: } assert roles["1.14"] == "retained" assert roles["1.15"] == "retained" - assert "| [`agent-handoff`](agent-handoff/README.md) | active | 1.16 | default |" in ( + assert "| [`agent-handoff`](agent-handoff/README.md) | active | 1.17 | default |" in ( _ROOT / "standards/catalog.md" ).read_text(encoding="utf-8") diff --git a/tests/package_contract/test_cut_successor.py b/tests/package_contract/test_cut_successor.py index a86ebd55..8ffa498a 100644 --- a/tests/package_contract/test_cut_successor.py +++ b/tests/package_contract/test_cut_successor.py @@ -11,7 +11,6 @@ from __future__ import annotations -import importlib.util import shutil import tomllib from pathlib import Path @@ -21,6 +20,7 @@ from project_standards.cli import main from project_standards.package_contract.cut_successor import apply_cut, plan_cut from project_standards.package_contract.diagnostics import PackageContractError +from tests.module_loading import load_module_from_path _ROOT = Path(__file__).resolve().parents[2] # python-coding is the smallest family in the repository (four payload files) and @@ -54,10 +54,7 @@ def _next_version(repository: Path, standard_id: str) -> tuple[str, str]: def _run_module(path: Path) -> None: """Import one generated test module and run every test function it defines.""" - spec = importlib.util.spec_from_file_location(path.stem, path) - assert spec is not None and spec.loader is not None - module = importlib.util.module_from_spec(spec) - spec.loader.exec_module(module) + module = load_module_from_path(path.stem, path) cases = [name for name in dir(module) if name.startswith("test_")] assert cases, f"scaffolded module defines no test: {path}" for name in cases: diff --git a/tests/package_contract/test_github_workflow_1_9.py b/tests/package_contract/test_github_workflow_1_9.py index 7819798f..4c602f5b 100644 --- a/tests/package_contract/test_github_workflow_1_9.py +++ b/tests/package_contract/test_github_workflow_1_9.py @@ -556,6 +556,14 @@ def _run_binary(args: Sequence[str], cwd: Path) -> subprocess.CompletedProcess[s ) +# The corpus this assertion measures is frozen at the last commit before the +# `Workflow-Admission` classes started landing on `testing` (the v5.28.0 D4 adoption +# commit). `HEAD` would drift: every legitimate `T0` or `handoff` commit admitted after +# the floor would flip the zero counts below, turning a fixed-epoch measurement into a +# prohibition on classes CLAUDE.md declares valid. +_CORPUS_TIP = "4866a9fa" + + @_requires_binary def test_github_workflow_1_9__classifier__flags_this_repository_own_history() -> None: """The non-vacuity proof #203 requires, run over the corpus that motivated it. @@ -571,7 +579,16 @@ def test_github_workflow_1_9__classifier__flags_this_repository_own_history() -> network reachability. """ result = _run_binary( - ["admission", "--branch", "HEAD", "--since", "9c47907f", "--offline", "--output", "json"], + [ + "admission", + "--branch", + _CORPUS_TIP, + "--since", + "9c47907f", + "--offline", + "--output", + "json", + ], cwd=_ROOT, ) if result.returncode == 2 and "reading commits" in result.stdout + result.stderr: diff --git a/tests/test_repository_hygiene.py b/tests/test_repository_hygiene.py index c3ed05a4..9c8c7591 100644 --- a/tests/test_repository_hygiene.py +++ b/tests/test_repository_hygiene.py @@ -116,6 +116,7 @@ "scripts/build-command-provider-fixture.sh", "scripts/build-gh-workflow.sh", "scripts/githooks/main-branch-guard", + "scripts/go-verify-stamp.sh", "scripts/install-githooks.sh", "scripts/wheel-runtime-stamp.sh", } diff --git a/tests/test_spec_selected_routing.py b/tests/test_spec_selected_routing.py index a2d040c0..0c93efe3 100644 --- a/tests/test_spec_selected_routing.py +++ b/tests/test_spec_selected_routing.py @@ -1197,8 +1197,10 @@ def test_selected_validate_uses_captured_bytes_if_path_changes_after_snapshot( def capture_then_swap( repo_root: Path, targets: tuple[SafeRelativePath, ...], + *, + retain_content: bool = True, ) -> RepositorySnapshot: - result = real_capture(repo_root, targets) + result = real_capture(repo_root, targets, retain_content=retain_content) if any(target.original == "victim.md" for target in targets): victim.unlink() victim.symlink_to(outside)