arks-hostfs 1.0.0

Host FS honesty helpers — DriveFS / OneDrive CfAPI / sync-root detect (advisory)
Documentation
<p align="center">
  <img src="docs/assets/icons/arks-icon.svg" alt="arks logo" width="88" height="88" />
</p>

<h1 align="center">arks for Git</h1>

<p align="center">
  <strong>Agent Revision Kinetic System</strong>: a native Rust, Git-compatible revision CLI and self-hosted forge built for high-concurrency multi-session workflows.
</p>

<p align="center">
  <a href="https://github.com/modootoday/arks/actions/workflows/ci.yml"><img src="https://github.com/modootoday/arks/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
  <a href="https://github.com/modootoday/arks/releases"><img src="https://img.shields.io/github/v/release/modootoday/arks?label=release" alt="Release" /></a>
  <a href="https://modootoday.github.io/arks/"><img src="https://img.shields.io/badge/docs-GitHub%20Pages-0a66c2" alt="Docs" /></a>
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0%20OR%20MIT-blue" alt="License" /></a>
  <img src="https://img.shields.io/badge/rust-1.85%2B-orange" alt="Rust 1.85+" />
</p>

---

When tens to hundreds of sessions (agents, orchestrators, or developers) commit, check out, merge, or move worktrees at once, stock Git's revision contention becomes the bottleneck. **arks** keeps the **same `.git` directory on disk** and a **symmetric CLI**, so you can adopt via `alias git=arks` (or `arks shim install`) while keeping stock Git fully interoperable.

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 the single native `arks` binary. Docker clean-room compose is for maintainer verification of compatibility and timing claims, not the end-user install path.
>
> **Honesty:** Every verified claim below links to a clean-room receipt. Unimplemented or out-of-scope surfaces fail closed and are documented in [Completeness](docs/completion.md) and [Limits](docs/limits.md).

## Quick Install & Quick Start

Install the single `arks` binary (Linux, macOS, or Windows):

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

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

Or build from source (Rust edition 2024, MSRV **1.85+**):

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

Run everyday Git commands directly on a standard `.git` repository:

```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
```

Adopt as a drop-in replacement with shell aliases or PATH shims:

```bash
alias git=arks
alias gh=arks          # optional forge-client peer
# Or install non-interactive PATH shims:
arks shim install
```

More onboarding steps and remote migration (`arks migrate --from-url`): [Quickstart & Migration](docs/quickstart-migration.md) and [Getting started](docs/getting-started.md).

## Architecture

One binary (`arks`) serves three CLI personalities, shares standard filesystem `.git` repositories with stock Git, and optionally hosts an independent self-hosted forge (`arks serve`) or `git://` daemon (`arks daemon`). Product paths **never** spawn `git` or `gh`.

```mermaid
flowchart LR
    U[Developer / Agent Session] --> B["Single binary: arks"]
    B -->|git personality| P1["Git-symmetric CLI<br/>add, commit, merge, rebase, clone..."]
    B -->|gh personality| P2["Forge client<br/>pr, issue, auth, release, actions..."]
    B -->|arks serve| P3["Self-hosted forge<br/>HTTP + SSH + REST API + Web UI"]
    B -->|arks daemon| P4["git:// protocol server<br/>git-daemon parity"]
    P1 --> G[("Standard .git on disk<br/>+ leases / ref-shard / shared-index")]
    P3 --> G
    P4 --> G
    G <-->|100% interoperable| SG["Stock Git"]
```

## Why arks

| Challenge | How arks responds |
|-----------|-------------------|
| Multi-agent / multi-session orchestration contends on one repository | Native Rust engine with product leases, batch-apply, worktree/ref-shard, and shared-index N-way support |
| Switching VCS tools breaks muscle memory and CI scripts | Git-symmetric CLI (`git` / `gh` / `arks` personalities) adoptable via alias or PATH shim |
| Proprietary object stores break existing Git tooling | Standard filesystem `.git` object store; inspect or interop with stock `git` anytime |
| Self-hosting requires stitching together separate services | Single-process `arks serve` umbrella with Smart HTTP, SSH, TLS, REST API, and embedded SSR Web UI |

**arks is not an agent framework.** It is the revision layer that multi-session environments share. Optional `arks agent …` is an explicit extension on the same binary, not the core product story.

## Verified Surface Summary

| Surface | Role | Clean-Room Verification Status |
|---------|------|--------------------------------|
| **Git CLI & Personalities** (`git` / `gh` / `arks`) | Native Git engine + argv/exit-code symmetry | **185/185 CLI commands Verified (0 Partial)** ([zero-partial receipt](https://github.com/modootoday/arks/blob/main/.spec/evidence/20261129010000-v1-0-0-zero-partial-verified/receipt.json)); **1,852/1,852** pin-2.39.5 options accepted, **4,446/4,549** flag-corpus lines identical (**0 unreasoned**, [pre-release receipt](https://github.com/modootoday/arks/tree/main/.spec/evidence/20261128052500-final-pre-release-receipt)); **19/19** journeys faster than stock Git 2.39.5 (`0.17x–0.73x`, zero-alloc `xdiff` `0.515x`, `commit 4x640` `0.53x`, `reflog 2000` `0.60x`, [Perf Round 1](https://github.com/modootoday/arks/blob/main/.spec/evidence/20261129060000-v1-5-0-perf-round1/receipt.json) · [Perf Round 2](https://github.com/modootoday/arks/blob/main/.spec/evidence/20261129064500-v1-6-0-perf-round2/receipt.json)) |
| **Self-Host (`arks serve`)** | Single-process Git HTTP + SSH + TLS + Forge API | HTTP git wire, in-process SSH, in-process TLS, zero-downtime `SIGHUP`/mtime config reload, `(mtime, len)`-validated `ForgeStore` `RwLock` cache (256 concurrent reads + 16 interleaved writes), `TCP_NODELAY`, pre-spawn `503` cap, bounded HTTP/1.1 Keep-Alive (64 req/conn, 256-request soak `fd_delta=0`), gzip bomb `413` cap, all-in-one TLS+SSH+LFS 128-request soak (`fd_delta=0`), and local forge-in-serve E2E verified ([Perf Round 2](https://github.com/modootoday/arks/blob/main/.spec/evidence/20261129064500-v1-6-0-perf-round2/receipt.json), [Perf Round 1](https://github.com/modootoday/arks/blob/main/.spec/evidence/20261129060000-v1-5-0-perf-round1/receipt.json), [soak receipt](https://github.com/modootoday/arks/blob/main/.spec/evidence/20261129020000-v1-1-0-edge-parity-soak/receipt.json), [self-host receipt](https://github.com/modootoday/arks/tree/main/.spec/evidence/20261111011425-self-host-forge-e2e), [SSH receipt](https://github.com/modootoday/arks/tree/main/.spec/evidence/20261125031426-claimed-ssh), [TLS receipt](https://github.com/modootoday/arks/tree/main/.spec/evidence/20261110233652-claimed-tls)) |
| **Embedded Forge Web UI & Security** | Multi-repo SSR Web UI, REST APIs, RBAC, 2FA, LFS | Hardened Web UI (`0/135` OSV/RustSec CVEs, atomic `ForgeStoreTx` across 68 write paths / 60-thread stress, 32-thread `arks-lease`/`arks-object` & 16-thread LFS unique atomic temp writes, `0` production `.unwrap()`, `/healthz`, `/metrics`, HSTS, PBKDF2/CSRF/RBAC, 2FA, OAuth Device Flow auth/CSRF anti-impersonation, `ARKS_DISABLE_REGISTRATION`, global logout revocation, private-repo `401`, HTTP/REST/SSH/LFS archived `403`, SSRF-guarded webhooks, Actions/leases APIs) verified in Docker ([atomic store](https://github.com/modootoday/arks/blob/main/.spec/evidence/20261129030000-v1-2-0-atomic-store-v2/receipt.json) · [CVE-zero & security](https://github.com/modootoday/arks/blob/main/.spec/evidence/20261129034500-v1-3-0-cve-security-durability/receipt.json) · [OAuth device auth](https://github.com/modootoday/arks/blob/main/.spec/evidence/20261129041500-v1-4-0-oauth-device-auth-ci/receipt.json) · [enterprise](https://github.com/modootoday/arks/tree/main/.spec/evidence/20261128180000-v0-4-0-enterprise-cleanroom) · [hardening](https://github.com/modootoday/arks/tree/main/.spec/evidence/20261128190000-v0-5-0-hardening-cleanroom)) |
| **Daemon (`arks daemon`)** | `git://` peer (`git-daemon` symmetry) | **37/37 Parity + 2 arks-only, Missing=0** against stock `git 2.39.5` in Docker (Windows CI-tested); byte-identical ustar archive and POSIX syslog verified |
| **Forge Client (`arks pr` / `issue` / `auth` …)** | Flat `gh`-peer client (never spawns `gh`) | **171/171 v1 rows verified, Missing=0, Deferred=0** (Docker re-receipt + 6/12-agent concurrent local-forge receipt); HTTPS remote client verified; out-of-scope groups fail closed with exit 2 |
| **Optional Agent (`arks agent …`)** | Review / CEV extension | Docker OpenAI-compatible fixture E2E verified; plain-HTTP smokes are diagnostics; HTTPS TLS client + live vendor smoke (host-advisory) |

### Self-host quick start

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

# Full self-hosted forge (HTTP + SSH + embedded Forge API & Web UI):
arks serve /path/to/repos
```

Prefer normative ports **22 / 80 / 443 / 9418** in production; **2222 / 8080** are demo/alternate defaults. See [Self-host](docs/self-host.md) and [Ports](docs/ports.md).

## Common Workflows

| Goal | Command |
|------|---------|
| Verify / repair environment | `arks doctor`, `arks doctor --fix`, `arks shim install` |
| Migrate a remote repository | `arks migrate --from-url <url>` |
| Stage, commit, inspect | `arks add`, `arks commit -m "…"`, `arks status`, `arks log`, `arks diff` |
| Branch, merge, replay | `arks switch`, `arks branch`, `arks merge`, `arks replay` |
| Remotes & shallow/partial clone | `arks clone --depth 1`, `arks fetch`, `arks pull`, `arks push` |
| Sign & verify (SSH / OpenPGP / X.509) | `arks commit -S`, `arks tag -s`, `arks verify-commit`, `arks verify-tag` |
| Forge client | `arks pr list`, `arks issue list`, `arks auth status` |

Full reference: [Workflows](docs/workflows.md) or run `arks --help`.

## Performance (Evidence, Not Slogans)

Clean-room Docker verification compared stock Git **2.39.5** to release `arks` on a 19-journey contention suite. Read timings as parallelism and wall-clock evidence for contended workflows, not as blanket speed marketing:

| Target | Result | Clean-Room Receipts |
|--------|--------|---------------------|
| ≤0.8× median wall-clock across all 19 journeys | **19/19** | [Measurement `c1b0b24`](.spec/evidence/20261110003836-g19-remeasure-c1b0b24/) · [Baseline receipt](.spec/evidence/20261109090000-m17-exit-g19-measured-19/) |
| Aggressive ≤0.5× median wall-clock | **19/19** (sole Docker hardlink run) | [19/19 receipt](.spec/evidence/20261111032000-eng-hard-alias-hardlink-g19/) · [Prior partial](.spec/evidence/20261111003444-u-ladder-partial-gap-close/) · [Archival 8/8](.spec/evidence/20261110142500-g19-remeasure-pf5-8of8/) |

Charts and methodology: [Performance](docs/performance.md). Prefer ratios over raw milliseconds across receipts. Host-only timings are advisory.

## Limits (What Is Not Claimed)

- **No GUI embeds or unrelated tools:** `gitk` / `git-gui` hand off externally; `scalar` and `arks host-env` are out of scope.
- **Standard `.git` object store only:** CELIR was not adopted and is withdrawn from the Cargo workspace.
- **Platform-specific forge extensions fail closed:** GitHub-proprietary CLI groups (`codespace`, `copilot`, `extension`) exit 2 rather than pretending to work.
- **Honest boundaries:** Absolute SHA-1 collision immunity is impossible (collision detect-and-refuse is verified); multi-device cloud-sync over `.git` is unsupported; live third-party forge latency SLOs without secrets remain unmeasured (honest SKIP).

Full details: [Limits](docs/limits.md) and [Git vs arks](docs/git-vs-arks.md).

## Documentation

Interactive documentation site: **[https://modootoday.github.io/arks/](https://modootoday.github.io/arks/)**

| Section | Pages |
|---------|-------|
| **Get Started** | [Overview](docs/overview.md) · [Install & setup](docs/install.md) · [Getting started](docs/getting-started.md) · [Quickstart & Migration](docs/quickstart-migration.md) · [Workflows](docs/workflows.md) |
| **Guides** | [Concurrent sessions](docs/concurrent-sessions.md) · [Alias `git` → `arks`](docs/alias-git-arks.md) · [Reftable & native LFS](docs/storage-and-lfs.md) · [History & maintenance](docs/history-and-maintenance.md) · [Self-host](docs/self-host.md) · [Forge Web UI](docs/forge-web-ui.md) · [Forge security & auth](docs/forge-security.md) · [Forge client](docs/arks-hub.md) · [Actions & local CI](docs/actions-ci.md) · [Agent](docs/agent.md) |
| **Reference** | [CLI personality](docs/cli-personality.md) · [REST API reference](docs/rest-api.md) · [Operations & deploy](docs/operations.md) · [Ports](docs/ports.md) · [Daemon](docs/daemon.md) · [Release channels](docs/release.md) · [Forge scale](docs/forge-scale.md) |
| **Honesty & Benchmarks** | [Completeness](docs/completion.md) · [Git vs arks](docs/git-vs-arks.md) · [Performance](docs/performance.md) · [Limits](docs/limits.md) |

Maintainer specifications, clean-room matrices, and agent routing live under [`.spec/`](.spec/), [`verify/`](verify/), and [`AGENTS.md`](AGENTS.md).

## Contributing, License & Security

- **Contributing:** Bug reports and pull requests are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) and [docs/contribute.md](docs/contribute.md).
- **License:** Dual-licensed under **Apache-2.0 OR MIT** ([`LICENSE`](LICENSE), [`LICENSE-APACHE`](LICENSE-APACHE), [`LICENSE-MIT`](LICENSE-MIT)).
- **Security:** Report vulnerabilities privately via GitHub Security Advisories. See [`SECURITY.md`](SECURITY.md).