[PR #1089] [MERGED] fix(workflows): keep caller-input details in workflow input errors #2637

Closed
opened 2026-10-17 21:08:29 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1089
Author: @kaoru0822-kitauji
Created: 10/8/2026
Status: ✅ Merged
Merged: 10/8/2026
Merged by: @N0zoM1z0

Base: main ← Head: fix/managed-input-details


📝 Commits (5)

  • 5ff4df6 fix(managed): keep caller-input details in managed workflow errors
  • 8a36ee6 fix(managed): keep nested Evidence schema issues off request paths
  • be9b13a test(managed): type the malformed nested Evidence fixture
  • ec6b648 fix(workflows): keep input details in the remaining workflow services
  • 4661e53 Merge remote-tracking branch 'origin/main' into fix/managed-input-details

📊 Changes

11 files changed (+198 additions, -49 deletions)

View changed files

📝 src/application/InventoryProjectionEvidence.ts (+4 -6)
📝 src/application/ReconstructionCoverageService.ts (+9 -6)
📝 src/application/ReconstructionObligationLedgerService.ts (+4 -6)
📝 src/application/managed/ManagedApplicationGraphService.ts (+7 -6)
📝 src/application/managed/ManagedMemberComparisonService.ts (+7 -13)
📝 src/application/managed/ManagedNativeVerificationService.ts (+7 -6)
📝 src/application/managed/ManagedReconstructionService.test.ts (+76 -0)
📝 src/application/managed/ManagedReconstructionService.ts (+7 -6)
➕ src/application/workflowInputError.ts (+38 -0)
📝 tests/boundary/mcp/reconstructionCoverageMcp.test.ts (+22 -0)
📝 tests/boundary/providers/managed/managedMemberComparison.test.ts (+17 -0)

📄 Description

Problem

The managed workflow services, inventory projection, the reconstruction obligation ledger and reconstruction coverage classify rejected input as AnalysisInputError but construct it as new AnalysisInputError(op, { cause }) with no issues. The projected result tells the caller to "Correct the listed arguments and retry." but lists nothing:

{"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."}}

Reproduced on main:

  • rea import-managed-reconstruction '{}', rea project-managed-application-graph '{"foo":1}' and rea verify-managed-native-boundaries call the raw entry points. Every Zod schema issue is dropped.
  • Domain checks that these services already classify as input errors lose their message on both CLI and MCP. Examples: "reconstruction text hash mismatch", "Evidence operation is not inspect_managed_members", "Managed graph projection requires managed Evidence".
  • rea compare-managed-members /missing.dll other.dll returns the same empty input error and does not say which path failed or why.
  • evaluate_reconstruction_coverage for an unknown boundary_id drops "Unknown reconstruction boundary: X" on both CLI and MCP. project_android_application_graph, project_apple_application_graph and build_reconstruction_obligation_ledger have the same pattern.

Change

  • Add two helpers in src/application/workflowInputError.ts. requestInputError projects the raw request's schema failures through projectInputIssues, keeping request paths and reasons. workflowInputError handles failures raised after the request parsed: a domain TypeError becomes one invalid_value issue carrying its message. A nested Evidence ZodError becomes root-path issues whose message names the nested location, so it never points at a wrong request field. This follows JavaScriptApplicationWorkflowService and JavaScriptRuntimeReconciliationService. The classification is unchanged: only issues these services already returned as input errors gain details.
  • Use them in ManagedReconstructionService, ManagedApplicationGraphService, ManagedNativeVerificationService, ManagedMemberComparisonService, InventoryProjectionEvidence, ReconstructionObligationLedgerService and ReconstructionCoverageService.
  • compareManagedMemberPaths returns the BinaryTargetError from parseBinaryTarget unchanged (target_unavailable with details.path and the reason), as every other path-based command reports an unopenable target.

No schemas change.

Verification

  • npm run test:focused -- src/application/managed/ManagedReconstructionService.test.ts tests/boundary/providers/managed/managedMemberComparison.test.ts tests/composition/analysis-sessions/managedApplicationGraph.test.ts tests/conformance/providers/managed/managedNativeVerification.test.ts: 26 passed. The new assertions cover schema issues, a domain-constraint message, a malformed nested Evidence result and a missing comparison path.
  • tests/boundary/mcp/reconstructionCoverageMcp.test.ts now covers the unknown-boundary message over MCP and fails with the source change reverted.
  • All 51 test files that reference these services or tools: 399 passed, 3 skipped.
  • npm run check:fast
  • rea import-managed-reconstruction '{}' now lists static_members, decompiler and the other missing fields. rea compare-managed-members with a missing file reports target_unavailable with the missing path.

No real Hopper or Ghidra verification was run, because this change does not touch those providers.

🤖 Generated with Claude Code


🔄 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/1089 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/8/2026 **Status:** ✅ Merged **Merged:** 10/8/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/managed-input-details` --- ### 📝 Commits (5) - [`5ff4df6`](https://github.com/morluto/rea/commit/5ff4df65532320df4ab8a493bdd1ff263391a669) fix(managed): keep caller-input details in managed workflow errors - [`8a36ee6`](https://github.com/morluto/rea/commit/8a36ee64ea80bab9eda8cfdf06c168ba1275a714) fix(managed): keep nested Evidence schema issues off request paths - [`be9b13a`](https://github.com/morluto/rea/commit/be9b13aac765d4a0c999c0fdb39e335e28b6d5fc) test(managed): type the malformed nested Evidence fixture - [`ec6b648`](https://github.com/morluto/rea/commit/ec6b648245c74cd72f357e4b3e190065f78f11e4) fix(workflows): keep input details in the remaining workflow services - [`4661e53`](https://github.com/morluto/rea/commit/4661e53fb8329297402b1a0a89a1058ea4566503) Merge remote-tracking branch 'origin/main' into fix/managed-input-details ### 📊 Changes **11 files changed** (+198 additions, -49 deletions) <details> <summary>View changed files</summary> 📝 `src/application/InventoryProjectionEvidence.ts` (+4 -6) 📝 `src/application/ReconstructionCoverageService.ts` (+9 -6) 📝 `src/application/ReconstructionObligationLedgerService.ts` (+4 -6) 📝 `src/application/managed/ManagedApplicationGraphService.ts` (+7 -6) 📝 `src/application/managed/ManagedMemberComparisonService.ts` (+7 -13) 📝 `src/application/managed/ManagedNativeVerificationService.ts` (+7 -6) 📝 `src/application/managed/ManagedReconstructionService.test.ts` (+76 -0) 📝 `src/application/managed/ManagedReconstructionService.ts` (+7 -6) ➕ `src/application/workflowInputError.ts` (+38 -0) 📝 `tests/boundary/mcp/reconstructionCoverageMcp.test.ts` (+22 -0) 📝 `tests/boundary/providers/managed/managedMemberComparison.test.ts` (+17 -0) </details> ### 📄 Description ## Problem The managed workflow services, inventory projection, the reconstruction obligation ledger and reconstruction coverage classify rejected input as `AnalysisInputError` but construct it as `new AnalysisInputError(op, { cause })` with **no issues**. The projected result tells the caller to "Correct the listed arguments and retry." but lists nothing: ```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."}} ``` Reproduced on `main`: - `rea import-managed-reconstruction '{}'`, `rea project-managed-application-graph '{"foo":1}'` and `rea verify-managed-native-boundaries` call the raw entry points. Every Zod schema issue is dropped. - Domain checks that these services already classify as input errors lose their message on both CLI and MCP. Examples: "reconstruction text hash mismatch", "Evidence operation is not inspect_managed_members", "Managed graph projection requires managed Evidence". - `rea compare-managed-members /missing.dll other.dll` returns the same empty input error and does not say which path failed or why. - `evaluate_reconstruction_coverage` for an unknown `boundary_id` drops "Unknown reconstruction boundary: X" on both CLI and MCP. `project_android_application_graph`, `project_apple_application_graph` and `build_reconstruction_obligation_ledger` have the same pattern. ## Change - Add two helpers in `src/application/workflowInputError.ts`. `requestInputError` projects the raw request's schema failures through `projectInputIssues`, keeping request paths and reasons. `workflowInputError` handles failures raised after the request parsed: a domain `TypeError` becomes one `invalid_value` issue carrying its message. A nested Evidence `ZodError` becomes root-path issues whose message names the nested location, so it never points at a wrong request field. This follows `JavaScriptApplicationWorkflowService` and `JavaScriptRuntimeReconciliationService`. The classification is unchanged: only issues these services already returned as input errors gain details. - Use them in `ManagedReconstructionService`, `ManagedApplicationGraphService`, `ManagedNativeVerificationService`, `ManagedMemberComparisonService`, `InventoryProjectionEvidence`, `ReconstructionObligationLedgerService` and `ReconstructionCoverageService`. - `compareManagedMemberPaths` returns the `BinaryTargetError` from `parseBinaryTarget` unchanged (`target_unavailable` with `details.path` and the reason), as every other path-based command reports an unopenable target. No schemas change. ## Verification - `npm run test:focused -- src/application/managed/ManagedReconstructionService.test.ts tests/boundary/providers/managed/managedMemberComparison.test.ts tests/composition/analysis-sessions/managedApplicationGraph.test.ts tests/conformance/providers/managed/managedNativeVerification.test.ts`: 26 passed. The new assertions cover schema issues, a domain-constraint message, a malformed nested Evidence result and a missing comparison path. - `tests/boundary/mcp/reconstructionCoverageMcp.test.ts` now covers the unknown-boundary message over MCP and fails with the source change reverted. - All 51 test files that reference these services or tools: 399 passed, 3 skipped. - `npm run check:fast` - `rea import-managed-reconstruction '{}'` now lists `static_members`, `decompiler` and the other missing fields. `rea compare-managed-members` with a missing file reports `target_unavailable` with the missing path. No real Hopper or Ghidra verification was run, because this change does not touch those providers. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:08:29 +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#2637
No description provided.