[PR #2261] [MERGED] refactor(evm): bind offline analysis through a static descriptor #5121

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

📋 Pull Request Information

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

Base: main ← Head: feat/evm-domain-descriptor-20261012


📝 Commits (3)

  • 2b61852 test(evm): pin real Uniswap interface migration controls
  • 152984d refactor(evm): bind offline analysis through a static descriptor
  • d999d98 docs(evm): record compatible wiring and real task costs

📊 Changes

13 files changed (+590 additions, -48 deletions)

View changed files

📝 docs/architecture.mermaid (+1 -1)
📝 experiments/analysis-efficiency/README.md (+7 -2)
📝 experiments/analysis-efficiency/corpus.json (+56 -0)
➕ experiments/analysis-efficiency/evm-descriptor.md (+181 -0)
📝 experiments/analysis-efficiency/measure.mjs (+35 -17)
➕ experiments/analysis-efficiency/questions/evm-uniswap.txt (+1 -0)
➕ experiments/analysis-efficiency/verify-evm-template.mjs (+95 -0)
📝 src/cli/evmCommands.ts (+4 -5)
📝 src/composition/evm.ts (+13 -0)
📝 src/contracts/evm/evmToolContracts.ts (+18 -15)
📝 src/server/createServer.ts (+5 -3)
📝 src/server/registerEvmTools.ts (+2 -2)
📝 tests/boundary/mcp/evmInterfaceMcp.test.ts (+172 -3)

📄 Description

Summary

EVM CLI/MCP registration independently repeats its operation, command and factory bindings, and keeps a redundant factory fallback after the host has already selected an owned service. Bind the existing exact contract, CLI name and legacy factory through a small static descriptor, and pass the selected full service instance to registration. Preserve injection identity and retryable cleanup. Continues #2016; that broader issue stays open.

Scope and compatibility

  • Keep createEvmInterfaceService, existing CLI/MCP names, path/encoding meanings, complete result/defaults, provider configuration and Evidence/session behavior unchanged.
  • Name the existing owning EVM contract directly; retain its original default catalog position and exact schemas/description/effects. No plugin loader, registry, pack selection, new provider protocol or installation behavior.
  • Keep domain/application layers independent of engine protocols; update the architecture map for static WASM/EVM composition.
  • Add digest-pinned public Uniswap v3-core 1.0.1 Factory/Pool compiler templates alongside the existing WETH historical example. Preserve original compiler JSON/carrier/decoded identity and unknown immutable/deployment metadata. Verify ABI dispatch selector multisets independently; no source-signature inference or live-chain claim.
  • Keep raw replies, binaries, model transcripts, credentials and detailed JSON outside Git. Only source-authored inputs/scripts and curated findings are included. No release or deployment.

Validation and actual evidence

  • Five actual in-memory SDK boundary scenarios: valid converted schemas, duplicate registration rejection before use, strict malformed input, unavailable/incompatible-output failures with healthy WASM peer, injected-owner cleanup retry and cancellation reaching handler settlement followed by a successful request. Recording ports establish adapter/lifetime semantics, not real engines.
  • Nine EVM service + 26 provider-boundary + seven WASM MCP cases pass; two unsupported-host cases are intentionally skipped on Linux. New fixture setup/SDK error-message assumptions were corrected with only the related MCP file rerun; first attempts remain private.
  • npm run check, npm run docs:check, npm run verify:test-discovery, formatting/diff and required pre-push checks pass. Source discovery covers all 940 files exactly once. The approximately 3 GiB static-check peak/high events are excluded from performance claims.
  • Actual default SDK catalog is byte-identical across six before/after EVM pairs (three inputs, two repetitions), including order, descriptions, schemas and annotations. All selected facts/settings agree; original run-specific reference maps remain preserved. Complete result byte counts stay 26,760 / 110,424 / 110,998 for WETH / Factory / Pool.
  • All 59 existing real EVM CLI/MCP verifier cases pass against the frozen modified runtime with unchanged EVMole 0.9.3 and private solc 0.8.30/strace. Actual verifier traces report no target execution/network sockets for those scenarios; owned descendants are empty.
  • Post-descriptor real public MCP workflows pass for SQLite WASM, ShareX managed PE/CLI, Obsidian inventory, NewPipe APK, OpenWrt firmware and jq native/Ghidra, with named schema validation and unchanged input digests. This is selected Linux coverage; no Windows runtime, DOS COM, IDA/Hopper, Android-device, browser or full JavaScript AST proof is added.
  • Six actual Codex CLI 0.161.0 trials request gpt-5.6-terra high: WETH/Factory/Pool each twice, isolated temporary configuration pointing at modified REA MCP. Every requested fact/observed-reference/target-integrity/profile-cleanup check passes; each uses one successful EVM call and no failed call. Requested alias is not a resolved-model identity claim; the fixed one-tool subset is not full-catalog discovery evaluation.

Performance interpretation and remaining work

This refactor establishes compatible wiring, not a new token reduction. Second-pair SDK latency/CPU are similar; slower initial controls are retained without attributing the difference to unchanged provider algorithms. Complete Uniswap model tasks still consume about 36–37k uncached input tokens. The captured complete-output cohort is a baseline for an explicit precise interface view in the next increment; complete defaults must remain available.

Frozen production comparison pins: control 1770f38cfc6cbe87491d0de8b8730c305c5cf8ea, candidate 152984da771450048ee9d60db8a410994a125878; driver/runtime digests and measurement order are in the curated notes. Later documentation-only commit does not change production behavior. All heavy trials were serial under one CPU, 4 GiB hard/3 GiB early-stop, no swap and bounded tasks. Final transient-cgroup counters remain unknown, so strict overall resource-qualified model grades are unverified, even though selected fact/lifecycle checks pass. No universal speedup, OOM absence or resource saving is claimed.

Remaining #2016 work includes precise EVM delivery, applicable preset lifecycle/snapshot coverage and additional domain/platform evidence. Existing unrelated REA bugs remain in the requested /tmp team handoff and are not repaired here.


🔄 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/2261 **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-domain-descriptor-20261012` --- ### 📝 Commits (3) - [`2b61852`](https://github.com/morluto/rea/commit/2b61852fe20adeb664bc72bd129be209a1585acc) test(evm): pin real Uniswap interface migration controls - [`152984d`](https://github.com/morluto/rea/commit/152984da771450048ee9d60db8a410994a125878) refactor(evm): bind offline analysis through a static descriptor - [`d999d98`](https://github.com/morluto/rea/commit/d999d9874bf59c3c8486bac9b2c867a4a6a9121d) docs(evm): record compatible wiring and real task costs ### 📊 Changes **13 files changed** (+590 additions, -48 deletions) <details> <summary>View changed files</summary> 📝 `docs/architecture.mermaid` (+1 -1) 📝 `experiments/analysis-efficiency/README.md` (+7 -2) 📝 `experiments/analysis-efficiency/corpus.json` (+56 -0) ➕ `experiments/analysis-efficiency/evm-descriptor.md` (+181 -0) 📝 `experiments/analysis-efficiency/measure.mjs` (+35 -17) ➕ `experiments/analysis-efficiency/questions/evm-uniswap.txt` (+1 -0) ➕ `experiments/analysis-efficiency/verify-evm-template.mjs` (+95 -0) 📝 `src/cli/evmCommands.ts` (+4 -5) 📝 `src/composition/evm.ts` (+13 -0) 📝 `src/contracts/evm/evmToolContracts.ts` (+18 -15) 📝 `src/server/createServer.ts` (+5 -3) 📝 `src/server/registerEvmTools.ts` (+2 -2) 📝 `tests/boundary/mcp/evmInterfaceMcp.test.ts` (+172 -3) </details> ### 📄 Description ## Summary EVM CLI/MCP registration independently repeats its operation, command and factory bindings, and keeps a redundant factory fallback after the host has already selected an owned service. Bind the existing exact contract, CLI name and legacy factory through a small static descriptor, and pass the selected full service instance to registration. Preserve injection identity and retryable cleanup. Continues #2016; that broader issue stays open. ## Scope and compatibility - Keep `createEvmInterfaceService`, existing CLI/MCP names, path/encoding meanings, complete result/defaults, provider configuration and Evidence/session behavior unchanged. - Name the existing owning EVM contract directly; retain its original default catalog position and exact schemas/description/effects. No plugin loader, registry, pack selection, new provider protocol or installation behavior. - Keep domain/application layers independent of engine protocols; update the architecture map for static WASM/EVM composition. - Add digest-pinned public Uniswap v3-core 1.0.1 Factory/Pool compiler templates alongside the existing WETH historical example. Preserve original compiler JSON/carrier/decoded identity and unknown immutable/deployment metadata. Verify ABI dispatch selector multisets independently; no source-signature inference or live-chain claim. - Keep raw replies, binaries, model transcripts, credentials and detailed JSON outside Git. Only source-authored inputs/scripts and [curated findings](experiments/analysis-efficiency/evm-descriptor.md) are included. No release or deployment. ## Validation and actual evidence - Five actual in-memory SDK boundary scenarios: valid converted schemas, duplicate registration rejection before use, strict malformed input, unavailable/incompatible-output failures with healthy WASM peer, injected-owner cleanup retry and cancellation reaching handler settlement followed by a successful request. Recording ports establish adapter/lifetime semantics, not real engines. - Nine EVM service + 26 provider-boundary + seven WASM MCP cases pass; two unsupported-host cases are intentionally skipped on Linux. New fixture setup/SDK error-message assumptions were corrected with only the related MCP file rerun; first attempts remain private. - `npm run check`, `npm run docs:check`, `npm run verify:test-discovery`, formatting/diff and required pre-push checks pass. Source discovery covers all 940 files exactly once. The approximately 3 GiB static-check peak/high events are excluded from performance claims. - Actual default SDK catalog is byte-identical across six before/after EVM pairs (three inputs, two repetitions), including order, descriptions, schemas and annotations. All selected facts/settings agree; original run-specific reference maps remain preserved. Complete result byte counts stay 26,760 / 110,424 / 110,998 for WETH / Factory / Pool. - All 59 existing real EVM CLI/MCP verifier cases pass against the frozen modified runtime with unchanged EVMole 0.9.3 and private solc 0.8.30/strace. Actual verifier traces report no target execution/network sockets for those scenarios; owned descendants are empty. - Post-descriptor real public MCP workflows pass for SQLite WASM, ShareX managed PE/CLI, Obsidian inventory, NewPipe APK, OpenWrt firmware and jq native/Ghidra, with named schema validation and unchanged input digests. This is selected Linux coverage; no Windows runtime, DOS COM, IDA/Hopper, Android-device, browser or full JavaScript AST proof is added. - Six actual Codex CLI 0.161.0 trials request `gpt-5.6-terra` high: WETH/Factory/Pool each twice, isolated temporary configuration pointing at modified REA MCP. Every requested fact/observed-reference/target-integrity/profile-cleanup check passes; each uses one successful EVM call and no failed call. Requested alias is not a resolved-model identity claim; the fixed one-tool subset is not full-catalog discovery evaluation. ## Performance interpretation and remaining work This refactor establishes compatible wiring, not a new token reduction. Second-pair SDK latency/CPU are similar; slower initial controls are retained without attributing the difference to unchanged provider algorithms. Complete Uniswap model tasks still consume about 36–37k uncached input tokens. The captured complete-output cohort is a baseline for an explicit precise interface view in the next increment; complete defaults must remain available. Frozen production comparison pins: control `1770f38cfc6cbe87491d0de8b8730c305c5cf8ea`, candidate `152984da771450048ee9d60db8a410994a125878`; driver/runtime digests and measurement order are in the curated notes. Later documentation-only commit does not change production behavior. All heavy trials were serial under one CPU, 4 GiB hard/3 GiB early-stop, no swap and bounded tasks. Final transient-cgroup counters remain unknown, so strict overall resource-qualified model grades are **unverified**, even though selected fact/lifecycle checks pass. No universal speedup, OOM absence or resource saving is claimed. Remaining #2016 work includes precise EVM delivery, applicable preset lifecycle/snapshot coverage and additional domain/platform evidence. Existing unrelated REA bugs remain in the requested `/tmp` team handoff and are not repaired here. --- <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:09 +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#5121
No description provided.