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
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- name: Install Tauri Linux prerequisites
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libxdo-dev \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev
- uses: dtolnay/rust-toolchain@1.96.1
with:
components: rustfmt, clippy
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ target/
.vscode/

# Note: Cargo.lock IS committed for this workspace (it ships a binary).

# Desktop frontend/build artifacts
apps/desktop/node_modules/
apps/desktop/dist/
apps/desktop/src-tauri/gen/
41 changes: 37 additions & 4 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ to reason about — which is exactly the property Phase 1 is meant to demonstrat

## System overview

The codebase is a Cargo workspace of six crates with a strict dependency
direction (`cli → repo → {vfs, gitio, crypto} → core`):
The codebase is a Cargo workspace of eight Rust crates with a strict dependency
direction (top-level adapters `{cli, desktop} → repo → {vfs, gitio, crypto}
→ core`, with the separate leaf edge `repo → tlsio`):

```
src-control/
Expand All @@ -79,6 +80,8 @@ src-control/
│ │ sc+http://), protection + secret lifecycle, GC, sparse & partial clone,
│ │ signatures & session transcripts, agent workspaces
│ └── cli/ `sc` binary — the full ~42-command surface (see CLAUDE.md)
├── apps/desktop/ Tauri v2 top-level adapter + bundled TypeScript renderer;
│ native read model only, with no UI dependency in domain crates
└── ARCHITECTURE.md
```

Expand All @@ -91,6 +94,11 @@ on-disk layout and all repo orchestration; it is deliberately **Git-agnostic**
imported snapshots down. This matters because the long-term plan is to own the
object format outright; Git is an import/export peer, not a foundation.

The desktop backend is a peer of the CLI, not a layer beneath `repo`. It calls
the same public Rust APIs and maps them to a narrow immutable read model. Its
WebView never receives a repository root for general use, filesystem or shell
authority, private keys, protected blob bytes, or private-branch internals.

## Content-addressed snapshot model

Every piece of repo state is an immutable object identified by the BLAKE3 hash of
Expand Down Expand Up @@ -946,8 +954,8 @@ Proven by `demo/run_limits_demo.sh`. See ADR-0041.
## Phase 32 — in-binary TLS: sc+https:// (built)

A new leaf crate, `crates/tlsio` (`scl-tlsio`), is the only crate linking
rustls/rcgen/`ring` — extending the dependency rule to `cli → repo → {vfs,
gitio, crypto, tlsio} → core` while leaving the RustCrypto quarantine in
rustls/rcgen/`ring` — extending the dependency rule with the separate leaf edge
`repo → tlsio` while leaving `repo → {vfs, gitio, crypto} → core` and the RustCrypto quarantine in
`crates/crypto` untouched. Two seam functions grow a TLS wrap and nothing
else changes: the client wraps the `TcpStream` before the opening write when
the URL is `sc+https://`; the server wraps before the opening read when
Expand Down Expand Up @@ -1027,3 +1035,28 @@ publish, and filtered clones exclude private branches (sealed trees can't be
path-filtered). Two additive object tags cross the wire, so
`PROTOCOL_VERSION` bumps 3 → 4; no existing object's format changes. See
ADR-0044.

## Phase 35 — native desktop read-only browser (built)

`apps/desktop/` proves the native object model can directly power a product
surface. A Tauri v2 Rust adapter retains the user-selected canonical repository
root and exposes five typed queries: choose repository, select reference,
snapshot details, public file read, and first-parent comparison. Each requested
snapshot must be reachable from a current public ref and each path must be a
canonical repository-relative path. The adapter walks every parent for the DAG,
uses native tree/diff objects, verifies signatures against public trust config,
and reads transcript presence without opening transcript bodies.

The renderer is a bundled React/TypeScript three-panel browser. Local and
remote-tracking branches sit beside the all-parent snapshot graph; provenance is
visible on each snapshot; the inspector shows metadata, a public repository
tree, and first-parent changes. `@pierre/trees` and `@pierre/diffs` passed a
Tauri/Vite integration spike and are isolated in renderer components so they
remain replaceable presentation dependencies.

This slice is deliberately keyless and read-only. A protected entry becomes a
fieldless `protected_locked` DTO before its blob is loaded. A private ref stops
at accepted `BranchManifest` metadata and becomes `private_opaque`; authors,
messages, paths, timestamps, and inner topology never cross IPC. The WebView has
no generic dialog, filesystem, URL, process, or object-store command. See
ADR-0045.
18 changes: 16 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ recorded as an ADR in `docs/adr/`. Keep them in sync when the design changes.
## Stack & tooling

- **Language:** Rust (stable). Rationale in ARCHITECTURE.md ("Why Rust").
- **Desktop:** Tauri v2 + React/TypeScript under `apps/desktop/`; frontend
dependencies are bundled and remain presentation-only.
- **Edition:** 2021, inherited via `[workspace.package]`.
- **Key deps (pin latest stable; no LTS concept in Rust/crates):**
`blake3`, `thiserror`, `hex`, `gix` (Git interop only), `clap`, `anyhow`.
Expand All @@ -40,9 +42,12 @@ crates/crypto → envelope encryption (depends on core; ONLY crate linking RustC
crates/tlsio → TLS for sc+https (depends on nothing; ONLY crate linking rustls/rcgen)
crates/repo → persistent .sc/ repo: objects, refs, branches, working tree (depends on core/vfs/crypto/tlsio)
crates/cli → `sc` binary (depends on repo + vfs + gitio + crypto + core)
apps/desktop/src-tauri → Tauri read-only adapter (depends on repo + core + crypto)
apps/desktop/src → bundled TypeScript presentation (typed IPC only)
```

Strict dependency direction: `cli → repo → {vfs, gitio, crypto, tlsio} → core`
Strict dependency direction: top-level adapters `{cli, desktop} → repo →
{vfs, gitio, crypto} → core`, with the separate leaf edge `repo → tlsio`
(`tlsio` is a leaf — it depends on no other workspace crate, not even `core`).
**`core` must never depend on Git, worktrees, or crypto.** **`gix` must stay
quarantined in `gitio`** — if you find yourself reaching for `gix` elsewhere,
Expand Down Expand Up @@ -96,6 +101,10 @@ snapshots down; `repo` stays Git-agnostic.

```sh
cargo test # whole workspace
cd apps/desktop && npm ci # desktop JS dependencies
Comment thread
tonibergholm marked this conversation as resolved.
Resolved
cd apps/desktop && npm run tauri dev # native desktop development app
cd apps/desktop && npm run typecheck && npm test
cd apps/desktop && npm run tauri build -- --bundles app # validated macOS production bundle
cargo run --bin sc -- demo --agents 4 # parallel-agent demo
cargo run --bin sc -- demo --agents 6 --budget-mb 4 --spill # exercise eviction
cargo run --bin sc -- import --repo <path> # import a Git repo's HEAD
Expand Down Expand Up @@ -433,7 +442,7 @@ the project tree if desired.

## Capability map (what's built, by phase)

All 34 phases are built and tested. One line of current fact per phase; the
All 35 phases are built and tested. One line of current fact per phase; the
authoritative rationale and full semantics live in the linked ADR, the design
in `ARCHITECTURE.md`. The old per-phase narrative log this table replaced is
archived verbatim at `docs/archive/claude-md-phase-log-2026-07.md` — do not
Expand Down Expand Up @@ -476,6 +485,7 @@ the code, those win.
| 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) |
| 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) |

## Standing boundaries & gotchas

Expand All @@ -487,6 +497,10 @@ transport-adjacent. The rest, imperatively:
sealed-branch object kinds). `MAX_OBJECT_SIZE` (256 MiB) guards the
transfer path only — a larger blob commits locally but fails every
subsequent push/fetch/clone at the receiver.
- **The P35 desktop app is a keyless, read-only top-level adapter.** Its
renderer has five typed repository commands, no general filesystem/shell
capability, and no DTO field capable of carrying protected ciphertext or
identity material.
- **Partial clones refuse merge, cherry-pick/rebase, `sc ws fork`/`harvest`,
`sc work`, `sc export`, and `sparse disable`.** `sc backfill --all` converts
to a genuine full clone and re-enables them.
Expand Down
Loading
Loading