mirror of
https://github.com/morluto/rea
synced 2026-10-26 22:28:27 -04:00
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:
@@ -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")}`,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user