Repository navigation
fix(node-sea): bound duplicate blob verification work - #11215
ShuaixinHuang wants to merge 15 commits into
Conversation
Codex Review Summary: ❌ FailedThis 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. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The reviewed changes appear safe to merge; no actionable defect was found. SummaryBounds duplicate Node SEA blob hashing in the shared reader used by Mach-O, ELF, and PE.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Mach-O, ELF, or PE declarations"] --> B["Remove exact range aliases"]
B --> C{"Multiple distinct ranges?"}
C -->|No| G["Return chosen location"]
C -->|Yes| D{"Equal lengths?"}
D -->|No| H["Conflicting-blob failure"]
D -->|Yes| E{"Total bytes fit carrier allowance?"}
E -->|No| I["Typed capacity refusal"]
E -->|Yes| F["Hash ranges and compare"]
F -->|Identical| G
F -->|Different| H
Reviews (5) · Last reviewed commit: "Merge commit 'a8f98b7a951ba0c28cb91f7429..." · Reviewed by Greptile |
…it-open-11215-20261116
…al-open-11215-20261116
|
@morluto @kaoru0822-kitauji @N0zoM1z0 Could you please review this change when available? The PR description records the implementation, validation evidence, and remaining limitations. Thank you. |
…file
The Windows-only case at `clientConfigurationEnvironment.test.ts:226` wrote
`rea_mcp_input_schema_profile: "full"`. That profile was retired: the reader
now refuses it ("REA_MCP_INPUT_SCHEMA_PROFILE accepts only \"compact\" …"),
so `configureClientConfiguration` returned `failed/readback` before writing
and the case failed on every Windows run, including main's own
`Windows capability and package lane`.
The case has no Windows dependency — it passes an explicit `configPath` and
the Kimi write dialect is the same everywhere — so it now runs on every
platform, which is what let the stale value rot unnoticed. The fixture keeps
the lowercase explicit key the case is about, with the supported value.
Verified on `main` `d6bcfc10`: the same fixture driven through
`configureClientConfiguration(..., "win32")` on this host reproduced
`{"status":"failed","reason":"readback"}` with the retired value and now
returns `{"status":"configured"}` with `compact`. The file's 75 cases pass
here (66 run, 9 platform-conditioned skips) and `check:fast` passes.
…alue-11215 # Conflicts: # src/artifacts/nodeSea/NodeSeaLocation.ts
Disposition
Superseded by 11736 at @ShuaixinHuang's request after CI repair and local qualification. The replacement preserves the original feature commits and links this review history.
Qualified-base verification
Validation cutoff: the results in this section are pinned to main
f916b3ecf. Later upstream resources/ports migrations, including main3fbeacf31, were not included in this PR qualification; current-main compatibility and hosted results remain unverified.Normally merged main
f916b3ecf5455ffc80e300d8cf7eea144d02d61cinto this same PR as85e84fffd65ed8bf4e937ba8c575d34680a72834. Accepted upstream test-only commits94bf2bdec,5579890ddandf916b3ecfrepair shared setup/lifecycle/isolation fixtures. In particular, the five failures recorded earlier on mainbd9f2cca4are now fixed upstream; they are not current blockers from that earlier baseline.hermesClientSetup,ompClientSetup,piClientSetup,ciTestProjects,agentEvaluationCleanup,agentEvaluationCommands) were run withnpm run test:focused: 75 passed, no skips, exit 0, on clean mainf916b3ecf. A local-only Linux subreaper preserved assertions and exit status while reaping 14 adopted children.8b5c792dea262c91d5acbb514c93d2965399f622and are unchanged by this test-only merge. The feature-suite results below apply to those exact preserved inputs.git diff --checkand normal pre-pushnpm run check:fast(typecheck, lint and architecture guards) passed on the published tree. Linux x64, Node 24.22.1 / npm 11.16.0.Fresh-head hosted CI remains pending. No complete monolithic local check, combined integration of all open PRs, or additional native Windows/macOS qualification is claimed. Earlier results below retain their stated revisions. Existing human-readiness text and checkbox lines are preserved verbatim; this update does not attest to a new human review.
Current-head verification — audit follow-up
Normally merged main
bd9f2cca45cb99c7460ab678f4fe6a3b12d6ba3ainto this same PR, published as8b5c792dea262c91d5acbb514c93d2965399f622. Accepted common-suite fixes #11193, #11211 and #11213 are inherited unchanged.npm run test:focused -- src/artifacts/nodeSea/NodeSeaHashWork.test.ts tests/boundary/cli/nodeSeaHashWork.test.tspassed (2 passed (2); 5 passed (5)).git diff --checkand normal pre-push hooks (npm run check:fast, including architecture guards) passed on this tree. Linux x64, Node 24.22.1 / npm 11.16.0.Fresh hosted CI remains required; no full monolithic local check or new native Windows/macOS qualification is claimed. Independent clean-main verification of 22 previously failing files produced 708 passes / 5 failures / 10 skips: four existing invalid-vs-unknown registration expectations and one read-only local account-home limitation. These are recorded separately from this PR's focused passes.
All earlier validation below is historical for its stated revision. Existing human readiness text and checkbox lines are retained verbatim; no new human review is attested.
Summary
Bound Node SEA duplicate-blob verification before hashing native payloads. A crafted Mach-O with eight overlapping section declarations makes a 17,135-byte file trigger 131,072 bytes of payload hashing and return a candidate location on main. Increasing the declaration count multiplies this work even when each blob satisfies the selected per-blob limit.
The shared
collapseRangesowner serves Mach-O, ELF and PE. It deduplicated exact ranges but had no aggregate hash-work allowance. This is distinct from merged #8031's ELF note-header scan bound; the reproduction uses Mach-O and reaches the later payload-hashing stage. The Deno sibling already enforces a carrier-size duplicate-verification allowance.Fix and boundaries
Reject unequal-length declarations as the existing conflicting-blob format failure before reading payloads. Preflight the total bytes of distinct ranges against the carrier file size, using the existing typed fixed-capacity failure and its no-runtime-override remediation. Exact aliases are still deduplicated; ordinary disjoint identical copies remain accepted.
One producing-owner fix covers all three native carrier paths. The owning guide documents the allowance. No schema, dependency, configurable limit, target execution, process lifecycle or timeout changes. This is an ordinary resource-bound correction in an existing passive parser; a new capability/scope decision is not applicable. No separate issue is linked because this focused fix includes the reproduction and public-boundary regression.
Reproduction and checks actually run
Base:
9c86465d47e98306e1ee1f77e7fb25d1d737b1db, latest main fetched again before commit.FileHandle.readbyte bound; unequal lengths unnecessarily read both payloads; the compiled publicinspect-artifactCLI reaches malformed-blob failure instead of the capacity refusal. Exact-alias and disjoint-copy controls pass.truncated/limit/capacity, fixed-allowance guidance, and unchanged source bytes. A subsequent Buffer comparison style correction passed the targeted CLI again; this is overlapping verification, not an additional distinct test count.npm run check:fast: passed (35.177 s).npm run docs:check, test discovery (3496 files exactly once), global format/Knip/metadata checks, architecture guards (2761 source files), and production reachability check passed.Verification limits: the overlapping fixture is an authored native carrier with zero-filled candidate blobs, not a runnable postject-produced executable. It deliberately reaches verification before blob decoding. Actual Linux file I/O and compiled CLI/MCP were exercised; native Windows/macOS/Bun and real Node SEA executable production/execution were not. Byte-read counts establish the work bound; no latency or memory benchmark improvement is claimed. Full
npm run check/check:prand the complete local suite were not run: all other global static components passed, while type-aware lint was scoped to changed files on this 8 GiB host. Hosted CI remains separate.Author readiness
Human owner: @ShuaixinHuang
Prepared with AI assistance. @ShuaixinHuang explicitly confirmed all three initial declarations after reviewing final commit
b0d8773ae10a0da7eb87fc5f5c08f41e3d39440cand the evidence/limits in this body. No previous PR's confirmation was reused.Resubmission
Re-submitted after closing the previous PR; source branch and validated change are unchanged.
Resubmission
Re-submitted after closing the previous PR; source branch and validated change are unchanged.
Current author readiness
@ShuaixinHuang confirmed on 2026-11-15 that the current head was reviewed, the evidence and limitations were checked, responsibility for the complete AI-assisted change is accepted, and this PR is ready for initial maintainer review.