diff --git a/AGENTS.md b/AGENTS.md index 13983ff9..b96bcff2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -266,9 +266,14 @@ v2/main/ │ # silently drove the previous fixture — reported not as │ # staleness but as a product failure in whatever the │ # smoke was checking. Unconditional emit is still not a -│ # clean: a DELETED src file leaves its stale `.js` -│ # behind, so `rm -rf test-servers/build` after one — -│ # #2111; +│ # clean, and that is the one hole it does NOT close: a +│ # DELETED src file leaves its stale `.js` behind, the +│ # existence checks pass against it, and anything still +│ # importing that module SILENTLY runs the old code — the +│ # same failure class. So `rm -rf test-servers/build` +│ # after deleting or renaming a source file; the +│ # `.tsbuildinfo` is pinned inside `build/` so that +│ # clean actually invalidates the cache — #2111; │ # resolve-node-bin.mjs resolves a │ # package's bin through its own package.json, so the │ # verify/smoke scripts spawn it with `process.execPath` diff --git a/scripts/lib/ensure-test-servers.mjs b/scripts/lib/ensure-test-servers.mjs index a273c7e8..d2bec471 100644 --- a/scripts/lib/ensure-test-servers.mjs +++ b/scripts/lib/ensure-test-servers.mjs @@ -21,14 +21,17 @@ * smokes that take tens of seconds and a `pack:verify` that does a real * `npm install` from the registry. * - * ⚠️ Unconditional emit is not a clean: `--noCheck` emit leaves the stale `.js` - * of a *deleted* `src` file behind, and no path here removes it. That is - * unchanged from before (the old early-return only skipped the build; it never - * cleaned either), and it is a loud failure rather than a silent one — an - * import of a removed module fails at the consumer. Fixing it properly means - * `tsc -b` with `composite`, which forces `declaration` on and drops - * `--noCheck`; not worth it for this. `rm -rf test-servers/build` if you have - * deleted a source file. + * ⚠️ Unconditional emit is not a clean, and this is the one hole it does NOT + * close. `--noCheck` emit leaves the stale `.js` of a *deleted* `src` file + * behind, and no path here removes it — the post-build existence checks pass + * against that stale file, so if anything still imports the deleted module it + * silently keeps running the old code. That is the same failure class as the + * one this helper fixes, so do not read the unconditional build as covering it. + * (It is unchanged from before: the old early return only skipped the build, it + * never cleaned either.) Fixing it properly means `tsc -b` with `composite`, + * which forces `declaration` on and drops `--noCheck`; not worth it for this. + * **`rm -rf test-servers/build` after deleting or renaming a source file** — + * the `.tsbuildinfo` lives inside `build/` precisely so that clean is real. * * The root-installed tsc is run via this Node — `npx` is a `.cmd` shim on * Windows that a shell-free spawnSync can't start (ENOENT — #1939). That is