[PR #1308] [CLOSED] fix(reference): avoid stack overflow while collecting source dependencies #2788

Closed
opened 2026-10-17 21:10:15 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1308
Author: @rudycelekli
Created: 10/9/2026
Status: ❌ Closed

Base: main ← Head: fix/reference-source-deep-ast


📝 Commits (1)

  • 73ba829 fix(reference): avoid stack overflow while collecting source dependencies

📊 Changes

3 files changed (+69 additions, -35 deletions)

View changed files

📝 src/domain/referenceSourceImportParsing.test.ts (+12 -0)
📝 src/domain/referenceSourceImportParsing.ts (+7 -35)
➕ tests/boundary/filesystem/referenceSourceDeepExpression.test.ts (+50 -0)

📄 Description

A valid generated member chain can parse successfully in Babel, then overflow REA’s recursive historical-source dependency collector and abort the import. Reuse the shared iterative Babel traversal instead of recursively scanning node properties. A compiled importer regression runs in an owned Node process with its own temporary HOME and imports a 20,000-member chain without evaluating source; source tests retain CommonJS/dynamic-import ordering.

Validation: 1 failed, 9 passed; RangeError stack points to collector on baseline 411498d4. Fixed: 130 passed. 130 passed in 16 files across affected suites. npm run check and git diff --check pass with pinned Node 24.18.0/npm 11.16.0.

Tests use owned fixtures and isolated processes; no real provider or full repository suite certification is claimed. Prepared with AI assistance.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/1308 **Author:** [@rudycelekli](https://github.com/rudycelekli) **Created:** 10/9/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/reference-source-deep-ast` --- ### 📝 Commits (1) - [`73ba829`](https://github.com/morluto/rea/commit/73ba8294d392172d118f2c0e83a8ad37a71034aa) fix(reference): avoid stack overflow while collecting source dependencies ### 📊 Changes **3 files changed** (+69 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/referenceSourceImportParsing.test.ts` (+12 -0) 📝 `src/domain/referenceSourceImportParsing.ts` (+7 -35) ➕ `tests/boundary/filesystem/referenceSourceDeepExpression.test.ts` (+50 -0) </details> ### 📄 Description A valid generated member chain can parse successfully in Babel, then overflow REA’s recursive historical-source dependency collector and abort the import. Reuse the shared iterative Babel traversal instead of recursively scanning node properties. A compiled importer regression runs in an owned Node process with its own temporary HOME and imports a 20,000-member chain without evaluating source; source tests retain CommonJS/dynamic-import ordering. Validation: 1 failed, 9 passed; RangeError stack points to collector on baseline 411498d4. Fixed: 130 passed. 130 passed in 16 files across affected suites. `npm run check` and `git diff --check` pass with pinned Node 24.18.0/npm 11.16.0. Tests use owned fixtures and isolated processes; no real provider or full repository suite certification is claimed. Prepared with AI assistance. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:10:15 +00:00
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#2788
No description provided.