fix(picker): correct crash-isolation and DPI claims, wire the built-worker guard, and tidy round-four nits

The round-four review's v6 pass found three factual gaps and the v5 pass two
nits. Correct them before merge:

- The in-process note claimed a koffi signature mistake is 'contained to
  the worker thread' — worker_threads share the process, so a native access
  violation takes down the whole Node process with no PowerShell fallback.
  State the real blast radius and record the deferred pkg-VFS worker-spawn
  arm in Consequences (both languages, pairing re-recorded).
- The 2026-07-27 picker note claimed unconditional 'per-monitor-v2 DPI';
  PMv2-less hosts (Server 2016 / Win10 1607) cascade to per-monitor or
  system-aware. Say 'the best thread DPI awareness the host accepts'
  (both languages, pairing re-recorded).
- built-worker.e2e.ts was not in any keyless gate (vitest.e2e config is
  not part of the default unit run and builtBinSmokeGate's explicit list
  missed it), so lib/worker.cjs load regressions passed keyless CI. Add it
  to builtBinSmokeGate alongside the workflow-workerthread sibling.
- Remove the dead trailing 'void bindings' in win32-dialog-logic.spec.ts
  and give native-picker.spec.ts the sibling module header it lacked.
This commit is contained in:
Huanqi Cao
2026-08-03 23:36:11 +08:00
parent e234a3a274
commit 020ce50414
9 changed files with 18 additions and 9 deletions

View File

@@ -1,3 +1,10 @@
/**
* Native picker tier selection and the execFile adapter: the in-process
* dialog primary, the pwsh → Windows PowerShell 5.1 fallback chain (any
* non-abort pwsh failure cascades), the abort-never-falls-through rule, and
* the triple-miss AggregateError carrying the dialog/pwsh/5.1 causes.
*/
type ExecFileCallback = (
error: (Error & { code?: string | number }) | null,
stdout: string,

View File

@@ -94,6 +94,5 @@ describe('runFolderDialog', () => {
expect(() => runFolderDialog(bindings, 'Pick', vi.fn())).toThrow(`${what} failed: HRESULT 0x80004005`)
expect(dialog.release).toHaveBeenCalledOnce()
expect(uninitialize).toHaveBeenCalledOnce()
void bindings
})
})