[GH-ISSUE #5217] [Bug] inspect-dart-aot advertises ABI strings that request validation rejects #3195

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

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

Before submitting

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

Area

CLI

Observed behavior

inspect-dart-aot --schema --json advertises ABI strings with length constraints but no character constraint. ARM64-V8A, ARM64, and arm64.v8a all pass that returned options schema, then receive a generic invalid_request without identifying abi. These refusals follow the tested canonical grammar; the discoverable schema and correction information are incomplete.

Reproduction

The executed check used production createCli({}).serve(...) through tests/boundary/cli/cliServeHarness.ts, with Ajv validating the actual emitted options schema. Each of the three names rejected by the tested grammar reproduced both with a synthetic APK and with nonexistent fixture.apk; the one-character controls A and a instead returned VALIDATION_ERROR naming abi. The same synthetic APK succeeded with arm64-v8a and complete coverage.

For a standalone replay, use the source revision below with its pinned toolchain, npm ci, and npm run build:cached, then run the following from the checkout root. These launcher commands express the argument arrays exercised by the boundary test; the standalone launcher itself was not executed in that verification. No APK is needed for the cases rejected by the tested grammar.

node scripts/rea.mjs inspect-dart-aot --schema --json > abi-schema.json
node --input-type=module <<'JS'
import { readFileSync } from 'node:fs';
import Ajv from 'ajv';
const schema = JSON.parse(readFileSync('abi-schema.json', 'utf8'));
const accepts = new Ajv().compile(schema.options);
for (const abi of ['ARM64-V8A', 'ARM64', 'arm64.v8a', 'A', 'a']) {
  console.log(JSON.stringify({ abi, accepted: accepts({ abi }) }));
}
JS
for abi in ARM64-V8A ARM64 arm64.v8a A a; do
  node scripts/rea.mjs inspect-dart-aot fixture.apk --abi "$abi" --json
done

The first three schema checks return true; the two length controls return false. No standalone process exit-status claim is made.

Expected behavior

The discoverable options schema should accurately describe the resulting supported ABI syntax so callers can identify admitted spellings before requesting inspection. Values that remain lexically refused should receive useful correction information identifying abi and the supported syntax, consistent with the field guidance in the tested length-invalid controls. The resulting grammar may admit spellings refused by the tested baseline. This discovery and correction-guidance contract leaves the supported syntax open to change and does not require identical CLI/MCP error envelopes.

Impact and scope

Observed impact is misleading input metadata and incomplete correction guidance for ABI values rejected by the tested grammar. Supported lowercase inspection succeeded; no wrong analysis result or data loss was observed. Frequency outside the tested cases is unknown.

REA version

Runtime-tested source revision: 39275420ea18ad803eccfcc2702865b98ed36e44, also the current default-branch revision when checked. Latest published release: rea-agents-6.7.0, commit 27dc42d10249f0410904a75c0997842eb03b931c. The CLI declaration, canonical request schema, service admission, and MCP binding are identical between these revisions; release applicability is source-derived, with no separate release runtime reproduction.

Runtime and platform

Node.js v24.18.0, macOS arm64; locked checkout dependencies and prepared runtime artifacts. No external engine or target execution.

Target and artifact context

The reduction for inputs rejected by the tested grammar uses a nonexistent APK path. The successful control used an inert APK containing lib/arm64-v8a/libapp.so, generated with the repository's createFlutterApk and aotFixtureImage helpers.

Interface

CLI

Earliest failure stage

Request parsing or validation

Relevant output or evidence

The emitted options.properties.abi contains type: "string", minLength: 2, and maxLength: 16, without pattern. Ajv accepts all three length-valid values rejected by the tested canonical grammar. Each then returns:

{
  "code": "invalid_request",
  "category": "invalid_input",
  "message": "Analysis input is invalid. Check the arguments and try again.",
  "retryable": true,
  "remediation": {
    "action": "Correct the listed arguments and retry."
  }
}

There is no details.issues or fieldErrors identifying abi. Both one-character controls return VALIDATION_ERROR with fieldErrors[0].path: "abi"; the lowercase APK control returns operation: "inspect_dart_aot", normalized_result.abi: "arm64-v8a", and normalized_result.coverage: "complete".

  • Expected source: The canonical request schema defines the tested grammar: 2–16 lowercase letters, digits, underscores, or hyphens. The lockfile-pinned Incur README's “Command schema” section documents --schema for validation and tooling.
  • Failure source: The executed CLI boundary results above; the CLI option declaration omits the character restriction, and shared admission refuses the canonical parse without supplying input issues.
  • Evidence provenance: observed
  • Local verification: reproduced
  • Reproduction completeness: complete

One focused CLI-boundary test passed all three values rejected by the tested grammar, both length controls, their no-file variants, and the successful lowercase fixture control. Direct canonical and MCP-bound schema calls agreed for each value; no MCP wire request was executed.

Typed outcome or recovery expected

Make the discoverable ABI schema accurately describe the resulting supported syntax, including how request validation treats ARM64-V8A, ARM64 and arm64.v8a. For each value that remains lexically refused, provide useful correction information identifying abi and the supported syntax. Recheck A and a against the resulting grammar and retain specific correction information whenever they remain refused. Preserve successful arm64-v8a inspection of the same fixture. The uppercase and dotted cases record the tested mismatch; this check does not require their continued rejection, prescribe a regex, or restrict explicit selection of an admitted payload.

Analysis or suspected cause

Source-derived: the CLI declares only ABI length constraints. Values passing those constraints reach shared canonical validation, which constructs AnalysisInputError without its issue list. The existing projector emits issue details only for a nonempty list. Release-to-main changes in that projector concern cleanup diagnostics and reports; the input-issue branch is unchanged.

Additional context

Issue #2180 concerns missing diagnostics in browser and Inspector handlers and explicitly treats advertised-schema constraints as a separate property. This report concerns Dart AOT's advertised ABI grammar and its shared-admission refusal; the existing issue's listed commands and restoration checks do not cover it. This report closes the discovery and correction-guidance contract. Explicit access to an admitted payload is a separate selection contract; accurately describing the resulting syntax must remain compatible with restoring that selection.

Triage assessment

  • Impact level: P3
  • Assessment status: supported
  • Impact basis: The demonstrated defect affects option metadata and correction diagnostics for values rejected by the tested grammar. Supported lowercase inspection succeeds; no consequential analysis change was observed, and wider frequency is unknown.
  • Workaround status: available
  • Workaround basis: Supplying the synthetic APK's actual lowercase ABI, arm64-v8a, succeeded. This does not establish that arbitrary directory names can safely be normalized or inspected.
Originally created by @coygeek on GitHub (Oct 19, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/5217 ### 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 CLI ### Observed behavior `inspect-dart-aot --schema --json` advertises ABI strings with length constraints but no character constraint. `ARM64-V8A`, `ARM64`, and `arm64.v8a` all pass that returned options schema, then receive a generic `invalid_request` without identifying `abi`. These refusals follow the tested canonical grammar; the discoverable schema and correction information are incomplete. ### Reproduction The executed check used production `createCli({}).serve(...)` through `tests/boundary/cli/cliServeHarness.ts`, with Ajv validating the actual emitted options schema. Each of the three names rejected by the tested grammar reproduced both with a synthetic APK and with nonexistent `fixture.apk`; the one-character controls `A` and `a` instead returned `VALIDATION_ERROR` naming `abi`. The same synthetic APK succeeded with `arm64-v8a` and complete coverage. For a standalone replay, use the source revision below with its pinned toolchain, `npm ci`, and `npm run build:cached`, then run the following from the checkout root. These launcher commands express the argument arrays exercised by the boundary test; the standalone launcher itself was not executed in that verification. No APK is needed for the cases rejected by the tested grammar. ```sh node scripts/rea.mjs inspect-dart-aot --schema --json > abi-schema.json node --input-type=module <<'JS' import { readFileSync } from 'node:fs'; import Ajv from 'ajv'; const schema = JSON.parse(readFileSync('abi-schema.json', 'utf8')); const accepts = new Ajv().compile(schema.options); for (const abi of ['ARM64-V8A', 'ARM64', 'arm64.v8a', 'A', 'a']) { console.log(JSON.stringify({ abi, accepted: accepts({ abi }) })); } JS for abi in ARM64-V8A ARM64 arm64.v8a A a; do node scripts/rea.mjs inspect-dart-aot fixture.apk --abi "$abi" --json done ``` The first three schema checks return true; the two length controls return false. No standalone process exit-status claim is made. ### Expected behavior The discoverable options schema should accurately describe the resulting supported ABI syntax so callers can identify admitted spellings before requesting inspection. Values that remain lexically refused should receive useful correction information identifying `abi` and the supported syntax, consistent with the field guidance in the tested length-invalid controls. The resulting grammar may admit spellings refused by the tested baseline. This discovery and correction-guidance contract leaves the supported syntax open to change and does not require identical CLI/MCP error envelopes. ### Impact and scope Observed impact is misleading input metadata and incomplete correction guidance for ABI values rejected by the tested grammar. Supported lowercase inspection succeeded; no wrong analysis result or data loss was observed. Frequency outside the tested cases is unknown. ### REA version Runtime-tested source revision: `39275420ea18ad803eccfcc2702865b98ed36e44`, also the current default-branch revision when checked. Latest published release: `rea-agents-6.7.0`, commit `27dc42d10249f0410904a75c0997842eb03b931c`. The CLI declaration, canonical request schema, service admission, and MCP binding are identical between these revisions; release applicability is source-derived, with no separate release runtime reproduction. ### Runtime and platform Node.js v24.18.0, macOS arm64; locked checkout dependencies and prepared runtime artifacts. No external engine or target execution. ### Target and artifact context The reduction for inputs rejected by the tested grammar uses a nonexistent APK path. The successful control used an inert APK containing `lib/arm64-v8a/libapp.so`, generated with the repository's `createFlutterApk` and `aotFixtureImage` helpers. ### Interface CLI ### Earliest failure stage Request parsing or validation ### Relevant output or evidence The emitted `options.properties.abi` contains `type: "string"`, `minLength: 2`, and `maxLength: 16`, without `pattern`. Ajv accepts all three length-valid values rejected by the tested canonical grammar. Each then returns: ```json { "code": "invalid_request", "category": "invalid_input", "message": "Analysis input is invalid. Check the arguments and try again.", "retryable": true, "remediation": { "action": "Correct the listed arguments and retry." } } ``` There is no `details.issues` or `fieldErrors` identifying `abi`. Both one-character controls return `VALIDATION_ERROR` with `fieldErrors[0].path: "abi"`; the lowercase APK control returns `operation: "inspect_dart_aot"`, `normalized_result.abi: "arm64-v8a"`, and `normalized_result.coverage: "complete"`. - Expected source: The [canonical request schema](https://github.com/morluto/rea/blob/39275420ea18ad803eccfcc2702865b98ed36e44/src/domain/flutter/flutterBuildAnalysis.ts#L14-L30) defines the tested grammar: 2–16 lowercase letters, digits, underscores, or hyphens. The lockfile-pinned Incur README's “Command schema” section documents `--schema` for validation and tooling. - Failure source: The executed CLI boundary results above; the [CLI option declaration](https://github.com/morluto/rea/blob/39275420ea18ad803eccfcc2702865b98ed36e44/src/cli/flutterCommands.ts#L53-L83) omits the character restriction, and [shared admission](https://github.com/morluto/rea/blob/39275420ea18ad803eccfcc2702865b98ed36e44/src/application/ProviderOperationExecution.ts#L49-L56) refuses the canonical parse without supplying input issues. - Evidence provenance: observed - Local verification: reproduced - Reproduction completeness: complete One focused CLI-boundary test passed all three values rejected by the tested grammar, both length controls, their no-file variants, and the successful lowercase fixture control. Direct canonical and MCP-bound schema calls agreed for each value; no MCP wire request was executed. ### Typed outcome or recovery expected Make the discoverable ABI schema accurately describe the resulting supported syntax, including how request validation treats `ARM64-V8A`, `ARM64` and `arm64.v8a`. For each value that remains lexically refused, provide useful correction information identifying `abi` and the supported syntax. Recheck `A` and `a` against the resulting grammar and retain specific correction information whenever they remain refused. Preserve successful `arm64-v8a` inspection of the same fixture. The uppercase and dotted cases record the tested mismatch; this check does not require their continued rejection, prescribe a regex, or restrict explicit selection of an admitted payload. ### Analysis or suspected cause Source-derived: the CLI declares only ABI length constraints. Values passing those constraints reach shared canonical validation, which constructs `AnalysisInputError` without its issue list. The existing projector emits issue details only for a nonempty list. Release-to-main changes in that projector concern cleanup diagnostics and reports; the input-issue branch is unchanged. ### Additional context [Issue #2180](https://github.com/morluto/rea/issues/2180) concerns missing diagnostics in browser and Inspector handlers and explicitly treats advertised-schema constraints as a separate property. This report concerns Dart AOT's advertised ABI grammar and its shared-admission refusal; the existing issue's listed commands and restoration checks do not cover it. This report closes the discovery and correction-guidance contract. Explicit access to an admitted payload is a separate selection contract; accurately describing the resulting syntax must remain compatible with restoring that selection. ## Triage assessment - Impact level: P3 - Assessment status: supported - Impact basis: The demonstrated defect affects option metadata and correction diagnostics for values rejected by the tested grammar. Supported lowercase inspection succeeds; no consequential analysis change was observed, and wider frequency is unknown. - Workaround status: available - Workaround basis: Supplying the synthetic APK's actual lowercase ABI, `arm64-v8a`, succeeded. This does not establish that arbitrary directory names can safely be normalized or inspected.
Author
Owner

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

Fixed on main in 64abd4aefb, with shared-admission diagnostics completed in a0edd145d3.

CLI arguments/options now reuse canonical Flutter fields, including local-path validation, instead of independently declaring a weaker ABI schema. The resulting grammar admits reported nonstandard labels without normalization; empty, slash-containing and over-bound selectors receive field-specific ABI correction. The Unicode pattern has the same counting/end semantics in actual advertised schemas and runtime validation. Inventory continues to own its exact UTF-8 path budget. Shared canonical refusals now use the existing safe issue projector and expose caller-relative paths while retaining their schema cause.

Baseline public CLI regressions:2 failed,5 passed. Actual Incur --schema output and SDK tools/list schemas were validated with AJV, including astral characters and boundary lengths; valid selection was exercised through the production provider and public CLI/MCP workflows.127 focused tests/5 files passed, plus final CLI file9/9. The shared-helper/JEB follow-up passed63 focused tests/8 files and24 additional ADB/Apktool/Flutter service controls, with final JEB service4/4. Check, check:fast, docs:check and test discovery passed. See #5219 for standalone parsing and descriptive cost scope.

Real parsers and synthetic APK/ELF fixtures were used; no device, target execution, real JEB engine, or separate stable-release runtime was exercised. The nearby schema-drift finding was recorded and fixed as #5234.

<!-- gh-comment-id:6265443846 --> @morluto commented on GitHub (Oct 19, 2026): Fixed on main in 64abd4aefb23317dd4f787094456d1b19de47c77, with shared-admission diagnostics completed in a0edd145d31ffeb9f022c25ec9e9131083f563d5. CLI arguments/options now reuse canonical Flutter fields, including local-path validation, instead of independently declaring a weaker ABI schema. The resulting grammar admits reported nonstandard labels without normalization; empty, slash-containing and over-bound selectors receive field-specific ABI correction. The Unicode pattern has the same counting/end semantics in actual advertised schemas and runtime validation. Inventory continues to own its exact UTF-8 path budget. Shared canonical refusals now use the existing safe issue projector and expose caller-relative paths while retaining their schema cause. Baseline public CLI regressions:2 failed,5 passed. Actual Incur --schema output and SDK tools/list schemas were validated with AJV, including astral characters and boundary lengths; valid selection was exercised through the production provider and public CLI/MCP workflows.127 focused tests/5 files passed, plus final CLI file9/9. The shared-helper/JEB follow-up passed63 focused tests/8 files and24 additional ADB/Apktool/Flutter service controls, with final JEB service4/4. Check, check:fast, docs:check and test discovery passed. See #5219 for standalone parsing and descriptive cost scope. Real parsers and synthetic APK/ELF fixtures were used; no device, target execution, real JEB engine, or separate stable-release runtime was exercised. The nearby schema-drift finding was recorded and fixed as #5234.
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#3195
No description provided.