Skip to content

Compare and Swap - #241

Open
davidabram wants to merge 9 commits into
quint-connectfrom
compare-and-swap
Open

Compare and Swap#241
davidabram wants to merge 9 commits into
quint-connectfrom
compare-and-swap

Conversation

@davidabram

Copy link
Copy Markdown
Member

No description provided.

@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sce-config-json Ready Ready Preview Aug 27, 2026 11:17pm

Request Review

Define the next build-out for durable mutation-cursor protocol state in the repository-scoped Agent Trace DB. The plan covers additive schema migration, explicit codecs, structural durable-transition projection, transactional CAS persistence, concurrency and restart coverage, and documentation.

Plan: mutation-cursor-store-persistence (T01-T11)

Co-authored-by: SCE <sce@crocoder.dev>
Persist the verified mutation-cursor protocol in the repository database so later store operations have durable tables for worktrees, scopes, processed events, mutation events, and active scopes. Add migration 003 with strict revision BLOB checks, enum allow-lists, and payload-consistency constraints, and extend repository initialization tests with constraint coverage.

Plan: mutation-cursor-store-persistence (T01)

Co-authored-by: SCE <sce@crocoder.dev>
Persist mutation-trace domain values using stable, migration-aligned encodings before query and commit logic is added. Add big-endian revision codecs and explicit string codecs plus discriminant helpers, with rejection of invalid values and round-trip tests.

Plan: mutation-cursor-store-persistence, T02

Co-authored-by: SCE <sce@crocoder.dev>
Use `(scope_id, event_id)` as the sole processed-event identity, matching
`EventKey` and avoiding duplicate worktree ownership data. Remove the redundant
column and index, and add a regression test covering the composite key.

Plan: mutation-cursor-store-persistence (T01, T03)

Co-authored-by: SCE <sce@crocoder.dev>
Load one worktree's active and referenced scopes plus processed-event state without querying historical events on the hot path, and reconstruct cold-path mutation events with full attribution and boundary data. Preserve transient protocol fields as empty in widened projections and reject inconsistent persisted payloads.

Plan: mutation-cursor-store-persistence (T03)

Co-authored-by: SCE <sce@crocoder.dev>
Persist fresh worktree cursors and scope registrations without overwriting existing durable state. Validate existing scope ownership and actor identity before returning its state, while keeping terminal/status state unchanged. Complete T04 in `context/plans/mutation-cursor-store-persistence.md` and record targeted tests and verification.

Co-authored-by: SCE <sce@crocoder.dev>
Validate protocol state changes before persistence can apply a durable transition. Add a pure structural diff that captures worktree, scope, processed-event, and mutation-event changes while rejecting malformed or unrelated changes.

Plan: mutation-cursor-store-persistence (T05)

Co-authored-by: SCE <sce@crocoder.dev>
Provide a generic transaction primitive for mutation persistence to atomically apply a CAS guard and ordered statements. Retry only Busy and BusySnapshot failures from a fresh BEGIN IMMEDIATE transaction while returning deterministic failures without retrying; add coverage for no-op, success, rollback, and contention.

Plan: mutation-cursor-store-persistence (T06)

Co-authored-by: SCE <sce@crocoder.dev>
Persist mutation-trace transitions through a CAS-guarded transaction so worktree, scope, processed-event, mutation-event, and active-scope writes succeed or roll back together. Return explicit Applied/Conflict outcomes and preserve deterministic failures, with round-trip coverage for the full transition.

Update the mutation-trace context and plan to record the database-backed store implementation.
Plan: `mutation-cursor-store-persistence`, task `T07`.

Co-authored-by: SCE <sce@crocoder.dev>
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