fix(javascript)!: avoid event payload copies in graph metadata (#1427)

Share the canonical string identity rule with endpoint projection, scope event keys to each emitter, and keep complete event/listener names in properties. Verify real CLI and stdio MCP with large names, registration/removal, distinct emitters, exact name seeds, reserved-prefix values, and unresolved dynamic names.

BREAKING CHANGE: New analyses use digest-based IDs for long or reserved-prefix event names and shorter event/listener display labels. Select IDs from the parent graph and read exact names from event_name properties. Stored graphs and their original IDs remain accepted for semantic tracing.
This commit is contained in:
Ysopwnable
2026-10-10 12:20:05 +08:00
committed by GitHub
parent a9ee2360fd
commit f4a0c1ce95
5 changed files with 196 additions and 12 deletions
+10
View File
@@ -0,0 +1,10 @@
import { digestCanonicalValue } from "./canonicalDigest.js";
/** Retain short exact string keys or commit their value in a reserved digest namespace. */
export const compactStringIdentityKey = (value: string): string => {
const prefix = "value-sha256:";
const digestKey = `${prefix}${digestCanonicalValue(value, "String identity")}`;
return value.length <= digestKey.length && !value.startsWith(prefix)
? value
: digestKey;
};