docs: retract the win32 launch note's unproven failure mechanism - #38
Merged
Merged
Conversation
The note asserted that `node --import tsx/esm <absolute .ts path>` fails on Windows and named `sandbox-local`'s windows-acl runner as a second instance of the same bug. Two repository sites contradict that. `packages/sandbox/sandbox-windows-acl/tests/runner.spec.ts` spawns exactly that argv — `--import tsx/esm` in front of an absolute path — under `skipIf(!isWin32)`, so it runs only on Windows, and `vitest.config.ts:62-68` relies on that suite as the Windows signal that lets `runner.ts` leave the per-file coverage gate. `packages/test-support/loader-smoke/src/index.ts` launches an absolute path behind a resolved tsx loader in src mode from a spec the Windows exclusion list does not cover. Neither the ESM-only-versus- full tsx entry nor the bare-versus-URL loader argument separates the failing site from those, so both discriminators the note offered are wrong. State what is established — the symptom, that koffi was never reached, and that replacing the launch fixed the dialog on Windows — and mark the `e:` scheme mechanism as untested, naming the one factor unique to the call site: `ELECTRON_RUN_AS_NODE=1` over a `process.execPath` a packaged host points at its own binary. The decision stands without it: plain node over a package-local erasable graph needs no loader chain either way. `sandbox-local` becomes counter-evidence rather than a queued fix. Adopting this launch there is a simplification that would rewrite its `--import tsx/esm` assertion, not a bug fix. Running `pnpm vitest run packages/sandbox/sandbox-windows-acl` on Windows settles which reading is right.
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.
Why
#37's Agent Note (now on master as
f637d84a27) asserts a failure mechanism this repository contradicts. I wrote part of that text during the review, so this corrects it in place per.agents/notes/implemented/AGENTS.md("Rewrite stale facts in place").The note claimed that
node --import tsx/esm <absolute .ts path>fails on Windows withERR_UNSUPPORTED_ESM_URL_SCHEME, and namedpackages/sandbox/sandbox-local/src/index.ts:563as a second, unfixed instance of the same bug.The counter-evidence
packages/sandbox/sandbox-windows-acl/tests/runner.spec.tsspawns that exact argv:It runs only on Windows,
sandbox-windows-aclis absent fromvitest.config.ts's Windows exclusion list, andvitest.config.ts:62-68relies on that suite as the Windows signal that letssrc/runner.tsleave the per-file coverage gate — the repository treats that launch as working.packages/test-support/loader-smoke/src/index.ts:116launches an absolute path behind a resolved tsx loader insrcmode (the default), from.spec.tsfiles Windows does not exclude.So neither discriminator the note offered survives:
import.meta.resolve('tsx/esm')→file://URLsandbox-windows-acl/tests/runner.spec.ts:29'tsx/esm'bareloader-smoke/src/index.ts:116import.meta.resolve('tsx')→file://URLsandbox-local/src/index.ts:563'tsx/esm'bareNeither "ESM-only versus full tsx entry" nor "bare specifier versus
file://URL" separates the failing site from the others.What this changes
## Problemsplits into what is established — the symptom, that koffi was never reached, that replacing the launch fixed the dialog on Windows — and the mechanism, now marked untested. The one factor unique to that call site is named:ELECTRON_RUN_AS_NODE=1over aprocess.execPatha packaged host points at its own binary.## Related launch pathsturnssandbox-localfrom a queued fix into counter-evidence. Adopting this launch there remains a reasonable simplification, one that would rewrite the--import tsx/esmassertion inpackages/sandbox/sandbox-local/tests/local.spec.ts, but not a bug fix.## Consequencesbullet no longer asserts the mechanism, only that the launch no longer depends on how a loader chain resolves the worker path.The shipped fix is untouched and still justified: plain node over a package-local erasable graph needs no loader chain regardless of which mechanism broke it.
Settling it
pnpm vitest run packages/sandbox/sandbox-windows-aclon a Windows host decides between the two readings. Green means the vector is fine andELECTRON_RUN_AS_NODEis the prime suspect; red meanssandbox-localreally does carry the same defect and wants its own fix.Verification
Documentation only — no source or test changes. Three files: the two note languages and their pairing record.
pnpm run doc-sync— 28 passed, 0 failed