Skip to content

fix(errors): name fixed allowances in resource-constraint recovery - #5633

Merged
morluto merged 11 commits into
mainfrom
cursor/fixed-allowance-remediation-e4bd
Oct 20, 2026
Merged

morluto merged 11 commits into
mainfrom
cursor/fixed-allowance-remediation-e4bd

Conversation

@morluto

@morluto morluto commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixed inspection, report, and capture refusals told callers to add memory, wait and retry, or recover Evidence that the refusal never produced. The allowances stay fixed. Recovery now names the allowance that was exceeded.

Fixes #5556, #5405, #5456, #5459, #5460, #5504, #5505, #5506, #5537, #5628, #5630, #5631, #5632.

Problem and expected behavior

A fixed parser, count, report, input, or capture allowance was thrown as AnalysisResourceConstraintError without remediationAction. Shared projection then used the resource-kind fallback:

  • memory: review worker and host memory
  • capacity: wait for an active analysis, and retryable: true
  • transport: retrieve retained Evidence or use complete CLI JSON
  • file-size: raise the evidence-reply file-size allowance

Those actions cannot admit the same input. Occupied IL2CPP reader capacity was also classified as memory, so a second inspection looked non-retryable.

Callers should still be refused. Recovery should name the fixed allowance. Deterministic caps stay retryable: false. A second IL2CPP inspection stays retryable only while that reader remains open. Once close() has stopped admission, the reader is capability_unavailable and non-retryable, including a second inspect that arrives while the active inspection is still finishing.

Change and scope

fixedAllowanceRemediation owns the recovery sentences. Each producer that enforces a fixed allowance sets that recovery when it constructs the error. PE resource metadata refusals also report maximum_metadata_bytes. IL2CPP reader occupancy uses capacity and tells the caller to retry after the active inspection only when the reader has not started closing. close() records that admission has stopped before it waits for the active inspection, and later inspects use that fact.

The IL2CPP complete-report refusal keeps source facts already observed on the error. Its recovery says no complete inventory is retained and does not deny that source observation. Command-output overruns use the retained command-output allowance. Ghidra seed recovery names the seed-name, seed-file, or seed-entry allowance that was exceeded. Byte budgets, including the WASM representation caps and the Ghidra seed-file cap, say they are a fixed byte allowance. Count limits stay a fixed count.

The generic fallback remains for genuine host, worker, or process resource failures that do not set their own recovery. Flutter snapshot-storage errors that forward an arbitrary filesystem code are unchanged.

Follow the contribution scope.
This is an ordinary recovery-text fix inside existing inspection and capture boundaries. No new provider, target execution, injection, mutation, or protection recovery. Maintainer scope decision: not applicable.

Contract and boundary impact

  • Semantic owner and earliest changed stage: each producer that constructs the resource-constraint error, before shared presentation. IL2CPP close records stopped admission before the occupancy check. Command-output recovery is owned by ArtifactAnalysisResources.commandFailure.
  • Contribution scope fit and linked maintainer decision: existing error contract; maintainer scope decision not applicable.
  • CLI and MCP/tool-catalog contract: same resource_constraint code and resource kinds, except IL2CPP reader occupancy changes from memory to capacity and stays retryable while the reader is open. A closing or closed reader projects capability_unavailable with retryable: false. Recovery text and retryable change for the fixed allowances listed in the linked issues. No catalog schema change.
  • Provider, bridge, target-format, or platform compatibility: none for engine selection. Refusal text changes for the listed producers.
  • Evidence, artifact, provenance, or reconstruction contract: an IL2CPP complete-report refusal still attaches the source observation already made. Other report allowances still say the refusal did not produce a completed report or Evidence record.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): unchanged, except a closed IL2CPP reader no longer describes itself as occupied capacity.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; edit authored instructions in .agents/skills/reverse-engineer-anything/ and never commit build outputs): none.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • 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: domain wording projection, including the byte-allowance sentence; Go build-info and header-search recovery; Rust hash-count and input-size recovery; Electron fuse sentinel and input recovery; Flutter APK snapshot recovery; PE metadata allowance and maximum_metadata_bytes; IL2CPP occupied-open retryable capacity, closing/closed non-retryable admission, and complete-report source facts; Ghidra seed-file byte allowance and seed-name count; typed WASM interface inventory and a comparison of two inventories that together exceed the cap; command-output allowance in ArtifactAnalysisResources and the tshark and sigrok provider simulators.
  • Base reproduction or other evidence: the linked issues record independent CLI replays of the original text. This change was checked with focused provider and source tests, not by replaying every issue script.
  • User-visible CLI/MCP output (if applicable): projected remediation.action and, for deterministic capacity caps, retryable: false. An open occupied IL2CPP reader projects retryable: true and resource: "capacity". A closing or closed reader projects capability_unavailable and retryable: false. A fixed command-output cap names the retained command-output allowance. Byte caps say fixed byte allowance.
  • Remaining proof gaps: apktool, adb, pcap, and native-command capture paths were source-checked and given the same helper. Their public CLI refusals were not replayed here. TShark and sigrok coverage uses the command-boundary simulators, not the real tools.

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 test:local -- src/domain/fixedAllowanceRemediation.test.ts src/wasm/WasmInterfaceBudget.test.ts src/electron/ElectronFuseProvider.test.ts src/native/pe/PeResourcesProvider.test.ts — 38 passed, then the PE file again with the helper test: 14 passed.
  • npm run test:focused -- tests/boundary/go/goBinaryProvider.test.ts tests/boundary/rust/rustBinaryBudget.test.ts tests/boundary/il2cpp/il2cppMetadataProvider.test.ts tests/boundary/filesystem/flutterBuildProvider.test.ts — 125 passed on an earlier head.
  • On 1d1bec7ad: npm run test:local -- src/process/ArtifactAnalysisResources.test.ts src/application/wasm/WasmInterfaceComparisonService.test.ts — 23 passed and 7 passed. npm run test:focused -- tests/boundary/il2cpp/il2cppMetadataProvider.test.ts tests/boundary/il2cpp/il2cppGhidraSeeds.test.ts tests/boundary/captures/captureProvider.test.ts tests/boundary/signals/recordingProvider.test.ts — 19, 8, 37, and 36 passed.
  • On eb8c31fd0: npm run test:local -- src/domain/fixedAllowanceRemediation.test.ts src/wasm/WasmInterfaceBudget.test.ts src/application/wasm/WasmInterfaceComparisonService.test.ts — 7, 1, and 7 passed. npm run test:focused -- tests/boundary/il2cpp/il2cppGhidraSeeds.test.ts — 8 passed.
  • npm run check:fast — typecheck and lint passed on this head.

Not run: npm run check:pr, real apktool/adb/tshark/sigrok/Ghidra/Hopper workflows, or the original issue CLI scripts.

Compatibility, safety, and release

  • Breaking changes or migration steps: none for request shape. Callers that branched on the old recovery sentence, or on IL2CPP occupancy as resource: "memory" / retryable: false, will see the new text and, for an open occupied reader, capacity with retryable: true. A closing or closed reader is capability_unavailable with retryable: false instead of retryable capacity. Deterministic capacity caps that were retryable: true are now retryable: false.
  • Real Hopper/Ghidra, browser, or OS coverage: not run. These refusals are local budget guards.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: recovery text and closed-reader classification only. No new process authority.

Author readiness

Human owner: @morluto

  • 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.
Open in Web Open in Cursor 

Fixed parser, count, report, input, and capture refusals inherited
host-memory, wait-and-retry, or retained-Evidence advice. Producers now
attach allowance-specific recovery, and deterministic capacity caps are
not retryable. IL2CPP reader occupancy stays retryable capacity.

Refs #5556, #5405, #5456, #5459, #5460, #5504, #5505, #5506, #5537, #5628, #5630, #5631, #5632
@morluto
morluto marked this pull request as ready for review October 20, 2026 17:30
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T19:35:20.371025Z 1de7319 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cdcf981673

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/il2cpp/Il2cppMetadataProvider.ts Resolved
close() stops admission before the active inspection finishes. A second
inspect in that window was projected as retryable capacity. Closing and
closed readers now report capability_unavailable. Occupied readers that
remain open stay retryable.
@cursor

cursor Bot commented Oct 20, 2026

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 461c83652f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@greptile-apps

greptile-apps Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issue remains.

Summary

The PR names the fixed allowance behind inspection and capture refusals instead of suggesting more memory, waiting, or unavailable reports.

  • Resource-limit refusals name the fixed allowance that stopped the request.
  • ADB output limits distinguish changing device observations from fixed command results.
  • IL2CPP refusals distinguish a busy reader from one that has stopped admitting work.

The previous-review comparison was not used because its target merge base differs from the current head’s. This review covered the full PR diff.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Resource refusal] --> B{Producer knows the limit?}
  B -->|Fixed allowance| C[Name allowance; do not retry]
  B -->|Live ADB output| D[Name allowance; allow retry]
  B -->|Open occupied IL2CPP reader| E[Retry after active inspection]
  B -->|Closing IL2CPP reader| F[Reject new inspections]
  B -->|No specific recovery| G[Keep generic resource guidance]
Loading

Reviews (9) · Last reviewed commit: "merge(main): align unresolved IDA lookup..." · Reviewed by Greptile

Comment thread src/il2cpp/Il2cppMetadataProvider.ts Resolved
Comment thread src/captures/TsharkCaptureProvider.ts Resolved
Comment thread src/il2cpp/Il2cppGhidraSeeds.ts Resolved
IL2CPP report refusals keep observed source facts instead of denying Evidence. Command-output caps use the capture allowance. Ghidra seed recovery names the limit that was exceeded.
@cursor

cursor Bot commented Oct 20, 2026

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1d1bec7ad8

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/domain/fixedAllowanceRemediation.ts Resolved
WASM representation limits and the IL2CPP Ghidra seed-file cap are byte budgets. Their recovery no longer says the exceeded allowance is a fixed count.
@cursor

cursor Bot commented Oct 20, 2026

Copy link
Copy Markdown

@codex review

1 similar comment

morluto commented Oct 20, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Main now treats an unchanged invalid request as non-retryable. The IDA lookup tests follow that projection.
@cursor

cursor Bot commented Oct 20, 2026

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: d98025bf95

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/domain/fixedAllowanceRemediation.ts Resolved
A fixed capture allowance still rejects the same output. Live captures such as adb logcat can change between requests, so recovery no longer says every unchanged request fails again.
@cursor

cursor Bot commented Oct 20, 2026

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e7c2bfdcd0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/domain/fixedAllowanceRemediation.ts Resolved
Device output can shrink between calls, so an adb capture that exceeds the allowance stays retryable. Deterministic capture and version-output limits stay non-retryable.
@cursor

cursor Bot commented Oct 20, 2026

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 99fc0900b3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/adb/AdbCommand.ts Resolved
Only live observations opt into retrying a capture that exceeded the allowance. Push, install, uninstall, and other mutations stay non-retryable.
@cursor

cursor Bot commented Oct 20, 2026

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/domain/fixedAllowanceRemediation.ts Resolved
Artifact-derived capture allowances again say the unchanged request fails. Only volatile adb observations use the live-output sentence.
@cursor

cursor Bot commented Oct 20, 2026

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 5e053db471

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@cursor

cursor Bot commented Oct 20, 2026

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 1de7319418

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@morluto
morluto merged commit ef59174 into main Oct 20, 2026
36 of 39 checks passed
@morluto
morluto deleted the cursor/fixed-allowance-remediation-e4bd branch October 20, 2026 19:45
@github-actions github-actions Bot mentioned this pull request Oct 20, 2026
3 tasks done
morluto pushed a commit that referenced this pull request Oct 21, 2026
…6148)

#5633 gave Rust and IL2CPP input-size refusals input-allowance recovery
through fixedAllowanceOptions, but no public CLI check covered either
command, and IL2CPP had no remediation assertion at all. Add both
commands to the CLI input-limit matrix.

Go and WASM still carried a duplicated hand-written copy of the same
advice. They now use the shared "input" allowance recovery, so all four
commands name their fixed allowance from one owner.

The matrix also asserted not.toContain("evidence reply"), which the new
"evidence-reply" wording passes only because of the hyphen. Assert the
absence of the old advice text instead.

Fixes #5405

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@morluto morluto added area: domain Domain logic, errors, and pure functions bug Something isn't working labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment