[PR #6088] [MERGED] fix(engines): keep format ceilings fixed and recover the EVMole deadline #7144

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6088
Author: @morluto
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @morluto

Base: main ← Head: cursor/engines-evmole-deadline-858c


📝 Commits (2)

  • d132ea7 fix(engines): keep format ceilings fixed and recover the EVMole deadline
  • 5e6052e fix(engines): recover the allowance that refused the request

📊 Changes

34 files changed (+851 additions, -106 deletions)

View changed files

📝 .agents/skills/reverse-engineer-anything/SKILL.md (+3 -1)
📝 docs/evm-bytecode.md (+5 -1)
📝 src/application/evm/EvmInterfaceEvidence.ts (+7 -1)
📝 src/application/evm/EvmInterfaceService.test.ts (+38 -0)
📝 src/cli/evmCommands.ts (+8 -1)
📝 src/contracts/evm/evmToolContracts.ts (+1 -1)
📝 src/domain/evm/evmInterface.ts (+13 -0)
📝 src/domain/native/nativeAotPe.budget.test.ts (+33 -0)
📝 src/domain/native/nativeAotPe.ts (+49 -24)
📝 src/evm/EvmWorkerLimits.ts (+2 -2)
📝 src/evm/EvmoleFailures.test.ts (+63 -0)
📝 src/evm/EvmoleFailures.ts (+54 -16)
📝 src/evm/EvmoleInterfaceProvider.ts (+22 -4)
📝 src/evm/EvmoleRelease.ts (+5 -1)
📝 src/firmware/FirmwareCommand.test.ts (+80 -1)
📝 src/firmware/FirmwareCommand.ts (+54 -14)
📝 src/firmware/FirmwareDeadline.test.ts (+67 -0)
📝 src/firmware/FirmwareFailures.ts (+65 -3)
📝 src/firmware/FirmwareFiles.ts (+6 -3)
📝 src/go/GoBinaryProvider.ts (+1 -2)

...and 14 more files

📄 Description

Summary

Refs #5910 (parent #5808). When an EVMole worker deadline or a fixed format/runtime ceiling in this theme is hit, recovery names the budget, whether it can change, and what a related setting does not raise.

The owned EVMole worker wall clock is now timeout_ms (default 30000 ms, integer 1..2147483647) on inspect_evm_interface and --timeout-ms on rea inspect-evm-interface. Omission keeps 30000 ms and is omitted from Evidence. It applies on the next call and does not raise the fixed 4 MiB input, 16 MiB reply, 1 MiB diagnostic, 3 GiB address-space, or 30-second CPU ceilings.

Firmware already has analysis_timeout_ms. This PR does not add a second firmware analysis knob. CPU (cpuSeconds 120), file-size, diagnostic, report, and input refusals say analysis_timeout_ms does not raise them. Extract staging file size remains the caller-selected max_output_bytes. Address-space exhaustion has no dedicated signal; unclassified tool failures name the fixed address-space and CPU allowances without treating a format failure as a resource limit.

Review follow-up: model capacity recovery uses a structured limit (header-bytes, report-bytes, representation-bytes, exact-offset, metadata-nesting) instead of message text. The 100,000,000-byte header ceiling is shared by GGUF and Safetensors. Firmware SIGXCPU and SIGXFSZ errors keep captured stdout, stderr, byte counts, and the exit signal. An oversized firmware report no longer says both to rerun and that the same request fails. NativeAOT hydration work or memory exhaustion explains the fixed parser allowance on the partial report.

Problem and expected behavior

A 30000 ms EVMole worker deadline was a fixed owned-command wall clock. A longer wall clock can still expire from scheduling or I/O while CPU stays under 30 seconds, so the deadline is the same class of setting as WABT command_timeout_ms and SQLite worker_timeout_ms. Recovery did not name it.

Firmware CPU and byte failures did not say that raising analysis_timeout_ms leaves those allowances unchanged. Several agent-visible format and runtime ceilings in this theme were silent about having no runtime override. The shared model header ceiling is 100,000,000 bytes for both GGUF and Safetensors.

Change and scope

Promotion is limited to that EVMole wall clock. Sibling byte, address-space, and CPU caps stay fixed, and recovery says timeout_ms does not raise them.

Wording-only, and only where the refusal was agent-visible and did not already name a control or fixed allowance: firmware CPU/file-size/diagnostic/report/input, WABT input/output/tool bytes, SQLite diagnostic capture, concurrent inspection slots, and combined snapshot input, Go input bytes, GPU object/report allowances, PE hard input and directory ceilings (caller-selected max_file_bytes / max_entries branches still say to raise those settings), NativeAOT snapshot and parser budgets, and the model header, report, representation, exact-offset, and nesting allowances. SQLite worker_timeout_ms and WABT command_timeout_ms recovery are unchanged. SQLITE_ROW_LIMIT_DEFAULT stays overridable through row_limit.

Out of scope: ASAR streaming and hdiutil (#5910 PR 9), and the already-open MCP (#6005), provider (#6014), JavaScript (#6022), Android (#6024), browser (#6036), native (#6059), and swiftc (#6071) limit PRs. No global settings tool, no retry_after_ms, and no numeric increases.

Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.

Contract and boundary impact

  • Semantic owner and earliest changed stage: domain inspect_evm_interface owns timeout_ms; the EVMole adapter applies it as the owned worker command deadline. Model capacity failures own their limit kind at ModelFormatFailure. Firmware signal errors own captured command output. NativeAOT hydration owns parser-budget explanation on the partial report. Firmware and the other engines keep their existing owners.
  • Contribution scope fit and linked maintainer decision: not applicable. Recovery and one existing deadline inside current read-only operations. No new provider and no target execution, injection, mutation, or protection recovery.
  • CLI and MCP/tool-catalog contract: inspect_evm_interface accepts optional timeout_ms; CLI flag --timeout-ms. Omission keeps 30000 ms. Other tool inputs are unchanged. Catalogs and skills/ stay generated; the authored skill text was updated.
  • Provider, bridge, target-format, or platform compatibility: EVMole 0.9.3 worker behavior is unchanged aside from the caller-selected wall clock. Fixed ceilings are unchanged. A tighter inherited Linux soft limit can still apply.
  • Evidence, artifact, provenance, or reconstruction contract: Evidence parameters record a selected timeout_ms and omit it when the caller omits it. Result identity is otherwise unchanged. Firmware resource errors retain captured tool output.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): unchanged. The worker still runs under the existing prlimit/CPU/byte ceilings.
  • 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): authored skill and docs/evm-bytecode.md updated. No package or installer change.

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: model recovery by limit kind, including GGUF header, exact-offset, and nesting refusals; firmware signal captured output, including a fixture SIGXCPU through runFirmwareCommand; oversized firmware report recovery; NativeAOT hydration work-budget text on the partial report.
  • Base reproduction or other evidence: source inspection of the fixed 30000 ms runOwnedCommand deadline versus the separate 30-second CPU ceiling. Firmware analysis_timeout_ms was already on main (default 120000, range 1..2147483647).
  • User-visible CLI/MCP output (if applicable): a worker timeout names timeout_ms, the effective milliseconds, the 30000 ms default when omitted, --timeout-ms, the maximum 2147483647, and the fixed caps it does not raise. No live CLI transcript was captured.
  • Remaining proof gaps: no live EVMole, binwalk, or unblob run. The firmware SIGXCPU path used a fixture process, not a live prlimit. Address-space death has no dedicated signal. The earlier EVMole, WABT, SQLite, and PE suite was not re-run on this revision.

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, 2/2 tasks).
  • npx oxfmt --check on the touched files — passed.
  • npm run test:local -- src/firmware/FirmwareDeadline.test.ts src/firmware/FirmwareCommand.test.ts src/domain/native/nativeAotPe.budget.test.ts src/domain/native/nativeAotPe.test.ts — 38 passed.
  • npm run test:local -- src/domain/native/nativeAotPe.headerRanges.test.ts src/domain/native/nativeAotPe.sectionRanges.test.ts src/domain/native/nativeAotPe.budget.test.ts — 28 passed.
  • npm run test:focused -- tests/boundary/model/modelArtifact.test.ts tests/boundary/firmware/firmwareReportFiles.test.ts — firmware report 11 passed; model artifact 71 passed after the nesting fixture fix.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. timeout_ms is optional. Omitting it keeps the previous 30000 ms deadline. Fixed numeric ceilings are unchanged.
  • Real Hopper/Ghidra, browser, or OS coverage: not run. NativeAOT wording is on the parser partial report. Linux prlimit integration for a live SIGXCPU was not executed here.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: the worker still uses the existing address-space, file-size, and CPU ceilings. A longer timeout_ms does not raise them. No new network or mutation 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 

🔄 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/6088 **Author:** [@morluto](https://github.com/morluto) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `cursor/engines-evmole-deadline-858c` --- ### 📝 Commits (2) - [`d132ea7`](https://github.com/morluto/rea/commit/d132ea78190a0261c4d156cb626c5025391d53b1) fix(engines): keep format ceilings fixed and recover the EVMole deadline - [`5e6052e`](https://github.com/morluto/rea/commit/5e6052e5e40ec1ea049cf0836cd593de0af7270d) fix(engines): recover the allowance that refused the request ### 📊 Changes **34 files changed** (+851 additions, -106 deletions) <details> <summary>View changed files</summary> 📝 `.agents/skills/reverse-engineer-anything/SKILL.md` (+3 -1) 📝 `docs/evm-bytecode.md` (+5 -1) 📝 `src/application/evm/EvmInterfaceEvidence.ts` (+7 -1) 📝 `src/application/evm/EvmInterfaceService.test.ts` (+38 -0) 📝 `src/cli/evmCommands.ts` (+8 -1) 📝 `src/contracts/evm/evmToolContracts.ts` (+1 -1) 📝 `src/domain/evm/evmInterface.ts` (+13 -0) 📝 `src/domain/native/nativeAotPe.budget.test.ts` (+33 -0) 📝 `src/domain/native/nativeAotPe.ts` (+49 -24) 📝 `src/evm/EvmWorkerLimits.ts` (+2 -2) 📝 `src/evm/EvmoleFailures.test.ts` (+63 -0) 📝 `src/evm/EvmoleFailures.ts` (+54 -16) 📝 `src/evm/EvmoleInterfaceProvider.ts` (+22 -4) 📝 `src/evm/EvmoleRelease.ts` (+5 -1) 📝 `src/firmware/FirmwareCommand.test.ts` (+80 -1) 📝 `src/firmware/FirmwareCommand.ts` (+54 -14) 📝 `src/firmware/FirmwareDeadline.test.ts` (+67 -0) 📝 `src/firmware/FirmwareFailures.ts` (+65 -3) 📝 `src/firmware/FirmwareFiles.ts` (+6 -3) 📝 `src/go/GoBinaryProvider.ts` (+1 -2) _...and 14 more files_ </details> ### 📄 Description <!-- CURSOR_AGENT_PR_BODY_BEGIN --> ## Summary Refs #5910 (parent #5808). When an EVMole worker deadline or a fixed format/runtime ceiling in this theme is hit, recovery names the budget, whether it can change, and what a related setting does not raise. The owned EVMole worker wall clock is now `timeout_ms` (default 30000 ms, integer 1..2147483647) on `inspect_evm_interface` and `--timeout-ms` on `rea inspect-evm-interface`. Omission keeps 30000 ms and is omitted from Evidence. It applies on the next call and does not raise the fixed 4 MiB input, 16 MiB reply, 1 MiB diagnostic, 3 GiB address-space, or 30-second CPU ceilings. Firmware already has `analysis_timeout_ms`. This PR does not add a second firmware analysis knob. CPU (`cpuSeconds` 120), file-size, diagnostic, report, and input refusals say `analysis_timeout_ms` does not raise them. Extract staging file size remains the caller-selected `max_output_bytes`. Address-space exhaustion has no dedicated signal; unclassified tool failures name the fixed address-space and CPU allowances without treating a format failure as a resource limit. Review follow-up: model capacity recovery uses a structured limit (`header-bytes`, `report-bytes`, `representation-bytes`, `exact-offset`, `metadata-nesting`) instead of message text. The 100,000,000-byte header ceiling is shared by GGUF and Safetensors. Firmware `SIGXCPU` and `SIGXFSZ` errors keep captured stdout, stderr, byte counts, and the exit signal. An oversized firmware report no longer says both to rerun and that the same request fails. NativeAOT hydration work or memory exhaustion explains the fixed parser allowance on the partial report. ## Problem and expected behavior A 30000 ms EVMole worker deadline was a fixed owned-command wall clock. A longer wall clock can still expire from scheduling or I/O while CPU stays under 30 seconds, so the deadline is the same class of setting as WABT `command_timeout_ms` and SQLite `worker_timeout_ms`. Recovery did not name it. Firmware CPU and byte failures did not say that raising `analysis_timeout_ms` leaves those allowances unchanged. Several agent-visible format and runtime ceilings in this theme were silent about having no runtime override. The shared model header ceiling is 100,000,000 bytes for both GGUF and Safetensors. ## Change and scope Promotion is limited to that EVMole wall clock. Sibling byte, address-space, and CPU caps stay fixed, and recovery says `timeout_ms` does not raise them. Wording-only, and only where the refusal was agent-visible and did not already name a control or fixed allowance: firmware CPU/file-size/diagnostic/report/input, WABT input/output/tool bytes, SQLite diagnostic capture, concurrent inspection slots, and combined snapshot input, Go input bytes, GPU object/report allowances, PE hard input and directory ceilings (caller-selected `max_file_bytes` / `max_entries` branches still say to raise those settings), NativeAOT snapshot and parser budgets, and the model header, report, representation, exact-offset, and nesting allowances. SQLite `worker_timeout_ms` and WABT `command_timeout_ms` recovery are unchanged. `SQLITE_ROW_LIMIT_DEFAULT` stays overridable through `row_limit`. Out of scope: ASAR streaming and hdiutil (#5910 PR 9), and the already-open MCP (#6005), provider (#6014), JavaScript (#6022), Android (#6024), browser (#6036), native (#6059), and swiftc (#6071) limit PRs. No global settings tool, no `retry_after_ms`, and no numeric increases. Follow the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope). Unresolved scope, authority, side effects, or required verification block integration. Link the required maintainer scope decision for new providers or capabilities involving target execution, injection, mutation, or protection recovery; ordinary fixes within existing boundaries may state "not applicable". Draft PRs may leave the scope decision pending and the readiness and merge checklists unchecked. Maintainers can help resolve open questions. ## Contract and boundary impact - Semantic owner and earliest changed stage: domain `inspect_evm_interface` owns `timeout_ms`; the EVMole adapter applies it as the owned worker command deadline. Model capacity failures own their limit kind at `ModelFormatFailure`. Firmware signal errors own captured command output. NativeAOT hydration owns parser-budget explanation on the partial report. Firmware and the other engines keep their existing owners. - Contribution scope fit and linked maintainer decision: not applicable. Recovery and one existing deadline inside current read-only operations. No new provider and no target execution, injection, mutation, or protection recovery. - CLI and MCP/tool-catalog contract: `inspect_evm_interface` accepts optional `timeout_ms`; CLI flag `--timeout-ms`. Omission keeps 30000 ms. Other tool inputs are unchanged. Catalogs and `skills/` stay generated; the authored skill text was updated. - Provider, bridge, target-format, or platform compatibility: EVMole 0.9.3 worker behavior is unchanged aside from the caller-selected wall clock. Fixed ceilings are unchanged. A tighter inherited Linux soft limit can still apply. - Evidence, artifact, provenance, or reconstruction contract: Evidence parameters record a selected `timeout_ms` and omit it when the caller omits it. Result identity is otherwise unchanged. Firmware resource errors retain captured tool output. - Target selection, authority, upstream behavior, and cleanup details (if applicable): unchanged. The worker still runs under the existing prlimit/CPU/byte ceilings. - 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): authored skill and `docs/evm-bytecode.md` updated. No package or installer change. Expected effects (check known effects; use documentation-only on its own). Unchecked items do not establish absence; leave uncertainties visible. - [x] Read existing files or captured data. - [x] 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: model recovery by limit kind, including GGUF header, exact-offset, and nesting refusals; firmware signal captured output, including a fixture `SIGXCPU` through `runFirmwareCommand`; oversized firmware report recovery; NativeAOT hydration work-budget text on the partial report. - Base reproduction or other evidence: source inspection of the fixed 30000 ms `runOwnedCommand` deadline versus the separate 30-second CPU ceiling. Firmware `analysis_timeout_ms` was already on main (default 120000, range 1..2147483647). - User-visible CLI/MCP output (if applicable): a worker timeout names `timeout_ms`, the effective milliseconds, the 30000 ms default when omitted, `--timeout-ms`, the maximum 2147483647, and the fixed caps it does not raise. No live CLI transcript was captured. - Remaining proof gaps: no live EVMole, binwalk, or unblob run. The firmware `SIGXCPU` path used a fixture process, not a live prlimit. Address-space death has no dedicated signal. The earlier EVMole, WABT, SQLite, and PE suite was not re-run on this revision. 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, 2/2 tasks). - `npx oxfmt --check` on the touched files — passed. - `npm run test:local -- src/firmware/FirmwareDeadline.test.ts src/firmware/FirmwareCommand.test.ts src/domain/native/nativeAotPe.budget.test.ts src/domain/native/nativeAotPe.test.ts` — 38 passed. - `npm run test:local -- src/domain/native/nativeAotPe.headerRanges.test.ts src/domain/native/nativeAotPe.sectionRanges.test.ts src/domain/native/nativeAotPe.budget.test.ts` — 28 passed. - `npm run test:focused -- tests/boundary/model/modelArtifact.test.ts tests/boundary/firmware/firmwareReportFiles.test.ts` — firmware report 11 passed; model artifact 71 passed after the nesting fixture fix. ## Compatibility, safety, and release - Breaking changes or migration steps: none. `timeout_ms` is optional. Omitting it keeps the previous 30000 ms deadline. Fixed numeric ceilings are unchanged. - Real Hopper/Ghidra, browser, or OS coverage: not run. NativeAOT wording is on the parser partial report. Linux prlimit integration for a live SIGXCPU was not executed here. - Package or release metadata impact: none. - Security, privacy, process, or containment review: the worker still uses the existing address-space, file-size, and CPU ceilings. A longer `timeout_ms` does not raise them. No new network or mutation authority. ## Author readiness Human owner: @morluto - [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 - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. <!-- CURSOR_AGENT_PR_BODY_END --> <div><a href="https://cursor.com/agents/bc-e087aadb-712b-5ef6-b90c-160d123b858c?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/background-agent?bcId=bc-e087aadb-712b-5ef6-b90c-160d123b858c&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div> --- <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:42 +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#7144
No description provided.