You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(tooling): docs-drift stops flagging docs for tests-only changes (#4091)
`affected-docs.mjs` derived changed-package roots from every file under `packages/`,
tests included. A test observes behaviour rather than defining it, so it cannot make an
implementation-accuracy doc stale — yet every tests-only PR lit up its packages' whole
doc set. Three in a row did it (#4064, #4078 and one before), each flagging 6
packages/services docs for a diff with no production code.
This is the one place the mapper's deliberate over-inclusion actively hurt: a category
that is ALWAYS false teaches the reader to skip the comment, and then it fails on the PR
where it is right.
- Test files are dropped before the roots are derived: *.test.* / *.spec.* at any depth
(covering .integration.test.ts and .conformance.test.ts) plus __tests__ / __mocks__ /
__fixtures__.
- The narrowing is NOT silent — the excluded count rides the summary line and
`testFilesSkipped` in --json.
- `--self-test` pins the matcher (the check-error-code-casing / check-route-envelope
convention), run by the workflow before it computes the mapping.
- The workflow also triggers on the mapper's own paths, so editing it runs its own guard.
CI surfaced that gap: on the first push the drift job never ran at all, which meant the
self-test had been added but was structurally unreachable by the change most likely to
break it.
Verified against real history: 46e86ba (tests only) → 0 docs, was 6; 4965bfa
(engine.ts + formula) → the same 11 docs as before; --all unchanged at 178. Swapping the
anchored match for a naive path.includes('test') fails 7 self-test cases, including
control-flow.zod.ts and latest.ts being swallowed as tests.
emit(affected.map((a)=>a.doc),changedPackages,`${affected.length} docs affected by ${changedPackages.length} changed package(s) since ${sinceRef}`,affected);
163
+
// Report what was excluded rather than dropping it silently — a tool that quietly
164
+
// narrows its own scope reads as "nothing to see here" when it means "I did not look".
0 commit comments