[GH-ISSUE #1039] [Bug] HTML script references use extension and directory fallbacks #381

Closed
opened 2026-10-15 18:24:28 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @6639835 on GitHub (Oct 8, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/1039

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

An HTML <script src="./app"> is linked to app.js when only app.js is inventoried. The resolver reports a complete resolved relationship even though the declared URL is ./app.

Reproduction

Call resolveArtifactPathByContext with declaredPath: "./app", sourcePath: "index.html", context: "html-reference", and a files map containing index.html and app.js, but no app.

Reproduced with the production resolver; only the import suffix changed from .js to .ts. No packaged CLI/MCP run.

Expected behavior

Match the exact HTML resource path. If only app.js exists, report not-found instead of adding a resolved loads edge.

Impact and scope

This can attach the wrong script asset to an HTML renderer in static application Evidence. CommonJS extension lookup can remain context-specific.

REA version

5.0.0; commit 2bf3663f65.

Runtime and platform

Node.js 26.10.0; macOS arm64.

Target and artifact context

JavaScript/HTML artifact inventory.

Interface

Other

Earliest failure stage

Artifact or evidence registration

Relevant output or evidence

resolution_status: resolved
resolved_path: app.js

Typed outcome or recovery expected

No response

Analysis or suspected cause

No response

Additional context

Resolver source

Originally created by @6639835 on GitHub (Oct 8, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/1039 ### 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 An HTML `<script src="./app">` is linked to `app.js` when only `app.js` is inventoried. The resolver reports a complete resolved relationship even though the declared URL is `./app`. ### Reproduction Call `resolveArtifactPathByContext` with `declaredPath: "./app"`, `sourcePath: "index.html"`, `context: "html-reference"`, and a files map containing `index.html` and `app.js`, but no `app`. Reproduced with the production resolver; only the import suffix changed from .js to .ts. No packaged CLI/MCP run. ### Expected behavior Match the exact HTML resource path. If only `app.js` exists, report `not-found` instead of adding a resolved `loads` edge. ### Impact and scope This can attach the wrong script asset to an HTML renderer in static application Evidence. CommonJS extension lookup can remain context-specific. ### REA version 5.0.0; commit 2bf3663f654386c9fd8c1437c49659df97bd4697. ### Runtime and platform Node.js 26.10.0; macOS arm64. ### Target and artifact context JavaScript/HTML artifact inventory. ### Interface Other ### Earliest failure stage Artifact or evidence registration ### Relevant output or evidence ```text resolution_status: resolved resolved_path: app.js ``` ### Typed outcome or recovery expected _No response_ ### Analysis or suspected cause _No response_ ### Additional context [Resolver source](https://github.com/morluto/rea/blob/2bf3663f654386c9fd8c1437c49659df97bd4697/src/application/javascript/JavaScriptArtifactPathResolution.ts)
bsakaguchi 2026-10-15 18:24:28 +00:00
  • closed this issue
  • added the
    triage
    bug
    labels
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#381
No description provided.