openscion README

项目的 README,来自 github.com/tinyhumansai/openscion。合并为一个 markdown 文件:README.md。

OpenScion

OpenScion

OpenScion is an open-source, server-centric source control system for very large monorepos where most clients are AI agents and CI jobs rather than people on laptops. It follows the design Anthropic described for its internal system, Scion, in Redesigning source control.

Benchmarks

opnscn against git on synthetic repositories of 4 KiB files, measured with openscion-bench (cargo run -p openscion-benchmarks --release):

OpenScion vs git on synthetic repositories: median times to import a repository, clone everything, commit one changed file, and clone one directory, on 1,000 and 10,000 files

OpenScion imports and clones several times faster than git at both sizes. The one-directory clone shows the design at work: opnscn fetches only the trees on the path to the directory and the files beneath it, so its cost tracks the slice you ask for rather than the size of the repository. Setup, methodology, and raw numbers are in benchmarks/README.md.

Why

Git assumes every client is offline and keeps a full copy of history. An agent-heavy monorepo breaks that assumption. Thousands of short-lived, always-online jobs each want a small slice of a huge tree, and each one pays for the whole repository anyway. Anthropic reports going from about 2,500 to over 30,000 merged changes a day in four months. At that point the main-branch history was almost 100 GB, CI ran about 25 million checkouts a day, and they needed several hundred git mirrors to keep up.

OpenScion takes the opposite approach:

OpenScion is purpose-built for one workload: large monorepos where most of the traffic comes from agents and CI jobs. Server-side operations, fetching only what is named, and lock-free landing are what keep thousands of concurrent clients fast at that scale.

Architecture

 opnscn (client) ──► openscion-daemon ──► openscion-cache ──► openscion-server
 working copy     one per node         regional,           log, refs,
 fs watcher       node-wide objects    immutable objects   derived data
                                                              │
                                              metadata store ─┴─ object store

All tiers answer the same object RPCs, so a client talks to whichever one is nearest. Mutable state (the log, refs, and derived indexes) lives only on the server. Storage sits behind two ports, ObjectStore and MetadataStore. The reference implementations are in-memory and local (filesystem, SQLite), so a single node works without any cloud services.

Documentation

Document What it covers
Architecture goals, principles, components, tiers, delivery phases
Data model object ids, paths, blobs, trees, changesets, the log, refs, derived data
API operations, fetch protocol, rebase and landing, access control, errors
Background: Scion notes on the system OpenScion is modelled on
Background: git, GitHub, GitLab how git stores and moves data, and how the two largest forges host it
Roadmap what exists, what is next, what is out of scope
AGENTS.md repository guidelines for humans and coding agents

Layout

crates/
├── openscion-proto/   # the protocol: payload types and the protocol version
├── openscion-core/    # the engine: data model, stores, derived data, rebase
├── openscion-server/  # openscion-server: the HTTP API over the engine
└── openscion/         # opnscn, the command-line client (crates.io: openscion)
benchmarks/            # openscion-bench: OpenScion vs git on synthetic repos
apps/web/              # the web GUI (Next.js + shadcn/ui)
docs/
├── research/          # source material: Scion, git, GitHub, GitLab
├── specs/             # what to build and why
├── plans/             # test-first implementation plans
└── adr/               # architecture decision records

openscion-proto holds every type that crosses a process boundary. It has no transport, runtime, or behavior, so any tool can depend on it to speak the API. openscion-core depends on it and re-exports it, so both crates name the same types. The server, the CLI, and the GUI all speak that one API.

Quick start

cargo run -p openscion-server                 # serves http://127.0.0.1:7878
cargo run -p openscion -- import ./tree       # opnscn: record a tree as `main`
cargo run -p openscion -- commit -m "edit" --dir ./tree
cargo run -p openscion -- clone ./copy        # or `--path dir` for one directory
cd apps/web && pnpm install && pnpm dev       # GUI on http://localhost:3000
cargo run -p openscion-benchmarks --release   # time the scenarios against git

Install the client from crates.io with cargo install openscion, which provides the opnscn binary.

Development

cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo build --all-targets --all-features
cargo test --all-features

CI runs those four checks. It also requires 90% line coverage in every source file, builds rustdoc with -D warnings, builds with the MSRV, runs a cargo-deny supply-chain check, and asserts that openscion-proto stays free of transports and runtimes. To run the extra checks locally:

cargo doc --no-deps --all-features   # CI builds this with RUSTDOCFLAGS="-D warnings"
cargo deny check all
cargo install cargo-llvm-cov         # once
.github/scripts/check-file-coverage.sh 90 coverage.json

Releasing

Run the Release workflow from the Actions tab and pick a patch, minor, or major bump. The workflow re-validates the workspace, bumps the shared [workspace.package] version, tags it, publishes openscion-proto, openscion-core, and openscion to crates.io (using the CARGO_REGISTRY_TOKEN secret), and creates a GitHub release. Do not edit the version in the root Cargo.toml by hand.

Contributing

See CONTRIBUTING.md. Behavior changes start in docs/specs/; each accepted spec gets a test-first plan in docs/plans/ before any code is written.

License

GPL-3.0-only. See LICENSE.

openscion (tinyhumansai/openscion)

正在搜索数据库…

这是什么?OpenScion 是一个开源的、以服务器为中心的源代码管理系统,专为超大型单体仓库(monorepo)设计,其主要客户端是 AI 智能体和 CI 任务,而不是笔记本电脑前的人类开发者。它以 Anthropic 内部系统 Scion 为原型,该系统在他们的文章“Redesigning source control”中有所介绍。
它是 Git 的替代品,还是运行在 Git 之上的工具?它是一套完整的源代码管理系统,目标是在智能体负载较重的场景中替代 Git,而不是插件。历史记录、blame、提交、变基(rebase)和合并都在服务器端运行,客户端则通过 RPC API 与之通信,而不是协商 packfile。
我该如何安装并试用?使用 'cargo install openscion' 安装客户端,即可获得 'opnscn' 可执行文件。服务器、CLI 和 GUI 都使用 openscion-proto crate 中定义的同一套 API。
使用它需要先安装 Rust 吗?需要。它通过 cargo 以 Rust crate 的形式分发,参考服务器的存储可运行在内存或本地文件系统/SQLite 后端上,因此单个节点无需任何云服务即可工作。
它现在已经可以在生产环境的单体仓库中替代 Git 了吗?它仍处于早期阶段(119 个 Star,创建于 2026 年 10 月),文档中明确以路线图的形式列出“已有功能、接下来要做的事、不在范围内的内容”,因此它还不能直接替代成熟的 Git 工作流。
为什么 OpenScion 在大型仓库上比 Git 快?操作在服务器端执行,客户端只拉取所请求路径上的树和文件,因此克隆单个目录的开销只与该部分的大小相当,而不是整个仓库。基准测试显示,在合成仓库上,它的导入和克隆速度比 git 快数倍。
什么是 changeset?它和快照有什么区别?changeset(变更集)只列出相对于其第一个父提交发生变化的文件,因此创建它的开销取决于变更本身的大小,而不是整个仓库树的大小。
为什么要开发它,而不是继续扩展 Git?Anthropic 的单体仓库增长到约 100GB,每天有 30,000 多次合并变更和 2500 万次 CI 检出。这打破了 Git 的假设:每个客户端都保有完整的离线历史。为了跟上负载,他们曾需要数百个 git 镜像。
落地变更如何避免全局合并锁?引用(refs)只能通过比较并交换(compare-and-swap)来移动:落地操作是在服务器端执行一次变基,加上一次原子性的记录交换,遇到竞争时会重试,因此成千上万的并发客户端不会因同一把锁而阻塞。
有哪些类似的项目?sapling, git-ai, walgit, walgithub, xerj, woml, layerfs, weave
大小
0.5 MB
星标
154
更新
提交Oct 13
时长
1个月
提交 · 90 天