[GH-ISSUE #6535] [Bug] Inspector reports valid script parse failures as invalid protocol data #3925

Closed
opened 2026-10-31 00:45:18 +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/6535

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; runtime not run. During observe_javascript_runtime, a valid Debugger.scriptFailedToParse event increments scripts.excluded.invalid_protocol_value. The same counter handles malformed scriptParsed URL data. When this Evidence enters runtime reconciliation, the counter also adds the entire scripts section to unavailableSections.

A VM failing to compile application source is a valid observation, not invalid Inspector protocol data. The result loses that distinction even though REA explicitly listens for the event.

Reproduction

Actually performed: inspected the production event listener, finalizer, public Evidence service, reconciliation consumer, and official protocol declaration. No runtime, test, CLI, or MCP reproduction was executed.

Concrete proposed check, unexecuted:

  1. Start a caller-owned Node Inspector target that remains running and periodically attempts new vm.Script('const = ;', { filename: 'parse-failure.js' }), catching the syntax error.
  2. Obtain its target ID with list_javascript_runtime_targets.
  3. Invoke observe_javascript_runtime with:
    {"inspector_endpoint":"http://127.0.0.1:9229","target_id":"TARGET_ID","runtime_kind":"node","observation_ms":250}
    
  4. Inspect the resulting exclusion count. For each Debugger.scriptFailedToParse event received, the source deterministically adds one to invalid_protocol_value, irrespective of whether every required event field is valid.
  5. Pass the observation Evidence into reconcile_javascript_runtime with corresponding static application Evidence. The inspected consumer marks scripts unavailable because that count is positive.

NOT_ENOUGH_INFO: live Inspector event delivery, occurrence frequency, and end-to-end output were not measured.

Expected behavior

Keep a script parse-failure count or explicit parse-failure observation separate from malformed-protocol exclusions. A well-formed scriptFailedToParse event should not claim invalid protocol data or cause reconciliation to report protocol-related script unavailability.

REA's passive protocol contract explicitly treats this event as an observed invalid-script count. The official Debugger event describes a VM script parse failure.

Impact and scope

Source-derived scope: any authorized Node/Electron Inspector observation that receives this valid event. It conflates an application syntax failure with malformed observation data and gives reconciliation a false scripts-unavailable reason. The event's distinction is absent from the emitted Evidence.

NOT_ENOUGH_INFO: no live frequency, lost successful script matches, or wider reconciliation result change was established. Successful script items are retained by a separate branch. This is an evidence-classification defect, not a claim that failed scripts were loaded or executed.

REA version

rea-agents 6.7.0 source; inspected baseline 28a33cae8f.

Runtime and platform

Linux x64 source inspection; no REA or Inspector runtime execution. Node.js/provider runtime versions: NOT_ENOUGH_INFO because no runtime reproduction was performed.

Target and artifact context

Caller-owned Node/Electron Inspector target with an ordinary script compilation failure; no private target artifacts.

Interface

MCP

Earliest failure stage

Capture or observation

Relevant output or evidence

No runtime output is claimed. These source references establish the failing path:

Derived delta for one well-formed failure event: events_observed += 1, events_retained += 1, invalid_protocol_value += 1, with no scriptsObserved increment. These are code-derived deltas, not captured output.

Typed outcome or recovery expected

A valid parse-failure event should increase a distinct parse-failure count while leaving invalid_protocol_value unchanged. Restoration signal: supply one well-formed failed-parse event and one malformed parsed-script event; only the latter should increment the invalid-protocol bucket or add its unavailability reason. Preserve the failed-parse observation and existing attach-window limitations.

Analysis or suspected cause

The producer's invalidScripts variable combines two different facts: VM compilation failure and invalid event metadata. Projection gives the combined counter the narrower wire name invalid_protocol_value; the reconciliation consumer relies on that name as an actual observation failure.

The source path is explicit. The proposed live Node fixture remains unexecuted.

Additional context

Open and closed issue searches for scriptFailedToParse returned no matches. Broader Inspector parse and invalid_protocol_value searches found #4376, now closed: it corrects a later conversion of already-invalid protocol observations to target-scope exclusions. It does not separate valid failed-parse events at the producer. #4380 concerns duplicate location-warning counts and is separate.

No fix, provider installation, or GitHub mutation was performed.

Triage assessment

  • Impact level: P2
  • Assessment status: provisional
  • Impact basis: The inspected producer creates a false invalid-protocol fact from a supported valid event, and the inspected consumer consequently marks scripts unavailable. Runtime frequency and effects beyond those classification fields remain unmeasured.
  • Workaround status: unverified
  • Workaround basis: REA exposes no separate failed-parse counter in the inspected result, so the combined count cannot be reliably split from emitted Evidence. Avoiding syntax failures in the target is not an equivalent observation workflow; no practical workaround was verified.
Originally created by @coygeek on GitHub (Oct 23, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/6535 ### 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; runtime not run. During `observe_javascript_runtime`, a valid `Debugger.scriptFailedToParse` event increments `scripts.excluded.invalid_protocol_value`. The same counter handles malformed `scriptParsed` URL data. When this Evidence enters runtime reconciliation, the counter also adds the entire scripts section to `unavailableSections`. A VM failing to compile application source is a valid observation, not invalid Inspector protocol data. The result loses that distinction even though REA explicitly listens for the event. ### Reproduction Actually performed: inspected the production event listener, finalizer, public Evidence service, reconciliation consumer, and official protocol declaration. No runtime, test, CLI, or MCP reproduction was executed. Concrete proposed check, unexecuted: 1. Start a caller-owned Node Inspector target that remains running and periodically attempts `new vm.Script('const = ;', { filename: 'parse-failure.js' })`, catching the syntax error. 2. Obtain its target ID with `list_javascript_runtime_targets`. 3. Invoke `observe_javascript_runtime` with: ```json {"inspector_endpoint":"http://127.0.0.1:9229","target_id":"TARGET_ID","runtime_kind":"node","observation_ms":250} ``` 4. Inspect the resulting exclusion count. For each `Debugger.scriptFailedToParse` event received, the source deterministically adds one to `invalid_protocol_value`, irrespective of whether every required event field is valid. 5. Pass the observation Evidence into `reconcile_javascript_runtime` with corresponding static application Evidence. The inspected consumer marks scripts unavailable because that count is positive. NOT_ENOUGH_INFO: live Inspector event delivery, occurrence frequency, and end-to-end output were not measured. ### Expected behavior Keep a script parse-failure count or explicit parse-failure observation separate from malformed-protocol exclusions. A well-formed `scriptFailedToParse` event should not claim invalid protocol data or cause reconciliation to report protocol-related script unavailability. REA's [passive protocol contract](https://github.com/morluto/rea/blob/28a33cae8f8d4de8e11f7a266ff0d756432ab092/docs/javascript-runtime-observation.md#L103-L114) explicitly treats this event as an observed invalid-script count. The [official Debugger event](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#event-scriptFailedToParse) describes a VM script parse failure. ### Impact and scope Source-derived scope: any authorized Node/Electron Inspector observation that receives this valid event. It conflates an application syntax failure with malformed observation data and gives reconciliation a false scripts-unavailable reason. The event's distinction is absent from the emitted Evidence. NOT_ENOUGH_INFO: no live frequency, lost successful script matches, or wider reconciliation result change was established. Successful script items are retained by a separate branch. This is an evidence-classification defect, not a claim that failed scripts were loaded or executed. ### REA version rea-agents 6.7.0 source; inspected baseline 28a33cae8f8d4de8e11f7a266ff0d756432ab092. ### Runtime and platform Linux x64 source inspection; no REA or Inspector runtime execution. Node.js/provider runtime versions: NOT_ENOUGH_INFO because no runtime reproduction was performed. ### Target and artifact context Caller-owned Node/Electron Inspector target with an ordinary script compilation failure; no private target artifacts. ### Interface MCP ### Earliest failure stage Capture or observation ### Relevant output or evidence No runtime output is claimed. These source references establish the failing path: - [The public observation provider subscribes before enabling Runtime/Debugger](https://github.com/morluto/rea/blob/28a33cae8f8d4de8e11f7a266ff0d756432ab092/src/inspector/V8InspectorProvider.ts#L371-L386). - [Every scriptFailedToParse event increments invalidScripts without inspecting its payload](https://github.com/morluto/rea/blob/28a33cae8f8d4de8e11f7a266ff0d756432ab092/src/inspector/V8InspectorProvider.ts#L597-L637). - [The finalizer exposes that counter as invalid_protocol_value](https://github.com/morluto/rea/blob/28a33cae8f8d4de8e11f7a266ff0d756432ab092/src/inspector/V8InspectorCaptureProjection.ts#L191-L197). - [The public application service validates and retains the report in Evidence](https://github.com/morluto/rea/blob/28a33cae8f8d4de8e11f7a266ff0d756432ab092/src/application/javascript/JavaScriptRuntimeObservationService.ts#L69-L128). - [Reconciliation adds scripts to unavailableSections when this counter is positive](https://github.com/morluto/rea/blob/28a33cae8f8d4de8e11f7a266ff0d756432ab092/src/domain/javascript/javascriptRuntimeReconciliationCaptureParsing.ts#L349-L370) and [preserves its invalid_protocol_value reason](https://github.com/morluto/rea/blob/28a33cae8f8d4de8e11f7a266ff0d756432ab092/src/domain/javascript/javascriptRuntimeReconciliationCaptureParsing.ts#L400-L423). Derived delta for one well-formed failure event: `events_observed += 1`, `events_retained += 1`, `invalid_protocol_value += 1`, with no `scriptsObserved` increment. These are code-derived deltas, not captured output. ### Typed outcome or recovery expected A valid parse-failure event should increase a distinct parse-failure count while leaving `invalid_protocol_value` unchanged. Restoration signal: supply one well-formed failed-parse event and one malformed parsed-script event; only the latter should increment the invalid-protocol bucket or add its unavailability reason. Preserve the failed-parse observation and existing attach-window limitations. ### Analysis or suspected cause The producer's `invalidScripts` variable combines two different facts: VM compilation failure and invalid event metadata. Projection gives the combined counter the narrower wire name `invalid_protocol_value`; the reconciliation consumer relies on that name as an actual observation failure. The source path is explicit. The proposed live Node fixture remains unexecuted. ### Additional context Open and closed issue searches for `scriptFailedToParse` returned no matches. Broader `Inspector parse` and `invalid_protocol_value` searches found [#4376](https://github.com/morluto/rea/issues/4376), now closed: it corrects a later conversion of already-invalid protocol observations to target-scope exclusions. It does not separate valid failed-parse events at the producer. [#4380](https://github.com/morluto/rea/issues/4380) concerns duplicate location-warning counts and is separate. No fix, provider installation, or GitHub mutation was performed. ## Triage assessment - Impact level: P2 - Assessment status: provisional - Impact basis: The inspected producer creates a false invalid-protocol fact from a supported valid event, and the inspected consumer consequently marks scripts unavailable. Runtime frequency and effects beyond those classification fields remain unmeasured. - Workaround status: unverified - Workaround basis: REA exposes no separate failed-parse counter in the inspected result, so the combined count cannot be reliably split from emitted Evidence. Avoiding syntax failures in the target is not an equivalent observation workflow; no practical workaround was verified.
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#3925
No description provided.