Support digest-backed state expansion for open agents - #10
Merged
Conversation
Allow runtime observed actor validation to accept actors whose source state expands the expected open observed base state, while still comparing the concrete storage field layout. Add an open ICC regression that attaches a Forager actor owning ForagerState expands AgentState to a core expecting actor<AgentState>.
Lower expanded state fields as a source-level view over fixed storage digests. The compiler now verifies a packed hidden preimage, exposes memory fields as locals, and synthesizes digest fields when constructing expanded states. Runtime builders accept flattened expanded-state fields, pack and hash them into storage, and provide the packed preimage as hidden entry material. The Sil ABI crate now exposes packed struct payload encoding for this runtime path.
Move the lattice-style cell and agent sketch into the compiling Open ICC examples. The core app now owns cell physics and observes a dynamic agent handle, while the agent app includes a Forager expanded state over AgentState. Regenerate tracked Open ICC build outputs, remove the old open_lattice sketch folder, and keep artifact schema fixtures explicit about state expansions.
Define AgentState in the Open ICC core app and have the concrete agent app import that shared state view. This makes the dependency direction match the intended open-agent model: core publishes the interface, agents implement or expand it. Regenerate tracked Open ICC artifacts after the import inversion.
Extend the Open ICC runtime regression to execute the real Forager::step path. The test co-spends a controller Cell input, builds a Forager output from flattened expanded-state fields, and verifies digest-backed memory is repacked correctly at script execution time.
Support digest-backed expanded state through virtual slots on base states and slot-qualified bindings on expanded states. Base states can declare virtual slots such as virtual strategy; while expanded states bind them with strategy: ForagerStrategy;. Generated Sil keeps the stored digest field, and expanded actor code accesses memory through strategy.*.
michaelsutton
force-pushed
the
state-expansion
branch
from
July 9, 2026 09:16
066fac0 to
2716ba6
Compare
11 tasks
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.
This PR adds digest-backed virtual slots for open-agent apps, and turns the old Open Lattice sketches into a compiling Open ICC lattice fixture.
Changes:
virtual <slot>;on base statesstate X expands Base { slot: Memory; }bindings for concrete agent statesstrategy.hungerstrategy: ForagerStrategy { ... }argent-runtimeto accept slot-qualified source values and fill hidden preimage witnessesForagerState expands AgentCapsule, to satisfy observedactor<AgentCapsule>handlesAgentCapsuleintocore.ag;agent.agimports the core state viewexamples/open_latticesketches with the realexamples/open_iccfixtureForager::step, including controller co-spend authorization and digest-backed strategy repackingExample:
The generated Sil stores the base layout only:
controller_id,strategy, andenergy. TheForagerStrategypreimage is Argent runtime/compiler plumbing: the contract verifies it against the storedstrategydigest, exposesstrategy.hungerandstrategy.moodto source code, and writes mutations back as a new digest.