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:
@@ -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>[],
|
||||
|
||||
Reference in New Issue
Block a user