Skip to content

fix(analysis): iterate admitted inventories without call spreads - #10304

Merged
kaoru0822-kitauji merged 1 commit into
mainfrom
fix/8545-inventory-appends-c5-01a1d00b
Nov 13, 2026
Merged

kaoru0822-kitauji merged 1 commit into
mainfrom
fix/8545-inventory-appends-c5-01a1d00b

Conversation

@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator

Summary

Fixes #8545. Admitted native symbol inventories, exported JavaScript binding lists, and wide directory trees currently become function arguments through push(...items). At 130,000 items they throw RangeError; the managed-verification CLI reports generic execution_failure instead of verifying its one P/Invoke.

Replace the four confirmed producer appends with ordered iteration. Existing ordering, Evidence identities, cancellation, and selected resource limits remain intact. This is a focused follow-up to closed, unmerged #8568; it does not carry that PR's repository-wide helper and lint migration.

Change and scope

  • Owners: native symbol collection, runtime export binding selection, artifact directory scheduling, and reference-source directory scheduling. Consumers retain the same arrays and parsed facts.
  • Scope decision: not applicable; routine corrections within existing read-only workflows. No contract, catalog, provider protocol, installation, or generated metadata changes.
  • Effects: reads caller-selected files and Evidence; no target execution or new authority. Existing resource ownership and cleanup remain in place.
  • Related cleanup: other argument spreads were inspected as candidates, but this patch changes only the four failures reproduced on current main. It does not claim to qualify every wide inventory in the repository.

Evidence and regression coverage

All four new regressions fail on base 54906fdb1f and pass with the fix:

  • Public managed-verification CLI: authenticated synthetic Mach-O Evidence with 130,000 exports produces the same verified P/Invoke outcome as a three-export control, preserving the native Evidence reference.
  • Electron static analysis: a 130,000-binding exported declaration retains the same app-path uncertainty as its three-binding control.
  • Real filesystem: 130,000 empty immediate child directories reach the artifact reader's cancellation checkpoint and all appear in the reference inventory. A 2,000-entry allowance still returns the typed refusal at 2,000 examined entries.

Boundary coverage includes representation expansion, selected capacity limits, public success/error delivery, and exact caller cancellation cause. This does not establish real large-binary provider behavior. Full Electron CLI analysis and large-input MCP were not run. Local host: macOS arm64, Node 24.22.1/npm 11.16.0. The reference-reader case explicitly skips Windows, where its no-follow admission is unsupported; Windows execution was not available. One existing Linux filename-bytes test skipped on macOS.

Validation performed

  • npm run test:focused -- tests/boundary/cli/managedNativeVerificationLargeInventory.test.ts tests/boundary/javascript/wideExportBindings.test.ts tests/boundary/filesystem/wideDirectoryTraversal.test.ts — 4 passed; final run 35.39 seconds.
  • Related managed verification, Electron export, and reference-reader source suites — 76 passed.
  • Related CLI/MCP verification and directory ownership/open/queued traversal suites — 20 passed, 1 platform skip.
  • npm run check — passed.
  • npm run verify:test-discovery — all 3,499 test files discovered exactly once.
  • git diff --check — passed.

No breaking changes, release metadata, or package changes.

Author readiness

Human owner: @kaoru0822-kitauji. This author is exempt from the declaration under CONTRIBUTING.md; no human review is attested here.

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T05:05:12.022808Z b45ea5f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kaoru0822-kitauji
kaoru0822-kitauji merged commit c2ca381 into main Nov 13, 2026
47 checks passed
@kaoru0822-kitauji
kaoru0822-kitauji deleted the fix/8545-inventory-appends-c5-01a1d00b branch November 13, 2026 07:57
N0zoM1z0 pushed a commit that referenced this pull request Nov 14, 2026
`target.push(...items)` passes every item as a call argument and
overflows the stack once a target-sized array grows past the engine's
argument limit. This class was fixed one site at a time in #10304,
#10343, #10362 and #8632. Add one shared appendAll helper in
src/domain and use it at the remaining sites whose arrays grow with the
input: XML member counting, app-task row suggestions, native call
routes and unresolved calls, call-path caveats, environment-manifest
merges, reference-source import entries, dyld trace edges and JS
symbolic flow values. The web bundle merge from the previous commit now
uses the shared helper too.

Bounded spreads (fixed literals, page-sized reads) are left as they are.

Refs #10445
Refs #10342

Co-Authored-By: gensokyo-dev <[email protected]>
@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Large inventories overflow bulk appends in verification and directory traversal

2 participants