[GH-ISSUE #2389] [Feature] Solidity: select exact solc Standard JSON contract artifacts and bytecode kinds #797

Open
opened 2026-10-15 18:28:33 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @matbrgz on GitHub (Oct 12, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/2389

Type: Feature Domain: Blockchain RE Status: Proposed Ecosystem: REA

Analyst question and current gap

inspect_evm_interface accepts only explicit raw/hex carriers and leaves init/runtime kind unknown. A compiler output can contain several source files/contracts, creation and deployed objects, unlinked libraries, immutable references and diagnostics; it cannot be treated as one runtime hex string.

Proposed outcome

  • Inspect caller-selected existing solc Standard JSON output without running a compiler; select an exact source-unit/contract and creation or deployed bytecode field.
  • Preserve file digest, JSON source coordinates, selected object identity, recorded compiler/settings and diagnostics. Output errors must remain visible even if an external compiler exited successfully.
  • Keep unresolved link placeholders, linkReferences and immutableReferences as distinct facts. Do not invent addresses or silently rewrite the input.
  • Feed admitted concrete selected bytes to the existing EVM interface operation with explicit selection provenance; bytecode kind is a supplied compiler-artifact fact, not proof of deployment.
  • Report absent outputs, malformed objects, conflicting contract names and compiler-version-dependent facets precisely.

Acceptance and verification

  • An owned multi-contract solc fixture selects creation/deployed objects independently and preserves compiler diagnostics.
  • Unlinked library placeholders are reported without being interpreted as hexadecimal bytes.
  • Missing contracts, ambiguous basename selectors and out-of-range reference spans fail or remain unavailable precisely.
  • CLI/MCP preserve exact selected identities with bounded JSON parsing and cancellation.
  • Define one feature specification, one implementation plan and incremental tasks under docs/specs/solidity/compiler-artifacts/ before implementation.

Scope and relationships

Offline caller-selected artifact inspection. Existing EVM interface recovery (PR #1051), retained delivery (PR #2308) and roadmap #972 are the foundations; this feature is independently scoped and does not reopen the entire roadmap. Parent language tracker: #2383. Use self-owned compiler fixtures and preserve provider/version provenance. New provider choices, if needed, follow CONTRIBUTING.md before substantial integration work.

Primary references

Originally created by @matbrgz on GitHub (Oct 12, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/2389 [![Type: Feature](https://img.shields.io/badge/type-feature-blue.svg?style=flat-square)](https://github.com/morluto/rea) [![Domain: Blockchain RE](https://img.shields.io/badge/domain-blockchain_RE-orange.svg?style=flat-square)](https://github.com/morluto/rea) [![Status: Proposed](https://img.shields.io/badge/status-proposed-blue.svg?style=flat-square)](https://github.com/morluto/rea) [![Ecosystem: REA](https://img.shields.io/badge/ecosystem-morluto%2Frea-8A2BE2.svg?style=flat-square)](https://github.com/morluto/rea) ## Analyst question and current gap inspect_evm_interface accepts only explicit raw/hex carriers and leaves init/runtime kind unknown. A compiler output can contain several source files/contracts, creation and deployed objects, unlinked libraries, immutable references and diagnostics; it cannot be treated as one runtime hex string. ## Proposed outcome - Inspect caller-selected existing solc Standard JSON output without running a compiler; select an exact source-unit/contract and creation or deployed bytecode field. - Preserve file digest, JSON source coordinates, selected object identity, recorded compiler/settings and diagnostics. Output errors must remain visible even if an external compiler exited successfully. - Keep unresolved link placeholders, linkReferences and immutableReferences as distinct facts. Do not invent addresses or silently rewrite the input. - Feed admitted concrete selected bytes to the existing EVM interface operation with explicit selection provenance; bytecode kind is a supplied compiler-artifact fact, not proof of deployment. - Report absent outputs, malformed objects, conflicting contract names and compiler-version-dependent facets precisely. ## Acceptance and verification - [ ] An owned multi-contract solc fixture selects creation/deployed objects independently and preserves compiler diagnostics. - [ ] Unlinked library placeholders are reported without being interpreted as hexadecimal bytes. - [ ] Missing contracts, ambiguous basename selectors and out-of-range reference spans fail or remain unavailable precisely. - [ ] CLI/MCP preserve exact selected identities with bounded JSON parsing and cancellation. - [ ] Define one feature specification, one implementation plan and incremental tasks under docs/specs/solidity/compiler-artifacts/ before implementation. ## Scope and relationships Offline caller-selected artifact inspection. Existing EVM interface recovery (PR #1051), retained delivery (PR #2308) and roadmap #972 are the foundations; this feature is independently scoped and does not reopen the entire roadmap. Parent language tracker: #2383. Use self-owned compiler fixtures and preserve provider/version provenance. New provider choices, if needed, follow CONTRIBUTING.md before substantial integration work. ## Primary references - [Solidity compiler Standard JSON](https://docs.soliditylang.org/en/latest/using-the-compiler.html)
Author
Owner

@matbrgz commented on GitHub (Oct 12, 2026):

Triage & Architectural Review Notes

Objective (ELI5):
Disambiguate contract artifacts produced by solc Standard JSON output (bin creation bytecode vs bin-runtime deployed bytecode) and preserve provenance across compilation targets.

Design Alignment:

  • Boundary Ownership: Standard JSON schema parsing belongs in src/domain/evm/. The domain contract must expose explicit discriminant properties (bytecodeKind: "creation" | "deployed") rather than inferring role from byte length or deployment context.
  • Fail-Closed Validation: Missing link references or unresolved library addresses (__$30...$__) must be retained as unresolved linkage evidence rather than zeroed or stripped.
  • Spec Target: docs/specs/evm/standard-json-artifacts/
<!-- gh-comment-id:6133834299 --> @matbrgz commented on GitHub (Oct 12, 2026): ### Triage & Architectural Review Notes **Objective (ELI5):** Disambiguate contract artifacts produced by `solc` Standard JSON output (`bin` creation bytecode vs `bin-runtime` deployed bytecode) and preserve provenance across compilation targets. **Design Alignment:** - **Boundary Ownership:** Standard JSON schema parsing belongs in `src/domain/evm/`. The domain contract must expose explicit discriminant properties (`bytecodeKind: "creation" | "deployed"`) rather than inferring role from byte length or deployment context. - **Fail-Closed Validation:** Missing link references or unresolved library addresses (`__$30...$__`) must be retained as unresolved linkage evidence rather than zeroed or stripped. - **Spec Target:** `docs/specs/evm/standard-json-artifacts/`
Author
Owner

@fangkangmi commented on GitHub (Oct 12, 2026):

I'd like to take this issue, working on it

<!-- gh-comment-id:6134126409 --> @fangkangmi commented on GitHub (Oct 12, 2026): I'd like to take this issue, working on it
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#797
No description provided.