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,4 +1,4 @@
import { compareCodePoints } from "../canonicalOrdering.js";
import { compareUnicodeCodePoints } from "../unicodeCodePointOrder.js";
import type { Evidence } from "../evidence.js";
import {
type ApplicationEdge,
@@ -38,7 +38,7 @@ export const buildJavaScriptNativeHandoffs = (
providers: uniqueProviders(linked),
evidence_ids: linked
.map(({ evidence_id: id }) => id)
.sort(compareCodePoints),
.sort(compareUnicodeCodePoints),
recommended_tools: [
"open_binary" as const,
"binary_overview" as const,
@@ -50,7 +50,7 @@ export const buildJavaScriptNativeHandoffs = (
];
})
.sort((left, right) =>
compareCodePoints(left.native_node_id, right.native_node_id),
compareUnicodeCodePoints(left.native_node_id, right.native_node_id),
);
};
@@ -95,7 +95,9 @@ const nativeExportNodes = (
return [...new Set(ids)]
.map((id) => nodeById.get(id))
.filter((node): node is ApplicationNode => node?.kind === "native-export")
.sort((left, right) => compareCodePoints(left.node_id, right.node_id));
.sort((left, right) =>
compareUnicodeCodePoints(left.node_id, right.node_id),
);
};
const requestedExports = (nodes: readonly ApplicationNode[]): string[] => {
@@ -106,7 +108,7 @@ const requestedExports = (nodes: readonly ApplicationNode[]): string[] => {
...stringArray(observation.properties.members),
]),
);
return [...new Set(values)].sort(compareCodePoints);
return [...new Set(values)].sort(compareUnicodeCodePoints);
};
const stringArray = (value: unknown): string[] =>
@@ -125,7 +127,7 @@ const uniqueProviders = (
]),
).values(),
].sort((left, right) =>
compareCodePoints(
compareUnicodeCodePoints(
`${left.id}\0${left.name}\0${left.version ?? ""}`,
`${right.id}\0${right.name}\0${right.version ?? ""}`,
),