Skip to content
Merged
10 changes: 10 additions & 0 deletions .claude/skills/sc-cli-reference/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,16 @@ cargo run --bin sc -- transcript show <ref> [--identity <key>] # decrypt + pri
cargo run --bin sc -- transcript list [<ref>] [--json] # list transcripts (never decrypts)
cargo run --bin sc -- transcript sign <ref> [--identity <key>] # retroactively sign a tip's
# transcript(s) (P30)
cargo run --bin sc -- clone|fetch|push --no-transcripts ... # leave transcripts (P30) out of one
# transfer (#211): clone/fetch hash-check then discard
# received transcripts + their signatures (sender
# still sends them, so no bandwidth saved); push
# does not send them. Per command, not remembered:
# 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)
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
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ the code, those win.
| P27 | Partial clone: `sc clone --filter <prefix…>`, `.sc/promisor`, `sc backfill [--all]`; wire `PROTOCOL_VERSION` 3 | [0037](docs/adr/0037-partial-clone.md) |
| P28 | Security hardening: `MAX_OBJECT_SIZE` (256 MiB) caps on every untrusted transfer length; strict ref-name validation | [0039](docs/adr/0039-security-hardening-sweep.md) |
| P29 | `sc serve --http` access control: bearer tokens (`sc serve token`), `--read-only`, fail-closed non-loopback bind gate | [0040](docs/adr/0040-sc-http-access-control.md) |
| P30 | Sealed agent-session transcripts: `sc transcript attach/show/list/sign/drop`, always-encrypted body, gc-coupled index; drop = grow-only tombstone (a bare `Transcript` object, no wire change), kept by gc, hides the body from fetch/reindex | [0038](docs/adr/0038-agent-session-transcripts.md) |
| P30 | Sealed agent-session transcripts: `sc transcript attach/show/list/sign/drop`, always-encrypted body, gc-coupled index; `--no-transcripts` on fetch/clone/push (client-side, per command); drop = grow-only tombstone (a bare `Transcript` object, no wire change), kept by gc, hides the body from fetch/reindex | [0038](docs/adr/0038-agent-session-transcripts.md) |
| P31 | Listener resource limits: `--max-connections`, `--timeout`, `--max-pack-size` (both transports), capped read-only drain, accept backoff | [0041](docs/adr/0041-listener-resource-limits.md) |
| P32 | In-binary TLS: `sc+https://` via leaf crate `tlsio`; accept-new TOFU pinning; public plaintext bind no longer justified by tokens alone | [0042](docs/adr/0042-in-binary-tls-sc-https.md) |
| 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) |
Expand Down
7 changes: 4 additions & 3 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -877,9 +877,10 @@ 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.
- **`--no-transcripts` transfer knob (P30).** `fetch`/`clone`/`push`
always carry every indexed transcript covering a transferred snapshot;
an opt-out for bandwidth- or exposure-sensitive transfers is deferred.
- **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
them needs a `GetPack` request field and a `PROTOCOL_VERSION` bump.
- **`sc export --transcripts=entire` (P30).** Git export unconditionally
drops transcripts (reported via `transcripts_dropped`); an opt-in mode
that carries them as detached Git notes or a sidecar format is
Expand Down
56 changes: 47 additions & 9 deletions crates/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,14 @@ enum Cmd {
/// process. Requires `--filter`.
#[arg(long, requires = "filter")]
lazy: bool,
/// Leave transcript objects (P30) out of this transfer: the server
/// 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.
#[arg(long)]
no_transcripts: bool,
},
/// Serve a repo to a remote `sc` client, either over stdin/stdout
/// (invoked by `ssh` for ssh:// remotes) or over TCP (`sc+http://`
Expand Down Expand Up @@ -393,6 +401,15 @@ enum Cmd {
Fetch {
#[arg(default_value = "origin")]
remote: String,
/// Leave transcript objects (P30) out of this fetch: the server
/// still sends them, the client hash-checks and discards them, so
/// 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.
#[arg(long)]
no_transcripts: bool,
},
/// Push the current branch to a remote (fast-forward-only).
Push {
Expand All @@ -401,6 +418,13 @@ enum Cmd {
/// For git remotes: allow pushing protected ciphertext and dropping secrets.
#[arg(long)]
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.
#[arg(long)]
no_transcripts: bool,
},
/// Protect a path prefix: files under it are convergently encrypted for the
/// named recipients on commit. With `--list` (or no prefix), list the rules.
Expand Down Expand Up @@ -1036,7 +1060,8 @@ fn main() -> Result<()> {
git,
filter,
lazy,
} => run_clone(src, dst, git, filter, lazy),
no_transcripts,
} => run_clone(src, dst, git, filter, lazy, no_transcripts),
Cmd::Cat { target } => run_cat(&target),
Cmd::Serve {
sub,
Expand Down Expand Up @@ -1085,11 +1110,15 @@ fn main() -> Result<()> {
}
},
Cmd::Remote { op } => run_remote(op),
Cmd::Fetch { remote } => run_fetch(&remote),
Cmd::Fetch {
remote,
no_transcripts,
} => run_fetch(&remote, no_transcripts),
Cmd::Push {
remote,
include_encrypted,
} => run_push(&remote, include_encrypted),
no_transcripts,
} => run_push(&remote, include_encrypted, no_transcripts),
Cmd::Protect {
prefix,
to,
Expand Down Expand Up @@ -3624,7 +3653,14 @@ fn absolute_local_source(src: String) -> String {
.unwrap_or(src)
}

fn run_clone(src: String, dst: PathBuf, git: bool, filter: Vec<String>, lazy: bool) -> Result<()> {
fn run_clone(
src: String,
dst: PathBuf,
git: bool,
filter: Vec<String>,
lazy: bool,
no_transcripts: bool,
) -> Result<()> {
// Auto-detect unambiguous git URL forms (https/http, scp-style, file://):
// those can never be sc-native, so no flag is needed. Bare `ssh://` is
// ambiguous — it means an sc-native remote (ADR-0022) unless `--git`
Expand All @@ -3638,7 +3674,7 @@ fn run_clone(src: String, dst: PathBuf, git: bool, filter: Vec<String>, lazy: bo
}
let src = absolute_local_source(src);
let filter_opt = (!filter.is_empty()).then_some(filter.as_slice());
let repo = scl_repo::Repo::clone_url_filtered(&src, &dst, filter_opt)?;
let repo = scl_repo::Repo::clone_url_opts(&src, &dst, filter_opt, no_transcripts)?;
if lazy {
scl_repo::promisor::set_lazy(repo.layout(), true)?;
}
Expand Down Expand Up @@ -4015,13 +4051,13 @@ fn run_remote(op: RemoteOp) -> Result<()> {
/// remote gets a full-history import into a remote-tracking ref (see
/// `run_fetch_git`); an `sc`-kind remote (or unconfigured, defaulting to `sc`)
/// uses the existing object-transport fetch.
fn run_fetch(remote: &str) -> Result<()> {
fn run_fetch(remote: &str, no_transcripts: bool) -> Result<()> {
let repo = open_repo()?;
let cfg = scl_repo::RemoteConfig::load(repo.layout())?;
match cfg.kind(remote) {
Some(scl_repo::RemoteKind::Git) => run_fetch_git(&repo, remote),
_ => {
let remote_refs = repo.fetch(remote)?;
let remote_refs = repo.fetch_opts(remote, no_transcripts)?;
println!("fetched {remote}: {} remote branch(es)", remote_refs.len());
for (branch, tip) in remote_refs {
println!(" {remote}/{branch} -> {}", tip.short());
Expand Down Expand Up @@ -4082,7 +4118,7 @@ fn run_fetch_git(repo: &scl_repo::Repo, remote: &str) -> Result<()> {
Ok(())
}

fn run_push(remote: &str, include_encrypted: bool) -> Result<()> {
fn run_push(remote: &str, include_encrypted: bool, no_transcripts: bool) -> Result<()> {
let repo = open_repo()?;
let cfg = scl_repo::RemoteConfig::load(repo.layout())?;
match cfg.kind(remote) {
Expand Down Expand Up @@ -4110,7 +4146,7 @@ fn run_push(remote: &str, include_encrypted: bool) -> Result<()> {
run_push_git(&repo, remote, include_encrypted)
}
_ => {
let tip = repo.push(remote)?;
let tip = repo.push_opts(remote, no_transcripts)?;
println!("pushed to {remote}: {}", tip.short());
Ok(())
}
Expand Down Expand Up @@ -4905,6 +4941,7 @@ mod tests {
false,
Vec::new(),
false,
false,
)
.unwrap();
let repo = scl_repo::Repo::open(&dst).unwrap();
Expand Down Expand Up @@ -4955,6 +4992,7 @@ mod tests {
false,
Vec::new(),
false,
false,
)
.unwrap_err();
std::env::remove_var("SC_SSH");
Expand Down
Loading
Loading