Repository navigation
Conversation
Fodesu
marked this pull request as ready for review
October 3, 2026 13:57
Fodesu
force-pushed
the
feat/agent-runtime-core-12-session-run-store
branch
from
October 3, 2026 17:04
7fb32df to
b976908
Compare
Fodesu
force-pushed
the
feat/agent-runtime-core-12-session-run-store
branch
from
October 3, 2026 17:11
b976908 to
b7b7cd9
Compare
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 Session-backed implementation of the RunStore protocol.
Run module
Register the
twilight/run/event domain:RunIDrunIdvalidation at the event boundarytwilight/run/machineprojectionRun streams use own inheritance, so a forked Session does not inherit Runs from
its parent.
Machine projection
The machine projection keeps:
MachineStateof each active RunTerminal Runs are removed from the projection. Their history remains the
authoritative source of record, so the projection is bounded by active Runs
rather than total historical Runs.
The projection is used for fast command evaluation.
Recordindependentlyreads and folds the Run stream, and compares the result with the projection
when both reads observe the same ledger head.
SessionRunStore
Implement the RunStore boundary over a Session Writer:
Bindattaches a RunStore to one Writer ownership capability.Loadreads the Writer's transactional machine projection.Commitevaluates one command and contributes its facts as one Session unitof work.
CreateRuncontributes Run creation and initial input facts to a largercreation unit.
Recordprovides an ownership-free, verified read of a Run.FrozenRequestrestores a model request from its content-addressed body.All Run commands in a drive use the same Writer, epoch, projection view, and
ownership fence.
Commit and recovery semantics
Command bodies are frozen before the unit commits. Storage is idempotent and
content-addressed, so rejected or replayed commands cannot leave an
unreferenced body with an incorrect digest.
Commit results distinguish:
Projection cache writes are best effort and never change commit success. The
event stream remains authoritative; the cache only reduces future replay work.
Cost model
Command evaluation operates on the active Run projection and the command's
facts rather than replaying the full Session. A full
Recordis linear in theRun's fact history, while valid projection and frozen-body caches avoid that
work for normal command processing.