P36a: WAL bucket remotes — objio leaf crate + BucketTransport (sc+wal://, sc+s3://) - #126
Merged
Conversation
…t asserts (P36a review) Advisor review of Task 5 caught: staged objects were dropped from the RefCell before upload, so a transient bucket failure lost them silently instead of leaving them for a retry; bucket_transport.rs wasn't rustfmt-clean; and the three new tests were missing the !broot.exists() cleanup assertion the read-half tests already use.
…review) pending_packs was only cleared on update_ref's success paths, so a call that failed (NonFastForward or CAS exhaustion) left its uploaded pack hashes in the field. A later, unrelated update_ref on the same long-lived transport (wire::serve keeps one instance per session) then committed a log entry citing a pack it never actually needed, violating the WAL's per-entry "packs support these ref updates" invariant. Fix: take pending_packs out of the shared field into a call-local Vec at the top of update_ref. It survives that call's internal CAS retries (unchanged) but is simply dropped on every exit — success or failure — instead of being explicitly cleared only on success. The abandoned pack itself stays in the bucket as inert, content-addressed orphan garbage, which is correct (compaction is a later phase). Adds a regression test that stages a pack, fails NonFastForward with it pending, then succeeds an update_ref for an unrelated branch on the same instance, and decodes the committed log entry straight from the bucket to assert it references only its own pack.
…OADMAP/THREAT-MODEL for P36a
…uracy, bucket ciphertext pin (P36a)
… h2 0.3 + rustls-webpki 0.101 tree)
tonibergholm-codento
approved these changes
Aug 26, 2026
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.
Summary
First slice of P36 (spec:
docs/superpowers/specs/2026-08-26-wal-bucket-backend-design.md, ADR-0046): an S3-compatible bucket — or a local directory standing in for one — becomes an sc remote. Immutable content-addressed packs + a parent-linked log + one compare-and-swapped manifest are the entire coordination model: no server, no database, no leader.objio(quarantines the S3 SDK exactly liketlsioquarantines rustls):Buckettrait (conditional get / create-only put / CAS put),DirBucket(local, tests/demos),S3Bucket(aws-sdk-s3 behind a sync facade; credentials via the SDK's standard chain — sc gains no credential surface).walfmtversioned strict codec (manifest + log entries; fail-closed on unknown versions, every length capped).BucketTransportimplements the existingTransporttrait, soclone/fetch/pushwork through the untouchedsync.rsentry points;sc remote add origin sc+s3://bucket/prefix(orsc+wal://<dir>). Readers trust only the parent chain from the CAS'd manifest — orphan/crash debris is invisible. Partial-clonefilteris refused loudly.scl_core::pack::read_object_at_bounded(trusted local path stays unbounded per ADR-0039's carve-out);MAX_OBJECT_SIZEcaps on all WAL metadata; ref-name validation on log contents.Design provenance: the WAL + manifest-CAS coordination layer is borrowed from walgit / Cursor's Continuity design (evaluated in
docs/research/walgit-evaluation.md); sc keeps its end-to-end sealing, which that model lacks.Test plan
cargo test --workspace: 756 passed, 0 failedcargo clippy --workspace --all-targets: cleansc demo --agents 4: zero residue confirmedSC_OBJIO_S3_BUCKET+ MinIO) — not run in CI; first follow-on