Repository navigation
Conversation
Fodesu
marked this pull request as ready for review
October 3, 2026 13:28
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
Add the durable Run protocol: canonical identities and digests, strict wire
encoding, frozen content storage, schema composition, and the transactional
RunStoreport.Protocol layers
canonicaldefines stable digest and identity derivations for each schemaversion.
wireencodes the sealed command and fact variants with explicit typediscriminators.
frozenstores large request, result, output, and response bodies by digest,keeping facts small and replayable.
schemabinds the Run state machine, canonical rules, identity rules, wirecodec, snapshot codec, and frozen-body codec into one versioned contract.
storedefines the transactional boundary for loading a Run and evaluatingcommands.
Wire format
Facts are persisted as typed canonical payloads. Commands use a typed envelope
containing the Run ID, command identity, discriminator, and command body.
The codec rejects:
Variant registration is schema-local, so a later schema version can add,
rename, or reshape variants without changing how earlier data is decoded.
Snapshots and frozen bodies
Machine snapshots flatten the interface-valued current step into an explicit
discriminator and one step body. Decoding restores the typed state and validates
its structural invariants.
Large content bodies are stored separately as content-addressed, versioned
envelopes. The digest is computed over the stored bytes and verified on both
write and read.
Transaction boundary
EvaluateCommitis the pure commit evaluator used by aRunStore:The store adapter is responsible for replay lookup, atomic persistence, session
ownership, and durable fact encoding. The Run protocol itself remains
independent of storage and transport.
Cost model
Wire and frozen-body operations are proportional to the encoded payload size.
Variant dispatch is map-based, while commit evaluation operates on the current
state and emitted facts rather than replaying the full Run history.