[GH-ISSUE #6546] [Bug] Inspector drops file-URL suffixes and merges distinct ESM loads #3938

Closed
opened 2026-10-31 00:45:24 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @coygeek on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/6546

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Process capture or runtime observation

Observed behavior

Source-only finding; no Inspector runtime reproduction was performed. Successful observe_javascript_runtime projection discards the query and fragment of a file-backed script URL. Two ordinary Node ESM loads of the same source file with different URL suffixes consequently receive one script key when their context, source hash, length and module classification match. Map.set retains one script item, and neither original URL remains in that item.

Reproduction

Actually performed: inspected the release capture, authorization and projection path; established main presence and unchanged projection code; checked Node's ESM contract and compilation/event-producer sources. Searched the downloaded open-issue inventory and open/closed GitHub issues for Inspector/query, runtime/fragment/file, Inspector/ESM and Inspector/deduplication. No application, Inspector target, REA command or protocol fixture was executed.

Proposed supported-input recipe, unexecuted: create ordinary readable regular files main.mjs and dep.mjs in an isolated directory, with these contents:

// main.mjs
import "./dep.mjs?instance=1#first";
import "./dep.mjs?instance=2#second";
setInterval(() => {}, 1000);

// dep.mjs
export const identity = import.meta.url;

Start the caller-owned program with node --inspect=127.0.0.1:9229 main.mjs, obtain its target ID with list_javascript_runtime_targets, then request observe_javascript_runtime with {"inspector_endpoint":"http://127.0.0.1:9229","target_id":"DISCOVERED_ID","runtime_kind":"node","observation_ms":100} using the discovered ID.

Source-derived check: for two retained Debugger.scriptParsed events whose URLs differ only by those suffixes and whose remaining metadata matches, the finalizer emits one script item with the canonical filesystem path. Both events can remain included in observed_total; the lost URL distinction is not an exclusion or budget omission.

NOT_ENOUGH_INFO: live event delivery, garbage-collection effects, capture frequency and end-to-end output were not measured. The recipe is proposed, not executed.

Expected behavior

Keep the reported URL identity, including its query and fragment, separately from the filesystem path used to validate the backing file. Distinct supported ESM module URLs should remain distinguishable in script observations.

Node's file-URL contract says different query or fragment specifiers load modules separately. REA's repository instructions require preserving URLs and source values when normalization loses information. This is an identity-preservation issue, not a request for require/import caller edges or script source capture.

Impact and scope

The source-derived scope is successful file-backed Inspector observations with meaningful URL suffixes, including the concrete standard ESM input. Single-script observations lose their suffix facts; equal-source module instances can additionally merge. This removes evidence distinguishing separate module loads and leaves callers unable to recover their original URLs from the emitted script items.

P2 is provisional because runtime triggering and downstream consequences were not measured. A practical workaround preserving the same module identities was not demonstrated; changing module filenames changes the target being observed.

REA version

Latest published rea-agents 6.7.0 source: 27dc42d10249f0410904a75c0997842eb03b931c. Main presence established at 1635eadfcc49bbb80178838ab74667c2981de383.

Runtime and platform

Source inspection on Linux x86_64 with Node.js v26.12.1. Node ESM behavior was checked against official documentation and pinned Node v24.18.0 compiler/Inspector sources. NOT_ENOUGH_INFO: no target runtime or Inspector version was exercised.

Target and artifact context

An ordinary caller-owned Node ESM application with a readable regular entry point and two query/fragment-qualified imports of the same readable local module, in one execution context. No external provider or private artifact is needed.

Interface

MCP

Earliest failure stage

Capture or observation

Relevant output or evidence

No executed REA output is claimed. The complete source path is:

The two small ordinary metadata events need no artificial timing, invalid protocol values, custom loader or exceeded budget. Once retained, identical reduced locations and metadata deterministically produce the same key; the original URL difference is irretrievably absent from the result.

Additional context

Related reports have distinct causes: #5872 rejects encoded separators in suffixes before observation; this input uses plain suffixes and is admitted. #4380 concerns a partial-capture warning count for identical drafts, while this report concerns distinct URL identities lost in successful captures. #3916 concerns static import resolution rather than Inspector script projection.

Triage assessment

  • Impact level: P2
  • Assessment status: provisional
  • Impact basis: Successful Inspector projection deterministically discards valid file-URL suffix facts and merges equal-source observations distinguished by those facts; the concrete ESM producer path is supported by source, but live delivery and downstream consequences were not measured.
  • Workaround status: unverified
  • Workaround basis: No practical observation path preserving the original ESM module identities was demonstrated; changing filenames would alter the observed input.
Originally created by @coygeek on GitHub (Oct 23, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/6546 ### 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 Process capture or runtime observation ### Observed behavior Source-only finding; no Inspector runtime reproduction was performed. Successful `observe_javascript_runtime` projection discards the query and fragment of a file-backed script URL. Two ordinary Node ESM loads of the same source file with different URL suffixes consequently receive one script key when their context, source hash, length and module classification match. `Map.set` retains one script item, and neither original URL remains in that item. ### Reproduction Actually performed: inspected the release capture, authorization and projection path; established main presence and unchanged projection code; checked Node's ESM contract and compilation/event-producer sources. Searched the downloaded open-issue inventory and open/closed GitHub issues for Inspector/query, runtime/fragment/file, Inspector/ESM and Inspector/deduplication. No application, Inspector target, REA command or protocol fixture was executed. Proposed supported-input recipe, unexecuted: create ordinary readable regular files `main.mjs` and `dep.mjs` in an isolated directory, with these contents: ```js // main.mjs import "./dep.mjs?instance=1#first"; import "./dep.mjs?instance=2#second"; setInterval(() => {}, 1000); // dep.mjs export const identity = import.meta.url; ``` Start the caller-owned program with `node --inspect=127.0.0.1:9229 main.mjs`, obtain its target ID with `list_javascript_runtime_targets`, then request `observe_javascript_runtime` with `{"inspector_endpoint":"http://127.0.0.1:9229","target_id":"DISCOVERED_ID","runtime_kind":"node","observation_ms":100}` using the discovered ID. Source-derived check: for two retained `Debugger.scriptParsed` events whose URLs differ only by those suffixes and whose remaining metadata matches, the finalizer emits one script item with the canonical filesystem path. Both events can remain included in `observed_total`; the lost URL distinction is not an exclusion or budget omission. NOT_ENOUGH_INFO: live event delivery, garbage-collection effects, capture frequency and end-to-end output were not measured. The recipe is proposed, not executed. ### Expected behavior Keep the reported URL identity, including its query and fragment, separately from the filesystem path used to validate the backing file. Distinct supported ESM module URLs should remain distinguishable in script observations. [Node's file-URL contract](https://nodejs.org/api/esm.html#file-urls) says different query or fragment specifiers load modules separately. REA's repository instructions require preserving URLs and source values when normalization loses information. This is an identity-preservation issue, not a request for require/import caller edges or script source capture. ### Impact and scope The source-derived scope is successful file-backed Inspector observations with meaningful URL suffixes, including the concrete standard ESM input. Single-script observations lose their suffix facts; equal-source module instances can additionally merge. This removes evidence distinguishing separate module loads and leaves callers unable to recover their original URLs from the emitted script items. P2 is provisional because runtime triggering and downstream consequences were not measured. A practical workaround preserving the same module identities was not demonstrated; changing module filenames changes the target being observed. ### REA version Latest published rea-agents 6.7.0 source: `27dc42d10249f0410904a75c0997842eb03b931c`. Main presence established at `1635eadfcc49bbb80178838ab74667c2981de383`. ### Runtime and platform Source inspection on Linux x86_64 with Node.js v26.12.1. Node ESM behavior was checked against official documentation and pinned Node v24.18.0 compiler/Inspector sources. NOT_ENOUGH_INFO: no target runtime or Inspector version was exercised. ### Target and artifact context An ordinary caller-owned Node ESM application with a readable regular entry point and two query/fragment-qualified imports of the same readable local module, in one execution context. No external provider or private artifact is needed. ### Interface MCP ### Earliest failure stage Capture or observation ### Relevant output or evidence No executed REA output is claimed. The complete source path is: - A discovered unattached or attachment-unknown Node target with its validated same-port WebSocket passes the normal guards: [release admission](https://github.com/morluto/rea/blob/27dc42d10249f0410904a75c0997842eb03b931c/src/inspector/V8InspectorProvider.ts#L359-L399), [main admission](https://github.com/morluto/rea/blob/1635eadfcc49bbb80178838ab74667c2981de383/src/inspector/V8InspectorProvider.ts#L518-L565). - The listener is installed before Debugger enable, and ingestion retains each URL as `rawUrl`: [release capture](https://github.com/morluto/rea/blob/27dc42d10249f0410904a75c0997842eb03b931c/src/inspector/V8InspectorProvider.ts#L180-L205), [release ingestion](https://github.com/morluto/rea/blob/27dc42d10249f0410904a75c0997842eb03b931c/src/inspector/V8InspectorProvider.ts#L453-L472), [main ingestion](https://github.com/morluto/rea/blob/1635eadfcc49bbb80178838ab74667c2981de383/src/inspector/V8InspectorProvider.ts#L619-L638). - Existing hostless file URLs without rejected encoded separators pass file admission. `fileURLToPath`, stat and realpath produce only a canonical path, and the runtime scope returns only that path: [release file helper](https://github.com/morluto/rea/blob/27dc42d10249f0410904a75c0997842eb03b931c/src/browser/ElectronFileScope.ts#L12-L47), [release scope](https://github.com/morluto/rea/blob/27dc42d10249f0410904a75c0997842eb03b931c/src/inspector/JavaScriptRuntimeScope.ts#L45-L57), [main helper](https://github.com/morluto/rea/blob/1635eadfcc49bbb80178838ab74667c2981de383/src/browser/ElectronFileScope.ts#L117-L165), [main scope](https://github.com/morluto/rea/blob/1635eadfcc49bbb80178838ab74667c2981de383/src/inspector/JavaScriptRuntimeScope.ts#L52-L73). - `scriptFromDraft` hashes the reduced location and metadata while omitting `rawUrl`; finalization stores scripts by that key: [release key](https://github.com/morluto/rea/blob/27dc42d10249f0410904a75c0997842eb03b931c/src/inspector/V8InspectorCaptureProjection.ts#L238-L257), [release merge](https://github.com/morluto/rea/blob/27dc42d10249f0410904a75c0997842eb03b931c/src/inspector/V8InspectorCaptureProjection.ts#L128-L145). The projection file is unchanged on [main](https://github.com/morluto/rea/blob/1635eadfcc49bbb80178838ab74667c2981de383/src/inspector/V8InspectorCaptureProjection.ts#L238-L257). - Node passes the module URL as the compilation origin: [Node v24.18.0 compiler](https://github.com/nodejs/node/blob/v24.18.0/src/module_wrap.cc#L459-L479). V8 forwards the script URL, source hash and metadata through its event producer: [scriptParsed emission](https://github.com/nodejs/node/blob/v24.18.0/deps/v8/src/inspector/v8-debugger-agent-impl.cc#L1934-L1942). The two small ordinary metadata events need no artificial timing, invalid protocol values, custom loader or exceeded budget. Once retained, identical reduced locations and metadata deterministically produce the same key; the original URL difference is irretrievably absent from the result. ### Additional context Related reports have distinct causes: [#5872](https://github.com/morluto/rea/issues/5872) rejects encoded separators in suffixes before observation; this input uses plain suffixes and is admitted. [#4380](https://github.com/morluto/rea/issues/4380) concerns a partial-capture warning count for identical drafts, while this report concerns distinct URL identities lost in successful captures. [#3916](https://github.com/morluto/rea/issues/3916) concerns static import resolution rather than Inspector script projection. ## Triage assessment - Impact level: P2 - Assessment status: provisional - Impact basis: Successful Inspector projection deterministically discards valid file-URL suffix facts and merges equal-source observations distinguished by those facts; the concrete ESM producer path is supported by source, but live delivery and downstream consequences were not measured. - Workaround status: unverified - Workaround basis: No practical observation path preserving the original ESM module identities was demonstrated; changing filenames would alter the observed input.
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#3938
No description provided.