Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .claude/skills/sc-cli-reference/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,9 @@ cargo run --bin sc -- clone|fetch|push --no-transcripts ... # leave transcript
# a later plain fetch brings them in; a plain push
# carries them only once the branch moves again.
# Snapshots transfer and verify as usual; no-op for
# git and bucket (sc+wal://, sc+s3://) remotes
# (push to a bucket still skips the upload)
# git remotes. Bucket remotes (sc+wal://, sc+s3://)
# serve transcripts and signatures (#229), so the
# flag works there like on any native remote
cargo run --bin sc -- transcript drop <id> [--identity <key>] # drop a transcript by id/hex prefix (see `list`): writes
# a tombstone that travels with fetch/clone so a peer
# that still has it cannot restore it; gc reclaims the
Expand Down
4 changes: 3 additions & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,9 @@ a transfer-relevant snapshot, and the receiver reindexes idempotently. `sc
gc` roots live transcript ids into reachability before signature pruning
runs, so a signed transcript survives exactly as long as the transcript
itself does. `sc export --to <git-repo>` drops transcripts (no Git-native
form exists) and reports a count. See ADR-0038.
form exists) and reports a count. A bucket remote (P36) has no index, so its
`get_pack` rebuilds the same over-send from the packs the manifest chain names
(#229, no format change). See ADR-0038.

## Phase 31 — listener resource limits (built)

Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ the code, those win.
| P33 | Randomized protected sealing (fresh DEK + nonce; `RANDOMIZED` perms bit); dual-read of pre-P33 convergent ciphertext; per-checkout keyed stat cache; `sc rewrap` upgrades convergent blobs at the tip | [0043](docs/adr/0043-randomized-protected-encryption.md) |
| P34 | Private branches: ref points at a sealed-branch manifest; every commit/tree/blob individually sealed (copy-on-write) under a per-branch KEK wrapped per recipient + escrow; `sc branch --private/grant/revoke/publish`; opaque to non-recipients (content, paths, messages); grant O(1), revoke rotates the KEK; publish replays to public with a scanner gate; git bridge + private→public integration refused; `PROTOCOL_VERSION` 4 | [0044](docs/adr/0044-per-branch-access-control.md) |
| P35 | Native Tauri desktop browser: opens `.sc` repositories through `scl-repo`, shows local/remote refs, all-parent snapshot DAG + provenance, public trees and first-parent diffs; protected content is locked and private branches remain opaque; no mutation or identity surface | [0045](docs/adr/0045-native-desktop-read-model.md) |
| P36 | Bucket WAL remotes (sc+wal://, sc+s3://): immutable packs + CAS'd manifest, checkpoints + log-tail cold start, bucket-backed `sc serve --store` with disposable instances | [0046](docs/adr/0046-wal-bucket-remotes.md) |
| P36 | Bucket WAL remotes (sc+wal://, sc+s3://): immutable packs + CAS'd manifest, checkpoints + log-tail cold start, bucket-backed `sc serve --store` with disposable instances; `get_pack` serves signatures, transcripts and signed drop tombstones by decoding the on-chain packs (#229, no format change) | [0046](docs/adr/0046-wal-bucket-remotes.md) |
| P37a | Want-by-id fetch: batched `GetObjects` verb (wire v5), opt-in `.sc/promisor-lazy`, `sc cat <ref>:<path>` fills only the absent trees and blob on its path; `Store::get` stays network-free; sealed objects refused by kind; sparse widen and the lifted P27 refusals are P37b | [0047](docs/adr/0047-want-by-id-fetch-and-gap-fill.md) |
| P37b-i | Presence-based partial clones: push, verify and gc walk what the store holds (`reachable_objects_partial`), not the fetch filter; push checks every gap id against the destination before sending; a view gap fails with `GapInView` before any write (preflight at the top of `materialize`, plus `undo` and `sparse set`); a partial clone fetches from its origin only. 37b-ii: on a lazy, online clone `ensure_view` fills the view closure by id before switch, fast-forward, undo and `sparse set`, `sparse set` may widen past the filter, a by-id reply is capped at `min(--max-pack-size, 2 GiB)` (a constant since #213, independent of the object cap) and a refused batch is split. | [0048](docs/adr/0048-presence-based-partial-clones.md) |
| P37c | Merge, cherry-pick and rebase on a partial clone: a tree-recursive engine (`merge_trees`) carries a subtree by id when the sides agree and no protection rule applies, reads only where they differ or a rule intersects, and on a lazy, online clone fills what it asks for by id outside the store lock (a non-lazy clone gets the gap error with `sc backfill <path>`); a carried protected subtree keeps the complete input wrap union; a conflict inside the view is marked and resolved like on a full clone (`sc conflicts`/`sc resolve`/`merge --abort`/`sc commit`; the out-of-view part is grafted from the decided root), while a conflict outside the view, or a result that must be sealed outside it, is refused before any ref, merge-state or working-tree change (fetched objects stay). A subtree identical on all three sides is carried even under a protection rule. Cherry-pick and rebase use the same engine (`replay_commit`): the fold's accumulator may hold absent subtrees, the view is filled before the final write, and a stopped pick or rebase keeps its carried subtrees in the decided root. Mode-only edits now merge and a file/directory collision fails before any write, on full clones too. | [0049](docs/adr/0049-merge-on-partial-clones.md) |
Expand Down
6 changes: 6 additions & 0 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,12 @@ scale-&-reach horizon):
rewrap/grant/revoke surface — sealed once, to the recipient set at
attach time, permanently. Extending P17's rewrap and P16's
grant/revoke machinery to transcripts is deferred.
- **Bucket leaf sidecar (#229 follow-on).** Bucket `get_pack` finds signatures,
transcripts and tombstones by decoding every on-chain pack (cached per pack
hash within one transport). A per-pack sidecar object listing those leaves,
written at push time and ignored by older readers, would remove the decode;
deferred until fetch egress or CPU on a real bucket shows the scan (up to a
second download of each pack per fetch) is too costly.
- **Sender-side `--no-transcripts` for fetch/clone (P30).** The #211
opt-out is client-side: `fetch`/`clone` still receive transcripts and
discard them, so only `push` saves bandwidth. Having the server skip
Expand Down
10 changes: 3 additions & 7 deletions crates/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,7 @@ enum Cmd {
/// still sends them, the client hash-checks and discards them, so
/// this transfer writes none and indexes none. Per command, not
/// remembered by the clone; a later plain fetch brings them in.
/// Does nothing for git remotes and bucket remotes (sc+wal://,
/// sc+s3://), which carry no transcripts.
/// Does nothing for git remotes, which carry no transcripts.
#[arg(long)]
no_transcripts: bool,
},
Expand Down Expand Up @@ -414,8 +413,7 @@ enum Cmd {
/// this fetch writes none and indexes none (a new signature over a
/// transcript you already hold is dropped too). Per command, not
/// remembered; a later plain fetch brings them in. Does nothing for
/// git remotes and bucket remotes (sc+wal://, sc+s3://), which
/// carry no transcripts.
/// git remotes, which carry no transcripts.
#[arg(long)]
no_transcripts: bool,
},
Expand All @@ -428,9 +426,7 @@ enum Cmd {
include_encrypted: bool,
/// Do not send transcript objects (P30) or their signatures. Sealed
/// bodies stay sealed either way; snapshots still transfer. Does
/// nothing for git remotes, which never carry transcripts. A bucket
/// remote (sc+wal://, sc+s3://) is stored but never served them, so
/// there the flag only spares the upload.
/// nothing for git remotes, which never carry transcripts.
#[arg(long)]
no_transcripts: bool,
},
Expand Down
59 changes: 59 additions & 0 deletions crates/cli/tests/bucket_remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,65 @@ fn bucket_clone_push_fetch_round_trip_and_url_validation() {
}
}

/// #229: a signed snapshot pushed to a bucket keeps its signature on a fresh
/// clone, so `sc verify --require` passes there once the signer is trusted
/// (trust is local config, written into the clone).
#[test]
fn verify_require_passes_after_a_bucket_clone_of_a_signed_snapshot() {
let a = tmp("sign-a");
let bucket = tmp("sign-bucket");
let parent = tmp("sign-parent");
let url = format!("sc+wal://{}", bucket.display());

// Keys live outside the work tree (the scanner flags key material in one).
let id = parent.join("alice.id");
let out = sc(&parent, &["keygen", "--out", id.to_str().unwrap()]);
assert!(out.status.success(), "{out:?}");
let text = String::from_utf8_lossy(&out.stdout).into_owned();
let sig_pk = text
.lines()
.find_map(|l| l.split_whitespace().find(|w| w.starts_with("scl-sig-")))
.expect("keygen prints a signing public key")
.to_string();

assert!(sc(&a, &["init"]).status.success());
std::fs::write(a.join("f.txt"), b"signed").unwrap();
let out = sc(
&a,
&[
"commit",
"-m",
"c1",
"--sign",
"--identity",
id.to_str().unwrap(),
],
);
assert!(out.status.success(), "{out:?}");
assert!(sc(&a, &["remote", "add", "origin", &url]).status.success());
assert!(sc(&a, &["push", "origin"]).status.success());

let b = parent.join("b");
let out = sc(&parent, &["clone", &url, b.to_str().unwrap()]);
assert!(out.status.success(), "{out:?}");
std::fs::write(
b.join(".sc/recipients.toml"),
format!("[signing]\nalice = \"{sig_pk}\"\n\n[signers]\ntrusted = [\"alice\"]\n"),
)
.unwrap();
let out = sc(&b, &["verify", "--require"]);
assert!(
out.status.success(),
"verify --require after a bucket clone: {out:?}"
);
assert!(String::from_utf8_lossy(&out.stdout).contains("1 trusted"));

for d in [&a, &bucket, &parent] {
std::fs::remove_dir_all(d).unwrap();
assert!(!d.exists());
}
}

/// `sc serve --http --store <sc+wal://…>` serves a bucket instead of the
/// serve-home's own object store (P36c): a repo pushed straight to the
/// bucket is clonable through the server, and a push through the server is
Expand Down
Loading
Loading