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
4 changes: 3 additions & 1 deletion .claude/skills/sc-cli-reference/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,9 @@ cargo run --bin sc -- serve --http <addr> <home> --store sc+git::<git-url> [--al
# lock is free (unix, one host, not NFS). Every
# fetch runs under a download watchdog (disk per
# fetch; 120 s no-progress deadline); serve mode
# needs a `kill` on the PATH to kill git's group
# runs git under a /bin/sh group leader and kills
# its group when the fetch ends (no `kill` program
# needed)
bash demo/run_git_carrier_demo.sh # sc+git:: proof (P39): a bare Git repo as the host;
# protected path + secret + private branch pushed
# (private branch refused without the opt-in), plain
Expand Down
6 changes: 3 additions & 3 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1376,9 +1376,9 @@ objects and is removed on `Drop`. A mutable key (the manifest) is read with one
of exactly `refs/sc/K` under protocol v2, so a v2 host lists that ref alone, and every fetch
runs under a watchdog that kills git past its download budget (disk bytes per fetch: a
key's value cap, 2 GiB for a family) or after 120 s without progress (only serve mode on
unix kills git's whole process group, through the system `kill`, and only while git is
unreaped; elsewhere, and for any helper that outlives git's exit, the helpers that write the
pack may keep writing). Scaling: `ls-remote` and push download the whole ref advertisement,
unix runs git under a `/bin/sh` group leader and kills the whole process group when the
fetch ends, helpers that outlive git included; elsewhere the helpers that write the pack may
keep writing, and a helper that leaves the group with `setsid` escapes). Scaling: `ls-remote` and push download the whole ref advertisement,
and a cold read fetches every `log/` and `checkpoints/` entry behind the last checkpoint;
refs grow by at least three per push until `sc remote compact` runs.

Expand Down
24 changes: 17 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,24 @@ transport-adjacent. The rest, imperatively:
instance, so a big store can still compact) or after 120 s with no progress,
what it added removed. The bound is disk per fetch, not
RAM inside `index-pack`, not the total cache, and not the refs a family fetch
writes. Only serve mode on unix bounds disk against a hostile HTTP host: it runs
git in its own process group and kills the group through the system `kill`,
but only while git is unreaped (after the reap the group id may have been
reused, so it is never signalled; `may_signal_group`). Without a `kill` it
warns once and kills git alone. The CLI and Windows kill git alone, and the
writes. Only serve mode on unix bounds disk against a hostile HTTP host: git
runs under a `/bin/sh` group leader that holds a stdin pipe only sc has and
writes git's exit code to `<cache>/.fetch-status-<n>`; when the fetch ends (a
normal exit or any breach) sc closes the pipe and the leader kills the whole
group with its builtin `kill`, so every helper that stays in git's process
group, including one that outlives git, dies (the group also ends when `sc serve`
exits, since the leader's stdin closes). That builtin is the only group kill: sc
runs no external `kill` and signals no group id. The leader must be seen running
when its stdin closes and to end by SIGKILL (its own group kill); otherwise
(killed from outside first, another exit, or still there after 5 s) the fetch is
an error even if git succeeded, and its helpers may survive. 126 or 127 from `/bin/sh` is the "cannot run
git" error. A helper that leaves the group (`setsid`: an ssh `ControlPersist`
master, a credential-cache daemon) escapes; the status file trusts local
executables; `SC_GIT` is resolved by `/bin/sh` through `command --`, with
`SHELLOPTS`, `BASHOPTS`, `BASH_ENV`, `ENV` and `BASH_FUNC_*` removed from its
environment (so no shell functions). The CLI and Windows spawn git directly and kill git alone, and the
helpers that write the pack may keep writing; so may any helper that outlives
git's exit, in any mode, until it exits. Only fetches are watched; `ls-remote`
and push are not.
git's exit there. Only fetches are watched; `ls-remote` and push are not.
- **`DirBucket` (`sc+wal://<dir>`) is a single-host, single-owner backend (#264).**
Its CAS takes an OS advisory file lock (`File::lock`: `flock` on unix,
`LockFileEx` on Windows) on `<root>/.cas-lock`, a file that is never removed and
Expand Down
15 changes: 7 additions & 8 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -1049,16 +1049,15 @@ P28 review follow-ons, the port de-flake, the clippy allow-list) are recorded in
`update_ref`, remain because only `has_object` may use the memo). Not in scope:
`ref_guard::check_ref_move` still downloads the old tip's pack to compare kinds
on every push after the first (bandwidth, not round trips; the idx carries no
kind). (4) validated against a private GitHub repository on 2026-11-21 (custom
kind). (10) a group-leading supervisor for the serve-mode watchdog (unix:
git runs under a `/bin/sh` leader, and the group is killed when the fetch ends,
so a helper that stays in git's process group cannot outlive it or write after
the discard; a helper that leaves the group with `setsid`, such as an ssh
`ControlPersist` master or a credential-cache daemon, escapes; ADR-0060).
(4) validated against a private GitHub repository on 2026-11-21 (custom
refs, lease CAS with one winner of two racing pushers, filtered fetch,
compaction 18 → 5 refs); still unexercised there: per-push and per-blob limits,
rulesets on custom refs, and CAS across GitHub replicas beyond one race. Still
deferred: (10) a group-leading supervisor for the serve-mode watchdog: run git
under a std-only `sh` leader (`sh -c 'git "$@"; echo $? > <status file>; read
_' sh <args>`, stdin piped from sc) so the process group id stays pinned after
git exits, and the watchdog can group-kill a helper that outlives git (the
post-exit gap ADR-0060 documents: a smart-HTTP v0/v1 helper chain, an ssh
`ControlPersist` master) before it closes the leader's stdin and reaps it.
rulesets on custom refs, and CAS across GitHub replicas beyond one race.
Declined, with reasons: (3) rollback and rewind of `refs/sc/manifest` by anyone with push
access is the cross-cutting signed-ref effort already tracked under P34
follow-on (6) and ADR-0059 follow-on (2), now reachable by more people; a
Expand Down
Loading
Loading