[PR #5550] [CLOSED] fix(rust): mark compiler-hash capacity refusals as non-retryable #6958

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5550
Author: @Totopo27
Created: 10/20/2026
Status: ❌ Closed

Base: main ← Head: fix/5504-rust-compiler-hash-retryable


📝 Commits (1)

  • bfd2c1e test(rust): assert non-retryable compiler-hash capacity in CLI and MCP (#5504)

📊 Changes

2 files changed (+34 additions, -0 deletions)

View changed files

📝 tests/acceptance/rustBinaryCli.test.ts (+28 -0)
📝 tests/boundary/mcp/rustBinaryMcp.test.ts (+6 -0)

📄 Description

Summary

Fixes #5504. Refuses Rust artifacts containing more than 64 distinct rustc commit paths with retryable: false and count-specific recovery advice indicating that the capacity is fixed, preventing automated callers from retrying unchanged inputs.

Problem and expected behavior

When readRustBinaryImage encounters more than 64 distinct /rustc/<hash>/ paths in read-only data, it throws RustAuditableResourceFailure with resource: "capacity" and reported_limits: { maximum_rustc_hashes: 64 }. RustBinaryProvider.failureForPrimary mapped this to AnalysisResourceConstraintError without overriding options. Because analysisErrorProjection defaults capacity errors to retryable: true and analysisErrorPresentation supplies admission advice ("Wait for an active analysis to complete..."), callers were told to retry even though the 64-hash bound is fixed and deterministic for the same artifact.

Expected behavior: The error remains a resource_constraint with maximum_rustc_hashes: 64, but returns retryable: false and count-specific remediation guidance explaining that the compiler-path capacity is fixed and that waiting for another analysis cannot admit the unchanged artifact.

Change and scope

Upstream integrated #5633, providing fixedAllowanceOptions("The rustc commit-path inventory", "count") in src/rust/RustBinaryProvider.ts. This rebase:

  • Rebased onto latest upstream/main.
  • Updated tests/boundary/mcp/rustBinaryMcp.test.ts to assert retryable: false and the canonical fixed-count remediation action.
  • Added a CLI acceptance test in tests/acceptance/rustBinaryCli.test.ts verifying the non-retryable refusal through the public CLI.

Ordinary fix within existing boundaries; contribution scope fit is not applicable.

Contract and boundary impact

  • Semantic owner and earliest changed stage: src/rust/RustBinaryProvider.ts (Rust binary inspection provider failure mapping).
  • Contribution scope fit and linked maintainer decision: not applicable.
  • CLI and MCP/tool-catalog contract: preserves resource_constraint and maximum_rustc_hashes: 64, verifies retryable: false, and confirms deterministic remediation guidance across CLI and MCP.
  • Provider, bridge, target-format, or platform compatibility: Rust binary offline inspection.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): none.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated:
    • tests/boundary/mcp/rustBinaryMcp.test.ts ("preserves rustc hash capacity units through the public error contract" asserts retryable: false and remediation.action).
    • tests/acceptance/rustBinaryCli.test.ts ("refuses distinct rustc paths above capacity with non-retryable guidance").
  • Base reproduction or other evidence: Verified against upstream unit test tests/boundary/rust/rustBinaryBudget.test.ts and confirmed non-retryable refusal in MCP and CLI.
  • User-visible CLI/MCP output (if applicable): Output on capacity overflow includes "retryable": false and "remediation": { "action": "The rustc commit-path inventory is a fixed count. Waiting for an active analysis to finish does not raise it. Repeating the unchanged request fails the same way." }.
  • Remaining proof gaps: none.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run check:fast — passed (typecheck and lint via turbo).
  • node node_modules/vitest/vitest.mjs run tests/boundary/rust/rustBinaryBudget.test.ts — passed (2 passed).

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: none needed; pure in-process Rust binary ELF/PE/Mach-O metadata parsing.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none.

Author readiness

Human owner: @Totopo27

  • 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/5550 **Author:** [@Totopo27](https://github.com/Totopo27) **Created:** 10/20/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/5504-rust-compiler-hash-retryable` --- ### 📝 Commits (1) - [`bfd2c1e`](https://github.com/morluto/rea/commit/bfd2c1e13b9ef6728909afa7e2375d3294140b0f) test(rust): assert non-retryable compiler-hash capacity in CLI and MCP (#5504) ### 📊 Changes **2 files changed** (+34 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `tests/acceptance/rustBinaryCli.test.ts` (+28 -0) 📝 `tests/boundary/mcp/rustBinaryMcp.test.ts` (+6 -0) </details> ### 📄 Description ## Summary Fixes #5504. Refuses Rust artifacts containing more than 64 distinct rustc commit paths with `retryable: false` and count-specific recovery advice indicating that the capacity is fixed, preventing automated callers from retrying unchanged inputs. ## Problem and expected behavior When `readRustBinaryImage` encounters more than 64 distinct `/rustc/<hash>/` paths in read-only data, it throws `RustAuditableResourceFailure` with `resource: "capacity"` and `reported_limits: { maximum_rustc_hashes: 64 }`. `RustBinaryProvider.failureForPrimary` mapped this to `AnalysisResourceConstraintError` without overriding options. Because `analysisErrorProjection` defaults capacity errors to `retryable: true` and `analysisErrorPresentation` supplies admission advice ("Wait for an active analysis to complete..."), callers were told to retry even though the 64-hash bound is fixed and deterministic for the same artifact. Expected behavior: The error remains a `resource_constraint` with `maximum_rustc_hashes: 64`, but returns `retryable: false` and count-specific remediation guidance explaining that the compiler-path capacity is fixed and that waiting for another analysis cannot admit the unchanged artifact. ## Change and scope Upstream integrated #5633, providing `fixedAllowanceOptions("The rustc commit-path inventory", "count")` in `src/rust/RustBinaryProvider.ts`. This rebase: - Rebased onto latest `upstream/main`. - Updated `tests/boundary/mcp/rustBinaryMcp.test.ts` to assert `retryable: false` and the canonical fixed-count remediation action. - Added a CLI acceptance test in `tests/acceptance/rustBinaryCli.test.ts` verifying the non-retryable refusal through the public CLI. Ordinary fix within existing boundaries; contribution scope fit is not applicable. ## Contract and boundary impact - Semantic owner and earliest changed stage: `src/rust/RustBinaryProvider.ts` (Rust binary inspection provider failure mapping). - Contribution scope fit and linked maintainer decision: not applicable. - CLI and MCP/tool-catalog contract: preserves `resource_constraint` and `maximum_rustc_hashes: 64`, verifies `retryable: false`, and confirms deterministic remediation guidance across CLI and MCP. - Provider, bridge, target-format, or platform compatibility: Rust binary offline inspection. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details (if applicable): none. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact: none. Expected effects: - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: - `tests/boundary/mcp/rustBinaryMcp.test.ts` ("preserves rustc hash capacity units through the public error contract" asserts `retryable: false` and `remediation.action`). - `tests/acceptance/rustBinaryCli.test.ts` ("refuses distinct rustc paths above capacity with non-retryable guidance"). - Base reproduction or other evidence: Verified against upstream unit test `tests/boundary/rust/rustBinaryBudget.test.ts` and confirmed non-retryable refusal in MCP and CLI. - User-visible CLI/MCP output (if applicable): Output on capacity overflow includes `"retryable": false` and `"remediation": { "action": "The rustc commit-path inventory is a fixed count. Waiting for an active analysis to finish does not raise it. Repeating the unchanged request fails the same way." }`. - Remaining proof gaps: none. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `npm run check:fast` — passed (typecheck and lint via turbo). - `node node_modules/vitest/vitest.mjs run tests/boundary/rust/rustBinaryBudget.test.ts` — passed (2 passed). ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: none needed; pure in-process Rust binary ELF/PE/Mach-O metadata parsing. - Package or release metadata impact: none. - Security, privacy, process, or containment review: none. ## Author readiness Human owner: @Totopo27 - [ ] 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:44:19 +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#6958
No description provided.