[PR #6498] [CLOSED] fix(android): preserve schema issues in input errors #7372

Closed
opened 2026-11-01 21:47:23 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6498
Author: @Ethereal49
Created: 10/23/2026
Status: ❌ Closed

Base: main ← Head: fix/android-schema-input-issues


📝 Commits (5)

  • dc8d002 fix(android): preserve schema issues in input errors
  • 75904cd fix(android): preserve schema issues in input errors
  • 42b0341 merge: preserve published branch while updating main
  • 167d1b7 merge: update branch with latest main
  • b58517c merge: update branch with latest main

📊 Changes

2 files changed (+101 additions, -1 deletions)

View changed files

➕ src/application/android/AndroidAnalysisService.test.ts (+88 -0)
📝 src/application/android/AndroidAnalysisService.ts (+13 -1)

📄 Description

ELI5

When an Android CLI command receives an explicitly empty required value, REA already rejects it and exits with status 1. This change keeps the existing rejection but also returns the rejected field and its minimum length, so the caller can correct the request without guessing.

What Changed

The Android analysis service now projects the already-available Zod issues through projectInputIssues() when it constructs AnalysisInputError. It removes the internal input path segment while preserving the public field path and constraint.

Before:

{
  "code": "invalid_request",
  "category": "invalid_input",
  "recovery": {
    "kind": "inspect_input_contract",
    "operation": "inspect_android_class"
  }
}

After:

{
  "code": "invalid_request",
  "category": "invalid_input",
  "details": {
    "operation": "inspect_android_class",
    "issues": [
      {
        "path": ["class_name"],
        "reason": "out_of_range",
        "minimum": 1
      }
    ]
  },
  "recovery": {
    "kind": "inspect_input_contract",
    "operation": "inspect_android_class"
  }
}

Why

The schema and shared projection already contain the safe correction metadata, but Android service admission discarded it. Reusing the existing projector fixes the shared failure point instead of adding command-specific error handling.

Linked Issue

Fixes https://github.com/morluto/rea/issues/5971

Visual Proof

N/A: this changes JSON CLI output, not a visual interface.

Testing

  • Automated tests added
  • I manually tested these changes locally

Validation performed:

  • Base worktree at f850b7c894fa5cba370092a3ad9ca3df899d6d6f, after npm run compile; node scripts/rea.mjs inspect-android-class /nonexistent/example.apk "" --format json exited 1 with details: null.
  • Fixed branch; the same command exits 1 and returns details.issues with path: ["class_name"], reason: "out_of_range", and minimum: 1.
  • The same GREEN check passed for inspect-android-package, inspect-android-method, trace-android-references, and search-android-classes; all five exit 1 with empty stderr and do not echo the rejected path or value.
  • npm run check:changed passed the repository static checks and 5 changed test files / 23 tests, including 3 Android service tests.

AI Disclosure

Codex completed source diagnosis, implementation, local validation, commit preparation, and this PR draft.

Review

Please focus review on the Android service admission boundary and the removal of only the internal input path segment.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • No target/provider interaction is needed for this validation failure.
  • MCP input admission, APK/device/JADX analysis, and real provider analysis were not run.
  • The change does not alter valid-target handling: a valid input with a nonexistent target remains target_unavailable.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Before/after screenshots are not applicable because the observable change is JSON CLI output
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass

Author readiness

Human owner: Ethereal49

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are up to date or unaffected.
  • User-visible CLI output includes representative before/after.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/6498 **Author:** [@Ethereal49](https://github.com/Ethereal49) **Created:** 10/23/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/android-schema-input-issues` --- ### 📝 Commits (5) - [`dc8d002`](https://github.com/morluto/rea/commit/dc8d00280ee7718bee5fa838d4f4a283f63c23d7) fix(android): preserve schema issues in input errors - [`75904cd`](https://github.com/morluto/rea/commit/75904cd0f9f0327ececb5a9be04ebad20858c634) fix(android): preserve schema issues in input errors - [`42b0341`](https://github.com/morluto/rea/commit/42b0341f6efdc3d641131e99942e980f4cdabd5a) merge: preserve published branch while updating main - [`167d1b7`](https://github.com/morluto/rea/commit/167d1b796d6ba3e5b042e0b47f7b77223ea3d301) merge: update branch with latest main - [`b58517c`](https://github.com/morluto/rea/commit/b58517c7ea6854ba514e4b21e85ad4cf3ee45bdf) merge: update branch with latest main ### 📊 Changes **2 files changed** (+101 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `src/application/android/AndroidAnalysisService.test.ts` (+88 -0) 📝 `src/application/android/AndroidAnalysisService.ts` (+13 -1) </details> ### 📄 Description ## ELI5 When an Android CLI command receives an explicitly empty required value, REA already rejects it and exits with status 1. This change keeps the existing rejection but also returns the rejected field and its minimum length, so the caller can correct the request without guessing. ## What Changed The Android analysis service now projects the already-available Zod issues through `projectInputIssues()` when it constructs `AnalysisInputError`. It removes the internal `input` path segment while preserving the public field path and constraint. Before: ```json { "code": "invalid_request", "category": "invalid_input", "recovery": { "kind": "inspect_input_contract", "operation": "inspect_android_class" } } ``` After: ```json { "code": "invalid_request", "category": "invalid_input", "details": { "operation": "inspect_android_class", "issues": [ { "path": ["class_name"], "reason": "out_of_range", "minimum": 1 } ] }, "recovery": { "kind": "inspect_input_contract", "operation": "inspect_android_class" } } ``` ## Why The schema and shared projection already contain the safe correction metadata, but Android service admission discarded it. Reusing the existing projector fixes the shared failure point instead of adding command-specific error handling. ## Linked Issue Fixes https://github.com/morluto/rea/issues/5971 ## Visual Proof N/A: this changes JSON CLI output, not a visual interface. ## Testing - [x] Automated tests added - [x] I manually tested these changes locally Validation performed: - Base worktree at `f850b7c894fa5cba370092a3ad9ca3df899d6d6f`, after `npm run compile`; `node scripts/rea.mjs inspect-android-class /nonexistent/example.apk "" --format json` exited 1 with `details: null`. - Fixed branch; the same command exits 1 and returns `details.issues` with `path: ["class_name"]`, `reason: "out_of_range"`, and `minimum: 1`. - The same GREEN check passed for `inspect-android-package`, `inspect-android-method`, `trace-android-references`, and `search-android-classes`; all five exit 1 with empty stderr and do not echo the rejected path or value. - `npm run check:changed` passed the repository static checks and 5 changed test files / 23 tests, including 3 Android service tests. ## AI Disclosure Codex completed source diagnosis, implementation, local validation, commit preparation, and this PR draft. ## Review Please focus review on the Android service admission boundary and the removal of only the internal `input` path segment. ## Agent skill upstream boundary - [x] Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation. ## Notes - No target/provider interaction is needed for this validation failure. - MCP input admission, APK/device/JADX analysis, and real provider analysis were not run. - The change does not alter valid-target handling: a valid input with a nonexistent target remains `target_unavailable`. ## Checklist - [x] This PR is small and focused - [x] I explained what changed and why - [x] Before/after screenshots are not applicable because the observable change is JSON CLI output - [x] Self-reviewed for correctness, security, and performance - [x] Cross-platform, SSH/remote, and path/shortcut impact considered - [x] `pnpm lint`, `pnpm typecheck`, `pnpm test`, and `pnpm build` pass ## Author readiness Human owner: [Ethereal49](https://github.com/Ethereal49) - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are up to date or unaffected. - [x] User-visible CLI output includes representative before/after. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:47:23 +00:00
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#7372
No description provided.