From bbd7f7f661415cfa7b346cc70af1467ca81e178a Mon Sep 17 00:00:00 2001 From: Davmunrey <108531295+Davmunrey@users.noreply.github.com> Date: Wed, 18 Nov 2026 18:09:20 +0000 Subject: [PATCH] feat(domain): map the ppc64 reader name to the powerpc Evidence subject Static readers report a 64-bit PowerPC ELF as ppc64, and the Evidence subject of those reports had no architecture because the name mapped to no family. With EM_PPC64 classified as powerpc, the subject now carries that family, as it does for ppc. The Go verifier and the Go and Rust guides state the new mapping, and the boundary test keeps an unknown machine (s390) to show that unrecognized names still map to no family. Refs morluto/rea#12085. --- docs/guides/native/go-binaries.md | 4 ++-- docs/rust-binaries.md | 4 ++-- scripts/verify-go-binary.mjs | 10 +++++++--- src/domain/binaryMetadataArchitecture.ts | 1 + tests/boundary/goRustSubjectArchitecture.test.ts | 4 +++- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/docs/guides/native/go-binaries.md b/docs/guides/native/go-binaries.md index 7e916ec553..10fb8fff29 100644 --- a/docs/guides/native/go-binaries.md +++ b/docs/guides/native/go-binaries.md @@ -273,5 +273,5 @@ reader. The verification lane requires Go; normal inspection does not. Reader architecture names remain verbatim in the report. Evidence subjects use the recognized canonical family: `386` maps to `x86`, `amd64` to `x86_64`, and -`ppc` to `powerpc`. Unknown families such as `ppc64` remain unknown rather than -being inferred from a related spelling. +`ppc` and `ppc64` to `powerpc`. Unknown families such as `s390` remain unknown +rather than being inferred from a related spelling. diff --git a/docs/rust-binaries.md b/docs/rust-binaries.md index 083cd4603c..0a5f0ee2ff 100644 --- a/docs/rust-binaries.md +++ b/docs/rust-binaries.md @@ -205,8 +205,8 @@ displace independently observed dependency facts. Reader architecture names remain verbatim in the report. Evidence subjects use the recognized canonical family: `386` maps to `x86`, `amd64` to `x86_64`, and -`ppc` to `powerpc`. Unknown families such as `ppc64` remain unknown rather than -being inferred from a related spelling. +`ppc` and `ppc64` to `powerpc`. Unknown families such as `s390` remain unknown +rather than being inferred from a related spelling. Input and complete-report admission are caller choices through `producer_limits`: `input_bytes` defaults to 256 MiB and `output_bytes` to 8 MiB. Both accept positive diff --git a/scripts/verify-go-binary.mjs b/scripts/verify-go-binary.mjs index 6b60423c0e..cf9c7ca51c 100644 --- a/scripts/verify-go-binary.mjs +++ b/scripts/verify-go-binary.mjs @@ -451,9 +451,13 @@ async function verify( assert.equal(report.architecture, target[1]); assert.equal( evidence.subject.identity.architecture, - { amd64: "x86_64", 386: "x86", arm64: "arm64", mips: "mips" }[ - target[1] - ] ?? null, + { + amd64: "x86_64", + 386: "x86", + arm64: "arm64", + mips: "mips", + ppc64: "powerpc", + }[target[1]] ?? null, ); assert.equal(report.bits, target[3]); assert.equal(report.byte_order, target[4]); diff --git a/src/domain/binaryMetadataArchitecture.ts b/src/domain/binaryMetadataArchitecture.ts index 3402199e09..b15191e3c5 100644 --- a/src/domain/binaryMetadataArchitecture.ts +++ b/src/domain/binaryMetadataArchitecture.ts @@ -8,6 +8,7 @@ export const binaryMetadataArchitecture = (architecture: string) => { case "amd64": return "x86_64"; case "ppc": + case "ppc64": return "powerpc"; default: return BINARY_ARCHITECTURES.find( diff --git a/tests/boundary/goRustSubjectArchitecture.test.ts b/tests/boundary/goRustSubjectArchitecture.test.ts index de80c310d1..ab959b93ab 100644 --- a/tests/boundary/goRustSubjectArchitecture.test.ts +++ b/tests/boundary/goRustSubjectArchitecture.test.ts @@ -23,7 +23,9 @@ it.each([ [1, 2, 20, "ppc", "powerpc"], [1, 1, 3, "386", "x86"], [2, 1, 62, "amd64", "x86_64"], - [2, 2, 21, "ppc64", null], + [2, 1, 21, "ppc64", "powerpc"], + [2, 2, 21, "ppc64", "powerpc"], + [2, 2, 22, "s390", null], ] as const)( "preserves ELF class%d byte-order%d machine%d in Go and Rust subjects", async (bits, endian, machine, local, canonical) => {