Repository navigation
Move the Turn journal, usage and the Item and Subagent projections into sessions and sessionpg - #334
Merged
Merged
Conversation
…to sessions and sessionpg The Turn execution journal runs through the lease-bound sessions.ExecutionOperations on sessionpg.NewExecution(lease), which the Worker receives as execution.Owner.Sessions and Dispatcher.Bind binds. sessions owns the journal batch rules, AppendTurnEvents and AppendTurnEvent, ProjectSource and ProjectInput, ValidTransition and the Subagent projection decisions; sessionpg's SessionTx loads the facts and applies them. The pooled store journal and its projection files are gone.
Contributor
|
Found 1 test failure on Blacksmith runners: Failure
|
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.
The Turn event journal, token usage and the Item and Subagent projections move out of
storeintosessionsandsessionpg.What changes
sessions:journal.goholds the batch, the limits and the append rules (NewJournalBatch,AppendTurnEvents,AppendTurnEvent).projection.goholdsProjectSource,ProjectInputand the Item projection.subagents.go.ValidTransitionlives inturn.go.JournalExecutionfamily (ExecutionOperations.AppendTurnEventsonsessionpg.Execution.WithTurnJournal).sessionpg: theSessionTxparticipants load journal, Item, usage and Subagent facts and apply the typed decisions. No decision lives in the adapter.store: the remaining Turn operations (transitions, completion, input admission) call the procedures throughsessionpg.BindSessionuntil their own PRs.services/core/tests/fixturesruns the same procedure pooled throughsessionpg.WithSessionandBindSession. That is its only pooled use.store:turn_events.go,item_projection.goand the fivesubagent_*projection and identity files.AppendTurnEvents,ListTurnEventsandGetSubagentIdentity. The two reads remain only as test helpers.IMPLEMENTATION.md,sessions/doc.goandsessionpg/doc.goname the new owners.Behavior
The public behavior is unchanged: event sequence allocation, ordering, idempotent replay, limits, projection order, pruning and rollback all behave as before. The error for a malformed ID still wins over the limit and missing-Session errors.
Internally:
Checks
go build ./...andgo vet ./services/core/....sessions,itemsandsessionpgin full. The PostgreSQL tests cover journal atomicity, lease fencing and isolation.-runwith the journal, Subagent, worker, owner and runtime protocol tests.-runwith the 75 tests in the edited store test files, including the dispatch, archive cancellation and prepared dispatch tests. The official-client tests ran with the pinned SDK.scripts/check-names.py.A blind review found no blockers or majors. The validation-order finding is fixed in this commit.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.