refactor(session): connection-scoped turn-intent helpers for the lifecycle stack - #512
Merged
Merged
Conversation
This was referenced Jul 27, 2026
beruro
added a commit
that referenced
this pull request
Jul 27, 2026
beruro
added a commit
that referenced
this pull request
Jul 27, 2026
beruro
added a commit
that referenced
this pull request
Jul 27, 2026
beruro
added a commit
that referenced
this pull request
Jul 27, 2026
This was referenced Jul 27, 2026
beruro
added a commit
that referenced
this pull request
Jul 27, 2026
beruro
added a commit
that referenced
this pull request
Jul 27, 2026
beruro
added a commit
that referenced
this pull request
Jul 27, 2026
beruro
added a commit
that referenced
this pull request
Jul 27, 2026
beruro
added a commit
that referenced
this pull request
Jul 27, 2026
This was referenced Jul 27, 2026
beruro
force-pushed
the
junyu/rpc-performance-closure
branch
2 times, most recently
from
July 29, 2026 04:05
4672245 to
08c6161
Compare
beruro
force-pushed
the
junyu/rpc-performance-closure
branch
from
July 29, 2026 05:20
08c6161 to
f2c5742
Compare
This was referenced Jul 29, 2026
Collaborator
Author
|
Split completed. The previous clean 233-file head remains recoverable at Review / merge order:
Independent async stack:
Independent PRs:
I also excluded 25 files that were byte-for-byte identical to running the current |
Neonforge98
pushed a commit
that referenced
this pull request
Jul 30, 2026
perf(session): batch persisted turn-intent status reads
Harry19081
self-requested a review
July 30, 2026 08:45
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
Why #512 was rewritten
The previous PR mixed RPC lifecycle, frontend async consumers, cache bounds, diagnostics, and profiling across 233 files. The clean pre-split head is preserved at
junyu/pr-512-clean-backup-20260729. This PR is now the small persistence root of the stack; dependent CLI and frontend lifecycle PRs will target it separately.Validation
cargo test -p session_persistence turn_intents(12 passed)cargo check -p session_persistencerustfmt --edition 2021 --check crates/session-persistence/src/turn_intents.rsgit diff --check origin/develop...HEADArchitecture boundary
This PR only changes the authoritative SQLite turn-intent persistence boundary. It does not include CLI runner wiring, frontend reconciliation, generic async hooks, runtime caches, browser diagnostics, or Team Inbox (#531).
Review follow-up (c42f777)
Retitled from
perf(session): batch persisted turn-intent status reads. Nothingin the tree calls
latest_for_sessions,upsert_initial_on, orupdate_status_onyet, so merging this changes no measured performance — it isthe enabling root for the dependent CLI and frontend PRs.
latest_for_sessionsis also one row lookup per id over a shared cached statement, not a single
set-based query; the win is one connection instead of a SQLite task per session.
Worth revisiting against a real caller's numbers before reaching for a window
function.
Also corrected the
_ondoc contract. Both variants claimed callers getatomicity "in the same SQLite transaction", which a
&Connectionparametercannot deliver.
&Connectionis this module's existing convention — seereconcile_in_flight_after_restart— and it buys re-entrancy, not atomicity, sothe signature stays and the docs now say what actually holds: the caller owns the
transaction via
begin_immediate, ideally insidewith_sessions_writer.update_status_ongets that spelled out, because its transition guard isread-check-write (read row → test whitelist →
UPDATE). On a bare connection twoconcurrent transitions can both observe the pre-state and both pass, so one is
lost with no error. That race is pre-existing in
update_statusand isunchanged here — but the
_onsplit is what finally gives callers a way toavoid it, so the dependent PRs should take these under a transaction rather than
calling the wrappers.
Minor, same commit: dropped a stale
&connreborrow left by the extraction,skipped repeated session ids, and short-circuited an empty request.
Re-validated:
cargo test -p session_persistence turn_intents(12 passed),cargo clippy -p session_persistence(clean),cargo doc -p session_persistence(no broken intra-doc links), rustfmt
--checkclean.