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
{{ message }}
Repository navigation
Commit 46ceb5a
Browse filesBrowse the repository at this point in the historyBrowse files
Follows 128ac34 (scan.mjs). query.mjs: all 91 process.exit sites become qexit(code), which throws a
QueryExit; one uncaughtException listener sets process.exitCode and returns, so the process ends
naturally (isolate disposed before the platform: no nodejs/node#64274 deadlock). Chosen over a labelled
block because query's exits live inside helper functions a label cannot reach; gate-core's GateDone is
the same shape and `accepts` already relies on it. Every catch in query.mjs (18) rethrows QueryExit first;
the file has no finally and no await. gateCore gets `exit: qexit`. policy.mjs's unreadable-config refusal
is shared with scan.mjs and keeps process.exit.
mcp.mjs / lsp.mjs: stdin EOF and LSP `exit` call contract.mjs exitNaturally(0): set exitCode, destroy
stdin, drain; an unref'd 2 s process.exit fallback fires only if another handle holds the loop open.
Measured: both exit in 0.04-0.08 s, code 0.
Unit test extended to scan/query/lsp/mcp (named allow-list of remaining process.exit; every query catch
guarded); fails on each old file, one at a time.
Byte-identity, 91 query invocations (every verb; exit 0 x48, 1 x20, 2 x23; with/without --json): rc,
stdout, stderr and --gate-json identical, except `gate --json` over a 34k-function report through a pipe:
old = 65,536 bytes, invalid JSON (console.log async + process.exit); new = 1,591,350 bytes, valid. That
diff is also the evidence the comparison can fail.
Stress reproduction on `query.mjs gate` (old file, --stress-concurrent-allocation, heap 16-192 MB, small
and 34k-function reports, ~160 runs): 0 hangs -- NOT reproduced locally; the gate is too light to leave
a background compile job parked. The fix is the same mechanism as scan's, whose reproduction stands.
npm test (unit 140, behavioural 3812 in 8 shards, MCP 246, LSP 130, watch 16, probe, fuzz) green;
ci/self-gate.sh OK.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jaUYop2PEqPfxttcNWPFx
0 commit comments