[PR #1423] [MERGED] fix(javascript)!: avoid endpoint payload copies in graph metadata #2875

Closed
opened 2026-10-17 21:11:18 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1423
Author: @N0zoM1z0
Created: 10/10/2026
Status: ✅ Merged
Merged: 10/10/2026
Merged by: @N0zoM1z0

Base: main ← Head: fix/javascript-endpoint-payload-metadata


📝 Commits (1)

  • 399149d fix(javascript)!: avoid endpoint payload copies in graph metadata

📊 Changes

4 files changed (+295 additions, -7 deletions)

View changed files

📝 docs/javascript-application-workflows.md (+14 -0)
📝 src/application/javascript/JavaScriptArtifactGraphFindings.ts (+13 -6)
📝 src/application/javascript/JavaScriptSemanticGraphDataProjection.ts (+5 -1)
➕ tests/acceptance/applications/javascriptEndpointPayload.test.ts (+263 -0)

📄 Description

A long static fetch() endpoint was copied into the artifact graph's identity key and label and the semantic request label, in addition to its two complete observation/property representations. Large endpoints could therefore exhaust the default MCP response budget before any useful analysis reached the caller.

Keep exact values, source identities, locations, and graph relationships. Use canonical JSON string digests for long endpoint keys and reserve the digest prefix to prevent collisions with caller values. Choose shorter descriptive endpoint/method labels. Exact value search, semantic tracing, and unique-only version pairing continue to use the complete properties.

On the same 150,024-character endpoint fixture, redirected CLI JSON fell from 774,402 to 324,428 bytes (58.1%), retaining all four artifact nodes and five semantic nodes. This compares against 4d8ef3f3, which already includes compact CLI JSON; it measures serialized output, not model-host token billing.

Migration: New analyses change hashed endpoint IDs and longer endpoint labels. Use IDs from the selected parent graph and read endpoint values from observation properties.value or semantic properties.endpoint. Previously stored Evidence and its original node IDs remain accepted; real stdio MCP verified legacy node-ID tracing and old/new semantic-key pairing. Documented in the JavaScript workflow guide. No schema or tool inventory changes.

Verification:

  • Real compiled CLI/stdio MCP acceptance journey with a near-million-character Unicode endpoint, complete text/structured Evidence parity, reserved-prefix collision, distinct UTF-16 strings, repeated endpoint grouping, exact endpoint tracing, version comparison, and follow-up ping.
  • 67 adjacent graph/query/version tests passed; acceptance journey passed (68 tests total).
  • npm run check:fast and npm run verify:test-discovery passed.
  • Public stdio MCP probes passed on Node 24.18.0 and 22.22.2, including original stored Evidence, node-ID tracing, and old/new graph comparison.
  • Real Hopper/Ghidra verification: not applicable; this changes static JavaScript projections only.

Partial follow-up to #723; its broader client-consumption investigation remains open.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/1423 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/10/2026 **Status:** ✅ Merged **Merged:** 10/10/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/javascript-endpoint-payload-metadata` --- ### 📝 Commits (1) - [`399149d`](https://github.com/morluto/rea/commit/399149de6fcc0f9309efd691e7b4f5b616d76f65) fix(javascript)!: avoid endpoint payload copies in graph metadata ### 📊 Changes **4 files changed** (+295 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `docs/javascript-application-workflows.md` (+14 -0) 📝 `src/application/javascript/JavaScriptArtifactGraphFindings.ts` (+13 -6) 📝 `src/application/javascript/JavaScriptSemanticGraphDataProjection.ts` (+5 -1) ➕ `tests/acceptance/applications/javascriptEndpointPayload.test.ts` (+263 -0) </details> ### 📄 Description A long static `fetch()` endpoint was copied into the artifact graph's identity key and label and the semantic request label, in addition to its two complete observation/property representations. Large endpoints could therefore exhaust the default MCP response budget before any useful analysis reached the caller. Keep exact values, source identities, locations, and graph relationships. Use canonical JSON string digests for long endpoint keys and reserve the digest prefix to prevent collisions with caller values. Choose shorter descriptive endpoint/method labels. Exact value search, semantic tracing, and unique-only version pairing continue to use the complete properties. On the same 150,024-character endpoint fixture, redirected CLI JSON fell from **774,402 to 324,428 bytes (58.1%)**, retaining all four artifact nodes and five semantic nodes. This compares against `4d8ef3f3`, which already includes compact CLI JSON; it measures serialized output, not model-host token billing. **Migration:** New analyses change hashed endpoint IDs and longer endpoint labels. Use IDs from the selected parent graph and read endpoint values from observation `properties.value` or semantic `properties.endpoint`. Previously stored Evidence and its original node IDs remain accepted; real stdio MCP verified legacy node-ID tracing and old/new semantic-key pairing. Documented in the JavaScript workflow guide. No schema or tool inventory changes. Verification: - Real compiled CLI/stdio MCP acceptance journey with a near-million-character Unicode endpoint, complete text/structured Evidence parity, reserved-prefix collision, distinct UTF-16 strings, repeated endpoint grouping, exact endpoint tracing, version comparison, and follow-up ping. - 67 adjacent graph/query/version tests passed; acceptance journey passed (68 tests total). - `npm run check:fast` and `npm run verify:test-discovery` passed. - Public stdio MCP probes passed on Node 24.18.0 and 22.22.2, including original stored Evidence, node-ID tracing, and old/new graph comparison. - Real Hopper/Ghidra verification: not applicable; this changes static JavaScript projections only. Partial follow-up to #723; its broader client-consumption investigation remains open. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:11:18 +00:00
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#2875
No description provided.