perf(javascript): validate the version change graph once (#1370)

compareJavaScriptApplicationVersions built the change graph with
createJavaScriptApplicationGraph, which validates it and re-derives
every node, observation, edge and graph ID, then parsed the result
with a schema that embeds the full graph schema, repeating all of
that work. Seal the change graph with the owned immutable factory and
accept that exact sealed graph in the result parse, as owned analysis
results already do. Items, coverage and the public result schema are
unchanged; output is byte-identical.
This commit is contained in:
keemsisi authored and GitHub committed 2026-10-10 06:34:21 +08:00
1 parent 810107a2ad
commit 037709a52c
4 files changed
+160 -6

No files matched your search

@@ -3,7 +3,7 @@ import { uniqueSorted } from "../canonicalOrdering.js";
import type { Evidence } from "../evidence.js";
import { buildJavaScriptApplicationChangeGraph } from "./javascriptApplicationChangeGraph.js";
import {
applicationVersionComparisonResultSchema,
ownedApplicationVersionComparisonResultSchema,
type ApplicationVersionComparisonResult,
} from "./javascriptApplicationVersionComparisonSchemas.js";
import type { JavaScriptApplicationGraph } from "./javascriptApplicationGraph.js";
@@ -76,7 +76,7 @@ export const compareJavaScriptApplicationVersions = (
evidence_links: evidenceLinks,
limitations: comparisonLimitations(input),
};
return applicationVersionComparisonResultSchema.parse({
return ownedApplicationVersionComparisonResultSchema.parse({
...semantic,
comparison_id: `javc_${digestCanonicalValue(semantic, "Application version comparison")}`,
});