[PR #7220] [MERGED] fix(provider-selection): name whether a rejection came from availability or target support #7723

Closed
opened 2026-11-03 13:39:54 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/7220
Author: @dxqlovestudy
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @gensokyo-dev

Base: main ← Head: fix/provider-rejection-origin


📝 Commits (3)

  • 60b7a5c fix(provider-selection): name whether a rejection came from availability or target support
  • 6f88f5b chore: merge current main for provider rejection validation
  • 9eb726b fix(provider-selection): describe readiness without configuration assumptions

📊 Changes

6 files changed (+187 additions, -17 deletions)

View changed files

📝 docs/cli.md (+7 -1)
📝 src/application/binary/AnalysisProviderRegistry.test.ts (+125 -0)
📝 src/application/binary/AnalysisProviderRegistry.ts (+38 -15)
📝 src/domain/analysisErrorProjection.ts (+1 -0)
📝 src/domain/providerSelectionError.ts (+15 -1)
📝 src/native/pwntools/PwntoolsFailures.ts (+1 -0)

📄 Description

Summary

Fixes #7214. CLI and MCP provider-selection errors now distinguish local readiness rejections (origin: "availability") from observed target-support refusals (origin: "target"). Original provider IDs, codes, reasons, diagnostics, candidate ordering and explicit provider choices are preserved. The shared error owner makes one defensive diagnostic copy.

An availability-only error describes recorded readiness failures and the absence of a reported target refusal. It does not claim that the host has no configured providers, or infer target support. This includes invalid existing registrations and an explicit unavailable provider alongside a ready alternative. Documentation uses the same distinction.

Validation

Integrated current main b45a83368 and reviewed head 9eb726b1f:

  • 116 focused registry, error-projection and pwntools input-limit tests pass. A new configured-but-unavailable/ready-alternative regression first failed on the original PR message, then passed. Mixed rejections retain the existing message.
  • npm run check:fast and npm run docs:check pass. One concurrent build attempt was refused by the existing artifact lock; documentation validation completed the required artifacts afterward.
  • Actual packaged CLI analyze /usr/bin/true --provider ida --json and stdio MCP open_binary were run with a private HOME in two cases: no IDA registration, and an invalid existing registration. Both adapters retain matching error projections, respectively not_configured/configured:false and open_options_invalid/configured:true; every recorded rejection gains its producer-derived origin. Exact main was run as the control and lacks these origin fields.
  • Two cases across both adapters, 2-CPU affinity: control 14.697 s wall / 10.666 s CPU / 323.41 MiB sampled process-family peak; changed final compiled head 11.492 s / 10.765 s / 321.90 MiB. These are single contended samples, not a speedup claim. MCP replies grow from 3226/3242 to 3424/3440 bytes; no report or extra analysis call is added. Agent token usage was not measured. Complete probe responses remain local evidence.

No IDA/Ghidra process was launched, no remote endpoint was contacted, and no native Windows DOS reproduction is claimed. This fixes diagnostic provenance, not DOS admission. Hosted CI 40349759511: source tests, static checks, docs, package build, real binary-layout/recorded-crash/web-network checks, SQLite versions, Linux native baseline, and four portable shards pass. Shard 4 fails four ADB MCP cases; the actual merge-base main d9908fd7a has the identical four assertions and diagnostic in its own CI job. The same four cases pass locally on both original main b45 (59.131 s, 1870 MiB peak) and this PR (54.573 s, 2023 MiB peak). Three fail-fast-canceled shards remain unverified. This is an authorized baseline-failure bypass, not a green-CI claim.

Fresh Codex review reports no findings and Greptile is 5/5 at 9eb726b1f; the previous thread is resolved with root cause, structural fix, validation and limitations.

Author readiness

Human owner: @dxqlovestudy

  • 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, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • 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/7220 **Author:** [@dxqlovestudy](https://github.com/dxqlovestudy) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `fix/provider-rejection-origin` --- ### 📝 Commits (3) - [`60b7a5c`](https://github.com/morluto/rea/commit/60b7a5ca492dfa27501ee7519597c7ad80e91c9b) fix(provider-selection): name whether a rejection came from availability or target support - [`6f88f5b`](https://github.com/morluto/rea/commit/6f88f5bfd6f012d5aa4b1a1417cecf341b9a777b) chore: merge current main for provider rejection validation - [`9eb726b`](https://github.com/morluto/rea/commit/9eb726b1f96602ce91493d533bc2c9f611dad37b) fix(provider-selection): describe readiness without configuration assumptions ### 📊 Changes **6 files changed** (+187 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `docs/cli.md` (+7 -1) 📝 `src/application/binary/AnalysisProviderRegistry.test.ts` (+125 -0) 📝 `src/application/binary/AnalysisProviderRegistry.ts` (+38 -15) 📝 `src/domain/analysisErrorProjection.ts` (+1 -0) 📝 `src/domain/providerSelectionError.ts` (+15 -1) 📝 `src/native/pwntools/PwntoolsFailures.ts` (+1 -0) </details> ### 📄 Description ## Summary Fixes #7214. CLI and MCP provider-selection errors now distinguish local readiness rejections (`origin: "availability"`) from observed target-support refusals (`origin: "target"`). Original provider IDs, codes, reasons, diagnostics, candidate ordering and explicit provider choices are preserved. The shared error owner makes one defensive diagnostic copy. An availability-only error describes recorded readiness failures and the absence of a reported target refusal. It does not claim that the host has no configured providers, or infer target support. This includes invalid existing registrations and an explicit unavailable provider alongside a ready alternative. Documentation uses the same distinction. ## Validation Integrated current main `b45a83368` and reviewed head `9eb726b1f`: - 116 focused registry, error-projection and pwntools input-limit tests pass. A new configured-but-unavailable/ready-alternative regression first failed on the original PR message, then passed. Mixed rejections retain the existing message. - `npm run check:fast` and `npm run docs:check` pass. One concurrent build attempt was refused by the existing artifact lock; documentation validation completed the required artifacts afterward. - Actual packaged CLI `analyze /usr/bin/true --provider ida --json` and stdio MCP `open_binary` were run with a private HOME in two cases: no IDA registration, and an invalid existing registration. Both adapters retain matching error projections, respectively `not_configured/configured:false` and `open_options_invalid/configured:true`; every recorded rejection gains its producer-derived origin. Exact main was run as the control and lacks these origin fields. - Two cases across both adapters, 2-CPU affinity: control 14.697 s wall / 10.666 s CPU / 323.41 MiB sampled process-family peak; changed final compiled head 11.492 s / 10.765 s / 321.90 MiB. These are single contended samples, not a speedup claim. MCP replies grow from 3226/3242 to 3424/3440 bytes; no report or extra analysis call is added. Agent token usage was not measured. Complete probe responses remain local evidence. No IDA/Ghidra process was launched, no remote endpoint was contacted, and no native Windows DOS reproduction is claimed. This fixes diagnostic provenance, not DOS admission. Hosted CI [40349759511](https://github.com/morluto/rea/actions/runs/40349759511): source tests, static checks, docs, package build, real binary-layout/recorded-crash/web-network checks, SQLite versions, Linux native baseline, and four portable shards pass. Shard 4 fails four ADB MCP cases; the actual merge-base main `d9908fd7a` has the identical four assertions and diagnostic in its own [CI job](https://github.com/morluto/rea/actions/runs/40349559391/job/121666788797). The same four cases pass locally on both original main b45 (59.131 s, 1870 MiB peak) and this PR (54.573 s, 2023 MiB peak). Three fail-fast-canceled shards remain unverified. This is an authorized baseline-failure bypass, not a green-CI claim. Fresh Codex review reports no findings and Greptile is 5/5 at `9eb726b1f`; the previous thread is resolved with root cause, structural fix, validation and limitations. ## Author readiness <!-- The human owner completes these declarations before requesting review. The PR author is the owner by default. A different owner must explicitly accept ownership on this PR. AI agents must leave these declarations to a human to dictate to them or there could be catastrophic consequences for many users of REA. Draft PRs may leave them unchecked. These declarations record initial readiness when opening the PR for review; later pushes do not require a new human sign-off. Keep the description and validation evidence current as the work changes. See CONTRIBUTING.md#pull-request-ownership-and-readiness. --> Human owner: @dxqlovestudy - [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 - [ ] 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, or the reason for not linking one is stated above. - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [ ] 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-03 13:39:54 +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#7723
No description provided.