Skip to content

feat: Agent Pack bundle format, on-chain verification, and conformance tests#20

Merged
Mehd1b merged 9 commits into
devfrom
feature/agent-pack
Jan 31, 2026
Merged

feat: Agent Pack bundle format, on-chain verification, and conformance tests#20
Mehd1b merged 9 commits into
devfrom
feature/agent-pack

Conversation

@Mehd1b

@Mehd1b Mehd1b commented Jan 31, 2026

Copy link
Copy Markdown
Member

Summary

  • Add Agent Pack bundle format for distributing verifiable agent binaries
  • Add verify-onchain command to check agent registration against KernelExecutionVerifier
  • Add cross-language conformance tests ensuring Rust and Solidity produce identical encodings
  • Add execution semantics tests for KernelVault action handling
  • Add reference-integrator crate with golden path deployment script

Changes

Agent Pack (crates/agent-pack/)

  • CLI tool for creating, verifying, and distributing agent bundles
  • Manifest schema with cryptographic hashes (ELF, image_id, agent_id)
  • pack command to create distribution bundles
  • verify command for offline validation
  • verify-onchain command (feature-gated) for on-chain registry verification

Cross-Language Conformance

  • Golden vectors in action_vectors.json shared between Rust and Solidity
  • KernelOutputParser.Conformance.t.sol validates Solidity parsing matches Rust encoding
  • SHA-256 commitment compatibility verified

Execution Semantics Tests

  • KernelVault.ExecutionSemantics.t.sol with 25+ tests covering:
    • CALL, TRANSFER_ERC20, NO_OP action execution
    • Commitment binding and mismatch handling
    • Nonce replay protection
    • Atomicity guarantees

Documentation

  • docs/agent-pack.md - Complete CLI and schema reference
  • docs/protocol/action-types.md - Canonical action type definitions
  • docs/protocol/onchain-policy.md - On-chain execution policy
  • docs/integration/reference-integrator.md - Deployment guide

Test plan

  • cargo test --workspace --exclude risc0-methods
  • cargo clippy --workspace --exclude risc0-methods -- -D warnings
  • forge test -vv (92 tests passing)
  • CI passing on all jobs

Add a complete reference implementation for integrating with Agent Pack
bundles. The crate provides:

- Bundle loading and parsing (agent-pack.json + ELF)
- Offline verification (structure, hashes, imageId)
- On-chain verification (registry lookup via KernelExecutionVerifier)
- Kernel input construction
- Proof generation (Groth16 and dev mode)
- On-chain execution via KernelVault
- Agent output reconstruction for yield agent

CLI commands:
- refint verify: Verify bundle offline and on-chain
- refint prove: Generate zkVM proof
- refint execute: Submit proof to vault
- refint status: Show feature availability

Also adds golden_path_sepolia.sh script for end-to-end testing.
…lidation

This commit locks down execution semantics with comprehensive testing:

Conformance Testing:
- Add golden vectors in crates/protocol/kernel-core/tests/fixtures/action_vectors.json
- Add Rust conformance tests validating encoding and SHA-256 commitments
- Add Solidity conformance tests parsing same vectors and verifying commitments
- Add CI workflow for Foundry tests alongside Rust tests

Execution Semantics Testing:
- Add MockKernelExecutionVerifier for configurable journal responses
- Add MockCallTarget for testing CALL action execution
- Add KernelVault.ExecutionSemantics.t.sol with 25 end-to-end tests covering:
  - TRANSFER_ERC20: exact transfers, vault drain, wrong token rejection
  - CALL: function invocation, ETH value transfer, revert handling
  - NO_OP: no balance changes, timestamp updates
  - Atomicity: rollback on partial failure
  - Failure modes: commitment mismatch, nonce replay, gap limits

Documentation:
- Add docs/protocol/action-types.md with ActionV1 wire format specification
- Add docs/protocol/onchain-policy.md describing trust model and failure handling

Code Fixes:
- Fix KernelVault.t.sol: deposit() -> depositERC20Tokens()
- Apply forge fmt to all Solidity files for consistent formatting
@Mehd1b
Mehd1b merged commit 9a87daf into dev Jan 31, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant