arks-hostfs 0.3.0

Host FS honesty helpers — DriveFS / OneDrive CfAPI / sync-root detect (advisory)
Documentation
# arks for Git

**arks** — **Agent Revision Kinetic System** — is a Git-compatible revision CLI and infra, written in Rust, for environments where **many concurrent sessions** (agents, orchestrators, humans) hit the same repositories.

When tens to hundreds of sessions commit, check out, merge, or move worktrees at once, stock Git’s revision contention becomes the bottleneck. arks keeps the **same `.git` on disk** and a **symmetric CLI**, so you can adopt with `alias git=arks` (or `alias gh=arks`) and keep muscle memory while the engine addresses diverse contention scenarios.

Compatibility with documented Git formats and commands comes first. Clean-room timings exist as evidence ([Performance](docs/performance.md)); this README does not market a blanket “faster than Git” slogan.

> **Runtime vs verification:** End users run native `arks`. Docker clean-room compose is for **maintainer verification** of compatibility and timing claims — not the product install path.
>
> **Honesty:** Design intent and CLI shells are **not** automatic **Claimed**. Surfaces marked **Partial** / **Missing** fail closed or document stubs — this README does not invent PASS.

## Why arks

| Pain | Response |
|------|----------|
| Multi-agent / multi-session orchestration piles onto one revision system | Native Rust engine + product leases and optional high-concurrency shapes aimed at that load |
| Switching tools breaks habits | Git-symmetric CLI; forge client leaves flattened beside porcelain; adopt via alias or PATH shim |
| Parallel proprietary stores break Git tooling | Same filesystem `.git` in Git-compatible mode — stock Git remains a peer |

arks is **not** an agent framework. It is the **revision layer** those environments share. Optional `arks agent …` is an explicit extension on the **same** binary — not the core product story.

More narrative and live interactive docs: [https://modootoday.github.io/arks/](https://modootoday.github.io/arks/) — especially [Quickstart & Migration](docs/quickstart-migration.md), [Concurrent sessions](docs/concurrent-sessions.md), [Completeness](docs/completion.md), and [Overview](docs/overview.md).

## Install / build

Quick install (one-line script):

```bash
# Linux / macOS
curl -fsSL https://raw.githubusercontent.com/modootoday/arks/main/scripts/install.sh | bash
arks doctor

# Windows (PowerShell)
irm https://raw.githubusercontent.com/modootoday/arks/main/scripts/install.ps1 | iex
```

Or build from source (Rust edition 2024 / `rust-version` **1.85+**):

```bash
git clone https://github.com/modootoday/arks.git
cd arks
cargo build -p arks --release
```

The published binary is **`arks` only** (debug: `target/debug/arks`, release: `target/release/arks`). Put it on your `PATH`, install drop-in shims with `arks shim install`, or invoke it with `cargo run -p arks -- …`.

```bash
cargo run -p arks -- --help
```

There is no separate `arks-hub` / `arks-daemon` / `arks-agent` product binary.

## Quick start

```bash
arks init my-repo
cd my-repo
echo "hello" > README.md
arks add README.md
arks commit -m "Initial commit"
arks status
arks log
```

Remote day-to-day (smart HTTP):

```bash
arks clone https://example.com/repo.git
arks fetch
arks pull
arks push
```

Same repository as Git: you can inspect the tree with stock `git` anytime — arks does not invent a separate object store for Git-compatible mode.

### Personalities (`git` | `gh` | `arks`)

One binary; three muscle memories (design / Partial — not Claimed drop-in proof):

| How you invoke | Personality | Expectation |
|----------------|-------------|-------------|
| `alias git=arks` / basename `git` / `ARKS_PERSONALITY=git` | **git** | Peer-pure Git argv, stdout, exit codes |
| `alias gh=arks` / basename `gh` / `ARKS_PERSONALITY=gh` | **gh** | Peer-pure forge-client argv, stdout, exit codes |
| Bare `arks` (default) | **arks** | Git-first merged surface; flat forge leaves (`pr`, `issue`, …); unified overlap where designed |

CI that today calls `git` / `gh` should prefer the peer personalities. Details: [CLI personality](docs/cli-personality.md).

### Alias sketch

```bash
alias git=arks
# optional forge peer:
alias gh=arks
```

**Honesty:**

- Treat aliases as the adoption path for claimed commands — not as a promise that every Git/`gh` subcommand and flag is covered today.
- Unimplemented or out-of-scope commands exit **non-zero** and must not mutate the repository.
- Shell aliases do not apply inside many scripts; use a PATH shim named `git` / `gh` when you need non-interactive drop-in behavior.

More detail: [docs/alias-git-arks.md](docs/alias-git-arks.md).

## Self-host (`arks serve`)

Product hosting umbrella — **one** process intended for Git HTTP + SSH + forge API (independent self-hosted forge). **`arks serve` ≠ forge client.** Flat client leaves (`arks pr`, `arks issue`, …) talk *to* a forge base URL; they do not start the host.

```bash
# HTTP git wire only (opt out of SSH/forge modules):
arks serve --no-ssh --no-forge /path/to/repos

# Product default (HTTP + SSH + embedded forge API & Web UI):
# arks serve /path/to/repos
```

| Surface | Role | Verified status |
|---------|------|-----------------|
| `arks serve` | Host umbrella (`--no-http` / `--no-ssh` / `--no-forge`) | HTTP git wire, in-process SSH, in-process TLS, local forge-in-serve hosting, and hardened Web UI (`/healthz`, `/metrics`, HSTS, PBKDF2/CSRF/RBAC, rate limits, global logout revocation, private-repo visibility, HTTP/REST/SSH/LFS archived guard, 2FA, archives, Actions/leases APIs, webhooks) are clean-room verified ([self-host forge receipt](https://github.com/modootoday/arks/tree/main/.spec/evidence/20261111011425-self-host-forge-e2e), [enterprise receipt](https://github.com/modootoday/arks/tree/main/.spec/evidence/20261128180000-v0-4-0-enterprise-cleanroom), [hardening receipt](https://github.com/modootoday/arks/tree/main/.spec/evidence/20261128190000-v0-5-0-hardening-cleanroom), [UI & enforcement receipt](https://github.com/modootoday/arks/tree/main/.spec/evidence/20261128193000-v0-6-0-cleanroom), [round-2 receipt](https://github.com/modootoday/arks/tree/main/.spec/evidence/20261128200000-v0-7-0-cleanroom), [visibility receipt](https://github.com/modootoday/arks/tree/main/.spec/evidence/20261128201500-v0-8-0-cleanroom), [revocation receipt](https://github.com/modootoday/arks/tree/main/.spec/evidence/20261128203000-v0-9-0-cleanroom)); push rulesets enforced (3-OS CI) |
| `arks serve config …` | Server config store | Zero-downtime reload across HTTP, SSH, and forge via `SIGHUP` on Unix and file-mtime reload on Windows (CI-tested) |
| `arks serve ssh-smoke` | Local SSH banner smoke | Diagnostic smoke check (separate from end-to-end SSH clone verification) |
| `arks daemon` | `git://` peer (`git-daemon` symmetry) | **37/37 Parity + 2 arks-only, Missing=0** in Docker clean-room (`git 2.39.5`; Windows CI-tested); byte-identical ustar archive and POSIX syslog verified |
| Flat `arks pr` / `issue` / `auth` / … | Forge **client** | **171/171 v1 rows verified, Missing=0, Deferred=0** (Docker re-receipt + 6/12-agent local forge multi-agent receipt); HTTPS remote client verified; out-of-scope groups fail closed with exit 2; never spawns `gh` |
| Personality `git`/`gh` | Drop-in + argv/corpus symmetry | **1,852/1,852** pin-2.39.5 options accepted, **4,446/4,549** flag-corpus lines identical (77 post-pin + 26 design, **0 unreasoned**, [pre-release receipt](https://github.com/modootoday/arks/tree/main/.spec/evidence/20261128052500-final-pre-release-receipt)); CLI survey **128 Verified / 36 reasoned Partial** ([personality expand](https://github.com/modootoday/arks/tree/main/.spec/evidence/20261111020515-personality-expand), [exit tables](https://github.com/modootoday/arks/tree/main/.spec/evidence/20261111025151-personality-exit-tables)) |
| `arks agent …` | Optional review / CEV extension | Docker OpenAI-compatible fixture end-to-end verified; plain-HTTP smokes are diagnostics; HTTPS TLS client + live vendor smoke (host-advisory) |

Ports: prefer **22 / 80 / 443 / 9418**; label **2222 / 8080** as demo/alternate — [Ports](docs/ports.md), [Self-host](docs/self-host.md).

## Symmetry DoD pillars

Public clean-room Definition of Done is **three peer-symmetry pillars** (plus adjacent self-host end-to-end verification):

| Pillar | Stock peer | Product entry |
|--------|------------|---------------|
| **1. CLI** | `git` | `arks <cmd>` / personality `git` |
| **2. Daemon** | `git-daemon` | `arks daemon` |
| **3. Forge client** | `gh` | flat `arks pr` / `issue` / … (transitional `arks hub …`) |

All three pillars pass pin pre-release symmetry (`Missing=0`, `untracked=0`: 171/171 hub v1 verified, 37/37 daemon parity, 4,446/4,549 flag-corpus lines identical with 0 unreasoned diffs) while keeping non-goals and owner-policy holds explicit. See [Completeness](docs/completion.md).

Product paths **never** spawn `git` or `gh`. Stock peers are oracles for clean-room only.

## Common workflows

| You want to… | Try |
|--------------|-----|
| Check / fix setup | `arks doctor`, `arks doctor --fix`, `arks shim install` |
| Migrate a remote repo | `arks migrate --from-url <url>` |
| Create a repo | `arks init` |
| Stage / commit | `arks add`, `arks commit -m "…"` |
| Inspect history | `arks status`, `arks log`, `arks show`, `arks diff` |
| Branches | `arks branch`, `arks checkout` / `arks switch`, `arks merge` |
| Remotes | `arks remote`, `arks fetch`, `arks pull`, `arks push`, `arks clone` |
| Sign / verify (SSH) | `arks commit -S` with `gpg.format=ssh`; `arks verify-commit` |
| Self-host (HTTP git) | `arks serve --no-ssh --no-forge <dir>` |
| Forge client | `arks pr list`, `arks issue list`, `arks auth status` |

Fuller tables: [docs/workflows.md](docs/workflows.md). For a command list, run `arks --help`.

## Concurrent sessions (honest bar)

arks ships product leases and a clean-room verified high-concurrency path (lease + batch-apply + worktree/ref-shard), plus shared-index N-way support backed by clean-room receipts. Public copy treats these as **verified only where receipts exist** — not as “all races fixed.”

Plain-language overview: [docs/concurrent-sessions.md](docs/concurrent-sessions.md).

## Performance (evidence, not slogans)

Clean-room Docker verification compared stock Git **2.39.5** to release `arks` on the shared journey suite. Read timings as **parallelism / wall-clock evidence for contended workflows**, not as empty speed marketing:

| Bar | Result | Evidence |
|-----|--------|----------|
| ≤0.8× median wall-clock on all journeys | **19/19** | [Clean-room measurement `c1b0b24`](.spec/evidence/20261110003836-g19-remeasure-c1b0b24/) · [baseline receipt](.spec/evidence/20261109090000-m17-exit-g19-measured-19/) |
| Aggressive ≤0.5× | **19/19** sole Docker run ([alias hardlink receipt](.spec/evidence/20261111032000-eng-hard-alias-hardlink-g19/)); prior partial receipt ([gap-close](.spec/evidence/20261111003444-u-ladder-partial-gap-close/)) and historical **8/8** at `79fc9bf` | [19/19 receipt](.spec/evidence/20261111032000-eng-hard-alias-hardlink-g19/) · [tip matrix](.spec/evidence/20261110224814-full-cleanroom-matrix/) · [historical 8/8](.spec/evidence/20261110142500-g19-remeasure-pf5-8of8/) |

Charts and honesty labels: [docs/performance.md](docs/performance.md). Prefer **ratios** over absolute ms across receipts (seeds change). Host-only timings are advisory only.

## Limits (what is not claimed)

Short and honest — see [docs/limits.md](docs/limits.md) and [Git vs arks](docs/git-vs-arks.md):

- **Not** a GUI embed (`gitk`/`git-gui` handoff only), `scalar` product, agent orchestrator, or “WAN-safe by default” host.
- The Git **object store** remains ordinary filesystem `.git`. CELIR was not adopted and is withdrawn from the Cargo graph; arks does not replace `.git` objects in Git-compatible mode.
- Forge **client** leaves (171/171 v1 rows) and self-host forge-in-serve end-to-end are verified in clean-room receipts; GitHub-platform-only groups (such as Actions/Codespaces/Copilot) fail closed with exit 2.
- In-process **SSH** ([SSH receipt](https://github.com/modootoday/arks/tree/main/.spec/evidence/20261110235116-claimed-ssh)), in-process **TLS** ([TLS receipt](https://github.com/modootoday/arks/tree/main/.spec/evidence/20261110233652-claimed-tls)), and zero-downtime config reload across HTTP/SSH/forge are verified; ops SSHD + stdio pack remains valid.
- **Verified with receipts:** pin-2.39.5 argv/flag-corpus symmetry (1,852/1,852 options, 4,446/4,549 identical, 0 unreasoned diffs); `--depth` shallow; partial-clone filter subset (`blob:none`, `tree:0`); OpenPGP / X.509 / `tag -s` / `verify-tag`; credential helper / askpass / TTY / first-party OS wallets; smart HTTP server wire and HTTP Basic auth; embedded Web UI & enterprise forge ([enterprise receipt](https://github.com/modootoday/arks/tree/main/.spec/evidence/20261128180000-v0-4-0-enterprise-cleanroom)).
- **Out of scope / advisory / owner-policy:** absolute SHA-1 collision **immunity** (detect+refuse is verified); full multi-device cloud-sync safety; live third-party forge latency SLOs without secrets; external registry publish timing; trimmed over-design (`arks host-env`, in-process LFS, CELIR).

## Documentation

Human-facing site (GitHub Pages): [https://modootoday.github.io/arks/](https://modootoday.github.io/arks/) ([`docs/`](docs/))

| Page | Topic |
|------|-------|
| [Home](docs/index.md) | Interactive 3D hero + product intro |
| [Overview](docs/overview.md) | What arks is (and is not) |
| [Quickstart & Migration](docs/quickstart-migration.md) | 5-minute onboarding, shims, and `arks migrate` |
| [Getting started](docs/getting-started.md) | One-line install, native build, and first commands |
| [Completeness](docs/completion.md) | Overall readiness and honest limits |
| [CLI personality](docs/cli-personality.md) | `git` / `gh` / `arks` dispatch |
| [Alias `git` → `arks`](docs/alias-git-arks.md) | Drop-in adoption path |
| [Workflows](docs/workflows.md) | Everyday command map |
| [Self-host](docs/self-host.md) | `arks serve` self-hosted forge, Web UI, and `deploy/` templates |
| [Ports](docs/ports.md) | Normative **22/80/443/9418** vs demo **2222/8080** |
| [Forge client](docs/arks-hub.md) | Flat `arks pr` / … (≠ host) |
| [Daemon](docs/daemon.md) | `arks daemon` ↔ `git-daemon` |
| [Agent](docs/agent.md) | Optional `arks agent …` extension |
| [Concurrent sessions](docs/concurrent-sessions.md) | Contention motive and concurrency honesty |
| [Git vs arks](docs/git-vs-arks.md) | Honest feature comparison |
| [Performance](docs/performance.md) | Clean-room git vs arks timings |
| [Forge scale](docs/forge-scale.md) | Maintainer live forge smoke & scale harness |
| [Release channels](docs/release.md) | Release packaging and OIDC dry-run status |
| [Limits](docs/limits.md) | What is not claimed |
| [Contribute](docs/contribute.md) | Bugs, docs, maintainer pointers |

Design specs, verification matrices, and agent routing live under [`.spec/`](.spec/), [`verify/`](verify/), and [`AGENTS.md`](AGENTS.md) — they are for maintainers, not the default product read.

## Contributing

Bug reports and pull requests are welcome on [modootoday/arks](https://github.com/modootoday/arks). Keep product docs in English. See [docs/contribute.md](docs/contribute.md). Maintainers: start from [`AGENTS.md`](AGENTS.md).

## License and security

- License: **Apache-2.0 OR MIT** (`LICENSE`, `LICENSE-APACHE`, `LICENSE-MIT`)
- Vulnerability reports: [`SECURITY.md`](SECURITY.md) (private GitHub Security Advisories)