Skip to content

Commit 1f656e3

Browse files
chore(knip): declare the safeWriteText module an entry of the src workspace
Production-mode knip is what fails this PR: knip --production --treat-config-hints-as-errors prints `Unused files (1)` / src/services/file-safety/safeWriteText.ts (check-run 129160792900 at 2026-11-09T12:30:46Z), while the development-mode run of the same command is clean at the same head. Nothing outside __tests__ imports the module here - a fixed-string search finds 148 spec rows and 8 self-references and no production importer - because the consumers are the sibling unit #2359: src/core/tools/guardedWrite.ts and src/utils/safeWriteJson.ts. Naming the module in workspaces.src.entry tells knip it is a root of this unit while no production caller exists yet, which is exactly why production mode reports it and development mode does not. This declaration is scaffolding: once the consumer content from #2359 lands the module has a real caller and the entry line becomes unnecessary. The resulting config object is byte-identical to the one the sibling unit #2385 already ships (blob 111f022 at fc2dc75 and at c4fc421), so the two units converge on one spelling of the rule instead of diverging into two. knip.json is blob 1f4956f at this head, at merge base e487cd7 and at main tip 18861b2, so refreshing onto main cannot clear this required context. Price, with the CI gate's own selector (scripts/stryker-diff.mjs blob 7dfe000, identical at this head and at the tip): the commit leg against parent 3edac64 prices 0 counted executable lines and 0 mutant selectors, and the CI-shape leg against tip 18861b2 through merge-tree and commit-tree prices extension 386 changed executable lines / 119 selectors, unchanged from the pristine head, which matches CI's own mutation job 129160793410 printing `Mutation-testing 1 package(s) from merge base e487cd7: extension (386 lines)`. That job's success is not a clean pass: it printed `extension timed out 12 of 372 valid mutants` and a non-empty advisory (survived mutants at safeWriteText.ts:102, 123, 124, 125, 127, 137, 139 and fileLock.ts:61, 73, 80, 86, 173, 183), and timed-out mutants are not counted as kills.
1 parent 3edac64 commit 1f656e3

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎knip.json‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@
1616
"playwright-ct": false,
1717
"workspaces": {
1818
"src": {
19-
"entry": ["extension.ts!", "extension/api.ts!", "workers/countTokens.ts!"],
19+
"entry": [
20+
"extension.ts!",
21+
"extension/api.ts!",
22+
"workers/countTokens.ts!",
23+
"services/file-safety/safeWriteText.ts!"
24+
],
2025
"project": [
2126
"**/*.ts!",
2227
"!**/__tests__/**!",

0 commit comments

Comments
 (0)