[GH-ISSUE #5955] [Docs] Canonical JavaScript application example has incorrect analysis counters #3625

Closed
opened 2026-10-31 00:42:30 +00:00 by bsakaguchi · 1 comment
Owner

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

Before submitting

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

Documentation location

The canonical inline JavaScript application Evidence example in javascriptRuntimeReconciliationExample.ts, used by the runtime-reconciliation contract and application workflow examples.

Problem

The example's source artifact contains export const example = true;\n, but its analysis statistics report visited_ast_nodes: 1 and findings: 0. Running the public analyzer on a directory containing only renderer.js with those exact bytes produces visited_ast_nodes: 7 and findings: 1.

Both records report one parsed JavaScript file, 29 text bytes read, no skipped files and no parse failures. Readers inspecting the canonical example therefore see counters inconsistent with the producer for the example's own source.

This is a documentation example discrepancy. The public analyzer returned the correct counts. The full inline example is not exposed in the current advertised MCP input schemas.

Expected content

Use statistics consistent with the source: at this revision, 7 visited AST nodes and 1 finding. If the record is intended only as a schematic shape, explain that its counters are illustrative rather than presenting them as completed analysis statistics for these bytes.

The producer increments the visit count for each entered AST node and includes module links in the application findings count.

Supporting evidence

Executed the built public CLI at source revision 52415975942a4b9c53a817915b313ccc404f280e (package 6.7.0), using a directory containing only renderer.js with the exact source above:

node scripts/rea.mjs analyze-javascript-application "$application_directory" --json

The command exited 0. Its normalized_result.statistics contained:

{
  "relevant_files": 1,
  "text_bytes_read": 29,
  "parsed_javascript_files": 1,
  "skipped_javascript_files": 0,
  "visited_ast_nodes": 7,
  "findings": 1,
  "modules": 0,
  "parse_failures": 0
}

Importing JAVASCRIPT_APPLICATION_EVIDENCE_EXAMPLE from the built contract module returned 1 and 0 for the two disputed counters, matching the hard-coded source values. The source bytes are defined here.

Runtime: Node v26.12.0, macOS 27.0.1 arm64. No browser, Electron process or native analysis provider was used. The repository-pinned Node 24.18.0 was not separately exercised.

Additional context

Impact is limited to the canonical example's accuracy (P3). No live analysis failure or downstream consumer malfunction was observed. modules: 0 agrees with the actual output and does not need correction.

The advertisement projection omits inline-only Evidence examples or replaces embedded Evidence with retained references. Executing it on the affected contracts returned no reconciliation example and reference-based trace/comparison examples without these counters. This report concerns the canonical source example, not incorrect statistics in tools/list.

Fetched upstream main at 25e1a24a3ed3671a0148757555f18d16c29d936a; the relevant example, producer and advertisement source was unchanged from the tested revision. This is a source freshness check, not a separate runtime run at that newer revision.

Originally created by @coygeek on GitHub (Oct 21, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/5955 ### Before submitting - [x] I searched the existing issues for a related documentation report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Documentation location The canonical inline JavaScript application Evidence example in [javascriptRuntimeReconciliationExample.ts](https://github.com/morluto/rea/blob/52415975942a4b9c53a817915b313ccc404f280e/src/contracts/javascript/javascriptRuntimeReconciliationExample.ts#L119-L178), used by the [runtime-reconciliation contract](https://github.com/morluto/rea/blob/52415975942a4b9c53a817915b313ccc404f280e/src/contracts/javascript/electronToolContracts.ts#L133-L137) and [application workflow examples](https://github.com/morluto/rea/blob/52415975942a4b9c53a817915b313ccc404f280e/src/contracts/javascript/javascriptApplicationWorkflowExamples.ts#L57-L68). ### Problem The example's source artifact contains `export const example = true;\n`, but its analysis statistics report `visited_ast_nodes: 1` and `findings: 0`. Running the public analyzer on a directory containing only `renderer.js` with those exact bytes produces `visited_ast_nodes: 7` and `findings: 1`. Both records report one parsed JavaScript file, 29 text bytes read, no skipped files and no parse failures. Readers inspecting the canonical example therefore see counters inconsistent with the producer for the example's own source. This is a documentation example discrepancy. The public analyzer returned the correct counts. The full inline example is not exposed in the current advertised MCP input schemas. ### Expected content Use statistics consistent with the source: at this revision, 7 visited AST nodes and 1 finding. If the record is intended only as a schematic shape, explain that its counters are illustrative rather than presenting them as completed analysis statistics for these bytes. The producer [increments the visit count for each entered AST node](https://github.com/morluto/rea/blob/52415975942a4b9c53a817915b313ccc404f280e/src/domain/javascript/javascriptStaticAnalysis.ts#L138-L149) and [includes module links in the application findings count](https://github.com/morluto/rea/blob/52415975942a4b9c53a817915b313ccc404f280e/src/application/javascript/JavaScriptArtifactAnalysis.ts#L227-L235). ### Supporting evidence Executed the built public CLI at source revision `52415975942a4b9c53a817915b313ccc404f280e` (package 6.7.0), using a directory containing only `renderer.js` with the exact source above: ```sh node scripts/rea.mjs analyze-javascript-application "$application_directory" --json ``` The command exited 0. Its `normalized_result.statistics` contained: ```json { "relevant_files": 1, "text_bytes_read": 29, "parsed_javascript_files": 1, "skipped_javascript_files": 0, "visited_ast_nodes": 7, "findings": 1, "modules": 0, "parse_failures": 0 } ``` Importing `JAVASCRIPT_APPLICATION_EVIDENCE_EXAMPLE` from the built contract module returned 1 and 0 for the two disputed counters, matching the [hard-coded source values](https://github.com/morluto/rea/blob/52415975942a4b9c53a817915b313ccc404f280e/src/contracts/javascript/javascriptRuntimeReconciliationExample.ts#L163-L174). The [source bytes are defined here](https://github.com/morluto/rea/blob/52415975942a4b9c53a817915b313ccc404f280e/src/contracts/javascript/javascriptRuntimeReconciliationExample.ts#L15-L18). Runtime: Node v26.12.0, macOS 27.0.1 arm64. No browser, Electron process or native analysis provider was used. The repository-pinned Node 24.18.0 was not separately exercised. ### Additional context Impact is limited to the canonical example's accuracy (P3). No live analysis failure or downstream consumer malfunction was observed. `modules: 0` agrees with the actual output and does not need correction. The [advertisement projection](https://github.com/morluto/rea/blob/52415975942a4b9c53a817915b313ccc404f280e/src/contracts/advertisedInputExamples.ts#L54-L75) omits inline-only Evidence examples or replaces embedded Evidence with retained references. Executing it on the affected contracts returned no reconciliation example and reference-based trace/comparison examples without these counters. This report concerns the canonical source example, not incorrect statistics in `tools/list`. Fetched upstream main at `25e1a24a3ed3671a0148757555f18d16c29d936a`; the relevant example, producer and advertisement source was unchanged from the tested revision. This is a source freshness check, not a separate runtime run at that newer revision.
Author
Owner

@coygeek commented on GitHub (Oct 24, 2026):

Verified resolved on main at d87e73f2db.

The canonical example now reports visited_ast_nodes: 7 and findings: 1. I rebuilt this revision, analyzed a directory containing only renderer.js with the exact export const example = true;\n bytes, and compared the public CLI's complete normalized_result.statistics with the exported canonical example. The statistics match, including one parsed file, 29 text bytes, seven AST nodes, one finding, and no parse failures.

This verifies the example discrepancy reported here; no browser or native provider was involved. Closing as completed on main.

<!-- gh-comment-id:6380612947 --> @coygeek commented on GitHub (Oct 24, 2026): Verified resolved on `main` at d87e73f2db50be72d33a4b3c7199af35518b441c. The [canonical example now reports `visited_ast_nodes: 7` and `findings: 1`](https://github.com/morluto/rea/blob/d87e73f2db50be72d33a4b3c7199af35518b441c/src/contracts/javascript/javascriptRuntimeReconciliationExample.ts#L163-L175). I rebuilt this revision, analyzed a directory containing only `renderer.js` with the exact `export const example = true;\n` bytes, and compared the public CLI's complete `normalized_result.statistics` with the exported canonical example. The statistics match, including one parsed file, 29 text bytes, seven AST nodes, one finding, and no parse failures. This verifies the example discrepancy reported here; no browser or native provider was involved. Closing as completed on main.
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#3625
No description provided.