[PR #3852] [MERGED] fix(javascript): mark resource-skipped files parse_status skipped #5947

Closed
opened 2026-10-31 01:10:39 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3852
Author: @sx4im
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/17/2026
Merged by: @baron

Base: main ← Head: fix/3670-skipped-parse-status


📝 Commits (5)

  • b3802d2 fix(javascript): mark resource-skipped files parse_status skipped
  • 5302586 fix(javascript): default skipped_javascript_files when reading old saved evidence
  • 2a9c41f fix(javascript): preserve unknown skipped count for legacy evidence
  • b3f0789 Merge branch 'main' of github.com:morluto/rea
  • f531705 fix(javascript): add required failure scope and status to graph fixture

📊 Changes

8 files changed (+209 additions, -2 deletions)

View changed files

📝 src/application/javascript/JavaScriptArtifactAnalysisTypes.ts (+16 -0)
➕ src/application/javascript/JavaScriptArtifactGraphStructure.test.ts (+148 -0)
📝 src/application/javascript/JavaScriptArtifactGraphStructure.ts (+5 -1)
📝 src/application/javascript/JavaScriptArtifactReconstruction.ts (+8 -1)
📝 src/contracts/javascript/javascriptExportShapeComparisonExample.ts (+1 -0)
📝 src/contracts/javascript/javascriptRuntimeReconciliationExample.ts (+1 -0)
📝 src/domain/javascript/javascriptApplicationAnalysis.ts (+4 -0)
📝 src/domain/javascript/javascriptApplicationAnalysisSteps.test.ts (+26 -0)

📄 Description

Summary

Fixes #3670. analyze-javascript-application skipped JavaScript files above ~5 MB without saying so: the file was inventoried with text_status: "included" but never parsed, so its observation showed parse_status: null, parsed_javascript_files stayed 0, parse_failures stayed 0, and the summary read as "nothing there" rather than "not analyzed".

Problem and expected behavior

Two resource walls drop these files. With the default 1024 MB worker heap, the worker runs out of memory during static analysis; with a bigger heap, the static checkpoint (10.2 MB for a 5 MB source) exceeds the 8 MB checkpoint budget. Either way the facts never reach the parent and nothing in the counters recorded the skip. The issue asks for the file to be reported as not analyzed instead.

Change and scope

Reporting only; no parsing behavior changed.

  • File observations now report parse_status: "skipped" for a JavaScript file with included text that produced no facts because its analysis failed. One shared predicate (isSkippedJavaScriptAnalysis) backs both this and the counter.
  • New statistics.skipped_javascript_files counter.
  • The resource-constraint reason keeps surfacing as a limitation entry, as before.

Contract and boundary impact

  • Semantic owner and earliest changed stage: JavaScript application graph projection; shared predicate in the artifact-analysis types.
  • Contribution scope fit and linked maintainer decision: ordinary bug fix within existing boundaries; not applicable.
  • CLI and MCP/tool-catalog contract: additive only. One new statistics key and one new parse_status value inside free-form observation properties; the result schema was extended and the contract examples updated.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none beyond the two additive fields.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata, package, or installation impact: none; no build outputs committed.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: src/application/javascript/JavaScriptArtifactGraphStructure.test.ts (3 tests). The skipped case failed before the fix (expected null to be 'skipped'); the unattempted and parsed controls passed before and after.
  • Base reproduction: the issue's generator script at 5,000,000 bytes. On current main: parsed_javascript_files 0, parse_failures 0, parse_status null. After the fix: parse_status "skipped", skipped_javascript_files 1, and the limitation entry naming the resource constraint is still there. A 4 MB control still parses (parse_status "complete", 25,749 IPC operations).
  • Remaining proof gaps: none for the reporting change. Large-file parsing itself is unchanged by design; the worker heap and checkpoint budgets stay as they are.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npx vitest run src/application/javascript/ — 12 files green (includes the 3 new tests)
  • npx vitest run src/domain/javascript/ — 70 files green
  • npx vitest run tests/boundary/filesystem/javascriptArtifactReconstruction.test.ts — green
  • npm run check:fast — green (typecheck + lint, 0 errors)
  • npm run verify:test-discovery — 1308 test files discovered exactly once
  • Real CLI runs against the built runtime: 5 MB repro before/after, plus a 4 MB control, outputs inspected

Compatibility, safety, and release

  • Breaking changes or migration steps: none. Additive statistics key and observation value.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable (pure JS pipeline change).
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none; no new I/O, no new processes.

Author readiness

Human owner:

  • 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.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 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/3852 **Author:** [@sx4im](https://github.com/sx4im) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@baron](https://github.com/baron) **Base:** `main` ← **Head:** `fix/3670-skipped-parse-status` --- ### 📝 Commits (5) - [`b3802d2`](https://github.com/morluto/rea/commit/b3802d26982c0ee632871677b6dc56cb3f6b0853) fix(javascript): mark resource-skipped files parse_status skipped - [`5302586`](https://github.com/morluto/rea/commit/5302586df07251be1ddfa939d796e1426ca9bce5) fix(javascript): default skipped_javascript_files when reading old saved evidence - [`2a9c41f`](https://github.com/morluto/rea/commit/2a9c41fcf5faaee6225f5a20606c434d7ba5e7f3) fix(javascript): preserve unknown skipped count for legacy evidence - [`b3f0789`](https://github.com/morluto/rea/commit/b3f0789dadbe61f71877deaeb2546fcc37f6873a) Merge branch 'main' of github.com:morluto/rea - [`f531705`](https://github.com/morluto/rea/commit/f531705f8da6cc036dc68bc66fbe57c4ba9af50e) fix(javascript): add required failure scope and status to graph fixture ### 📊 Changes **8 files changed** (+209 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/application/javascript/JavaScriptArtifactAnalysisTypes.ts` (+16 -0) ➕ `src/application/javascript/JavaScriptArtifactGraphStructure.test.ts` (+148 -0) 📝 `src/application/javascript/JavaScriptArtifactGraphStructure.ts` (+5 -1) 📝 `src/application/javascript/JavaScriptArtifactReconstruction.ts` (+8 -1) 📝 `src/contracts/javascript/javascriptExportShapeComparisonExample.ts` (+1 -0) 📝 `src/contracts/javascript/javascriptRuntimeReconciliationExample.ts` (+1 -0) 📝 `src/domain/javascript/javascriptApplicationAnalysis.ts` (+4 -0) 📝 `src/domain/javascript/javascriptApplicationAnalysisSteps.test.ts` (+26 -0) </details> ### 📄 Description ## Summary Fixes #3670. `analyze-javascript-application` skipped JavaScript files above ~5 MB without saying so: the file was inventoried with `text_status: "included"` but never parsed, so its observation showed `parse_status: null`, `parsed_javascript_files` stayed 0, `parse_failures` stayed 0, and the summary read as "nothing there" rather than "not analyzed". ## Problem and expected behavior Two resource walls drop these files. With the default 1024 MB worker heap, the worker runs out of memory during static analysis; with a bigger heap, the static checkpoint (10.2 MB for a 5 MB source) exceeds the 8 MB checkpoint budget. Either way the facts never reach the parent and nothing in the counters recorded the skip. The issue asks for the file to be reported as not analyzed instead. ## Change and scope Reporting only; no parsing behavior changed. - File observations now report `parse_status: "skipped"` for a JavaScript file with included text that produced no facts because its analysis failed. One shared predicate (`isSkippedJavaScriptAnalysis`) backs both this and the counter. - New `statistics.skipped_javascript_files` counter. - The resource-constraint reason keeps surfacing as a limitation entry, as before. ## Contract and boundary impact - Semantic owner and earliest changed stage: JavaScript application graph projection; shared predicate in the artifact-analysis types. - Contribution scope fit and linked maintainer decision: ordinary bug fix within existing boundaries; not applicable. - CLI and MCP/tool-catalog contract: additive only. One new statistics key and one new `parse_status` value inside free-form observation properties; the result schema was extended and the contract examples updated. - Provider, bridge, target-format, or platform compatibility: none. - Evidence, artifact, provenance, or reconstruction contract: none beyond the two additive fields. - Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable. - Generated metadata, package, or installation impact: none; no build outputs committed. Expected effects (check known effects; use documentation-only on its own). Unchecked items do not establish absence; leave uncertainties visible. - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: `src/application/javascript/JavaScriptArtifactGraphStructure.test.ts` (3 tests). The skipped case failed before the fix (`expected null to be 'skipped'`); the unattempted and parsed controls passed before and after. - Base reproduction: the issue's generator script at 5,000,000 bytes. On current main: `parsed_javascript_files` 0, `parse_failures` 0, `parse_status` null. After the fix: `parse_status` "skipped", `skipped_javascript_files` 1, and the limitation entry naming the resource constraint is still there. A 4 MB control still parses (`parse_status` "complete", 25,749 IPC operations). - Remaining proof gaps: none for the reporting change. Large-file parsing itself is unchanged by design; the worker heap and checkpoint budgets stay as they are. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `npx vitest run src/application/javascript/` — 12 files green (includes the 3 new tests) - `npx vitest run src/domain/javascript/` — 70 files green - `npx vitest run tests/boundary/filesystem/javascriptArtifactReconstruction.test.ts` — green - `npm run check:fast` — green (typecheck + lint, 0 errors) - `npm run verify:test-discovery` — 1308 test files discovered exactly once - Real CLI runs against the built runtime: 5 MB repro before/after, plus a 4 MB control, outputs inspected ## Compatibility, safety, and release - Breaking changes or migration steps: none. Additive statistics key and observation value. - Real Hopper/Ghidra, browser, or OS coverage: not applicable (pure JS pipeline change). - Package or release metadata impact: none. - Security, privacy, process, or containment review: none; no new I/O, no new processes. ## Author readiness Human owner: - [x] 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. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:10:39 +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#5947
No description provided.