test(contract): guard release.yaml reusable-target rules with a negative fixture#18
Merged
Conversation
…ive fixture PR #17 added runner content-rules requiring release.yaml to call the org release-please (NWarila/.github) and framework release-evidence (NWarila/packer-framework-template) reusables by SHA and forbidding local copies, but added no bad-* fixture exercising the FAIL path. The good fixture only covers the PASS path (via the inherited real release.yaml), so a regression pointing release.yaml at a local/wrong-owner reusable would not be caught by the suite. Add bad-release-local-reusables (mirrors terraform-runner-template) + an EXPECTED_BAD_CONTRACT_FAILURES entry pinning all three rules: release-please required, release-evidence required, and the ./reusable-release-* local copy forbidden. Allowlist the fixture in the deny-all .gitignore. Contract suite: 10 passed, 0 failed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Finding S1 (adversarial alignment re-audit)
PR #17 added runner content-rules requiring
release.yamlto call the orgreusable-release-please(NWarila/.github) and the frameworkreusable-release-evidence(NWarila/packer-framework-template) by 40-hex SHA,and forbidding local
./reusable-release-*copies — but added no bad-*fixture exercising the FAIL path. The
goodfixture only covers the PASS path(via the inherited real
release.yaml), so a regression pointingrelease.yamlat a local/wrong-owner reusable would not be caught by
run_contract_tests.py.Change
tests/fixtures/contract/bad-release-local-reusables/(single-filerelease.yamloverlay that calls./local reusables) — mirrorsterraform-runner-template.EXPECTED_BAD_CONTRACT_FAILURESentry pinning all three rules:release-please required, release-evidence required, and the local-copy
forbidden marker (stricter than the sibling, which omits the evidence marker).
.gitignore.Verification (local, origin/main worktree)
python tools/run_contract_tests.py→ EXIT 0, contract summary: 10 passed, 0 failed(was 9);
bad-release-local-reusablesdetected as expected-failure.python tools/check_template_contract.py --type template→ EXIT 0, 28 passed, 0 failed.No production workflow changed; this only adds negative test coverage for an
existing, correct contract rule.
🤖 Generated with Claude Code