[PR #875] [MERGED] fix(native): report why a selected plist cannot be inspected #2310

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

📋 Pull Request Information

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

Base: main ← Head: fix/native-plist-selection-failures


📝 Commits (2)

  • 0674fac fix(native): report why a selected plist cannot be inspected
  • 5738a0c fix(native): report plist permission denials as access failures

📊 Changes

3 files changed (+210 additions, -5 deletions)

View changed files

📝 src/cli/utilityCommands.ts (+7 -3)
📝 src/native/NativeMacOSProvider.ts (+78 -2)
➕ tests/boundary/cli/nativePlistSelectionFailureCli.test.ts (+125 -0)

📄 Description

Summary

inspect_plist / rea inspect-plist gave one generic failure for every unreadable plist:

{"code":"execution_failure","message":"Analysis could not complete. Retry once; if it continues, run `rea doctor`.","details":{"provider_id":"native-macos","operation":"inspect_plist"}}

That happened for a missing --relative-path/path, a directory, a file that is not a property list, and a bare Mach-O with no Contents/Info.plist. The advice (retry, run rea doctor) fits none of them.

Now the resolved path is checked before plutil runs, and plutil's decode diagnostic is kept:

Case Result
Selected path missing invalid_request, issue path: Cannot inspect <path>: no file exists there.
Selected path is a directory invalid_request: … it is not a regular file.
Selected file is not a plist invalid_request: … plutil could not decode it as a property list (Property List error: Unexpected character n at line 1 / …)
Default Contents/Info.plist missing (e.g. a bare Mach-O) capability_unavailable: The target has no readable Contents/Info.plist at <path>: no file exists there. Pass path to inspect another plist.
Selected file exists but cannot be opened (EACCES/EPERM, including ACL and macOS privacy denials) target_unavailable with the path and reason: permission denied while reading plist (EACCES). It is not reported as an undecodable plist.

Other filesystem errors keep the existing provider failure.

CLI/MCP parity: the CLI used to default --relative-path to Contents/Info.plist and always sent it as an explicit path. The CLI default therefore differed from the MCP call that omits path. The option is now optional, so both produce the same default result and the same failure classification.

No schema or catalog change.

Verification

  • New tests/boundary/cli/nativePlistSelectionFailureCli.test.ts (darwin only, real file/plutil through the CLI) covers the five cases above (the permission case is skipped as root). On main they return the generic execution_failure.
  • Existing tests/boundary/cli/nativePlistCli.test.ts (default, alternate, missing, data/date/real, large integers) and tests/boundary/providers/native/nativeProvider.test.ts pass.
  • npm run check:changed, npm run docs:check, tests/boundary/cli/productCatalog.test.ts, tests/acceptance/contractPresentation.test.ts, and tests/boundary/cli/cliOutput.test.ts pass.

No Hopper/Ghidra/IDA verification is needed.

🤖 Generated with Claude Code


🔄 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/875 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/7/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Base:** `main` ← **Head:** `fix/native-plist-selection-failures` --- ### 📝 Commits (2) - [`0674fac`](https://github.com/morluto/rea/commit/0674facd468c3321584ece908031feee7220b9c6) fix(native): report why a selected plist cannot be inspected - [`5738a0c`](https://github.com/morluto/rea/commit/5738a0cf8c111833847fecb2f7d0c2ee35eabbd6) fix(native): report plist permission denials as access failures ### 📊 Changes **3 files changed** (+210 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/cli/utilityCommands.ts` (+7 -3) 📝 `src/native/NativeMacOSProvider.ts` (+78 -2) ➕ `tests/boundary/cli/nativePlistSelectionFailureCli.test.ts` (+125 -0) </details> ### 📄 Description ## Summary `inspect_plist` / `rea inspect-plist` gave one generic failure for every unreadable plist: ```json {"code":"execution_failure","message":"Analysis could not complete. Retry once; if it continues, run `rea doctor`.","details":{"provider_id":"native-macos","operation":"inspect_plist"}} ``` That happened for a missing `--relative-path`/`path`, a directory, a file that is not a property list, and a bare Mach-O with no `Contents/Info.plist`. The advice (retry, run `rea doctor`) fits none of them. Now the resolved path is checked before plutil runs, and plutil's decode diagnostic is kept: | Case | Result | | --- | --- | | Selected path missing | `invalid_request`, issue `path`: `Cannot inspect <path>: no file exists there.` | | Selected path is a directory | `invalid_request`: `… it is not a regular file.` | | Selected file is not a plist | `invalid_request`: `… plutil could not decode it as a property list (Property List error: Unexpected character n at line 1 / …)` | | Default `Contents/Info.plist` missing (e.g. a bare Mach-O) | `capability_unavailable`: `The target has no readable Contents/Info.plist at <path>: no file exists there. Pass path to inspect another plist.` | | Selected file exists but cannot be opened (EACCES/EPERM, including ACL and macOS privacy denials) | `target_unavailable` with the path and `reason: permission denied while reading plist (EACCES)`. It is not reported as an undecodable plist. | Other filesystem errors keep the existing provider failure. **CLI/MCP parity:** the CLI used to default `--relative-path` to `Contents/Info.plist` and always sent it as an explicit `path`. The CLI default therefore differed from the MCP call that omits `path`. The option is now optional, so both produce the same default result and the same failure classification. No schema or catalog change. ## Verification - New `tests/boundary/cli/nativePlistSelectionFailureCli.test.ts` (darwin only, real `file`/`plutil` through the CLI) covers the five cases above (the permission case is skipped as root). On `main` they return the generic `execution_failure`. - Existing `tests/boundary/cli/nativePlistCli.test.ts` (default, alternate, missing, data/date/real, large integers) and `tests/boundary/providers/native/nativeProvider.test.ts` pass. - `npm run check:changed`, `npm run docs:check`, `tests/boundary/cli/productCatalog.test.ts`, `tests/acceptance/contractPresentation.test.ts`, and `tests/boundary/cli/cliOutput.test.ts` pass. No Hopper/Ghidra/IDA verification is needed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:17:06 +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#2310
No description provided.