diff --git a/scripts/tests/test_ci_image_pin_population.py b/scripts/tests/test_ci_image_pin_population.py index b7a635751..b30a8d08b 100644 --- a/scripts/tests/test_ci_image_pin_population.py +++ b/scripts/tests/test_ci_image_pin_population.py @@ -197,7 +197,7 @@ def test_the_registry_partitions_every_job_in_the_workflow(): "always a recorded decision rather than an omission." ) assert not (TOOLCHAIN_JOBS & BARE_RUNNER_JOBS), "a job cannot be in both lists" - assert TOOLCHAIN_JOBS | BARE_RUNNER_JOBS == all_jobs, ( + assert all_jobs == TOOLCHAIN_JOBS | BARE_RUNNER_JOBS, ( f"the registry names jobs that do not exist: " f"{sorted((TOOLCHAIN_JOBS | BARE_RUNNER_JOBS) - all_jobs)}" ) diff --git a/scripts/tests/test_guard_inventory.py b/scripts/tests/test_guard_inventory.py index 1ff662274..34282ee8a 100644 --- a/scripts/tests/test_guard_inventory.py +++ b/scripts/tests/test_guard_inventory.py @@ -99,11 +99,24 @@ def wired_hook_files() -> set[str]: its file, keeps its inventory row, and stops running — and the table would go on describing a working guard. That is #631 and #719's shape ("wired is not running") one level down, and it was the derivation's blind spot until cold review named it. + + COMMENT LINES ARE STRIPPED from the husky hooks first, and that is not a refinement — the first + version of this function counted a mention anywhere, and `.husky/pre-commit:7` reads + + # CI where a base ref exists). Fail-open shim — see .claude/hooks/decisions-guard.sh. + + one line above the real invocation. Delete line 8 and keep line 7 and the hook would still have + read as wired, which is the exact substitution of mention for invocation this function exists to + stop, reproduced inside the fix for it. `.claude/settings.json` needs no stripping: JSON has no + comments, so every occurrence there is in a real command string. """ text = (REPO_ROOT / ".claude" / "settings.json").read_text() for husky in HUSKY_DIR.iterdir(): if husky.is_file(): - text += husky.read_text() + text += "\n".join( + line for line in husky.read_text().splitlines() + if not line.lstrip().startswith("#") + ) return { str(p.relative_to(REPO_ROOT)) for p in HOOKS_DIR.glob("*.sh") if p.name in text }