[GH-ISSUE #5051] [Bug] ADB failure classification uses a display-truncated diagnostic #3098

Closed
opened 2026-10-31 00:36:37 +00:00 by bsakaguchi · 0 comments
Owner

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

Before submitting

  • Searched open and closed issues and the related ADB identity proposal #4655.
  • Only inert fixture data and synthetic serials/paths are used.

Area

CLI / MCP or agent integration

Observed behavior

At main fd728f271e7de7bcfa63890b573715720d5f948c, the built public CLI maps a missing-file diagnostic to unreadable_output when its important suffix occurs after the first 512 JavaScript characters. The same diagnostic shape with a short path is recognized as unsupported_target.

This was reproduced three times against the unchanged baseline using an owned fake adb executable, not a real Android device. A positive-control pull completed three times per build and preserved the full normalized result, 14 source bytes, and independent SHA-256.

Reproduction

Use REA_ADB_PATH to select a local fake adb which reports a valid version for version, then exits 1 and writes this to stderr for -s fixture-device pull <remote> <host>:

const remote = '/sdcard/' + 'directory/'.repeat(60) + 'long.bin';
console.error("adb: error: failed to stat remote object '" + remote + "': No such file or directory");

Run the built CLI:

node scripts/rea.mjs pull-adb-file fixture-device "$remote" --output-directory <owned-empty-directory> --json

The remote path above is the literal value generated by the JavaScript expression; the fixture never contacts a device or writes the failure target. Actual baseline result: exit 1, code: unreadable_output, category execution_failure, without the selected remote path in structured details. Runtime producer output is simulated; this does not establish platform-tools/device prevalence.

Expected behavior

Classify complete captured command facts before shortening a displayed reason. A display excerpt must not determine the typed failure or erase the accepted file identity. This follows AGENTS.md's ownership and identity rules and the shared ADB error contract. Keep capture-resource bounds and unknown failures explicit.

Impact and scope

Verified against the built CLI and a controlled command-owner regression. Source-derived MCP scope shares the same provider. No physical Android device, native adb binary, Windows/Linux execution, or production frequency established. Last known good: NOT_ENOUGH_INFO.

REA version / runtime and platform

Source fd728f271e7de7bcfa63890b573715720d5f948c, package 6.7.0; Node 24.18.0, macOS arm64.

Earliest failure stage

Transport or result projection: command-owner failure classification before adapter projection.

Relevant output or evidence

src/adb/AdbCommand.ts at the baseline first computes failure.stderr.trim().slice(0, 512) and then searches that excerpt for missing/permission diagnostics. The suffix is absent in the fixture's excerpt. A local candidate which classifies full captured stderr instead returns unsupported_target and the exact remote path in all three repetitions. Local transcripts and measurements are retained under .cache/codebase-audit/adb4655-*.

This is related to #4641/#4643 and PR #4655, but is a separate producing-boundary flaw: the scalar target identity split alone still uses the shortened excerpt and does not repair classification. The pending local correction also scans leading daemon notices without expanding all stderr into a line array. No performance improvement is claimed.

Originally created by @morluto on GitHub (Oct 18, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/5051 ### Before submitting - [x] Searched open and closed issues and the related ADB identity proposal #4655. - [x] Only inert fixture data and synthetic serials/paths are used. ### Area CLI / MCP or agent integration ### Observed behavior At main `fd728f271e7de7bcfa63890b573715720d5f948c`, the built public CLI maps a missing-file diagnostic to `unreadable_output` when its important suffix occurs after the first 512 JavaScript characters. The same diagnostic shape with a short path is recognized as `unsupported_target`. This was reproduced three times against the unchanged baseline using an owned fake adb executable, not a real Android device. A positive-control pull completed three times per build and preserved the full normalized result, 14 source bytes, and independent SHA-256. ### Reproduction Use `REA_ADB_PATH` to select a local fake adb which reports a valid version for `version`, then exits 1 and writes this to stderr for `-s fixture-device pull <remote> <host>`: ```js const remote = '/sdcard/' + 'directory/'.repeat(60) + 'long.bin'; console.error("adb: error: failed to stat remote object '" + remote + "': No such file or directory"); ``` Run the built CLI: ```sh node scripts/rea.mjs pull-adb-file fixture-device "$remote" --output-directory <owned-empty-directory> --json ``` The remote path above is the literal value generated by the JavaScript expression; the fixture never contacts a device or writes the failure target. Actual baseline result: exit 1, `code: unreadable_output`, category `execution_failure`, without the selected remote path in structured details. Runtime producer output is simulated; this does not establish platform-tools/device prevalence. ### Expected behavior Classify complete captured command facts before shortening a displayed reason. A display excerpt must not determine the typed failure or erase the accepted file identity. This follows AGENTS.md's ownership and identity rules and the shared ADB error contract. Keep capture-resource bounds and unknown failures explicit. ### Impact and scope Verified against the built CLI and a controlled command-owner regression. Source-derived MCP scope shares the same provider. No physical Android device, native adb binary, Windows/Linux execution, or production frequency established. Last known good: NOT_ENOUGH_INFO. ### REA version / runtime and platform Source `fd728f271e7de7bcfa63890b573715720d5f948c`, package 6.7.0; Node 24.18.0, macOS arm64. ### Earliest failure stage Transport or result projection: command-owner failure classification before adapter projection. ### Relevant output or evidence `src/adb/AdbCommand.ts` at the baseline first computes `failure.stderr.trim().slice(0, 512)` and then searches that excerpt for missing/permission diagnostics. The suffix is absent in the fixture's excerpt. A local candidate which classifies full captured stderr instead returns `unsupported_target` and the exact remote path in all three repetitions. Local transcripts and measurements are retained under `.cache/codebase-audit/adb4655-*`. This is related to #4641/#4643 and PR #4655, but is a separate producing-boundary flaw: the scalar target identity split alone still uses the shortened excerpt and does not repair classification. The pending local correction also scans leading daemon notices without expanding all stderr into a line array. No performance improvement is claimed.
bsakaguchi 2026-10-31 00:36:37 +00:00
  • closed this issue
  • added the
    triage
    bug
    labels
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#3098
No description provided.