[Feat] Unified Sessions M1: Add schema and helpers - #1696
Draft
roomote-roomote[bot] wants to merge 2 commits into
Draft
[Feat] Unified Sessions M1: Add schema and helpers#1696roomote-roomote[bot] wants to merge 2 commits into
roomote-roomote[bot] wants to merge 2 commits into
Conversation
Contributor
Contributor
Author
|
Fixed the concurrent Session status refresh race in 862c94c7. Session refreshes now lock before reading linked Tasks, and a two-transaction regression test verifies concurrent settlements finish at |
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.
What changed
sessions,session_tasks, andsession_participantsschema, relations, constraints, indexes, and generated Drizzle migration.deriveSessionStatus, idempotent visible-Task attachment, owner participant creation, monotonic activity updates, and cached-status recomputation serialized by a Session row lock.Why this change was made
This is Unified Sessions milestone M1. It establishes the N-1-safe persistence and package-owned helper layer required before enqueue interception or any user-visible Session behavior can ship.
Impact
There is no user-visible behavior change and no feature flag is introduced in M1. The schema is additive, existing Task and Fast conversation records remain canonical, and older application code ignores the new tables safely.
The owner-shape constraint intentionally allows a user or automation owner FK to become null after deletion. This is required for the specified
ON DELETE SET NULLretention behavior; values in the wrong owner column remain prohibited, and deletion retention is covered by a real-database test.Validation completed against the final branch: 44 targeted real-Postgres tests passed,
pnpm lintpassed,pnpm check-typespassed, and the pre-push oxlint, residual lint, fast typecheck, and knip gates passed.