[PR #1740] [MERGED] fix(javascript): report JSON status for imported package manifests #4787

Closed
opened 2026-10-31 00:55:03 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1740
Author: @immanuwell
Created: 10/11/2026
Status: ✅ Merged
Merged: 10/11/2026
Merged by: @N0zoM1z0

Base: main ← Head: fix/package-json-import-status


📝 Commits (1)

  • 1b9e4c2 fix(javascript): report JSON status for imported package manifests

📊 Changes

3 files changed (+178 additions, -2 deletions)

View changed files

📝 src/application/javascript/JavaScriptModuleRelationships.ts (+3 -1)
➕ tests/acceptance/applications/packageJsonImports.test.ts (+105 -0)
📝 tests/boundary/javascript/javascriptApplicationCancellation.test.ts (+70 -1)

📄 Description

Summary

Report JSON availability for imported package manifests. No matching issue found after searching issues and PRs.

Problem and expected behavior

require("./package.json").version resolves, but its import edge has target_json_status: null. Valid JSON should report included, just like other JSON imports.

Repro from a built checkout:

repro_dir=$(mktemp -d)
printf '%s' '{"name":"demo","version":"1.0.0"}' > "$repro_dir/package.json"
printf '%s' 'const version = require("./package.json").version;' > "$repro_dir/main.cjs"
node scripts/rea.mjs analyze-javascript-application "$repro_dir" --json
rm -r "$repro_dir"

Change and scope

The existing jsonStatus checker already does the job. Use it for package-json targets too.

Contract and boundary impact

  • Semantic owner and earliest changed stage: module relationship properties.
  • CLI and MCP/tool-catalog contract: existing result field corrected; schemas unchanged.
  • Provider, bridge, target-format, or platform compatibility: unchanged.
  • Evidence, artifact, provenance, or reconstruction contract: JSON status populated; artifact identities and provenance preserved.
  • Process execution, authorization, cleanup, or containment impact: none.
  • Generated metadata, package, or installation impact: none.

Evidence and regression coverage

  • Tests added: packageJsonImports.test.ts, using compiled CLI and stdio MCP. Covers valid/malformed/unavailable manifests, ordinary JSON, and JavaScript imports. Native Node confirms the valid manifest is readable.

  • Base reproduction: both new workflow tests failed on e36c82be with null instead of included.

  • User-visible output: in normalized_result.graph.edges, the manifest import now reports included, invalid, or unavailable.

  • Remaining proof gaps: macOS and Windows not run.

  • 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

  • npm run test:focused for packageJsonImports, packageSubpathsCli, applicationManifestRoots, and javascriptModuleRelationships: 10 passed.
  • npm run check: passed.
  • npm run verify:test-discovery: passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: Linux, Node 24.18.0; static source workflow needs no engine or browser.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no changes.

Review checklist

  • This PR addresses a concrete problem.
  • One focused outcome; conventional title.
  • Related work searched; no matching issue found.
  • Tests cover changed behavior and failure paths.
  • No docs, schema, or generated metadata changes needed.
  • Representative CLI/MCP output described above.
  • Final diff checked for secrets, unrelated changes, 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/1740 **Author:** [@immanuwell](https://github.com/immanuwell) **Created:** 10/11/2026 **Status:** ✅ Merged **Merged:** 10/11/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/package-json-import-status` --- ### 📝 Commits (1) - [`1b9e4c2`](https://github.com/morluto/rea/commit/1b9e4c2109effcc57bd0e5962547ed03b35e3d35) fix(javascript): report JSON status for imported package manifests ### 📊 Changes **3 files changed** (+178 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/application/javascript/JavaScriptModuleRelationships.ts` (+3 -1) ➕ `tests/acceptance/applications/packageJsonImports.test.ts` (+105 -0) 📝 `tests/boundary/javascript/javascriptApplicationCancellation.test.ts` (+70 -1) </details> ### 📄 Description ## Summary Report JSON availability for imported package manifests. No matching issue found after searching issues and PRs. ## Problem and expected behavior `require("./package.json").version` resolves, but its import edge has `target_json_status: null`. Valid JSON should report `included`, just like other JSON imports. Repro from a built checkout: ```sh repro_dir=$(mktemp -d) printf '%s' '{"name":"demo","version":"1.0.0"}' > "$repro_dir/package.json" printf '%s' 'const version = require("./package.json").version;' > "$repro_dir/main.cjs" node scripts/rea.mjs analyze-javascript-application "$repro_dir" --json rm -r "$repro_dir" ``` ## Change and scope The existing `jsonStatus` checker already does the job. Use it for `package-json` targets too. ## Contract and boundary impact - Semantic owner and earliest changed stage: module relationship properties. - CLI and MCP/tool-catalog contract: existing result field corrected; schemas unchanged. - Provider, bridge, target-format, or platform compatibility: unchanged. - Evidence, artifact, provenance, or reconstruction contract: JSON status populated; artifact identities and provenance preserved. - Process execution, authorization, cleanup, or containment impact: none. - Generated metadata, package, or installation impact: none. ## Evidence and regression coverage - Tests added: `packageJsonImports.test.ts`, using compiled CLI and stdio MCP. Covers valid/malformed/unavailable manifests, ordinary JSON, and JavaScript imports. Native Node confirms the valid manifest is readable. - Base reproduction: both new workflow tests failed on `e36c82be` with `null` instead of `included`. - User-visible output: in `normalized_result.graph.edges`, the manifest import now reports `included`, `invalid`, or `unavailable`. - Remaining proof gaps: macOS and Windows not run. - [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 - `npm run test:focused` for packageJsonImports, packageSubpathsCli, applicationManifestRoots, and javascriptModuleRelationships: 10 passed. - `npm run check`: passed. - `npm run verify:test-discovery`: passed. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: Linux, Node 24.18.0; static source workflow needs no engine or browser. - Package or release metadata impact: none. - Security, privacy, process, or containment review: no changes. ## Review checklist - [x] This PR addresses a concrete problem. - [x] One focused outcome; conventional title. - [x] Related work searched; no matching issue found. - [x] Tests cover changed behavior and failure paths. - [x] No docs, schema, or generated metadata changes needed. - [x] Representative CLI/MCP output described above. - [x] Final diff checked for secrets, unrelated changes, 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 00:55:03 +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#4787
No description provided.