[PR #2308] [MERGED] feat(evm): add retained interface summary delivery #5153

Closed
opened 2026-10-31 01:04:23 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: feat/evm-interface-view-20261012


📝 Commits (4)

  • 3766749 feat(evm): add retained interface summary delivery
  • f995470 fix(experiments): read retained EVM bundle through its public envelope
  • cda794f test(evm): verify retained migration and report paired delivery costs
  • c575fb5 docs(evm): record latest-main verification scope

📊 Changes

18 files changed (+1043 additions, -28 deletions)

View changed files

📝 .agents/skills/reverse-engineer-anything/SKILL.md (+5 -1)
📝 docs/evm-bytecode.md (+44 -1)
📝 experiments/analysis-efficiency/README.md (+4 -0)
📝 experiments/analysis-efficiency/compare.mjs (+1 -0)
➕ experiments/analysis-efficiency/evm-interface-summary.md (+208 -0)
📝 experiments/analysis-efficiency/measure.mjs (+96 -7)
📝 experiments/analysis-efficiency/review-model.py (+5 -0)
➕ experiments/analysis-efficiency/verify-evm-retention.mjs (+167 -0)
📝 src/application/analysisView/AnalysisViewService.ts (+30 -11)
📝 src/contracts/analysisViewToolContracts.ts (+1 -1)
📝 src/contracts/evm/evmToolContracts.ts (+26 -4)
📝 src/domain/analysisView/analysisView.ts (+29 -1)
📝 src/domain/analysisView/binaryLayoutView.ts (+4 -0)
➕ src/domain/analysisView/evmInterfaceView.ts (+145 -0)
📝 src/domain/analysisView/javascriptApplicationView.ts (+4 -0)
📝 src/server/createServer.ts (+1 -0)
📝 src/server/registerEvmTools.ts (+30 -1)
📝 tests/boundary/mcp/evmInterfaceMcp.test.ts (+243 -1)

📄 Description

Summary

Part of #2016. Add opt-in EVM interface summary delivery while keeping existing complete CLI/MCP calls usable. Questions about inferred selectors and identities no longer need full hex and duplicate producer stdout inline; unchanged complete Evidence remains retained and accessible.

Repeated SDK replies are 43–87% smaller for three public inputs. Twelve real Codex trials show mixed token/time results, so this PR does not claim a stable model speedup or uniform token saving.

Problem and expected behavior

inspect_evm_interface({path, encoding}) continues returning its complete Evidence. Selecting detail: "summary" returns a distinct linked inspect_analysis_view summary with all inferred candidates, offsets, arguments/mutability including null, identities, limitations and explicit unknowns. Bytecode hex and duplicate stdout remain accessible from the original parent. No interpreter work or provider selection is silently reduced.

{"name":"inspect_evm_interface","arguments":{"path":"/artifacts/runtime.hex","encoding":"hex","detail":"summary"}}

The returned normalized_result.parent_evidence_id selects retained functions, bytecode_hex, stdout or stderr pages through inspect_analysis_view. Summary coverage covers the returned candidate set; global discovery completeness remains unknown.

Change and scope

  • Reuse the existing view/retention owner and exact named EVM contract. Strip delivery selection before calling the unchanged provider.
  • Require retention before starting a selected-summary analysis. Fixed servers still support complete delivery.
  • Add pure EVM projection and preserve historical carrier identity, function order, original text and explicit unknowns through retained/inline views.
  • Add a public SDK/CLI migration verifier and curated repeated measurements. Generated replies, model transcripts, binaries and toolchains remain outside Git.

Contract and boundary impact

  • Semantic owner and earliest changed stage: MCP delivery selection; pure domain EVM view projection. Shared retention owner checks the prerequisite.
  • Contribution scope fit and linked maintainer decision: agreed additive, read-only continuation in #2016 of the existing EVM pilot from #2261. New target execution/provider authority requiring a separate scope decision is not applicable.
  • CLI and MCP/tool-catalog contract: existing command/tool names, complete defaults and provider arguments preserved; optional EVM detail and EVM view kind added. Actual converted input/output schemas are checked. Only the EVM and generic-view definitions change against the pinned control; old schemas accept new default replies.
  • Provider/format/platform compatibility: unchanged bundled EVMole 0.9.3 and raw/hex inputs. Real-provider scope is Linux x64. No new host prerequisites or dependency changes.
  • Evidence/provenance contract: original complete record/parameters/raw result/ID preserved; distinct view ID links its parent; existing retention/close semantics unchanged. Inferred candidates and unknowns do not become verified ABI/deployment/runtime facts.
  • Target selection, authority and cleanup: same explicit local carrier/encoding, same owned bounded worker and service lifetime; retained views invoke no producer. Existing cancellation and cleanup retry boundaries remain covered.
  • Generated/package/installation impact: authored guide/skill updated; generated catalogs and packaged skills stay ignored. No version, release or installation/configuration change.

Expected effects:

  • Read explicit existing bytecode files or retained/portable Evidence.
  • Launch the existing bounded local analysis worker for an inspection.
  • Run existing analysis worker code; no target code or injected instrumentation.
  • Explicit migration verifier writes new caller-selected Evidence/output files using existing ledger workflows.
  • Contact network services.
  • Recover protected code or work around protections.
  • Unresolved scope or authority.

Evidence and regression coverage

  • 64 focused checks before rebase cover exact SDK schemas, old omitted/complete behavior, original retained records, inferred/null/diagnostic fields, paging without another producer call, historical identity failures, missing-retention preflight, healthy peers, cancellation and cleanup retry. Injected provider seams are boundary evidence, not real EVMole claims.
  • 21 actual SDK measurements include six paired fact/settings comparisons, old-client output-schema compatibility, new default parity, old-server fallback and separate retained proofs.
  • Three actual old-runtime EVM bundles pass new MCP import/view/export and CLI inline use; the source verifier additionally checks exact function/hex pages with the analysis limiter unavailable. Original records, IDs and source bytes remain unchanged.
  • All 59 existing real EVM CLI/MCP verifier cases pass with privately supplied solc 0.8.30/strace 6.1. Actual traces verify absent target exec/network sockets; owned descendants are cleaned up.
  • Six shared-domain public MCP regressions pass: SQLite WASM, ShareX, Obsidian inventory, NewPipe, OpenWrt region and jq/Ghidra entry analysis.

For evidence-bearing changes:

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

Validation performed

  • npm run test:focused -- tests/boundary/mcp/evmInterfaceMcp.test.ts tests/boundary/mcp/wasmArtifactMcp.test.ts tests/boundary/mcp/analysisViewMcp.test.ts src/application/analysisView/AnalysisViewService.test.ts src/domain/analysisView/analysisView.test.ts — 64 pass on the production feature.
  • npm run check and npm run docs:check — pass before rebase; one guarded static-check attempt was stopped at the unchanged early-stop threshold and retained, then the bounded retry passed.
  • After rebasing onto main 0043d9b134c0a353e8bf85c0bde4492275f1f720, the three affected MCP suites pass (30 tests), full static/docs gates pass, and real current-runtime Factory retained/Pool old-bundle SDK and CLI workflows pass. The guarded integrated static-check attempt is preserved; running the same single Turbo typecheck with less launcher overhead passes, then the full gate passes using that valid cache. Memory thresholds and required checks remain unchanged.

Compatibility, safety and release

  • Existing users can keep complete requests and existing Evidence; no migration step is required. Clients selecting the new option against older servers must discover schema support and use supported complete delivery when needed. The explicit experimental fallback is not a universal server guarantee.
  • Real-provider/platform proof is limited to recorded Linux workflows; Windows native/PE/DOS evidence remains at the prior checkpoint. Obsidian inventory is not full AST analysis; OpenWrt region inspection is not full firmware reconstruction. Browser and other provider lanes are not newly claimed.
  • Every real model answer matches exact core fields and observed Evidence IDs, but only three pass the existing verbatim ordered limitation-list check. Four others preserve every source string with extra statements/reordering; five paraphrase or omit source caveats. Strict reports remain unchanged. These are descriptive cost observations, not twelve fully qualified successes.
  • Cached/uncached usage varies. Five of six candidate model calls choose summary; one requests complete. Keep all trials. Final cgroup counters are unavailable after teardown and remain unverified. One CPU, 4 GiB hard memory, 3 GiB early-stop, no swap and bounded tasks remain enforced; no OOM-free performance guarantee is inferred from sampled counters.
  • No publication, deployment or version change. Existing unrelated REA defects remain in the requested private /tmp record.

Detailed pins, sizes, all pair costs, failed attempts, grading qualifications and reproduction: EVM interface summary checkpoint.

Before merge

  • Agreed concrete enhancement, scoped to #2016.
  • Material scope and authority questions resolved within existing static analysis.
  • One focused outcome; Conventional Commit title.
  • Changed behavior and meaningful failure paths covered.
  • Owning contracts, guide and authored skill updated.
  • Representative caller request and returned view/parent semantics documented.
  • Diff reviewed for secrets, unrelated changes and unsupported claims.
  • Current-head CI and manual final review completed at c575fb5390833d7d1b2957247bffc64755b43124; all 37 checks succeed. CI receipt. Bot review quota is exhausted, so automated approval is not claimed.

🔄 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/2308 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/12/2026 **Status:** ✅ Merged **Merged:** 10/12/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `feat/evm-interface-view-20261012` --- ### 📝 Commits (4) - [`3766749`](https://github.com/morluto/rea/commit/3766749316c345ccb594b1b748747b1af9582b34) feat(evm): add retained interface summary delivery - [`f995470`](https://github.com/morluto/rea/commit/f99547023dc084b2b15f7f0ef45f3234cc6f7e47) fix(experiments): read retained EVM bundle through its public envelope - [`cda794f`](https://github.com/morluto/rea/commit/cda794fb9d4a5ca2bd661853a899d579fb8a47b2) test(evm): verify retained migration and report paired delivery costs - [`c575fb5`](https://github.com/morluto/rea/commit/c575fb5390833d7d1b2957247bffc64755b43124) docs(evm): record latest-main verification scope ### 📊 Changes **18 files changed** (+1043 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `.agents/skills/reverse-engineer-anything/SKILL.md` (+5 -1) 📝 `docs/evm-bytecode.md` (+44 -1) 📝 `experiments/analysis-efficiency/README.md` (+4 -0) 📝 `experiments/analysis-efficiency/compare.mjs` (+1 -0) ➕ `experiments/analysis-efficiency/evm-interface-summary.md` (+208 -0) 📝 `experiments/analysis-efficiency/measure.mjs` (+96 -7) 📝 `experiments/analysis-efficiency/review-model.py` (+5 -0) ➕ `experiments/analysis-efficiency/verify-evm-retention.mjs` (+167 -0) 📝 `src/application/analysisView/AnalysisViewService.ts` (+30 -11) 📝 `src/contracts/analysisViewToolContracts.ts` (+1 -1) 📝 `src/contracts/evm/evmToolContracts.ts` (+26 -4) 📝 `src/domain/analysisView/analysisView.ts` (+29 -1) 📝 `src/domain/analysisView/binaryLayoutView.ts` (+4 -0) ➕ `src/domain/analysisView/evmInterfaceView.ts` (+145 -0) 📝 `src/domain/analysisView/javascriptApplicationView.ts` (+4 -0) 📝 `src/server/createServer.ts` (+1 -0) 📝 `src/server/registerEvmTools.ts` (+30 -1) 📝 `tests/boundary/mcp/evmInterfaceMcp.test.ts` (+243 -1) </details> ### 📄 Description ## Summary Part of #2016. Add opt-in EVM interface summary delivery while keeping existing complete CLI/MCP calls usable. Questions about inferred selectors and identities no longer need full hex and duplicate producer stdout inline; unchanged complete Evidence remains retained and accessible. Repeated SDK replies are 43–87% smaller for three public inputs. Twelve real Codex trials show mixed token/time results, so this PR does **not** claim a stable model speedup or uniform token saving. ## Problem and expected behavior `inspect_evm_interface({path, encoding})` continues returning its complete Evidence. Selecting `detail: "summary"` returns a distinct linked `inspect_analysis_view` summary with all inferred candidates, offsets, arguments/mutability including null, identities, limitations and explicit unknowns. Bytecode hex and duplicate stdout remain accessible from the original parent. No interpreter work or provider selection is silently reduced. ```json {"name":"inspect_evm_interface","arguments":{"path":"/artifacts/runtime.hex","encoding":"hex","detail":"summary"}} ``` The returned `normalized_result.parent_evidence_id` selects retained `functions`, `bytecode_hex`, `stdout` or `stderr` pages through `inspect_analysis_view`. Summary coverage covers the returned candidate set; global discovery completeness remains unknown. ## Change and scope - Reuse the existing view/retention owner and exact named EVM contract. Strip delivery selection before calling the unchanged provider. - Require retention before starting a selected-summary analysis. Fixed servers still support complete delivery. - Add pure EVM projection and preserve historical carrier identity, function order, original text and explicit unknowns through retained/inline views. - Add a public SDK/CLI migration verifier and curated repeated measurements. Generated replies, model transcripts, binaries and toolchains remain outside Git. ## Contract and boundary impact - Semantic owner and earliest changed stage: MCP delivery selection; pure domain EVM view projection. Shared retention owner checks the prerequisite. - Contribution scope fit and linked maintainer decision: agreed additive, read-only continuation in #2016 of the existing EVM pilot from #2261. New target execution/provider authority requiring a separate scope decision is not applicable. - CLI and MCP/tool-catalog contract: existing command/tool names, complete defaults and provider arguments preserved; optional EVM `detail` and EVM view kind added. Actual converted input/output schemas are checked. Only the EVM and generic-view definitions change against the pinned control; old schemas accept new default replies. - Provider/format/platform compatibility: unchanged bundled EVMole 0.9.3 and raw/hex inputs. Real-provider scope is Linux x64. No new host prerequisites or dependency changes. - Evidence/provenance contract: original complete record/parameters/raw result/ID preserved; distinct view ID links its parent; existing retention/close semantics unchanged. Inferred candidates and unknowns do not become verified ABI/deployment/runtime facts. - Target selection, authority and cleanup: same explicit local carrier/encoding, same owned bounded worker and service lifetime; retained views invoke no producer. Existing cancellation and cleanup retry boundaries remain covered. - Generated/package/installation impact: authored guide/skill updated; generated catalogs and packaged skills stay ignored. No version, release or installation/configuration change. Expected effects: - [x] Read explicit existing bytecode files or retained/portable Evidence. - [x] Launch the existing bounded local analysis worker for an inspection. - [x] Run existing analysis worker code; no target code or injected instrumentation. - [x] Explicit migration verifier writes new caller-selected Evidence/output files using existing ledger workflows. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Unresolved scope or authority. ## Evidence and regression coverage - 64 focused checks before rebase cover exact SDK schemas, old omitted/complete behavior, original retained records, inferred/null/diagnostic fields, paging without another producer call, historical identity failures, missing-retention preflight, healthy peers, cancellation and cleanup retry. Injected provider seams are boundary evidence, not real EVMole claims. - 21 actual SDK measurements include six paired fact/settings comparisons, old-client output-schema compatibility, new default parity, old-server fallback and separate retained proofs. - Three actual old-runtime EVM bundles pass new MCP import/view/export and CLI inline use; the source verifier additionally checks exact function/hex pages with the analysis limiter unavailable. Original records, IDs and source bytes remain unchanged. - All 59 existing real EVM CLI/MCP verifier cases pass with privately supplied solc 0.8.30/strace 6.1. Actual traces verify absent target exec/network sockets; owned descendants are cleaned up. - Six shared-domain public MCP regressions pass: SQLite WASM, ShareX, Obsidian inventory, NewPipe, OpenWrt region and jq/Ghidra entry analysis. 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 and uncertain outcomes remain visible. ## Validation performed - `npm run test:focused -- tests/boundary/mcp/evmInterfaceMcp.test.ts tests/boundary/mcp/wasmArtifactMcp.test.ts tests/boundary/mcp/analysisViewMcp.test.ts src/application/analysisView/AnalysisViewService.test.ts src/domain/analysisView/analysisView.test.ts` — 64 pass on the production feature. - `npm run check` and `npm run docs:check` — pass before rebase; one guarded static-check attempt was stopped at the unchanged early-stop threshold and retained, then the bounded retry passed. - After rebasing onto main `0043d9b134c0a353e8bf85c0bde4492275f1f720`, the three affected MCP suites pass (30 tests), full static/docs gates pass, and real current-runtime Factory retained/Pool old-bundle SDK and CLI workflows pass. The guarded integrated static-check attempt is preserved; running the same single Turbo typecheck with less launcher overhead passes, then the full gate passes using that valid cache. Memory thresholds and required checks remain unchanged. ## Compatibility, safety and release - Existing users can keep complete requests and existing Evidence; no migration step is required. Clients selecting the new option against older servers must discover schema support and use supported complete delivery when needed. The explicit experimental fallback is not a universal server guarantee. - Real-provider/platform proof is limited to recorded Linux workflows; Windows native/PE/DOS evidence remains at the prior checkpoint. Obsidian inventory is not full AST analysis; OpenWrt region inspection is not full firmware reconstruction. Browser and other provider lanes are not newly claimed. - Every real model answer matches exact core fields and observed Evidence IDs, but only three pass the existing verbatim ordered limitation-list check. Four others preserve every source string with extra statements/reordering; five paraphrase or omit source caveats. Strict reports remain unchanged. These are descriptive cost observations, not twelve fully qualified successes. - Cached/uncached usage varies. Five of six candidate model calls choose summary; one requests complete. Keep all trials. Final cgroup counters are unavailable after teardown and remain unverified. One CPU, 4 GiB hard memory, 3 GiB early-stop, no swap and bounded tasks remain enforced; no OOM-free performance guarantee is inferred from sampled counters. - No publication, deployment or version change. Existing unrelated REA defects remain in the requested private `/tmp` record. Detailed pins, sizes, all pair costs, failed attempts, grading qualifications and reproduction: [EVM interface summary checkpoint](https://github.com/morluto/rea/blob/feat/evm-interface-view-20261012/experiments/analysis-efficiency/evm-interface-summary.md). ## Before merge - [x] Agreed concrete enhancement, scoped to #2016. - [x] Material scope and authority questions resolved within existing static analysis. - [x] One focused outcome; Conventional Commit title. - [x] Changed behavior and meaningful failure paths covered. - [x] Owning contracts, guide and authored skill updated. - [x] Representative caller request and returned view/parent semantics documented. - [x] Diff reviewed for secrets, unrelated changes and unsupported claims. - [x] Current-head CI and manual final review completed at `c575fb5390833d7d1b2957247bffc64755b43124`; all 37 checks succeed. [CI receipt](https://github.com/morluto/rea/actions/runs/38293703525). Bot review quota is exhausted, so automated approval is not claimed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:04:23 +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#5153
No description provided.