Skip to content

feat(postgres): coordinate ephemeral typing state - #20

Merged
Deathcharge merged 1 commit into
mainfrom
codex/postgres-typing-state-v0.13
Aug 2, 2026
Merged

feat(postgres): coordinate ephemeral typing state#20
Deathcharge merged 1 commit into
mainfrom
codex/postgres-typing-state-v0.13

Conversation

@Deathcharge

Copy link
Copy Markdown
Owner

Summary

  • advance the internal PostgreSQL foundation to schema v6 with typing state bound by foreign key to admitted connection leases
  • emit one durable coordination event on inactive→active, refresh deadlines without event storms, and make explicit stop owner-bound/idempotent
  • sweep expired typing rows in bounded SKIP LOCKED batches and append stop events in the same transaction
  • retain an internal origin connection ID for future sender exclusion while intentionally keeping typing events off the public relay until that contract is wired

Verification

  • python -m ruff check .
  • python -m ruff format --check .
  • python -m mypy samsarix_chat_engine/postgres.py samsarix_chat_engine/postgres_typing.py
  • python -m pytest -q -m "not postgres" → 139 passed
  • 180 tests collected; live transition-only, owner-binding, bounded-expiry, event-order, and invalid-lease cases run in PostgreSQL CI

Migration and rollback

Opening the internal foundation adds samsarix_typing_states and advances compatible schema metadata to v6. Connection deletion cascades ephemeral rows; authoritative chat data is unchanged. Before public wiring, rollback requires stopping candidate processes, dropping the v6-only table, restoring metadata to v5, and deploying the prior exact commit.

Remaining gates

Lease-derived presence, sender-excluding public relay wiring, real multi-process sockets, reconnect/gap recovery, interruptions, load/soak, backup, and rollback drills remain required. Clients must continue honoring expires_in; a stop event is never the sole expiry mechanism.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Deathcharge, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 5 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ae160498-a4c0-4712-803b-a253ec4083e6

📥 Commits

Reviewing files that changed from the base of the PR and between b150c3e and de7e81e.

📒 Files selected for processing (8)
  • CHANGELOG.md
  • ROADMAP.md
  • docs/MULTI_INSTANCE_ARCHITECTURE.md
  • samsarix_chat_engine/postgres.py
  • samsarix_chat_engine/postgres_typing.py
  • tests/conftest.py
  • tests/test_postgres_store.py
  • tests/test_postgres_typing.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Deathcharge
Deathcharge marked this pull request as ready for review August 2, 2026 12:26
@Deathcharge
Deathcharge merged commit 41f6981 into main Aug 2, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant