← Back to Pull requests

fix(javascript): report JSON status for imported package manifests #1740

Closed
unknown closed this pull request without merging on Oct 11, 2026 09:07 UTC
View on GitHub
unknown unknown commented on Oct 11, 2026 06:50 UTC
Author

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.
  • Diff: 380 lines (+285 / -95) across 4 files Reviewer: immanuwell Review duration: 137m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 380 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.356
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1740"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.9% (MEDIUM) · Higher = larger blast radius
    42.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.0% · Safe to merge
    17.0%
    Repository