Description
@windyroad/tdd's PreToolUse hook tdd_find_test_for_impl requires a canonical <stem>.test.js file to exist for a source module. When a module's tests are ALL variant-named (src/foo.<variant>.test.js) with no src/foo.test.js, the hook associates NO test and blocks TDD-gated edits to src/foo.js, even though the variant tests exist and pass under vitest. Co-location (same-dir) is necessary but not sufficient — the stem-match is additionally strict. Distinct from the closed same-dir / __tests__ / test-mirror location issue (#123): this is stem-canonicality, not test location.
Symptoms
- A source module whose tests are all variant-named, with no canonical
src/foo.test.js, is associated with NO test — tdd_find_test_for_impl returns empty.
- TDD-gated edits hit the enforce-edit deny (
no tests written for this file yet. TDD state is IDLE) despite passing variant tests.
- vitest still discovers and runs the variant tests; only the hook's per-module association fails.
Workaround
Keep a canonical <stem>.test.js per module (the hook's ${STEM}.test.* glob matches it); additional edge-case suites use <stem>.<variant>.test.js. When a module has only variant suites, rename the primary suite to the canonical name (git mv src/foo.success.test.js src/foo.test.js).
Affected plugin / component
@windyroad/tdd — tdd_find_test_for_impl in hooks/lib/tdd-gate.sh (stem-match strictness).
Frequency
Per source module whose paired tests are all variant-named with no canonical <stem>.test.js.
Versions
- Local plugin:
@windyroad/tdd (not detected — marketplace install)
- Upstream package:
@windyroad/tdd (not detected)
- Claude Code CLI: 2.1.219
- Node: v24.16.0
- OS: Darwin 25.3.0 arm64
Evidence
Fix shape: relax tdd_find_test_for_impl's glob to match ${STEM}.*.test.* (variant-named) in addition to ${STEM}.test.*, so any same-stem test file in the module's directory associates.
Cross-reference
Reported from https://github.com/voder-ai/dry-aged-deps — tracked locally as problem ticket P020 in docs/problems/.
Description
@windyroad/tdd's PreToolUse hooktdd_find_test_for_implrequires a canonical<stem>.test.jsfile to exist for a source module. When a module's tests are ALL variant-named (src/foo.<variant>.test.js) with nosrc/foo.test.js, the hook associates NO test and blocks TDD-gated edits tosrc/foo.js, even though the variant tests exist and pass under vitest. Co-location (same-dir) is necessary but not sufficient — the stem-match is additionally strict. Distinct from the closed same-dir /__tests__/ test-mirror location issue (#123): this is stem-canonicality, not test location.Symptoms
src/foo.test.js, is associated with NO test —tdd_find_test_for_implreturns empty.no tests written for this file yet. TDD state is IDLE) despite passing variant tests.Workaround
Keep a canonical
<stem>.test.jsper module (the hook's${STEM}.test.*glob matches it); additional edge-case suites use<stem>.<variant>.test.js. When a module has only variant suites, rename the primary suite to the canonical name (git mv src/foo.success.test.js src/foo.test.js).Affected plugin / component
@windyroad/tdd—tdd_find_test_for_implinhooks/lib/tdd-gate.sh(stem-match strictness).Frequency
Per source module whose paired tests are all variant-named with no canonical
<stem>.test.js.Versions
@windyroad/tdd(not detected — marketplace install)@windyroad/tdd(not detected)Evidence
Fix shape: relax
tdd_find_test_for_impl's glob to match${STEM}.*.test.*(variant-named) in addition to${STEM}.test.*, so any same-stem test file in the module's directory associates.Cross-reference
Reported from https://github.com/voder-ai/dry-aged-deps — tracked locally as problem ticket P020 in
docs/problems/.