Repository navigation
fix(#885): count spawns of dist/ build output as production in tautology detector - #887
Merged
admarble merged 3 commits intoAug 2, 2026
Conversation
…ogy detector Subprocess-driven integration tests (cli.integration.test.ts) import only node builtins and exercise production code by spawning node dist/bin/cli.js. Static import analysis can't see through the process boundary, so every block scored 100% tautological and the local /qa gate produced a wrong verdict. The detector now counts a block as calling production code when it spawns the project's dist/ build output (execSync/spawnSync/etc.), directly or via a describe/module-scope helper resolved transitively. Detection keys on content (a spawn referencing a build path), never on filename or an opt-out annotation, and stays per-block so genuine tautologies are still reported. AC-4: documents the gate as a local/agent-only advisory, inert in CI by design. Entire-Checkpoint: 23c671d114ad
4 tasks
…ss spawns QA on PR #887 demonstrated a false negative: SPAWN_PATTERN's bare exec/spawn/fork alternates matched after a dot, so a tautological block running RegExp.prototype.exec against a dist/ path string was masked as production-calling. Split the pattern by ambiguity: unambiguous long names (execFileSync, spawnSync, execSync, execFile) still match anywhere, including cp.execSync(...); the short generic names now reject a preceding identifier char or dot. Mutation-verified: reverting SPAWN_PATTERN to the previous alternation fails exactly the new regression test ("does not mask a tautology via method-style .exec() plus a dist/ token"), 59/60 others pass. Real cli.integration.test.ts stays 0/17 tautological under the new pattern.
…utology-detector-scores-subprocess-driven # Conflicts: # CHANGELOG.md
admarble
deleted the
feature/885-fix-qa-tautology-detector-scores-subprocess-driven
branch
August 2, 2026 14:06
7 tasks
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.
Summary
cli.integration.test.ts) 100% tautological because they import only node builtins and exercise production code by spawningnode dist/bin/cli.js— a boundary static import analysis can't see through. On any PR touching such a file the local/qagate produced a wrong 100% verdict, training people to ignore the detector.dist/build output (execSync/spawnSync/etc.), directly or through a describe/module-scope helper resolved transitively. Detection keys on content (a spawn referencing a build path), never on filename or an opt-out annotation, and stays per-block so genuine tautologies are still flagged.cli.integration.test.tsgoes 100% → 0% tautological (all 17 blocks).Pre-PR AC Verification
cli.integration.test.tsnot reported tautologicalcollectSpawnHandles(src/lib/test-tautology-detector.ts)spawnsBuildOutputkeys on a child-process spawn referencingdist/; tests use non-integrationfilenames and no@tautology-skipgit diff main...HEAD); documented inquality-gates.md(×3 mirrors) + CLI headerdist/string but not spawning is NOT productionspawnsBuildOutputrequires spawn and build-token co-occurrence; AC-5 testMutation verification (per repo gate-test policy)
spawnsBuildOutputforced toreturn false: exactly the 5 spawn-detection tests (AC-1 direct, AC-2 direct + inline, AC-1 transitive, AC-3 spawn block) failed; the AC-5 test (asserts a non-spawning helper stays tautological) correctly still passed. Restored.SPAWN_PATTERN.test(body) &&) so adist/mention alone counts: the AC-5 test failed (expected tautologicaltrue, gotfalse). Restored.Test plan
npm run build— passesnpm run lint— passesnpx vitest run src/lib/test-tautology-detector.test.ts scripts/qa/tautology-detector-cli.test.ts— 63 passed (7 new)cli.integration.test.ts: 100% → 0% tautologicalFiles changed
src/lib/test-tautology-detector.ts— build-output-var + spawn-helper collectors (transitive), extended per-block predicatesrc/lib/test-tautology-detector.test.ts— 7 new tests (AC-1/2/3/5)scripts/qa/tautology-detector-cli.ts— AC-4 scope note in header.claude/skills/qa/references/quality-gates.md,skills/…,templates/skills/…— detection rule + local-only advisory scope (3 mirrors synced)CHANGELOG.md— Unreleased → Fixed entryCloses #885
🤖 Generated with Claude Code