Compare and Swap - #241
Open
davidabram wants to merge 15 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
davidabram
force-pushed
the
compare-and-swap
branch
from
August 27, 2026 11:22
679f480 to
f70194a
Compare
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>
davidabram
force-pushed
the
compare-and-swap
branch
from
August 27, 2026 11:35
f70194a to
87679e1
Compare
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>
davidabram
force-pushed
the
compare-and-swap
branch
from
August 27, 2026 12:24
a35acf9 to
1027a98
Compare
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>
davidabram
force-pushed
the
compare-and-swap
branch
from
August 27, 2026 13:47
a2e3b26 to
5029513
Compare
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>
davidabram
force-pushed
the
compare-and-swap
branch
from
August 27, 2026 21:20
ca6f2b6 to
54a6507
Compare
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>
davidabram
force-pushed
the
compare-and-swap
branch
from
August 27, 2026 21:59
f187da9 to
3748ce9
Compare
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>
davidabram
force-pushed
the
compare-and-swap
branch
from
August 27, 2026 22:38
438b48d to
b72a420
Compare
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>
davidabram
force-pushed
the
compare-and-swap
branch
from
August 27, 2026 23:17
0ab175a to
63be85e
Compare
Correct module documentation that described the store's persistence and database call sites as future work. Record the T07 correction and verification evidence in the mutation-cursor-store-persistence plan. Co-authored-by: SCE <sce@crocoder.dev>
Cover CAS races, atomic rollback, boundary-value revisions, replay rejection, and recovery scope behavior against real repository databases. Mark plan mutation-cursor-store-persistence task T08 complete with verification evidence for the new store tests. Co-authored-by: SCE <sce@crocoder.dev>
davidabram
force-pushed
the
compare-and-swap
branch
from
August 29, 2026 09:57
e8cb931 to
fda523e
Compare
Exercise the real database load, protocol transition, commit, reopen, and reload flow across mutation trace boundaries and recovery cases. Cover Start, Advance, Close, Flush, taint, abandon, recovery, contention, and replay handling, including exact mutation-event decoding, and record T09 completion. Plan: mutation-cursor-store-persistence (T09) Co-authored-by: SCE <sce@crocoder.dev>
davidabram
force-pushed
the
compare-and-swap
branch
from
August 29, 2026 10:25
b3b4bf5 to
a65d944
Compare
Ensure existing databases with migrations 001 and 002 apply migration 003 through setup while hook-runtime opens don't apply it and retain setup guidance. Record the migration lifecycle coverage and verification for T10. Plan: mutation-cursor-store-persistence (T10) Co-authored-by: SCE <sce@crocoder.dev>
davidabram
force-pushed
the
compare-and-swap
branch
from
August 29, 2026 11:02
cb93d11 to
5a050cb
Compare
Record the completed mutation-cursor store persistence work so the repository's context reflects the durable protocol boundary, transactional CAS behavior, revision encoding, and bounded read paths. Capture the store design, shared Turso transactional primitive, completed acceptance criteria, and validation evidence, including the remaining test-isolation follow-up. Ref: context/plans/mutation-cursor-store-persistence.md (T11, AC1-AC15) Co-authored-by: SCE <sce@crocoder.dev>
davidabram
force-pushed
the
compare-and-swap
branch
from
August 29, 2026 11:30
8bc598e to
d65312c
Compare
The Initialization section previously implied register_scope returns Err whenever a scope's stored worktree_id/actor_kind merely happen to match the request, inverting the actual behavior: a match returns the existing ScopeState unchanged, and only a mismatch returns Err. Co-authored-by: SCE <sce@crocoder.dev>
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.
No description provided.