[GH-ISSUE #5513] [Bug] Desktop inspection classifies invalid and unreadable targets as execution failures #3357

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

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

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Evidence, artifacts, or reconstruction

Observed behavior

node scripts/rea.mjs inspect-desktop-application "$work_dir/regular-file" --json and the same command selecting a missing directory or a directory with mode 000 all exit 1 with code: artifact_operation_failed and category: execution_failure. The underlying non-directory, ENOENT or EACCES condition appears only in message text or nested details. A readable empty directory succeeds.

Reproduction

An independent verifier executed these fixture and CLI steps against the built source checkout with installed dependencies. REA's HOME and XDG config/data/cache/state directories were isolated to disposable state. Run as a non-root user on a POSIX filesystem that enforces directory permissions. Run each REA command separately so its expected exit 1 does not stop the remaining checks.

work_dir=$(mktemp -d)
mkdir "$work_dir/readable-directory" "$work_dir/locked-directory"
printf 'fixture\n' > "$work_dir/regular-file"
printf 'fixture\n' > "$work_dir/denied-file"
chmod 000 "$work_dir/locked-directory" "$work_dir/denied-file"

node scripts/rea.mjs inspect-desktop-application "$work_dir/regular-file" --json
node scripts/rea.mjs inspect-desktop-application "$work_dir/missing-directory" --json
node scripts/rea.mjs inspect-desktop-application "$work_dir/locked-directory" --json

node scripts/rea.mjs inspect-artifact "$work_dir/missing-directory" --json
node scripts/rea.mjs inspect-artifact "$work_dir/denied-file" --json
node scripts/rea.mjs inspect-desktop-application "$work_dir/readable-directory" --json

chmod 700 "$work_dir/locked-directory"
node scripts/rea.mjs inspect-desktop-application "$work_dir/locked-directory" --json
chmod 600 "$work_dir/denied-file"

Keep missing-directory absent. Restore the denied fixtures' permissions even if a command fails unexpectedly. Each selected failure and control was executed once; no repeated-run frequency is established.

Expected behavior

Source-derived expectation: CLI help and src/cli/desktopApplicationCommands.ts:23 define the target as a local installation directory. docs/cli.md documents structured identification of invalid input and permission failures. src/domain/analysisErrorCore.ts:188 models host filesystem read denial separately, and src/domain/analysisErrorProjection.test.ts:663 pins access_denied / unavailable and read-access recovery for EACCES/EPERM.

A regular file should receive a typed input/target refusal, a missing root should preserve target-unavailability semantics, and a read-denied root should receive access_denied / unavailable with read-access guidance. The exact refusal code for a non-directory should follow the existing input/target contract; the schema enumeration alone does not determine it. The sibling artifact controls below already distinguish missing targets and read denials.

Impact and scope

Callers cannot use the top-level code/category to distinguish invalid selection, target unavailability and filesystem denial on these bounded inputs. They must inspect nested diagnostics to choose recovery. Selecting an existing readable directory or restoring authorized access is a practical workaround, and the restored-access control succeeded.

CLI reproduction only. MCP reachability is source-derived through the same service, not runtime-tested. No native provider or external service was used. No data loss or unauthorized read was observed. The denied desktop result retained partial_observation; this report concerns classification, not lost observations.

REA version

6.7.0, built from source commit 074768901f3cdc8205b61773fb1faf6f6c7b3ca8.

Runtime and platform

Node v26.12.0; macOS 27.0.1; arm64; non-root user. No Hopper/Ghidra provider required.

Target and artifact context

Self-created regular files, an absent directory, and empty readable or mode-000 directories on the local filesystem.

Interface

CLI

Earliest failure stage

Transport or result projection

Relevant output or evidence

Selected fields from the independently reproduced CLI JSON, with fixture paths omitted:

Desktop target Exit code category details.reason Diagnostic
Regular file 1 artifact_operation_failed execution_failure path Artifact root must be a directory
Missing directory 1 artifact_operation_failed execution_failure io Could not resolve artifact root, ENOENT
Mode-000 directory 1 artifact_operation_failed execution_failure io Could not open directory, EACCES

The missing and denied desktop selections returned Artifact could not be read or written. Check file access and try again. All three returned retryable: false; that flag is not itself alleged to be incorrect.

The inspect-artifact missing-path control exited 1 with target_unavailable / unavailable. Its denied-file control exited 1 with access_denied / unavailable, system_code: EACCES, boundary: filesystem-read and read-access remediation. The readable-directory desktop control exited 0 with complete-within-scan coverage. Restoring the locked directory to mode 0700 made that same desktop command exit 0 with the same coverage.

Typed outcome or recovery expected

Preserve typed input/target refusal, target-unavailability and filesystem-denial distinctions, meaningful root diagnostics and any retained partial observations. A denied root should expose access_denied / unavailable and structured read-access recovery. Retrying an unchanged inaccessible selection need not be marked retryable.

Analysis or suspected cause

Source-derived: DirectoryArtifactReader.ts:125 rejects non-directory roots and wraps root/traversal I/O failures. DesktopApplicationReader.ts:85 and ArtifactOperationFailure.ts:19 translate them to artifact errors. src/domain/analysisErrorProjection.ts:175 and src/domain/analysisErrorPresentation.ts:213 default these reasons to the observed generic code/category. Reader and translator filenames are under src/artifacts/.

The relevant handling/projection code remains unchanged on fetched upstream main c374c2fe7290b914d73d9e27af38b498753ec593. The later CLI output-filter fix does not change these unfiltered requests.

Additional context

Prepared with AI assistance and independently reproduced through the public CLI. Searches covered open and closed issues and PRs using the command name, error code, source modules and desktop access-denial/execution-failure terms. #5229 and #5230 concern unreadable child entries and coverage, rather than classification of rejected root selections.

NOT_ENOUGH_INFO for the last known good version or regression window. No MCP execution or Windows ACL reproduction was performed.

Originally created by @coygeek on GitHub (Oct 20, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/5513 ### Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area Evidence, artifacts, or reconstruction ### Observed behavior `node scripts/rea.mjs inspect-desktop-application "$work_dir/regular-file" --json` and the same command selecting a missing directory or a directory with mode `000` all exit 1 with `code: artifact_operation_failed` and `category: execution_failure`. The underlying non-directory, `ENOENT` or `EACCES` condition appears only in message text or nested details. A readable empty directory succeeds. ### Reproduction An independent verifier executed these fixture and CLI steps against the built source checkout with installed dependencies. REA's HOME and XDG config/data/cache/state directories were isolated to disposable state. Run as a non-root user on a POSIX filesystem that enforces directory permissions. Run each REA command separately so its expected exit 1 does not stop the remaining checks. ```sh work_dir=$(mktemp -d) mkdir "$work_dir/readable-directory" "$work_dir/locked-directory" printf 'fixture\n' > "$work_dir/regular-file" printf 'fixture\n' > "$work_dir/denied-file" chmod 000 "$work_dir/locked-directory" "$work_dir/denied-file" node scripts/rea.mjs inspect-desktop-application "$work_dir/regular-file" --json node scripts/rea.mjs inspect-desktop-application "$work_dir/missing-directory" --json node scripts/rea.mjs inspect-desktop-application "$work_dir/locked-directory" --json node scripts/rea.mjs inspect-artifact "$work_dir/missing-directory" --json node scripts/rea.mjs inspect-artifact "$work_dir/denied-file" --json node scripts/rea.mjs inspect-desktop-application "$work_dir/readable-directory" --json chmod 700 "$work_dir/locked-directory" node scripts/rea.mjs inspect-desktop-application "$work_dir/locked-directory" --json chmod 600 "$work_dir/denied-file" ``` Keep `missing-directory` absent. Restore the denied fixtures' permissions even if a command fails unexpectedly. Each selected failure and control was executed once; no repeated-run frequency is established. ### Expected behavior Source-derived expectation: CLI help and `src/cli/desktopApplicationCommands.ts:23` define the target as a local installation directory. `docs/cli.md` documents structured identification of invalid input and permission failures. `src/domain/analysisErrorCore.ts:188` models host filesystem read denial separately, and `src/domain/analysisErrorProjection.test.ts:663` pins `access_denied` / `unavailable` and read-access recovery for `EACCES`/`EPERM`. A regular file should receive a typed input/target refusal, a missing root should preserve target-unavailability semantics, and a read-denied root should receive `access_denied` / `unavailable` with read-access guidance. The exact refusal code for a non-directory should follow the existing input/target contract; the schema enumeration alone does not determine it. The sibling artifact controls below already distinguish missing targets and read denials. ### Impact and scope Callers cannot use the top-level code/category to distinguish invalid selection, target unavailability and filesystem denial on these bounded inputs. They must inspect nested diagnostics to choose recovery. Selecting an existing readable directory or restoring authorized access is a practical workaround, and the restored-access control succeeded. CLI reproduction only. MCP reachability is source-derived through the same service, not runtime-tested. No native provider or external service was used. No data loss or unauthorized read was observed. The denied desktop result retained `partial_observation`; this report concerns classification, not lost observations. ### REA version 6.7.0, built from source commit `074768901f3cdc8205b61773fb1faf6f6c7b3ca8`. ### Runtime and platform Node v26.12.0; macOS 27.0.1; arm64; non-root user. No Hopper/Ghidra provider required. ### Target and artifact context Self-created regular files, an absent directory, and empty readable or mode-000 directories on the local filesystem. ### Interface CLI ### Earliest failure stage Transport or result projection ### Relevant output or evidence Selected fields from the independently reproduced CLI JSON, with fixture paths omitted: | Desktop target | Exit | code | category | details.reason | Diagnostic | | --- | --- | --- | --- | --- | --- | | Regular file | 1 | `artifact_operation_failed` | `execution_failure` | `path` | `Artifact root must be a directory` | | Missing directory | 1 | `artifact_operation_failed` | `execution_failure` | `io` | `Could not resolve artifact root`, `ENOENT` | | Mode-000 directory | 1 | `artifact_operation_failed` | `execution_failure` | `io` | `Could not open directory`, `EACCES` | The missing and denied desktop selections returned `Artifact could not be read or written. Check file access and try again.` All three returned `retryable: false`; that flag is not itself alleged to be incorrect. The `inspect-artifact` missing-path control exited 1 with `target_unavailable` / `unavailable`. Its denied-file control exited 1 with `access_denied` / `unavailable`, `system_code: EACCES`, `boundary: filesystem-read` and read-access remediation. The readable-directory desktop control exited 0 with `complete-within-scan` coverage. Restoring the locked directory to mode `0700` made that same desktop command exit 0 with the same coverage. ### Typed outcome or recovery expected Preserve typed input/target refusal, target-unavailability and filesystem-denial distinctions, meaningful root diagnostics and any retained partial observations. A denied root should expose `access_denied` / `unavailable` and structured read-access recovery. Retrying an unchanged inaccessible selection need not be marked retryable. ### Analysis or suspected cause Source-derived: `DirectoryArtifactReader.ts:125` rejects non-directory roots and wraps root/traversal I/O failures. `DesktopApplicationReader.ts:85` and `ArtifactOperationFailure.ts:19` translate them to artifact errors. `src/domain/analysisErrorProjection.ts:175` and `src/domain/analysisErrorPresentation.ts:213` default these reasons to the observed generic code/category. Reader and translator filenames are under `src/artifacts/`. The relevant handling/projection code remains unchanged on fetched upstream main `c374c2fe7290b914d73d9e27af38b498753ec593`. The later CLI output-filter fix does not change these unfiltered requests. ### Additional context Prepared with AI assistance and independently reproduced through the public CLI. Searches covered open and closed issues and PRs using the command name, error code, source modules and desktop access-denial/execution-failure terms. #5229 and #5230 concern unreadable child entries and coverage, rather than classification of rejected root selections. NOT_ENOUGH_INFO for the last known good version or regression window. No MCP execution or Windows ACL reproduction was performed.
Author
Owner

@matbrgz commented on GitHub (Oct 20, 2026):

Cross-referencing with canonical issue #5455 and siblings #5457, #5458, and #5515 regarding command-level misclassification of invalid or unreadable target inputs as . Cataloged under Cluster AL in consolidation tracker #4330.

<!-- gh-comment-id:6292619529 --> @matbrgz commented on GitHub (Oct 20, 2026): Cross-referencing with canonical issue #5455 and siblings #5457, #5458, and #5515 regarding command-level misclassification of invalid or unreadable target inputs as . Cataloged under Cluster AL in consolidation tracker #4330.
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#3357
No description provided.