Repository navigation
msdmd: run node --jitless; signal-killed node and failed identity probe exit 3 - #120
Merged
Merged
Conversation
…y probe exit 3 Under systemd MemoryDenyWriteExecute=yes V8's JIT cannot map W^X pages, so node died with a V8 fatal error (SIGTRAP, shell exit 133). The identity probe then reported node/typescript as absent and exited 0, and the TypeScript reader became typescript_reader_failed without changing the exit code, so TypeScript facts silently went missing. - NODE_ARGV = node --jitless for both the TypeScript worker and the identity probe (output byte-identical, verified with JIT, jitless and jitless under PR_SET_MDWE). - A worker killed by a signal (-N or shell-style 128+N) is the new node_runtime_unavailable runtime diagnostic: the CLI exits 3, writes nothing. - --print-generator-identity exits 3 with no output when its probe is killed, exits nonzero, cannot spawn, or prints unexpected output. Node missing from PATH is still recorded as absent. - Tests mock the signal death (patched subprocess and a self-killing node on PATH) and, where the kernel supports PR_SET_MDWE, run the real restriction. - Docs, CHANGELOG, ratios seals and skill-lib_msdmd.ts regenerated.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Unblocks stack #78 keeping
MemoryDenyWriteExecute=trueon its msdmd worker (Review finding on stack #78 at 131497c).Problem
Under systemd
MemoryDenyWriteExecute=yes, V8's JIT can't map writable-then-executable pages, so Node aborts with a V8 fatal error (SIGTRAP, shell exit 133). Then:nodeandtypescriptasabsentand still exited 0;typescript_reader_failedwithout changing the exit code, so TypeScript facts went missing without anyone noticing (unless--strictwas set).Fix (
msdmd/native_code.py,msdmd/collect.py)NODE_ARGV = ("node", "--jitless")is used by both the TypeScript worker and the identity probe. The output is byte-identical: I checked the worker output oncollection.tsandskill-lib_msdmd.tsunder JIT,--jitless, and--jitlessunder realPR_SET_MDWE, and the sha256 matched in all three. It's slower because it only interprets.node_signal()recognizes a signal death, either-Nfrom Python or128+Nfrom a shell or shim wrapper. If the worker is killed by a signal, it reports the newnode_runtime_unavailablediagnostic, which is inRUNTIME_UNAVAILABLE_CODES. The CLI exits 3 and writes nothing.--checkalso gives 3, not drift. The opt-out is unchanged (--allow-missing-reader-runtimes). The CLI prints the signal name, but never the worker's stderr.--print-generator-identityprobe is killed by a signal, exits nonzero, can't spawn (OSError, for example ENOMEM), or prints unexpected output, it raisesGeneratorIdentityError, and the CLI exits 3 with nothing on stdout. If Node isn't on PATH at all, it's still recorded asabsent, as documented before.Tests (
tests/test_msdmd_node_sandbox.py, 8 tests)subprocess.run(-5 and 133) and with a fakenodeon PATH that runskill -TRAP $$. They cover the reader, the probe, and both CLI paths. The CLI tests check exit 3, that the previous artifact is left byte-identical, that no temp files remain, and that the identity prints nothing.node --jitless.absent.PR_SET_MDWE(Linux 6.3+). It's skipped otherwise. In that test, JIT node gets killed, the jitless collection and identity under MDWE match the unrestricted run byte for byte, and TypeScript isn'tabsent.38c6433.Docs
msdmd/SKILL.md,docs/runner-config-guidance.md,docs/propagation-checklist.md, the collector docstring, and a new CHANGELOG entry. Consumers must treat a nonzero--print-generator-identityas meaning there's no identity at all, not an empty one.Gates, all run locally (Python 3.13, Node 24.15.0)
msdmd.collect --strict --checkplustsc,unittest discover(426 OK), gonol authority, drift--warnings-fail, compliance--warnings-fail,build_codex_plugin_skills --check,ratios_check --strict(0 drift),llms.build --check, and RepoLOTO audit and checks (7/7). Theskill-lib_msdmd.tschurn is mechanical: snapshot revision and implementation digest.Consumers: stack #78 will re-pin to the merge of this PR.