[PR #1427] [MERGED] fix(javascript)!: avoid event payload copies in graph metadata #2879

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

📋 Pull Request Information

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

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


📝 Commits (1)

  • cf1289c fix(javascript)!: avoid event payload copies in graph metadata

📊 Changes

5 files changed (+196 additions, -12 deletions)

View changed files

📝 docs/javascript-application-workflows.md (+10 -0)
📝 src/application/javascript/JavaScriptArtifactGraphFindings.ts (+2 -9)
📝 src/application/javascript/JavaScriptSemanticGraphAsyncProjection.ts (+10 -3)
➕ src/domain/compactStringIdentity.ts (+10 -0)
➕ tests/acceptance/applications/javascriptEventPayload.test.ts (+164 -0)

📄 Description

Long EventEmitter names were copied into the event identity and display labels as well as the complete event/listener properties. Keep the exact properties and emitter-scoped registration/removal/dispatch graph, while using compact canonical string identities and shorter display labels. Share the existing endpoint identity rule so reserved-prefix and UTF-16 behavior has one owner.

On an inert static fixture with a 150,000-character name, redirected CLI JSON fell from 804,522 to 354,612 bytes (55.9%), preserving all 21 semantic nodes and ten relations. These are serialized-output measurements, not model-host token billing.

Migration: New analyses change hashed event IDs and longer event/listener labels. Select IDs from the parent graph or query the exact properties.event_name. Stored Evidence and its original semantic-node IDs remain valid; real stdio MCP verified legacy node-ID tracing. Dynamic names retain null and explicit uncertainty. The workflow guide documents this change; no schema or tool inventory changes.

Verification:

  • Real compiled CLI/stdio MCP acceptance with a large Unicode name, complete text/structured Evidence parity, repeated registration/dispatch/removal grouping, emitter isolation, reserved-prefix lookalike, unresolved dynamic name, exact event/listener seeds, and follow-up ping.
  • Endpoint acceptance and 33 adjacent async/empty-value cases passed alongside the new acceptance journey (35 tests).
  • 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 legacy original semantic-node IDs and complete event/listener values.
  • Real Hopper/Ghidra verification: not applicable; static JavaScript projection only.

Follows #1423; partial follow-up to #723, which remains open for broader client consumption work.


🔄 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/1427 **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-event-payload-metadata` --- ### 📝 Commits (1) - [`cf1289c`](https://github.com/morluto/rea/commit/cf1289cce54f4d23d1d2538cfa1df2da0cd1a99b) fix(javascript)!: avoid event payload copies in graph metadata ### 📊 Changes **5 files changed** (+196 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `docs/javascript-application-workflows.md` (+10 -0) 📝 `src/application/javascript/JavaScriptArtifactGraphFindings.ts` (+2 -9) 📝 `src/application/javascript/JavaScriptSemanticGraphAsyncProjection.ts` (+10 -3) ➕ `src/domain/compactStringIdentity.ts` (+10 -0) ➕ `tests/acceptance/applications/javascriptEventPayload.test.ts` (+164 -0) </details> ### 📄 Description Long EventEmitter names were copied into the event identity and display labels as well as the complete event/listener properties. Keep the exact properties and emitter-scoped registration/removal/dispatch graph, while using compact canonical string identities and shorter display labels. Share the existing endpoint identity rule so reserved-prefix and UTF-16 behavior has one owner. On an inert static fixture with a 150,000-character name, redirected CLI JSON fell from **804,522 to 354,612 bytes (55.9%)**, preserving all 21 semantic nodes and ten relations. These are serialized-output measurements, not model-host token billing. **Migration:** New analyses change hashed event IDs and longer event/listener labels. Select IDs from the parent graph or query the exact `properties.event_name`. Stored Evidence and its original semantic-node IDs remain valid; real stdio MCP verified legacy node-ID tracing. Dynamic names retain `null` and explicit uncertainty. The workflow guide documents this change; no schema or tool inventory changes. Verification: - Real compiled CLI/stdio MCP acceptance with a large Unicode name, complete text/structured Evidence parity, repeated registration/dispatch/removal grouping, emitter isolation, reserved-prefix lookalike, unresolved dynamic name, exact event/listener seeds, and follow-up ping. - Endpoint acceptance and 33 adjacent async/empty-value cases passed alongside the new acceptance journey (35 tests). - `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 legacy original semantic-node IDs and complete event/listener values. - Real Hopper/Ghidra verification: not applicable; static JavaScript projection only. Follows #1423; partial follow-up to #723, which remains open for broader client consumption work. --- <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:20 +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#2879
No description provided.