Skip to content
Closed
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
432 changes: 432 additions & 0 deletions docs/designs/saiph/README.md

Large diffs are not rendered by default.

1,048 changes: 1,048 additions & 0 deletions docs/designs/saiph/ci-cd.md

Large diffs are not rendered by default.

1,105 changes: 1,105 additions & 0 deletions docs/designs/saiph/client.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/ci-cd/DL-602.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-602
decision: "saiph-ci is a first-party Go service that runs each shard of targets as one Kubernetes Job with backoffLimit 0 and adopts no CI engine."
status: "Active (design, 2026-10-19)"
record: ../../ci-cd.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/ci-cd/DL-603.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-603
decision: "Saiph CI triggers from the store's WatchRefs and review's WatchEvents, each resumed at a cursor stored in the same transaction as the runs it creates."
status: "Active (design, 2026-10-19)"
record: ../../ci-cd.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/ci-cd/DL-604.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-604
decision: "A Saiph CI target is a build-graph task id; affected targets come from the store's snapshot Diff, fed to moon on stdin in a skeleton of graph-input files, with all as the barrier."
status: "Active (design, 2026-10-19)"
record: ../../ci-cd.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/ci-cd/DL-605.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-605
decision: "Saiph CI policy is one .saiph/ci.yaml, read at the run's base and never from the change under test."
status: "Active (design, 2026-10-19)"
record: ../../ci-cd.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/ci-cd/DL-606.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-606
decision: "Each (repo, changeset, target) has one immutable Saiph CI result; CI never retries a target and a Job never retries a pod; INFRA is red, alerts, and is stored on the run only."
status: "Active (design, 2026-10-19)"
record: ../../ci-cd.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/ci-cd/DL-607.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-607
decision: "Saiph postsubmit runs in TAP-style milestones; a red target opens a breakage that keeps it red at trunk until a later trunk changeset passes it; culprit finding is flake-aware Bayesian search that runs each (target, changeset) at most once, and it comments, never reverts."
status: "Active (design, 2026-10-19)"
record: ../../ci-cd.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/ci-cd/DL-608.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-608
decision: "A Saiph CI flake is two results that disagree on one input key; it opens a flake breakage, and the target is quarantined, not required, until the breakage closes."
status: "Active (design, 2026-10-19)"
record: ../../ci-cd.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/ci-cd/DL-609.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-609
decision: "Saiph CI Jobs get their source from a saiphd CSI inline ephemeral volume and have no git."
status: "Active (design, 2026-10-19)"
record: ../../ci-cd.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/ci-cd/DL-610.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-610
decision: "Saiph CD follows Rapid: a release is a protected release/* ref cut from a green milestone, a pick is a rebased trunk changeset, and stages run deploy targets behind human land approvals."
status: "Active (design, 2026-10-19)"
record: ../../ci-cd.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/ci-cd/DL-611.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-611
decision: "Saiph's remote build cache is REAPI with SHA-256 on bb-storage, scoped per repo by instance prefix and written only by postsubmit; CI compute is capped by a namespace ResourceQuota, a per-repo shard limit and a budget alert that pages Matt."
status: "Active (design, 2026-10-19)"
record: ../../ci-cd.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/client/DL-590.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-590
decision: "Saiph's client follows Scion's tiers: the saiph CLI, one saiphd per node and a regional saiph-cache answer the same id-read RPCs as saiph-server, tiering is strict, objects travel in their stored form, and every tier verifies each object's id before it keeps it."
status: "Active (design, 2026-10-19)"
record: ../../client.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/client/DL-591.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-591
decision: "Saiph fetch is want-only (trees recursively, then blobs, with no have list); checkouts are sparse and either virtual (FUSE through go-fuse, with an overlay) or materialized; the filesystem monitor is the FUSE journal or inotify in saiphd; EdenFS is a design reference only."
status: "Active (design, 2026-10-19)"
record: ../../client.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/client/DL-592.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-592
decision: "A Saiph working copy sits on one changeset and is committed through server-side Commit; the saiph CLI shows change ids in jj's reverse hex, keeps a per-workspace op log with undo, keeps bookmarks local and shows a smartlog; jj as backend or client is rejected."
status: "Active (design, 2026-10-19)"
record: ../../client.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/client/DL-593.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-593
decision: "Saiph tokens are JWTs with iss, sub, aud, tenant, scope, exp and iat, at most one hour long; keys are discovered from the issuer URL; Kubernetes service-account tokens map to service:k8s/<ns>/<sa> in Issuer.Tenant; Compass mints ES256 tokens for agents, humans (device grant) and itself."
status: "Active (design, 2026-10-19)"
record: ../../client.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/client/DL-594.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-594
decision: "Agents hold no Saiph token: the vcs_* tools on a Saiph workspace go through the Runner's relay to saiphd, which adds the session's token; each repo's backend is derived from repoCutoverState and never stored; the git backend is unchanged."
status: "Active (design, 2026-10-19)"
record: ../../client.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/client/DL-595.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-595
decision: "A Compass session whose repos are all on Saiph has no GitHub egress and no GitHub credential."
status: "Active (design, 2026-10-19)"
record: ../../client.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/client/DL-596.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-596
decision: "Saiph CI gets source through the CSI driver saiph.rigel.build as an inline ephemeral volume with the pod's own token, and every Saiph client tier ships with a cap per layer, a paging budget alert and spend-cap rows."
status: "Active (design, 2026-10-19)"
record: ../../client.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/git-bridge/DL-621.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-621
decision: "Saiph's git export is a pure function and import round-trips: every imported git commit exports byte-identical, and the bridge proves it per batch and never force-pushes."
status: "Active (design, 2026-10-19)"
record: ../../git-bridge.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/git-bridge/DL-622.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-622
decision: "After a repo's switch to Saiph, GitHub main has one writer: a ruleset whose only bypass actor is the bridge's own App enforces it, and the bridge checks it before switching."
status: "Active (design, 2026-10-19)"
record: ../../git-bridge.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/git-bridge/DL-623.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-623
decision: "Saiph git import is trunk-only, first-parent diffed and refusing: it goes through store intake with CommitBatch, and unrepresentable history keeps the repo on git."
status: "Active (design, 2026-10-19)"
record: ../../git-bridge.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/git-bridge/DL-624.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-624
decision: "Saiph cutover is a per-repo state machine in Compass (GIT, IMPORTING, NATIVE_MIRRORED, NATIVE_ONLY); the backend is derived, and rollback from NATIVE_MIRRORED loses no landed history."
status: "Active (design, 2026-10-19)"
record: ../../git-bridge.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/git-bridge/DL-625.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-625
decision: "After cutover, allowlisted same-repo GitHub PRs become external Saiph review changes and land by merge; other PRs are closed with a comment."
status: "Active (design, 2026-10-19)"
record: ../../git-bridge.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/git-bridge/DL-626.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-626
decision: "The Saiph git bridge is its own binary, schema and GitHub App; it mints its own tokens and leaves RIG-5558 unchanged."
status: "Active (design, 2026-10-19)"
record: ../../git-bridge.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/merge-queue/DL-612.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-612
decision: "saiph-queue is its own service with the schema saiph_queue and one planner per repo under a lease; it reads review and is never called by it."
status: "Active (design, 2026-10-19)"
record: ../../merge-queue.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/merge-queue/DL-613.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-613
decision: "Saiph merge-queue lanes are not configured: two entries share a lane when their affected targets or changed paths meet; all, graph_changed and a .saiphqueue change are barriers."
status: "Active (design, 2026-10-19)"
record: ../../merge-queue.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/merge-queue/DL-614.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-614
decision: "A Saiph merge-queue batch is tested on a speculative projection of its lane, with a Zuul window per lane and at most batch_max entries."
status: "Active (design, 2026-10-19)"
record: ../../merge-queue.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/merge-queue/DL-615.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-615
decision: "The Saiph merge queue never reruns a target; a failure is judged by CI's flake quarantine, successor probes with flake rates as priors, and prefix bisection on changesets CI has not tested; INFRA holds a batch until Requeue."
status: "Active (design, 2026-10-19)"
record: ../../merge-queue.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/merge-queue/DL-616.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-616
decision: "A Saiph merge-queue batch lands by one UpdateRef with chain; a lost CAS rebases the batch onto the new trunk and retests only targets the trunk delta touches, with no retest when the graph is unchanged and they do not meet; at most 100 attempts."
status: "Active (design, 2026-10-19)"
record: ../../merge-queue.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/merge-queue/DL-617.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-617
decision: "Saiph merge-queue auto-rebase is Rebase with drop_empty; the queue fixes only trunk conflicts, with a deterministic classifier first and then one chat-completion call whose answer may only choose lines the two sides wrote, written by Rebase with resolutions and uploaded as a CONFLICT_FIX version that passes the same CI."
status: "Active (design, 2026-10-19)"
record: ../../merge-queue.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/merge-queue/DL-618.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-618
decision: "A Saiph merge-queue eject is one unresolved change-level comment with a typed reason and the conflict or failed targets attached, with the owner in attention."
status: "Active (design, 2026-10-19)"
record: ../../merge-queue.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/merge-queue/DL-619.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-619
decision: "Saiph merge-queue fixer spend has a per-call token cap and per-repo and per-tenant daily micro-USD caps, reserved before each call, plus a budget alert that pages Matt; the fixer stays off until they exist."
status: "Active (design, 2026-10-19)"
record: ../../merge-queue.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/merge-queue/DL-620.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-620
decision: "Saiph merge-queue policy is .saiphqueue at the trunk head, with a per-repo gate of pre (default) or post; operator caps can only be lowered."
status: "Active (design, 2026-10-19)"
record: ../../merge-queue.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/overview/DL-580.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-580
decision: "Two backends sit behind one agent vcs_* tool surface, chosen per repo: the RIG-5558 git backend ships unchanged for repos on GitHub, and Saiph serves Saiph repos through the saiph CLI, where agents have no GitHub egress and only trunk is mirrored to GitHub as derived git commits; the tools, the Runner backend pick and the web UI hooks stay in Compass, and Saiph stays in its own repo."
status: "Active (design, 2026-10-18)"
record: ../../README.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/review/DL-597.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-597
decision: "A Saiph review change is named by the store's 16-byte change_id; a version is an immutable changeset plus its base, numbered densely from 1; review owns versions and the store keeps none."
status: "Active (design, 2026-10-19)"
record: ../../review.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/review/DL-598.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-598
decision: "The Saiph stack graph is a DAG of open-change dependencies taken from changeset parents and kept apart from version history; each change is reviewed and approved alone and lands with or after what it sits on."
status: "Active (design, 2026-10-19)"
record: ../../review.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/review/DL-599.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-599
decision: "Saiph approval is four gates (LGTM, owner coverage from the owners list in .saiphacl, complete required checks, and .saiphreview rules); approvals carry only across message-only versions, trivial rebases and conflict fixes the policy allows."
status: "Active (design, 2026-10-19)"
record: ../../review.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/review/DL-600.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-600
decision: "Saiph review is its own service, saiph-review, serving saiph.v1.ReviewService from schema saiph_review; it learns of landings from the trunk ref log and never calls the queue, which pulls land units."
status: "Active (design, 2026-10-19)"
record: ../../review.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/review/DL-601.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-601
decision: "Compass keeps the Saiph review UI and agent tools, proxies ReviewService for the browser with a token it mints for the user, and tells an agent it is its turn with a home-channel message."
status: "Active (design, 2026-10-19)"
record: ../../review.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/store/DL-578.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-578
decision: "Saiph's store follows Scion: changesets hold ordered parents, a 16-byte change id and the files changed against the first parent, are created only by the server, and are encoded as deterministic CBOR with BLAKE2b-256 ids keyed per type; file contents live zstd-compressed in object storage; changesets, derived data, refs, the ref log and pins live in a metadata database (YugabyteDB YSQL for many servers, Postgres 16 or later on one node, one shared schema saiph); a ref moves only by a single-row compare-and-swap."
status: "Active (design, 2026-10-18)"
record: ../../store.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/store/DL-579.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-579
decision: "Saiph's server creates commits, rebases and merges; a conflict is a typed result (paths, jj-ordered terms, hunks) and is never stored; UpdateRef advances a ref by an ordered chain of changesets in one compare-and-swap; derived data (trees, commit graph, ACL manifest eager; path index and git commits on trunk; blame lazy) is a pure function of a changeset and its parents, written back to the database."
status: "Active (design, 2026-10-18)"
record: ../../store.md#decisions
---
6 changes: 6 additions & 0 deletions docs/designs/saiph/decisions/store/DL-581.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: DL-581
decision: "Saiph is its own repo and product, with its own Connect package saiph.v1, its own schema and tenant GUC, and per-tenant object keys; it reads the caller from an auth.Principal built from a verified issuer token (Compass is one issuer); per-directory ACLs are in-tree .saiphacl files, and a denied read answers NOT_FOUND."
status: "Active (design, 2026-10-18)"
record: ../../store.md#decisions
---
Loading
Loading