feat(ci): add forgotten-sibling-tests quality gate (#9530)

New CI policy gate that detects when a PR changes source file Y but the test siblings of Y's consumers are not in the same diff. Prevents the 'forgotten sibling test' pattern (7 documented occurrences in PR #9529).

- Extracts shared import resolution library (resolveImport, sourceDepsOf) from build-test-impact-map.mjs
- Creates check-forgotten-sibling-tests.mjs gate with consumer-walk logic
- Adds forgotten-sibling-allowlist.json for false positive mitigation
- Wires into pr-test-policy CI job and adds npm script
- Documents in QUALITY_GATES.md
- 17 TDD unit tests for isSourceFile, resolveBase, testSiblingOf, isAllowlisted, findConsumers
This commit is contained in:
diegosouzapw
2026-08-06 21:53:00 -03:00
parent 5f471181fa
commit 6c5329bcfe
9 changed files with 471 additions and 57 deletions

View File

@@ -587,6 +587,9 @@ jobs:
# Anti test-masking: flag net assert removal / new assert.ok(true) in changed tests.
- name: Detect test-masking (weakened assertions)
run: npm run check:test-masking
# Detect forgotten sibling tests (consumers whose test sibling is not in the diff).
- name: Detect forgotten sibling tests
run: npm run check:forgotten-sibling-tests
# Evidence-in-PR-body (Hard Rule #18 mechanized): claims of "tests pass" must carry output.
- name: Require evidence in PR body
run: npm run check:pr-evidence