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:35:19 +08:00
parent 3283a45d09
commit 765e809e36
119 changed files with 577 additions and 629 deletions
+6 -4
View File
@@ -1,5 +1,5 @@
import type { ArtifactInventorySnapshot } from "../../domain/artifactInventorySnapshot.js";
import { compareCodePoints } from "../../domain/canonicalOrdering.js";
import { compareUnicodeCodePoints } from "../../domain/unicodeCodePointOrder.js";
import { createReadStream } from "node:fs";
import { lstat } from "node:fs/promises";
@@ -253,18 +253,20 @@ const verifyRootDigest = async (
const sortNodes = (nodes: ArtifactNode[]): ArtifactNode[] =>
nodes.sort((left, right) =>
compareCodePoints(left.artifact_id, right.artifact_id),
compareUnicodeCodePoints(left.artifact_id, right.artifact_id),
);
const sortOccurrences = (
occurrences: MutableOccurrence[],
): MutableOccurrence[] =>
occurrences.sort((left, right) =>
compareCodePoints(left.logical_path, right.logical_path),
compareUnicodeCodePoints(left.logical_path, right.logical_path),
);
const sortEdges = <T extends { edge_id: string }>(edges: T[]): T[] =>
edges.sort((left, right) => compareCodePoints(left.edge_id, right.edge_id));
edges.sort((left, right) =>
compareUnicodeCodePoints(left.edge_id, right.edge_id),
);
const buildManifest = ({
rootNode,