feat(javascript): discover semantic call literals in feature traces (#7840)

* feat(javascript): discover semantic call literals in feature traces

* fix(javascript): bound retained call literals by transfer capacity

* test(javascript): align feature no-match diagnostic
This commit is contained in:
morluto
2026-10-29 01:25:23 +08:00
committed by GitHub
parent 685f6db960
commit f9e7571a3d
20 changed files with 681 additions and 15 deletions
@@ -5,6 +5,7 @@ import type { JavaScriptSemanticGraphNode } from "./javascriptSemanticGraphSchem
import { uniqueSorted } from "../canonicalOrdering.js";
import { compareUnicodeCodePoints } from "../unicodeCodePointOrder.js";
import type { JavaScriptSemanticQueryInput } from "./javascriptSemanticQuerySchemas.js";
import { semanticCallLiteralValues } from "./javascriptSemanticCallLiterals.js";
/** Derive the stable identity for one graph-bound query. */
export const javaScriptSemanticQueryIdentifier = (
@@ -74,8 +75,12 @@ const seedMatches = (
if (seed.kind === "application-node")
return node.application_node_ids.includes(seed.node_id);
if (seed.kind === "function") return fingerprintFunctions.has(node.node_id);
if (seed.kind === "literal")
return node.kind === "literal" && node.properties.value === seed.value;
if (seed.kind === "literal") {
if (node.kind === "literal") return node.properties.value === seed.value;
return semanticCallLiteralValues(node).some(
(value) => value === seed.value,
);
}
if (seed.kind === "property") {
if (node.kind === "property-slot")
return node.properties.name === seed.name;