[GH-ISSUE #8455] [Bug] Large retained Evidence link sets overflow closure traversal #6611

Open
opened 2026-11-01 21:12:40 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @morluto on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/8455

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Evidence, artifacts, or reconstruction

Observed behavior

build_call_path returns an unstructured Maximum call stack size exceeded error when resolving a retained dossier with 150,000 distinct source links. A subsequent session summary still works.

Reproduction

  1. Generate an authenticated Evidence dossier containing 150,000 distinct syntactically valid evidence_links to records absent from the session; package it as a canonical single-record bundle.
  2. Import the file using import_evidence_bundle over stdio MCP; the import succeeds.
  3. Call build_call_path with the retained dossier ID and the same existing function address for start and goal.
  4. Observe an error whose text is Maximum call stack size exceeded; get_evidence_bundle summary afterward succeeds. Reproduced with both full and compact MCP schema profiles.

The dossier and links were synthetic. Its normalized dossier was based on an earlier Ghidra capture; no provider or target ran during these controls. This does not establish that either provider normally produces this many links.

Expected behavior

Follow the existing retained-closure contract and report a typed missing-source error without discarding links or imposing a new arbitrary limit.

Impact and scope

The selected workflow cannot complete or communicate the missing source in this large-input case. Other workflows using the shared closure resolver may also be affected; those were not separately exercised. Frequency and other platforms are unknown.

REA version

e18594b247

Runtime and platform

Node 24.22.1; macOS Darwin 25.3.0 arm64

Target and artifact context

Synthetic canonical Evidence bundle, approximately 10.5 MB, with one retained record and 150,000 unique missing links.

Interface

MCP or agent integration

Earliest failure stage

Native analysis or reconstruction

Relevant output or evidence

Public MCP results: import { imported: 1, total: 1 }; build_call_path returns isError: true with text Maximum call stack size exceeded; later summary succeeds. An isolated direct call with the same record raised RangeError at the shared resolver's pending.push(...evidence.value.evidence_links).

Typed outcome or recovery expected

The existing retained-closure missing-reference error identifying the first source selected by traversal.

Analysis or suspected cause

The resolver expands all source links into arguments to Array.push, exceeding the runtime's argument limit. Iterating the links preserves the traversal order and existing missing-reference behavior without adding a link-count cap.

Additional context

Related discovery design: #8454. @gensokyo-dev @kaoru0822-kitauji @N0zoM1z0

Originally created by @morluto on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/8455 ### Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area Evidence, artifacts, or reconstruction ### Observed behavior `build_call_path` returns an unstructured `Maximum call stack size exceeded` error when resolving a retained dossier with 150,000 distinct source links. A subsequent session summary still works. ### Reproduction 1. Generate an authenticated Evidence dossier containing 150,000 distinct syntactically valid `evidence_links` to records absent from the session; package it as a canonical single-record bundle. 2. Import the file using `import_evidence_bundle` over stdio MCP; the import succeeds. 3. Call `build_call_path` with the retained dossier ID and the same existing function address for start and goal. 4. Observe an error whose text is `Maximum call stack size exceeded`; `get_evidence_bundle` summary afterward succeeds. Reproduced with both full and compact MCP schema profiles. The dossier and links were synthetic. Its normalized dossier was based on an earlier Ghidra capture; no provider or target ran during these controls. This does not establish that either provider normally produces this many links. ### Expected behavior Follow the existing retained-closure contract and report a typed missing-source error without discarding links or imposing a new arbitrary limit. ### Impact and scope The selected workflow cannot complete or communicate the missing source in this large-input case. Other workflows using the shared closure resolver may also be affected; those were not separately exercised. Frequency and other platforms are unknown. ### REA version e18594b24754ab95ebd119311cc32a1d1ad6fa13 ### Runtime and platform Node 24.22.1; macOS Darwin 25.3.0 arm64 ### Target and artifact context Synthetic canonical Evidence bundle, approximately 10.5 MB, with one retained record and 150,000 unique missing links. ### Interface MCP or agent integration ### Earliest failure stage Native analysis or reconstruction ### Relevant output or evidence Public MCP results: import `{ imported: 1, total: 1 }`; `build_call_path` returns `isError: true` with text `Maximum call stack size exceeded`; later summary succeeds. An isolated direct call with the same record raised `RangeError` at the shared resolver's [`pending.push(...evidence.value.evidence_links)`](https://github.com/morluto/rea/blob/e18594b24754ab95ebd119311cc32a1d1ad6fa13/src/application/investigation/InvestigationEvidence.ts#L33). ### Typed outcome or recovery expected The existing `retained-closure` missing-reference error identifying the first source selected by traversal. ### Analysis or suspected cause The resolver expands all source links into arguments to `Array.push`, exceeding the runtime's argument limit. Iterating the links preserves the traversal order and existing missing-reference behavior without adding a link-count cap. ### Additional context Related discovery design: #8454. @gensokyo-dev @kaoru0822-kitauji @N0zoM1z0
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#6611
No description provided.