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
@@ -50,14 +50,14 @@ const keyMethod = (item: Method): Keyed<Method> => ({
item,
exactKey:
item.body.status === "present" && item.body.normalized_il_sha256 !== null
? stableKey([
? sha256([
"method-exact",
item.signature.raw_sha256,
item.body.normalized_il_sha256,
])
: null,
// The raw blob is the exact signature; decoding only feeds shape keys.
signatureKey: stableKey([
signatureKey: sha256([
"method-signature",
item.declaring_type,
item.name,
@@ -65,7 +65,7 @@ const keyMethod = (item: Method): Keyed<Method> => ({
]),
structuralKey:
item.signature.parse_status === "decoded" && item.body.status === "present"
? stableKey([
? sha256([
"method-structural",
item.signature.kind,
item.signature.calling_convention,
@@ -98,17 +98,17 @@ const keyField = (item: Field): Keyed<Field> => ({
item,
exactKey:
item.signature.parse_status === "decoded"
? stableKey(["field-exact", item.signature.raw_sha256])
? sha256(["field-exact", item.signature.raw_sha256])
: null,
// Only an undecoded field reaches this round: a decoded field with the
// same raw signature already met its counterpart in the exact round.
signatureKey: stableKey([
signatureKey: sha256([
"field-signature",
item.declaring_type,
item.name,
item.signature.raw_sha256,
]),
structuralKey: stableKey([
structuralKey: sha256([
"field-structural",
item.signature.kind,
item.signature.field_type,
@@ -116,8 +116,6 @@ const keyField = (item: Field): Keyed<Field> => ({
]),
});
const stableKey = (value: JsonValue): string => sha256(value);
const matchMethods = (
left: readonly Keyed<Method>[],
right: readonly Keyed<Method>[],