Skip to content

proposal: atomic working-surface persistence for App #2207 - #126

Merged
sswiftdrtv merged 1 commit into
mainfrom
codex/durable-surfaces-2207
Oct 27, 2026
Merged

sswiftdrtv merged 1 commit into
mainfrom
codex/durable-surfaces-2207

Conversation

@sswiftdrtv

@sswiftdrtv sswiftdrtv commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

The current assistant persistence path replaces full UIMessage JSON and cannot safely acknowledge concurrent saved controls. This proposal selects a current companion plus digest-bound receipts inside the existing disabled chat_fence boundary, preserving the source snapshot in chat_messages.

The SQL outside migrations defines absent-version create, compare-and-swap saves, authorized head/exact reads, original-operation reconciliation, source immutability and deletion markers under the existing session/chat locks. Actual suffix deletion clears controls in the same transaction; deleted IDs cannot return. The API-facing design also binds acknowledgements to the submitted draft so a late save cannot mark newer edits saved.

Validation: 15 new mechanics cases plus 17 existing fencing regressions pass with the extension installed on both PostgreSQL 15 and 17 (32 each). Tests include actual lock waits, both save/delete orders, source-revocation seam, changed-key retry rejection, lost ack, receipt-insert rollback, and byte limits. Independent source review PASS after repairs. Added scoped read-only CI for the same disposable harness.

This is NOT a migration or runtime activation. No service EXECUTE grant or enrollment is supplied; the source-authority adapter deliberately refuses until an owning implementation exists. The test adapter is synthetic and does not establish live authorization. No production store, grant, provider action or migration apply occurred. Root owns adoption and merge; App #2207 remains incomplete. See proposals/durable-surfaces-2207/PROTOCOL.md for placement alternatives, lock order, writer inventory and remaining owner facts.

Related App contract: recoupable/app#2373

Paired API contract: recoupable/api#1185 (head 484cb541233fd7f8e1d0983e39ede45d4860e41d).

Fresh remote CI passed on exact head 6d1da43: PG17 job 122284403200 and PG15 job 122284403523 each ran all 32 tests successfully with cleanup. Other Database Actions checks also passed; Supabase Preview was skipped. This remains offline proposal verification, not an applied migration.

Summary by CodeRabbit

  • Documentation
    • Added an offline technical proposal describing durable working-surface behavior, including command rules, deletion handling, and adoption requirements. It does not activate the feature or add a production migration.
  • Tests
    • Added mechanics tests covering command behavior, authorization checks, deletion, limits, and concurrent operations.
  • Chores
    • Added pull-request validation that runs the mechanics tests against PostgreSQL 15 and 17.

@supabase

supabase Bot commented Oct 27, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project godremdqwajrwazhbrue because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

Adds an offline proposal for durable working surfaces, including SQL command mechanics, source-message handling rules, tests, and a PostgreSQL 15/17 pull-request workflow. The proposal does not create production relations, grants, or authorization.

Changes: Durable working surfaces

Layer / File(s) Summary
Storage and command contracts
proposals/durable-surfaces-2207/PROTOCOL.md, proposals/durable-surfaces-2207/proposal.sql
Defines private surface-state and command-receipt relations, revision and payload bounds, snapshot validation, and the six command contracts. The SQL remains an offline proposal.
Command authorization and execution
proposals/durable-surfaces-2207/PROTOCOL.md, proposals/durable-surfaces-2207/proposal.sql, proposals/durable-surfaces-2207/test_mechanics.py
Specifies authorization and acknowledgement rules. Implements create, save, delete, read, head, and reconcile commands with revision checks and request-bound receipts. Tests cover command outcomes, retries, rollback, validation, and lock waits.
Source preservation and deletion
proposals/durable-surfaces-2207/PROTOCOL.md, proposals/durable-surfaces-2207/proposal.sql, proposals/durable-surfaces-2207/test_mechanics.py
Specifies source-message preservation and deletion behavior. The SQL trigger protects saved snapshots and marks a surface deleted when its anchor is deleted. Tests cover update and deletion behavior.
Offline test execution
.github/workflows/durable-surfaces-proposal.yml, proposals/durable-surfaces-2207/PROTOCOL.md, proposals/durable-surfaces-2207/test_mechanics.py
Documents harness coverage and adoption limits, adds regression test execution, and runs the mechanics suite with PostgreSQL 15 and 17 in pull requests.

Priority: Not assessed

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Other

Possibly related issues

  • recoupable/app issue 2197: The proposal defines database persistence, revision checks, authorized reads, deletion markers, and acknowledgement rules for the save-and-reopen continuity scope.
  • recoupable/app issue 2116: The proposal defines the chat working-surface persistence and source-authority boundary, while leaving Context ownership and runtime activation unresolved.
Merge Risk: Low · up to 6d1da

The proposal remains offline and is mergeable with bounded security follow-up: pin the checkout action and avoid exposing an unnecessary read-only token to the test step.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T15:31:36.861088Z 6d1da43 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sswiftdrtv
sswiftdrtv merged commit 6ae03a0 into main Oct 27, 2026
15 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.

2 participants