[PR #701] [MERGED] fix(native): inspect mixed-signature Mach-O slices #2181

Closed
opened 2026-10-16 21:15:20 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/701
Author: @kaoru0822-kitauji
Created: 10/6/2026
Status: ✅ Merged
Merged: 10/6/2026
Merged by: @kaoru0822-kitauji

Base: main ← Head: fix/mixed-signature-slices


📝 Commits (1)

  • 66f3cfa fix(native): inspect mixed-signature Mach-O slices

📊 Changes

2 files changed (+253 additions, -27 deletions)

View changed files

📝 src/native/NativeMacOSProvider.ts (+134 -27)
📝 tests/boundary/providers/native/nativeInventory.golden.test.ts (+119 -0)

📄 Description

Summary

  • treat a nonzero supplemental codesign query as an observation only when its captured output says the code object is unsigned
  • when aggregate signature data proves a mixed-signature universal Mach-O, probe each displayed architecture and report unsigned slices explicitly
  • retain every per-slice probe, including nonzero unsigned observations, in exact command provenance
  • preserve hard failures for unrelated nonzero codesign output

Closes #684.

Evidence

For the reported x86_64 + arm64/arm64e inputs, aggregate codesign -d --verbose=4 succeeds, while codesign -d -r- exits 1 with code object is not signed at all. The provider previously set acceptNonZero only from the successful aggregate display, so the runner converted that expected supplemental observation into a provider failure before its output could be classified.

The regression replays that exact exit/output combination through the production runner seam for both arm64 and arm64e displays. It asserts a typed signed result, an explicit Unsigned Mach-O slices: x86_64. limitation, and per-slice provenance. A control proves unrelated nonzero supplemental output still returns ProviderAdapterError; the existing fully unsigned and missing-file controls continue to pass.

Validation

Passed:

  • npx vitest run tests/boundary/providers/native/nativeInventory.golden.test.ts --project boundary (4 tests)
  • signature-focused native boundary selection (5 tests)
  • npm exec --package=typescript@5.9.3 -- tsc --noEmit
  • npm run lint
  • npm run knip
  • npm run metadata:check
  • targeted oxfmt --check for both changed files

Materially unverified:

  • Real codesign execution on macOS was unavailable in this Linux environment.
  • The repository's TypeScript 7 binary panics while resolving /proc/self/exe, so npm run check could not complete; the stable TypeScript compiler passed.
  • Whole-tree formatting and two process-spawn native tests hit the same sandbox's missing process/memory facilities. Targeted formatting and all signature-focused tests passed.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/701 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/6/2026 **Status:** ✅ Merged **Merged:** 10/6/2026 **Merged by:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Base:** `main` ← **Head:** `fix/mixed-signature-slices` --- ### 📝 Commits (1) - [`66f3cfa`](https://github.com/morluto/rea/commit/66f3cfa594a86cbf1f21fc6d2eca1a82e236c896) fix(native): inspect mixed-signature Mach-O slices ### 📊 Changes **2 files changed** (+253 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `src/native/NativeMacOSProvider.ts` (+134 -27) 📝 `tests/boundary/providers/native/nativeInventory.golden.test.ts` (+119 -0) </details> ### 📄 Description ## Summary - treat a nonzero supplemental `codesign` query as an observation only when its captured output says the code object is unsigned - when aggregate signature data proves a mixed-signature universal Mach-O, probe each displayed architecture and report unsigned slices explicitly - retain every per-slice probe, including nonzero unsigned observations, in exact command provenance - preserve hard failures for unrelated nonzero `codesign` output Closes #684. ## Evidence For the reported `x86_64 + arm64/arm64e` inputs, aggregate `codesign -d --verbose=4` succeeds, while `codesign -d -r-` exits 1 with `code object is not signed at all`. The provider previously set `acceptNonZero` only from the successful aggregate display, so the runner converted that expected supplemental observation into a provider failure before its output could be classified. The regression replays that exact exit/output combination through the production runner seam for both arm64 and arm64e displays. It asserts a typed signed result, an explicit `Unsigned Mach-O slices: x86_64.` limitation, and per-slice provenance. A control proves unrelated nonzero supplemental output still returns `ProviderAdapterError`; the existing fully unsigned and missing-file controls continue to pass. ## Validation Passed: - `npx vitest run tests/boundary/providers/native/nativeInventory.golden.test.ts --project boundary` (4 tests) - signature-focused native boundary selection (5 tests) - `npm exec --package=typescript@5.9.3 -- tsc --noEmit` - `npm run lint` - `npm run knip` - `npm run metadata:check` - targeted `oxfmt --check` for both changed files Materially unverified: - Real `codesign` execution on macOS was unavailable in this Linux environment. - The repository's TypeScript 7 binary panics while resolving `/proc/self/exe`, so `npm run check` could not complete; the stable TypeScript compiler passed. - Whole-tree formatting and two process-spawn native tests hit the same sandbox's missing process/memory facilities. Targeted formatting and all signature-focused tests passed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:15:20 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2181
No description provided.