[PR #6145] [CLOSED] fix(managed): report malformed PE layout during member comparison as invalid input (#6075) #7160

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6145
Author: @JaiPrakashVI
Created: 10/21/2026
Status: ❌ Closed

Base: main ← Head: fix/managed-compare-pe-invalid-input-6075


📝 Commits (2)

  • b07b551 fix(managed): report malformed PE layout during member comparison as invalid input (#6075)
  • 2a88783 Merge branch 'main' into fix/managed-compare-pe-invalid-input-6075

📊 Changes

2 files changed (+87 additions, -5 deletions)

View changed files

📝 src/application/managed/ManagedMemberComparisonService.ts (+31 -5)
📝 tests/boundary/providers/managed/managedMemberComparison.test.ts (+56 -0)

📄 Description

Summary

Fixes #6075.

compare-managed-members incorrectly classifies malformed PE input as an internal execution failure instead of a caller input error.

When a selected PE has an invalid layout, such as NumberOfSections = 0, inspectManagedMembersBytes raises a ManagedReaderFailure. Previously, this failure was not translated by the comparison workflow and was ultimately reported as unreadable_output / execution_failure, with an incorrect suggestion to run rea doctor.

The corresponding managed inspection path already treats the same reader failure as malformed caller input. This change makes managed member comparison follow that established error contract.

Changes

  • Translate non-resource-limit ManagedReaderFailure instances during managed member comparison into AnalysisInputError.
  • Report the correct comparison argument path:
    • leftPath for malformed left input.
    • rightPath for malformed right input.
  • Preserve the existing invalid_request / invalid_input / invalid_format error contract.
  • Preserve resource-limit failures and re-throw unexpected failures unchanged.
  • Preserve already-collected partial Evidence when the right-hand input fails.

Regression Tests

Added focused coverage for malformed PE input on both sides of the comparison.

The tests verify:

  • Malformed left input is reported as invalid_format on leftPath.
  • Malformed right input is reported as invalid_format on rightPath.
  • The PE parsing detail PE section count must be positive is preserved.
  • Partial Evidence from the successfully inspected left artifact is retained when the right artifact is malformed.
  • Existing comparison behavior remains unchanged for valid input.

The regression uses the same malformed PE condition described in #6075 by setting the PE NumberOfSections field to zero.

Validation

  • managedMemberComparison.test.ts: 29/29 passed
  • Managed boundary tests: 117/117 passed
  • .NET tests: 344/344 passed
  • Managed CLI acceptance tests: 7/7 passed
  • TypeScript typecheck: passed
  • Lint: passed
  • Pre-commit hooks: passed
  • Pre-push checks: passed

Scope

The change is intentionally limited to:

  • src/application/managed/ManagedMemberComparisonService.ts
  • tests/boundary/providers/managed/managedMemberComparison.test.ts

No dependencies, configuration, or unrelated behavior were changed.

Author Readiness

Author readiness

Human owner: @JaiPrakashVI

  • 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.

🔄 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/6145 **Author:** [@JaiPrakashVI](https://github.com/JaiPrakashVI) **Created:** 10/21/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/managed-compare-pe-invalid-input-6075` --- ### 📝 Commits (2) - [`b07b551`](https://github.com/morluto/rea/commit/b07b551c12342ec0bd3f06d7bf897c79baa18ec8) fix(managed): report malformed PE layout during member comparison as invalid input (#6075) - [`2a88783`](https://github.com/morluto/rea/commit/2a8878375c354555878a85e6a2290de4e12014c9) Merge branch 'main' into fix/managed-compare-pe-invalid-input-6075 ### 📊 Changes **2 files changed** (+87 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/application/managed/ManagedMemberComparisonService.ts` (+31 -5) 📝 `tests/boundary/providers/managed/managedMemberComparison.test.ts` (+56 -0) </details> ### 📄 Description ## Summary Fixes #6075. `compare-managed-members` incorrectly classifies malformed PE input as an internal execution failure instead of a caller input error. When a selected PE has an invalid layout, such as `NumberOfSections = 0`, `inspectManagedMembersBytes` raises a `ManagedReaderFailure`. Previously, this failure was not translated by the comparison workflow and was ultimately reported as `unreadable_output` / `execution_failure`, with an incorrect suggestion to run `rea doctor`. The corresponding managed inspection path already treats the same reader failure as malformed caller input. This change makes managed member comparison follow that established error contract. ## Changes - Translate non-resource-limit `ManagedReaderFailure` instances during managed member comparison into `AnalysisInputError`. - Report the correct comparison argument path: - `leftPath` for malformed left input. - `rightPath` for malformed right input. - Preserve the existing `invalid_request` / `invalid_input` / `invalid_format` error contract. - Preserve `resource-limit` failures and re-throw unexpected failures unchanged. - Preserve already-collected partial Evidence when the right-hand input fails. ## Regression Tests Added focused coverage for malformed PE input on both sides of the comparison. The tests verify: - Malformed left input is reported as `invalid_format` on `leftPath`. - Malformed right input is reported as `invalid_format` on `rightPath`. - The PE parsing detail `PE section count must be positive` is preserved. - Partial Evidence from the successfully inspected left artifact is retained when the right artifact is malformed. - Existing comparison behavior remains unchanged for valid input. The regression uses the same malformed PE condition described in #6075 by setting the PE `NumberOfSections` field to zero. ## Validation - `managedMemberComparison.test.ts`: **29/29 passed** - Managed boundary tests: **117/117 passed** - .NET tests: **344/344 passed** - Managed CLI acceptance tests: **7/7 passed** - TypeScript typecheck: **passed** - Lint: **passed** - Pre-commit hooks: **passed** - Pre-push checks: **passed** ## Scope The change is intentionally limited to: - `src/application/managed/ManagedMemberComparisonService.ts` - `tests/boundary/providers/managed/managedMemberComparison.test.ts` No dependencies, configuration, or unrelated behavior were changed. ## Author Readiness ## Author readiness Human owner: @JaiPrakashVI - [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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:45:50 +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#7160
No description provided.