feat: Agent Pack bundle format, on-chain verification, and conformance tests#20
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
verify-onchaincommand to check agent registration against KernelExecutionVerifierChanges
Agent Pack (
crates/agent-pack/)packcommand to create distribution bundlesverifycommand for offline validationverify-onchaincommand (feature-gated) for on-chain registry verificationCross-Language Conformance
action_vectors.jsonshared between Rust and SolidityKernelOutputParser.Conformance.t.solvalidates Solidity parsing matches Rust encodingExecution Semantics Tests
KernelVault.ExecutionSemantics.t.solwith 25+ tests covering:Documentation
docs/agent-pack.md- Complete CLI and schema referencedocs/protocol/action-types.md- Canonical action type definitionsdocs/protocol/onchain-policy.md- On-chain execution policydocs/integration/reference-integrator.md- Deployment guideTest plan
cargo test --workspace --exclude risc0-methodscargo clippy --workspace --exclude risc0-methods -- -D warningsforge test -vv(92 tests passing)