[PR #2262] [MERGED] fix(native): refuse inspect_signature on non-Mach-O targets #5124

Closed
opened 2026-10-31 01:04:09 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2262
Author: @aznikline
Created: 10/12/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @morluto

Base: main ← Head: fix/inspect-signature-non-macho


📝 Commits (3)

  • 0280541 fix(native): refuse inspect_signature on non-Mach-O targets
  • 64af56e test(native): scope the signature-gate comment to this provider
  • f6f4cd7 fix(native): align signature capability discovery with Mach-O support

📊 Changes

4 files changed (+47 additions, -1 deletions)

View changed files

📝 src/application/CapabilityInventory.ts (+1 -0)
📝 src/contracts/native/nativeToolContracts.ts (+1 -1)
📝 src/native/NativeMacOSProvider.ts (+13 -0)
📝 tests/boundary/providers/native/nativeProvider.test.ts (+32 -0)

📄 Description

Summary

  • inspect_signature on a non-Mach-O container (e.g. a .pkg archive) ran codesign -d on the byte snapshot with no format gate. The codesign "code object is not signed" verdict cannot see a container-level signature layer (such as a xar pkg signature), so a signed or invalidly-signed package was reported as signed:false / "Artifact is not signed." — an unsigned claim for a layer that was never evaluated.
  • Add the same kind/isMachOFormat gate used by inspect_macho and list_architectures: non-Mach-O targets now return capability_unavailable with an explicit reason instead of a false unsigned result.
  • Add a boundary test asserting inspect_signature refuses pkg and elf targets without invoking codesign.

Test plan

  • tests/boundary/providers/native/nativeProvider.test.ts — 37/37 pass (vitest --maxWorkers=4)
  • Real-provider verification (macOS): rea inspect-signature python-3.13.9-macos11.pkg (Developer ID Installer-signed; pkgutil --check-signature = signed + notarized) → capability_unavailable with reason "its container-level signature layer is not evaluated by codesign" (previously signed:false)
  • Regression: rea inspect-signature /bin/ls → signed: true unchanged

Scope note

Reporting the signature layer itself (xar TOC <signature> parsing) is out of scope — this change only stops the false unsigned classification. A future inspect_signature on .pkg could evaluate the archive layer or report it as an explicit unknown.

Generated with Devin


🔄 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/2262 **Author:** [@aznikline](https://github.com/aznikline) **Created:** 10/12/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/inspect-signature-non-macho` --- ### 📝 Commits (3) - [`0280541`](https://github.com/morluto/rea/commit/0280541162ab01731438c56bbe4186e21d9cfd07) fix(native): refuse inspect_signature on non-Mach-O targets - [`64af56e`](https://github.com/morluto/rea/commit/64af56e8261ff92c57d31d73939af9e23d224891) test(native): scope the signature-gate comment to this provider - [`f6f4cd7`](https://github.com/morluto/rea/commit/f6f4cd79efe5aaa511717068615e49a3170fc0b1) fix(native): align signature capability discovery with Mach-O support ### 📊 Changes **4 files changed** (+47 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/application/CapabilityInventory.ts` (+1 -0) 📝 `src/contracts/native/nativeToolContracts.ts` (+1 -1) 📝 `src/native/NativeMacOSProvider.ts` (+13 -0) 📝 `tests/boundary/providers/native/nativeProvider.test.ts` (+32 -0) </details> ### 📄 Description ## Summary - `inspect_signature` on a non-Mach-O container (e.g. a `.pkg` archive) ran `codesign -d` on the byte snapshot with no format gate. The codesign "code object is not signed" verdict cannot see a container-level signature layer (such as a xar pkg signature), so a signed or invalidly-signed package was reported as `signed:false` / "Artifact is not signed." — an unsigned claim for a layer that was never evaluated. - Add the same `kind`/`isMachOFormat` gate used by `inspect_macho` and `list_architectures`: non-Mach-O targets now return `capability_unavailable` with an explicit reason instead of a false unsigned result. - Add a boundary test asserting `inspect_signature` refuses `pkg` and `elf` targets without invoking codesign. #### Test plan - [x] `tests/boundary/providers/native/nativeProvider.test.ts` — 37/37 pass (`vitest --maxWorkers=4`) - [x] Real-provider verification (macOS): `rea inspect-signature python-3.13.9-macos11.pkg` (Developer ID Installer-signed; `pkgutil --check-signature` = signed + notarized) → `capability_unavailable` with reason "its container-level signature layer is not evaluated by codesign" (previously `signed:false`) - [x] Regression: `rea inspect-signature /bin/ls` → `signed: true` unchanged #### Scope note Reporting the signature layer itself (xar TOC `<signature>` parsing) is out of scope — this change only stops the false unsigned classification. A future `inspect_signature` on `.pkg` could evaluate the archive layer or report it as an explicit unknown. Generated with [Devin](https://devin.ai) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:04:09 +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#5124
No description provided.