[GH-ISSUE #4923] [Bug] Caller-selected malformed plist target is reported as a missing default #3053

Closed
opened 2026-10-31 00:35:35 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @morluto on GitHub (Oct 18, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/4923

Before submitting

  • Searched open and closed plist/default/selection reports. #4849 mentions this observation but explicitly excludes it from the decode-diagnostic fix. #772 concerns reading the wrong file, not classifying this refusal.
  • Only self-authored inert XML is used.

Area

Native analysis or decompilation

Observed behavior

The caller selects a malformed plist file as the target, but inspect_plist reports it as an unavailable default plist with remediation to select another plist in the target. Repeating the same inspection with --relative-path naming that same file instead yields invalid_request, which correctly identifies a selected-input refusal.

Reproduction

Executed once per command on macOS26.3 arm64 / Node24.18.0, REA6.5, source f2b7bbb31 with the #4849 diagnostic work.

Create chosen.plist:

<plist><dict><key>value</key><integer> 42 </integer></dict></plist>

Then run the built public CLI:

node scripts/rea.mjs inspect-plist /absolute/path/chosen.plist --json
node scripts/rea.mjs inspect-plist /absolute/path/chosen.plist --relative-path /absolute/path/chosen.plist --json

Both exit1 and preserve the original bytes. First: capability_unavailable, reason begins The target has no readable default plist at ...chosen.plist, and suggests selecting a plist in the target. Second: invalid_request, with a path issue explaining plutil refused the selected file. plutil rejects the whitespace integer in both. Paths may appear canonicalized for the positional target versus preserved for explicit path input; both commands examine the same file.

Expected behavior

Preserve caller selection intent through resolution and error projection. A plist explicitly selected as the target should receive the selected-input refusal, while an actually unavailable default remains capability_unavailable. Preserve permission/identity/cleanup outcomes and diagnostic provenance independently of that selection fact.

Impact and scope

Observed deterministically for the authored selected plist. Misleading remediation and typed code can make an agent treat bad caller input as missing provider/target capability. Broader frequency and non-macOS scope: NOT_ENOUGH_INFO; not measured.

Relevant output or evidence

First message: The target has no readable default plist at ...chosen.plist: plutil could not decode it as a property list (Property List error: Unknown character ... in <integer> on line 1 ...). Select another plist in the target ...
Second code: invalid_request; details.issues[0].path=["path"], reason=invalid_value, selected-file refusal retained. The caller never asked for a default in the first command.

Analysis

Source-derived: resolvePlistPath knows when target.kind=artifact and format=plist, but returns only a string. unreadablePlist uses absence of parameters.path to decide default versus selected, losing target-selection intent. Resolve one owned selection fact and let physical-file and conversion failure consumers use it rather than infer intent independently. Ordinary read-only error-contract correction; no new execution, mutation or provider capability.

Typed outcome or recovery expected

Selected plist target: invalid_request for unparseable caller input, with exact diagnostics. Actual missing default: retain capability_unavailable and default-location remediation.

Originally created by @morluto on GitHub (Oct 18, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/4923 ### Before submitting - [x] Searched open and closed plist/default/selection reports. #4849 mentions this observation but explicitly excludes it from the decode-diagnostic fix. #772 concerns reading the wrong file, not classifying this refusal. - [x] Only self-authored inert XML is used. ### Area Native analysis or decompilation ### Observed behavior The caller selects a malformed plist file as the target, but inspect_plist reports it as an unavailable default plist with remediation to select another plist in the target. Repeating the same inspection with --relative-path naming that same file instead yields invalid_request, which correctly identifies a selected-input refusal. ### Reproduction Executed once per command on macOS26.3 arm64 / Node24.18.0, REA6.5, source f2b7bbb31 with the #4849 diagnostic work. Create chosen.plist: ```xml <plist><dict><key>value</key><integer> 42 </integer></dict></plist> ``` Then run the built public CLI: ```sh node scripts/rea.mjs inspect-plist /absolute/path/chosen.plist --json node scripts/rea.mjs inspect-plist /absolute/path/chosen.plist --relative-path /absolute/path/chosen.plist --json ``` Both exit1 and preserve the original bytes. First: capability_unavailable, reason begins `The target has no readable default plist at ...chosen.plist`, and suggests selecting a plist in the target. Second: invalid_request, with a path issue explaining plutil refused the selected file. plutil rejects the whitespace integer in both. Paths may appear canonicalized for the positional target versus preserved for explicit path input; both commands examine the same file. ### Expected behavior Preserve caller selection intent through resolution and error projection. A plist explicitly selected as the target should receive the selected-input refusal, while an actually unavailable default remains capability_unavailable. Preserve permission/identity/cleanup outcomes and diagnostic provenance independently of that selection fact. ### Impact and scope Observed deterministically for the authored selected plist. Misleading remediation and typed code can make an agent treat bad caller input as missing provider/target capability. Broader frequency and non-macOS scope: NOT_ENOUGH_INFO; not measured. ### Relevant output or evidence First message: `The target has no readable default plist at ...chosen.plist: plutil could not decode it as a property list (Property List error: Unknown character ... in <integer> on line 1 ...). Select another plist in the target ...` Second code: invalid_request; details.issues[0].path=["path"], reason=invalid_value, selected-file refusal retained. The caller never asked for a default in the first command. ### Analysis Source-derived: resolvePlistPath knows when target.kind=artifact and format=plist, but returns only a string. unreadablePlist uses absence of parameters.path to decide default versus selected, losing target-selection intent. Resolve one owned selection fact and let physical-file and conversion failure consumers use it rather than infer intent independently. Ordinary read-only error-contract correction; no new execution, mutation or provider capability. ### Typed outcome or recovery expected Selected plist target: invalid_request for unparseable caller input, with exact diagnostics. Actual missing default: retain capability_unavailable and default-location remediation.
bsakaguchi 2026-10-31 00:35:35 +00:00
  • closed this issue
  • added the
    triage
    bug
    labels
Author
Owner

@morluto commented on GitHub (Oct 18, 2026):

Fixed on main in e6c487799.

Root cause: path resolution recognized a selected plist artifact but returned only a string. Downstream file/conversion failures inferred default intent from omission of parameters.path.

Structural fix: NativePlistSource owns a resolved path plus selected/default origin. Explicit paths and selected plist targets retain selected origin independently of readiness; actual bundle/program defaults retain default origin. Admission, source-format reads, recursive physical/cleanup errors and conversion failures consume the same fact. The old string resolver and path/requested pairing were removed. Unresolved outer scope admission carries no invented file-selection context.

Executed on macOS26.3 arm64 / Node24.18:

  • Public CLI/MCP baseline:3 failures,8 controls passed. Two direct-target CLI refusals and the active-plist MCP refusal incorrectly returned capability_unavailable.
  • Final55 passed across7files, including real plutil CLI/MCP direct-target and explicit/default controls, valid source formats, integer precision, prototype keys, captured diagnostics and file cleanup.
  • Controlled physical-boundary checks: missing/non-regular selected targets, permission denial, absolute/relative/default/recorded-bundle resolution, unknown scope context and closed client admission.
  • Prefix read/close failure and repeated cleanup now run for both explicit path input and a selected plist target; exact owner, primary cause and captured output survive retry. Existing cancellation/mixed cleanup controls passed.
  • check:fast, docs:check5, discovery1566 files exactly once and normal commit/pre-push hooks passed. Two read-only source reviews found no blocker. Commit hooks left the tested content unchanged.

Limits: native execution verified only on macOS26.3; controlled provider boundaries do not qualify Linux/Windows native utilities. No performance or full-codebase completion claim; CPU/process-family memory not measured. The unrelated malformed XML compatibility policy remains #4852. Heavy CPU test/profiling remain stopped.

<!-- gh-comment-id:6243594154 --> @morluto commented on GitHub (Oct 18, 2026): Fixed on main in e6c487799. Root cause: path resolution recognized a selected plist artifact but returned only a string. Downstream file/conversion failures inferred default intent from omission of parameters.path. Structural fix: NativePlistSource owns a resolved path plus selected/default origin. Explicit paths and selected plist targets retain selected origin independently of readiness; actual bundle/program defaults retain default origin. Admission, source-format reads, recursive physical/cleanup errors and conversion failures consume the same fact. The old string resolver and path/requested pairing were removed. Unresolved outer scope admission carries no invented file-selection context. Executed on macOS26.3 arm64 / Node24.18: - Public CLI/MCP baseline:3 failures,8 controls passed. Two direct-target CLI refusals and the active-plist MCP refusal incorrectly returned capability_unavailable. - Final55 passed across7files, including real plutil CLI/MCP direct-target and explicit/default controls, valid source formats, integer precision, prototype keys, captured diagnostics and file cleanup. - Controlled physical-boundary checks: missing/non-regular selected targets, permission denial, absolute/relative/default/recorded-bundle resolution, unknown scope context and closed client admission. - Prefix read/close failure and repeated cleanup now run for both explicit path input and a selected plist target; exact owner, primary cause and captured output survive retry. Existing cancellation/mixed cleanup controls passed. - check:fast, docs:check5, discovery1566 files exactly once and normal commit/pre-push hooks passed. Two read-only source reviews found no blocker. Commit hooks left the tested content unchanged. Limits: native execution verified only on macOS26.3; controlled provider boundaries do not qualify Linux/Windows native utilities. No performance or full-codebase completion claim; CPU/process-family memory not measured. The unrelated malformed XML compatibility policy remains #4852. Heavy CPU test/profiling remain stopped.
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#3053
No description provided.