refactor: use canonical implementations and types directly

Remove forwarding wrappers and shadow aliases, migrate callers and verification scripts to their owners, and share one exhaustive semantic resource-bound projection.
This commit is contained in:
morluto
2026-10-09 23:17:17 +08:00
parent 3283a45d09
commit 765e809e36
119 changed files with 577 additions and 629 deletions
@@ -1,5 +1,6 @@
import { canonicalDigest } from "../comparisonSemantics.js";
import { compareCodePoints, uniqueSorted } from "../canonicalOrdering.js";
import { digestCanonicalValue } from "../canonicalDigest.js";
import { uniqueSorted } from "../canonicalOrdering.js";
import { compareUnicodeCodePoints } from "../unicodeCodePointOrder.js";
import type { Evidence } from "../evidence.js";
import {
createJavaScriptApplicationGraph,
@@ -86,7 +87,7 @@ export const traceApplicationFeature = (
};
return applicationFeatureTraceResultSchema.parse({
...semantic,
trace_id: `jatr_${canonicalDigest(semantic, "Feature trace")}`,
trace_id: `jatr_${digestCanonicalValue(semantic, "Feature trace")}`,
});
};
@@ -126,7 +127,7 @@ const noMatchResult = (
};
return applicationFeatureTraceResultSchema.parse({
...semantic,
trace_id: `jatr_${canonicalDigest(semantic, "Feature trace")}`,
trace_id: `jatr_${digestCanonicalValue(semantic, "Feature trace")}`,
});
};
@@ -170,7 +171,9 @@ const terminalPaths = (
)
.map((node) => pathTo(node, traversal.predecessors, edgeById))
.filter((path): path is NonNullable<typeof path> => path !== null)
.sort((left, right) => compareCodePoints(left.path_id, right.path_id));
.sort((left, right) =>
compareUnicodeCodePoints(left.path_id, right.path_id),
);
};
const pathTo = (
@@ -207,7 +210,7 @@ const pathTo = (
};
return {
...semantic,
path_id: `jatp_${canonicalDigest(semantic, "Feature trace")}`,
path_id: `jatp_${digestCanonicalValue(semantic, "Feature trace")}`,
};
};