[GH-ISSUE #5642] [Bug] Reverse command error classification can throw or replace non-Error failures #3419

Closed
opened 2026-10-31 00:40:10 +00:00 by bsakaguchi · 2 comments
Owner

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

Before submitting

  • I searched open and closed issues and PRs for related reports.
  • I removed credentials and private target data.

Area

Native analysis or decompilation

Observed behavior

Controlled application-boundary tests show ReverseEngineeringService.inspectWithObjdump can throw while classifying a rejected stat or command promise. A rejection with null or undefined reaches an unchecked .code read. Separately, stat rejection with undefined is treated as successful settlement with no Stats, replacing the original failure with Cannot read properties of undefined (reading 'isFile').

This is an injected-boundary reproduction, not a real filesystem/provider reproduction.

Reproduction

Executed four source tests against edbd291a28a70e2c0b984ff374d5a6b437280e82, using the production service and its supported stat/run injection ports. For each port, reject its promise with null, then with undefined; invoke inspectWithObjdump({path: inertFixture, operation: 'symbols'}). The fixture is four inert ELF-magic bytes. All four controls failed: three operations threw during classification; the undefined-stat case returned a different cause.

The candidate regression is tests/composition/reverseEngineeringUnknownFailures.test.ts; command executed: vitest run --project composition tests/composition/reverseEngineeringUnknownFailures.test.ts. The four controls pass with the candidate structural fix. No command provider was launched.

Expected behavior

Return the declared Result<Evidence, AnalysisError> with a meaningful typed classification and original rejection cause, even when a boundary rejects a non-Error value. AGENTS.md requires parsing unknown boundary values and preserving meaningful failure reasons. statWithDeadline must distinguish successful Stats from every rejection value.

Impact and scope

Observed only at the injected application ports. NOT_ENOUGH_INFO: whether a shipped filesystem/provider emits such a rejection. No target execution, evidence corruption, or resource escape was observed. The unchecked reads and undefined settlement sentinel also remain in main b3aadaf474e59b33e5ff465236008a67eccefb87 by source inspection.

REA version

6.7.0, source baseline edbd291a28a70e2c0b984ff374d5a6b437280e82; current-source inspection at b3aadaf474e59b33e5ff465236008a67eccefb87.

Runtime and platform

Node.js 24.18.0; Darwin 25.3.0 arm64. No Hopper/Ghidra/objdump execution.

Target and artifact context

Disposable four-byte inert local file; no executable workload.

Interface

Other: shared application service boundary.

Earliest failure stage

Transport or result projection

Relevant output or evidence

TypeError: Cannot read properties of null (reading 'code') and the corresponding undefined variant originate in the service's preflight/command catches. The undefined-stat control instead receives an isFile TypeError as its cause. The candidate replaces the optional (cause, value) settlement convention with Result<Stats, unknown> and parses error codes before classification.

Typed outcome or recovery expected

Preserve null/undefined rejection identity and return a schema-valid typed error. Existing known errno, cancellation, cleanup, and captured-output paths must retain their classifications. No real-provider restoration claim is made.

Analysis or suspected cause

Source-derived: two cause as NodeJS.ErrnoException assertions do not validate runtime values. statWithDeadline.finish(cause?, value?) uses undefined as a success sentinel, although promises can reject with undefined.

Additional context

Prepared with AI assistance; independently source-reviewed. Related #5401 concerns lost path diagnostics for ordinary ENOENT/directory failures. Searches for statWithDeadline, ReverseEngineeringService undefined, and objdump non-Error/property-read reports found no matching issue or PR. NOT_ENOUGH_INFO: first introducing revision and real-provider frequency.

Originally created by @morluto on GitHub (Oct 20, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/5642 ### Before submitting - [x] I searched open and closed issues and PRs for related reports. - [x] I removed credentials and private target data. ### Area Native analysis or decompilation ### Observed behavior Controlled application-boundary tests show `ReverseEngineeringService.inspectWithObjdump` can throw while classifying a rejected stat or command promise. A rejection with `null` or `undefined` reaches an unchecked `.code` read. Separately, stat rejection with `undefined` is treated as successful settlement with no Stats, replacing the original failure with `Cannot read properties of undefined (reading 'isFile')`. This is an injected-boundary reproduction, not a real filesystem/provider reproduction. ### Reproduction Executed four source tests against `edbd291a28a70e2c0b984ff374d5a6b437280e82`, using the production service and its supported `stat`/`run` injection ports. For each port, reject its promise with `null`, then with `undefined`; invoke `inspectWithObjdump({path: inertFixture, operation: 'symbols'})`. The fixture is four inert ELF-magic bytes. All four controls failed: three operations threw during classification; the undefined-stat case returned a different cause. The candidate regression is `tests/composition/reverseEngineeringUnknownFailures.test.ts`; command executed: `vitest run --project composition tests/composition/reverseEngineeringUnknownFailures.test.ts`. The four controls pass with the candidate structural fix. No command provider was launched. ### Expected behavior Return the declared `Result<Evidence, AnalysisError>` with a meaningful typed classification and original rejection cause, even when a boundary rejects a non-Error value. `AGENTS.md` requires parsing unknown boundary values and preserving meaningful failure reasons. `statWithDeadline` must distinguish successful Stats from every rejection value. ### Impact and scope Observed only at the injected application ports. NOT_ENOUGH_INFO: whether a shipped filesystem/provider emits such a rejection. No target execution, evidence corruption, or resource escape was observed. The unchecked reads and undefined settlement sentinel also remain in main `b3aadaf474e59b33e5ff465236008a67eccefb87` by source inspection. ### REA version 6.7.0, source baseline `edbd291a28a70e2c0b984ff374d5a6b437280e82`; current-source inspection at `b3aadaf474e59b33e5ff465236008a67eccefb87`. ### Runtime and platform Node.js 24.18.0; Darwin 25.3.0 arm64. No Hopper/Ghidra/objdump execution. ### Target and artifact context Disposable four-byte inert local file; no executable workload. ### Interface Other: shared application service boundary. ### Earliest failure stage Transport or result projection ### Relevant output or evidence `TypeError: Cannot read properties of null (reading 'code')` and the corresponding undefined variant originate in the service's preflight/command catches. The undefined-stat control instead receives an `isFile` TypeError as its cause. The candidate replaces the optional `(cause, value)` settlement convention with `Result<Stats, unknown>` and parses error codes before classification. ### Typed outcome or recovery expected Preserve null/undefined rejection identity and return a schema-valid typed error. Existing known errno, cancellation, cleanup, and captured-output paths must retain their classifications. No real-provider restoration claim is made. ### Analysis or suspected cause Source-derived: two `cause as NodeJS.ErrnoException` assertions do not validate runtime values. `statWithDeadline.finish(cause?, value?)` uses undefined as a success sentinel, although promises can reject with undefined. ### Additional context Prepared with AI assistance; independently source-reviewed. Related #5401 concerns lost path diagnostics for ordinary ENOENT/directory failures. Searches for `statWithDeadline`, `ReverseEngineeringService undefined`, and objdump non-Error/property-read reports found no matching issue or PR. NOT_ENOUGH_INFO: first introducing revision and real-provider frequency.
bsakaguchi 2026-10-31 00:40:10 +00:00
  • closed this issue
  • added the
    bug
    triage
    labels
Author
Owner

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

Cross-referencing with canonical issue #5401 ([Bug] inspect-with-objdump loses missing-file and directory failure reasons). Both address error propagation, diagnostic preservation, and unexpected rejection boundary handling in ReverseEngineeringService.inspectWithObjdump. Cataloged under Cluster BP in consolidation tracker #4330.

<!-- gh-comment-id:6297655357 --> @matbrgz commented on GitHub (Oct 20, 2026): Cross-referencing with canonical issue #5401 (`[Bug] inspect-with-objdump loses missing-file and directory failure reasons`). Both address error propagation, diagnostic preservation, and unexpected rejection boundary handling in `ReverseEngineeringService.inspectWithObjdump`. Cataloged under Cluster BP in consolidation tracker #4330.
Author
Owner

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

Closing as completed: verified fixed on main at 1629266e3 (unknown-failure / null-undefined reverse classification). The four unknown-failure regression controls pass on current main. Tracked during REA Bot open-bug audit; no further PR needed for this report.

<!-- gh-comment-id:6300556853 --> @morluto commented on GitHub (Oct 20, 2026): Closing as completed: verified fixed on main at `1629266e3` (unknown-failure / null-undefined reverse classification). The four unknown-failure regression controls pass on current main. Tracked during REA Bot open-bug audit; no further PR needed for this report.
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#3419
No description provided.