fix(sqlite): commit local proofs with their operations#194
Open
marcus-pousette wants to merge 1 commit into
Open
fix(sqlite): commit local proofs with their operations#194marcus-pousette wants to merge 1 commit into
marcus-pousette wants to merge 1 commit into
Conversation
This was referenced Jul 12, 2026
ba21c50 to
6cc3ac6
Compare
416b21e to
644b31d
Compare
6cc3ac6 to
b148b40
Compare
b148b40 to
260817c
Compare
fd77168 to
729a743
Compare
0b5e4a2 to
5158707
Compare
0e2e6e4 to
f50f698
Compare
5158707 to
44948a1
Compare
44948a1 to
6643f10
Compare
f50f698 to
afa49f6
Compare
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.
Problem
If a local operation commits and its authorization proof is stored afterward, a crash between those writes leaves an operation that cannot be safely forwarded or audited.
What changes
Every optimistic SQLite commit requires a 64-byte signature and 16-byte proof reference. The native extension writes that complete proof into
treecrdt_sync_op_authinside the same savepoint as the operation, materialized tree changes, and materialization metadata.Both schema initialization orders enforce
NOT NULL,length(sig) = 64, andlength(proof_ref) = 16. The operation reference comes from the operation actually committed and the database clock supplies the timestamp.Clean-slate choice
There is no proofless commit arity, optional reference, unconstrained old schema, migration, or durable mirror. Authenticated optimistic commits are proof-bearing by contract. Unauthenticated writes use #193's separate immediate path.
Fast paths
Failure behavior
Any bind, constraint, insert, trigger, finalization, materialization, or savepoint-release failure rolls back operation, proof, tree state, and metadata together.
Verification
Stack
Stacked on #193 and consumes #187's exact-proof shape.