Skip to content

docs: formal spec + machine-checked proof for git refs over object storage#721

Merged
tlongwell-block merged 3 commits into
mainfrom
spec/git-on-object-storage
May 22, 2026
Merged

docs: formal spec + machine-checked proof for git refs over object storage#721
tlongwell-block merged 3 commits into
mainfrom
spec/git-on-object-storage

Conversation

@tlongwell-block
Copy link
Copy Markdown
Collaborator

What

A formal specification and machine-checked (TLA+) proof for hosting git repositories on conditional-write object storage (S3 / S3-compatible), with no persistent filesystem.

  • docs/git-on-object-storage.md — spec + prose proof. Repo state = create-only, content-addressed pack objects + one mutable manifest pointer updated by atomic compare-and-swap. Proves three safety theorems (durability-ordering, manifest reconstruction, ref-update linearizability), each reduced to three explicitly stated object-store axioms.
  • docs/spec/GitOnObjectStore.tla (+ .cfg) — TLA+ model, TLC-checked: 435,745 distinct states, no violation, under a BoundedManifests constraint. Eight invariants, each proven non-vacuous by a mutation that trips it.

Why it's defensible

The algorithm isn't novel — it's git's own reftable model (immutable artifacts + atomic pointer swap), with the atomic primitive substituted from POSIX rename() to an S3 conditional PUT. The contribution is the formal characterization of git refs over conditional-write object storage, which prior-art search (incl. arXiv) found unaddressed.

Honest scope boundary

  • Safety is machine-checked, relative to three axioms (durable write; strong read-after-write; linearizable conditional PUT).
  • Liveness/performance is empirical, explicitly out of scope.
  • A backend is admitted per deployment by a conformance probe — a finite probe is an admission gate, not a universal proof.

Implementation status

The publish-ordering fence is real code in crates/sprout-relay/.../transport.rs (branch quinn/transport-fence-typesplit @ 17df7884): a PushContext → finalize_push seam where the compiler enforces "no push response without going through the fence," with six decision tests covering every arm including the both-snapshots-fail case. S3 manifest-CAS and the 412→409 mapping are named follow-up work.

Provenance

Authored by the Sprout agent team — Eva (lead), with review from Dawn, Max, Mari, Perci, and Quinn — under direction of @tlongwell-block. Six review rounds; every pass caught what the last missed. Doc-only change (plus the referenced relay branch); no production code in this PR.

…orage

Adds a formal specification and TLA+ proof for hosting git repositories on
conditional-write object storage (S3 / S3-compatible), under no-persistent-disk.

- docs/git-on-object-storage.md: the spec + prose proof. Repository state is a
  set of create-only, content-addressed pack objects plus one mutable manifest
  pointer updated by atomic compare-and-swap. Proves three safety theorems
  (durability-ordering, manifest reconstruction, ref-update linearizability),
  each reduced to three explicitly stated, empirically-gated object-store axioms
  (durable write; strong read-after-write; linearizable conditional PUT).
- docs/spec/GitOnObjectStore.tla (+ .cfg): TLA+ model, TLC-checked
  (435,745 distinct states, no violation) under a BoundedManifests constraint.
  Eight invariants, each proven non-vacuous by a mutation that trips it.
- Scope is honest: safety is machine-checked relative to the axioms; liveness
  and performance are empirical (out of scope); a backend is admitted per
  deployment by a conformance probe, not proved universally.

The algorithm is git's own (reftable: immutable artifacts + atomic pointer
swap), with the atomic primitive substituted from POSIX rename() to an S3
conditional PUT; the contribution is the formal characterization. The
publish-ordering fence is implemented in crates/sprout-relay/.../transport.rs
(branch quinn/transport-fence-typesplit @ 17df788) via a PushContext ->
finalize_push seam; S3 manifest-CAS and 412->409 are named future work.

Authored by the Sprout agent team (Eva lead; Dawn, Max, Mari, Perci, Quinn
review) under direction of tlongwell-block.

Signed-off-by: tlongwell-block <109685178+tlongwell-block@users.noreply.github.com>
Co-authored-by: Eva (sprout agent) <18234bd709ff00c47a3b66f001675bd14c07700d862ed61c21a4423dcc1d9687@sprout-oss.stage.blox.sqprod.co>
@tlongwell-block tlongwell-block requested a review from a team as a code owner May 22, 2026 02:27
@tlongwell-block tlongwell-block merged commit 3467a67 into main May 22, 2026
15 checks passed
@tlongwell-block tlongwell-block deleted the spec/git-on-object-storage branch May 22, 2026 03:43
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