gunk-dev/the-valley

concepts.md

source28abc5737165main's published tip history
46.2 KiB · Rendered
1# Concepts and glossary
2
3the-valley separates software work into clear, composable pieces: changes with stable identity
4across revisions, check evidence signed over content trees, a pre-receive hook and integrator on the
5host, project storage outside `main` for records and the plan graph, and explicit principals and
6grants. Every section below states what a concept means first, then how git, Nix, and CUE implement
7it, and distinguishes what the code always enforces from what an instance configures and what is not
8built.
9
10## A change: ready, approve, submitted
11
12A **change** is one unit of proposed work with a stable identity across revisions. An author creates
13a change, revises it until it is complete, and marks it **ready** (`valley ready`) to put a specific
14version up for review. Each revision is a numbered version (`v1`, `v2`, …) that records the proposed
15source commit (`head`), title, branch name, and uploader; the latest version is the **active
16version**, and its **base** is the `main` commit that version was branched or rebased from
17(`git merge-base origin/main <head>`), which review and integration use to measure what the change
18modifies and whether `main` has moved since. If the author needs to revise further before the change
19lands, they can pause it back to `draft` (`valley unready`), or mark it `withdrawn`
20(`valley withdraw`) to abandon it; readying a `draft` or `withdrawn` change again at its active
21version's head re-readies that same version number without creating a new version.
22
23An operator lists ready changes with `valley pending` and inspects one with
24`valley review <change>`, which offers an interactive prompt. So a reviewer does not have to re-read
25an entire change from scratch after a rebase or revision, `valley review` compares the active
26version against its earlier **approved version** when one can be compared: if the file delta is
27unchanged (a clean restack), it prints a short summary with any landings between the two bases and
28pages nothing; if the version changed files, it pages the comparison (the files whose change
29differs, with the landings that also edited them, and the shown version's diff of those files, or,
30when a commit was edited, what it changes beyond the approved version carried onto main); and if
31there is no approved version or no comparison can be made, it pages the full diff (`[v]iew diff` is
32available at the prompt in every case). The operator approves the change with
33`valley approve <change>` (or by selecting `[a]pprove` in `valley review`), which reuses eligible
34evidence already on `origin` for the commit's content tree, runs and signs the required `command`
35checks, and writes an integration request binding that one exact commit. Approval and passing checks
36are separate. When a required `nix` check has no evidence on `origin` yet, the request is filed all
37the same. When evidence is published, an enabled integrator considers the request again. Landing
38still requires the change to apply cleanly and carry acceptable evidence for every required check.
39The operator can pass `--build-here` to build the missing `nix` evidence on this machine.
40
41Once the integrator verifies that commit's required check evidence and integrates it into `main`,
42the change version is **submitted**: `landed` when its commit is on `main`'s first-parent history
43with no merge commit above it, or `landed-recorded` when a single-parent commit on `main` carries a
44verified transfer statement, the integrator's records bind the version's head to that commit, and
45the head merges to the same tree. The record is the **landing record** for the head, or for a
46landing made before landing records existed, a `land` outcome record. The integrator lands every
47change as one single-parent commit of its own, so every change it lands reads `landed-recorded`. To
48keep operators and tooling from acting on a guess when a landing's evidence is incomplete or
49unverified, the CLI reports the version as **uncertain** whenever neither `landed` nor
50`landed-recorded` holds and the outcome record says `failed`, or says `land` after the request ref
51was consumed, or a landing record names the head (including when signer verification environment
52variables are unset for a recorded landing).
53
54_How git and Nix realize this:_ To give every change a stable identity across rebases and a short
55name for everyday CLI commands, each change has a 32-letter **Change ID** drawn from `k`–`z` and a
56short CLI **handle** — the shortest prefix (at least 4 letters) unique among changes currently
57recorded on `origin`, which can lengthen if a colliding Change ID is recorded later. Without
58`--stamp` or `--head`, `valley ready [<branch>]` records the remote branch tip (`origin/<branch>`),
59which must already be pushed to `origin`. For a change with no record yet whose local head commit is
60not on `origin`, `valley ready --stamp` amends the local commit with a `Change-Id: <id>` trailer and
61pushes the branch before writing `v1`. Across later revisions or rebases, `valley ready` keeps the
62same Change ID if the commit carries a `change-id` commit header (written by `jj`) or `Change-Id`
63trailer, or if you pass `--change <id>`. Change records live as `record.json` commits at
64`refs/the-valley/changes/main/<id>` (`valleyhook` accepts change records only for `target: "main"`),
65and approvals write an **integration request** ref at
66`refs/the-valley/integration-requests/<target>/c-<id>` (or `<branch>` with `/` replaced by `-` for
67an unrecorded branch). On the client, this flake's `valley` package (`nix shell .#valley` or
68`packages.<system>.valley`) wraps the `valley` command with `attest`, `cue`, `git`, `less` (for
69paging diffs and taking review notes), and `natscli`, and takes `ssh` and `coreutils` from `PATH`;
70`nix` with flakes enabled builds pure checks ([`nix/packages.nix`](../nix/packages.nix)).
71
72Follow [Authoring a change](./guide.md#authoring-a-change) to put these steps into practice,
73[Reviewing and approving changes](./guide.md#reviewing-and-approving-changes) to review one, or the
74[CLI reference](./reference.md#cli-reference) for exact flags and exit codes.
75
76## Checks and evidence
77
78Every change **requires** a set of checks determined by the files it modifies. So an instance can
79enforce baseline verification across every hosted project while letting individual repositories add
80stricter rules, two CUE policy layers govern verification in `valley checks`, `valley approve`, and
81the integrator: an **instance floor** (`policy/instance/`) required of every project the integrator
82judges on the host, and an optional **project policy** (`policy/project/`) that can only add checks
83or tighten rules, never weaken the floor. If a project has no `policy/project/` directory, the
84instance floor governs verification alone. To map changed files to the checks they require, policy
85groups file globs into **path classes**, and any changed path that matches no declared class falls
86under `unclassified` and requires the checks listed in `unclassified` (which may be empty). A path
87class can also declare checks in `follows`: a landing that touches the class sets those checks due
88on `main` without gating the change, and the host's check worker runs the pure (`nix`) checks among
89them on `main` when no ready change awaits checks. To express how far an approval may carry across a
90rebase, each path class can also declare a `carry` mode (`same-paths`, `same-class`, or `exact`);
91`valley checks` reports the composed carry mode, and `valley review` keeps a reviewer's answer when
92a restack adds a version during review and the mode allows it. Carrying an already filed approval by
93its mode is **not built** ([`schema/verification.cue`](../schema/verification.cue)).
94
95Checks come in two kinds: **pure checks**, which build Nix flake check targets via `nix build`
96(`runner: "nix"`, `<root>#checks.<system>.<attr>`, with sandboxing determined by the machine's Nix
97configuration), and **effectful checks**, which run commands (`runner: "command"`) that may touch
98external state and whose evidence is accepted only when its age is within a policy-defined
99`validity` window. To prove that a check passed on a specific source tree without re-running the
100check on the server, `valley approve` invokes `attest` for the checks it runs locally to produce
101**evidence**: a cryptographic **attestation** signed with the supplied SSH key (`--key` or
102`VALLEY_ATTEST_KEY`) over the content digest of the source tree (`valley-tree-v1`). On push,
103`valleyhook` verifies the note against the host's trusted signers and requires a verified signature
104matching the key hash in the ref name. A host with no trusted signers accepts no attestations. The
105integrator also checks the signer against its trusted `known-signers` file when verifying evidence.
106When `main` has moved ahead of a change's base, the integrator never re-executes checks itself;
107instead, it reuses existing evidence if the check transfers: a pure check transfers if the landed
108tree is identical or carries passing evidence of its own (`unmoved`), or if recomputing the check's
109Nix evaluation on the landed tree yields both the same input-closure digest (`valley-inputs-v1`) and
110the same Nix derivation digest (`closure`); an effectful check transfers if the landed tree carries
111passing evidence within the policy's `validity` window (`unmoved`), or (`untouched`) if the net diff
112on `main` between the attested base and current `main` tip (`base..tip`) touches none of the path
113classes that required that check for this change, the policy sets a non-zero `validity` window, and
114the attestation age is strictly within that window.
115
116_How git realizes this:_ Signed notes live under
117`refs/the-valley/attestations/<tree-digest>/<key-hash>`. On every landing, the integrator signs a
118**transfer statement** (`the-valley/integration/transfer/v1`, recording the landed tree, the
119attested base tree, the policy digest, and the per-check verdicts) and countersigns the
120contributor's notes. It then moves `main`, stores that signed evidence, writes the landing and
121outcome records, and deletes the request in one ref transaction, so all of them change or none does.
122Readers verify from the transfer statement that `main`'s new tree satisfied policy.
123
124Use [Client setup](./guide.md#client-setup) to configure signing,
125[Recovering from failure](./guide.md#recovering-from-failure) when a check or landing fails, or
126[Wire formats and JSON schemas](./reference.md#wire-formats-and-json-schemas) for attestation and
127digest formats.
128
129## The host, the hook, and the integrator
130
131A **valley host** is a server (configured on NixOS via `services.valley`) that stores repositories
132and enforces project rules. Like a valley, the host is the low place where streams of work meet. Two
133components guard it:
134
135- **The pre-receive hook (`valleyhook`)** inspects every SSH push before git accepts it
136 ([`valleyhook/policy.go`](../valleyhook/policy.go)). To let the host pause all incoming SSH pushes
137 during initialization or maintenance, the git user's login shell enforces a **push hold**. It
138 refuses every push across all projects whenever the sentinel file `${dataDir}/.valley-hold`
139 (default `/srv/git/.valley-hold`) is present. Whether a branch such as `refs/heads/main` is
140 protected is a **deployment choice** in `valley.cue`: if a project declares a `protection` block,
141 `protection.refs` defaults to `["refs/heads/main"]` and only principals listed in
142 `protection.writers` may push to those refs over SSH; if `protection.refs` matches
143 `refs/heads/main` and `protection.writers` is empty, no SSH push may update `main`, whereas a
144 project with no `protection` block leaves all branches open. Unprotected topic branches
145 (`refs/heads/*`) are open to any authorized key; outside `refs/heads/*`, the five admitted
146 `refs/the-valley/*` namespaces, and the exact `refs/the-valley/knots` ref, refs (including
147 `refs/tags/*`) require a project-level ref grant (`grants.<name>: {refs, writers}` in
148 `valley.cue`) unless categorically forbidden. On `refs/the-valley/*`, the hook enforces schema and
149 permission rules: any named principal may create a change record (becoming its `owner`); only the
150 change's `owner` or an `approve` grant holder may update a change record, except that a `restack`
151 grant holder may add a single version to a `ready` change keeping its active branch and title;
152 only an `approve` holder may delete a change record or write/delete integration requests; and
153 nobody may push to `integration-outcomes`, `integration-inputs`, `integration-landings` or
154 `projects`.
155- **The integrator** verifies approved changes and lands them onto `main`; it runs as an optional
156 host service (`services.valley.integrator.enable`). A push to the project starts a pass promptly,
157 and a recovery pass runs at a configurable interval (`services.valley.integrator.interval`,
158 default `15s`). On each pass, it deletes pending requests for changes that are currently
159 `withdrawn` and records `voided-withdrawn` (if a withdrawn change is readied again before that
160 pass runs, the old request remains standing and can land; to revoke an approval immediately, an
161 `approve` holder must delete the request ref). For each remaining request, the integrator refuses
162 if the request's commits include a merge (`refused-merge`) or a version head of a `draft` or
163 `withdrawn` change, or if a `c-<id>` request's change is not `ready` or does not list the
164 requested head among its versions (`refused-not-ready`). Otherwise it evaluates policy and signed
165 check evidence (and Nix closure equivalence when `main` has moved) and lands the change on `main`
166 via a local ref transaction (which runs on the host and bypasses `pre-receive`). Every change
167 lands as a **new single-parent commit** the integrator writes on top of `main`, with the approved
168 commit's tree when `main` has not moved since the change's base, and otherwise with the tree
169 `git merge-tree` builds. It re-reads the change records right before the transaction, though an
170 `unready` or `withdraw` push arriving in the narrow instant between that final read and the
171 transaction will not stop the landing. It writes an **outcome record** (`land`, `stale`, `reject`,
172 `refused-not-ready`, `refused-merge`, `voided-withdrawn`, or `failed`) at
173 `refs/the-valley/integration-outcomes/<target>/<change>`, an **inputs record** beside a standing
174 outcome at `refs/the-valley/integration-inputs/<target>/<change>`, and for each landing a
175 **landing record** at `refs/the-valley/integration-landings/<target>/<head>`.
176
177See [Project storage ref layout and bounds](./reference.md#project-storage-ref-layout-and-bounds)
178for every ref namespace, write rule, and size limit.
179
180## Records, project storage, the plan graph, and knots
181
182A repository has two parts: **the source** (`main` and release tags) and **project storage** (the
183operational records around the source: change records, check attestations, integration requests,
184check requests, integration outcomes, restack reports, and the plan graph). Keeping project storage
185outside `main` means updating a plan item, recording a check attestation, or marking a change ready
186never dirties `main` or triggers source-level rebuilds.
187
188Within project storage, the **plan graph** tracks what the project intends to do and why. Each item
189in the graph is a **knot** — named after the knotted cords used to keep records before writing. A
190knot has one of four types, with `owner` optional on every type
191([`knot/model.go`](../knot/model.go)):
192
193- **`outcome`** — a target result or piece of work to complete (`oc-*` in `outcomes/`, with state
194 `open`, `in-progress`, `done`, or `abandoned`); root `outcome` knots (those with no `parent`) are
195 displayed as milestones in `valley plan`.
196- **`bug`** — a defect to fix (`bd-*` in `bugs/`, with state `open` or `closed`).
197- **`idea`** — an exploration or proposal (`ida-*` in `ideas/`, with state `raw`, `exploring`,
198 `adopted`, `graduated`, `superseded`, or `discarded`); when `graduated`, its `graduated_into`
199 field names the local `outcome` or `question` it became.
200- **`question`** — an open decision work can wait on (`qn-*` in `questions/`, with state `open`,
201 `answered`, or `dropped`).
202
203To show how work breaks down, what blocks it, and which changes implement it, knots connect through
204`parent` edges (to a local `outcome`), `blocked_by` edges (on `outcome` and `bug`, naming local
205knots or `<project>:<id>` across projects), `graduated_into` links (on a `graduated` `idea`),
206`changes` links (`valley:<project>/<change-id>` on `outcome`, `bug`, and `question`), and `[[id]]`
207wiki-links in prose. Local `parent` edges and local `blocked_by` edges are each checked separately
208for cycles — so a parent `outcome` may be `blocked_by` one of its own child knots — while
209cross-project `blocked_by` references are checked for syntax only.
210
211_How git realizes this:_ Project storage lives under `refs/the-valley/*`, and knots live as Markdown
212files with canonical YAML frontmatter (`<type-dir>/<id>-<slug>.md`, plus comment files at
213`comments/<id>/<stamp>-<op>.md`) in a commit tree at `refs/the-valley/knots`. Knot and comment files
214are never deleted, and each write adds a commit to `refs/the-valley/knots`, so the ref's history
215keeps every earlier text of a knot and its comments. Because a plain `git clone` fetches only
216`refs/heads/*` and `refs/tags/*`, and the host's mirror publisher sends only `main` and tags
217(`refs/heads/main` and `refs/tags/*`), cloning from a push mirror (such as GitHub) does not fetch
218the host's plan graph or change records; running `valley plan` or `valley status` against a valley
219host clone fetches the `refs/the-valley/*` refs each command needs directly from `origin`.
220
221Read [Planning work with knots](./guide.md#planning-work-with-knots) to create and update the plan,
222or [Plan graph and knots](./reference.md#plan-graph-and-knots-refsthe-valleyknots) for the knot file
223and frontmatter contract.
224
225## Principals and grants
226
227A **principal** is a named actor — a human or an agent — authenticated by an SSH key when pushing
228over SSH, or identified by a cryptographic signing key when verifying check attestations. When an
229SSH key is tagged with a principal name in `authorized_keys`, the host passes that name to
230`valleyhook`; an untagged key in `services.valley.authorizedKeys` can still push to open topic
231branches and attestations as an anonymous pusher, but cannot write change records, restack reports,
232integration requests, or knots. A **grant** is a capability assigned to a principal at a named
233**boundary**. Two boundary grants govern `valleyhook` on `refs/the-valley/*`:
234
235- **`approve`** (also accepted as `request`) — allows a principal to write or delete integration
236 requests (`refs/the-valley/integration-requests/<target>/<change>`), update any change record, and
237 delete change records. The two names are one grant. A principal holding either holds it, and a
238 principal holding both holds it once. Who holds `approve` is a **deployment choice** (for example,
239 a deployment may give it to the human operator alone).
240- **`restack`** — allows a principal to push restack reports
241 (`refs/the-valley/restack/<target>/<id>`) and add a single restacked version to another owner's
242 `ready` change while keeping its active branch and title. The restacker (`valley-restacker`) needs
243 this grant, and its principal holds it only when the host assigns it explicitly: the host's
244 `grants.restack` list is empty by default. The restacker runs on a host under
245 `services.valley.restacker` (`implemented`; enabling it, enrolling its principal, and granting it
246 `restack` are a **deployment choice**).
247
248A **read grant** is the instance's consent for a principal to read a project at an edge, the web
249server a valley host publishes to. Evaluating read access takes two consents (`implemented`): the
250project's own `policy/read` names the principal as a reader, and the instance's registry grants the
251principal read access to that project, or to all projects, at the edge. **`anyone`** is the reader
252who presents no credential. It has its own entry in the registry with only read grants and no SSH
253key, whereas an untagged SSH key in `authorizedKeys` pushes as an anonymous pusher. A project's
254**effective readers** at an edge are the principals that both consents authorize there, including
255`anyone`, and a project is **public** at an edge when both consents authorize `anyone` to read it
256there. The consent evaluator treats the operator the same as any other named principal
257(`implemented`). The web publisher exports every project with an effective reader, and its
258authorization names each project's effective readers (`implemented`). A reader can sign in at the
259edge with a read link, and `valley-web` serves that reader's requests as the link's principal
260(`implemented`; see [Read access](./architecture.md#read-access)).
261
262_How Nix and CUE realize this:_ To manage principals and grants as reviewed changes in the instance
263repository rather than only through NixOS rebuilds, a host can enable
264`services.valley.identity.enable` to compile `identity/*.cue` from the instance repository into
265`/var/lib/valley-identity/` whenever a registry change lands, or declare keys, grants, and trusted
266signers statically in NixOS (`services.valley.authorizedKeys`, `services.valley.grants`,
267`services.valley.integrator.knownSignersFile`; compiled `authorized_keys` and `grants` supplement
268any static `authorizedKeys` and `grants`, while compiled `known-signers` replaces
269`services.valley.integrator.knownSignersFile`, which must be unset when both `identity.enable` and
270`integrator.enable` are true). In `identity/*.cue`, a boundary has one of five kinds
271([`schema/identity.cue`](../schema/identity.cue)): `git-push` authorizes SSH pushes (compiled into
272`authorized_keys`), `approve` (also accepted as `request`) and `restack` authorize integration
273requests and restack updates (compiled into `grants`), `edge-read` names a web destination for read
274grants (read by `valley-web-publish` and `valley-read-coverage`), and `registry` is checked by the
275identity compiler, which rejects compiling a registry with no unexpired principal holding a
276`registry` grant (`governanceOrphaned`) — neither `valleyhook` nor the integrator enforces
277`registry` grants on pushes or landings.
278
279Follow [Running a valley host](./guide.md#running-a-valley-host) to configure a deployment, or
280[CUE configuration schemas](./reference.md#cue-configuration-schemas) for the host and identity
281schema definitions.
282
283## Glossary
284
285| Term | Plain definition | Full explanation |
286| :--------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
287| **Active version** | The current version (`vN`) of a change up for review or revision (`versions[active-1]` in the change record, which is always the highest-numbered version `versions[len-1]`). | [A change: ready, approve, submitted](#a-change-ready-approve-submitted), [Change records](./architecture.md#change-records) |
288| **Approved version** | In `valley review`, the greatest prior version of a revised change whose exact head commit carries an unambiguous integration request or `land`, `stale`, or `reject` outcome record on `origin` (never falling back to an older version if the greatest version with evidence is ambiguous). | [A change: ready, approve, submitted](#a-change-ready-approve-submitted), [Review against the approved version](./architecture.md#review-against-the-approved-version) |
289| **Attestation** | A signed statement recording that a check passed on a specific content tree (`valley-tree-v1`), formatted as `the-valley/attestation/v1` and stored under `refs/the-valley/attestations/<tree-digest>/<key-hash>`. | [Checks and evidence](#checks-and-evidence), [Signed notes](./reference.md#signed-notes-and-attestation-statement-the-valleyattestationv1) |
290| **Base** | The `main` commit a change version was branched or rebased from (`git merge-base origin/main <head>`). | [A change: ready, approve, submitted](#a-change-ready-approve-submitted), [Review against the approved version](./architecture.md#review-against-the-approved-version) |
291| **Boundary** | A named scope in the identity registry (`kind: "git-push"`, `"approve"`, `"request"`, `"restack"`, `"registry"`, or `"edge-read"`) where a principal holds a grant. | [Principals and grants](#principals-and-grants), [Identity registry](./reference.md#identity-registry-schemaidentitycue) |
292| **Change** | A tracked unit of proposed work with a stable 32-letter Change ID (`k`–`z`), moving through `draft`, `ready`, or `withdrawn` states across numbered versions (`v1`, `v2`, …) until submitted to `main`. | [A change: ready, approve, submitted](#a-change-ready-approve-submitted), [Change records](./architecture.md#change-records) |
293| **Change ID** | A 32-character identifier drawn from letters `k` through `z` (`[k-z]{32}`) that uniquely names a change across revisions and rebases. | [A change: ready, approve, submitted](#a-change-ready-approve-submitted), [Naming rules](./reference.md#naming-changes-handles-branches-and-requests) |
294| **Change record** | The record tracking a change's target branch (`main`), owner, state, and version history (`valley-change-record/v1`, stored as `record.json` in a commit at `refs/the-valley/changes/main/<id>`). | [A change: ready, approve, submitted](#a-change-ready-approve-submitted), [Change record](./reference.md#change-record-valley-change-recordv1) |
295| **Check** | An executable verification step that a change requires based on the path classes its diff touches (including `unclassified` for paths matching no declared class). | [Checks and evidence](#checks-and-evidence), [Verification policy](./reference.md#verification-policy-schemaverificationcue) |
296| **Draft** | A change state meaning work is in progress or paused (`valley unready`) and not currently up for integration. | [A change: ready, approve, submitted](#a-change-ready-approve-submitted), [Change records](./architecture.md#change-records) |
297| **Effectful check** | A check (`runner: "command"`) that may depend on external state; its evidence transfers across `main` movement if the landed tree has valid passing evidence (`unmoved`), or (`untouched`) if `base..tip` on `main` touches none of the classes requiring it and its age is within `validity`. | [Checks and evidence](#checks-and-evidence), [Policy](./architecture.md#policy) |
298| **Evidence** | Signed check attestations stored in project storage that prove a change's required checks passed. | [Checks and evidence](#checks-and-evidence), [Evidence: attest and notes](./architecture.md#evidence-attest-and-notes) |
299| **Grant** | A capability (`approve`, also accepted as `request`, `restack`, `git-push`, `registry`, `edge-read`, or `observe`/`report` in `services.valley.telemetry`) assigned to a principal in NixOS or the identity registry, or a project ref grant (`grants.<name>`) in `valley.cue`. | [Principals and grants](#principals-and-grants), [Host configuration](./reference.md#host-configuration-schemavalleycue) |
300| **Group** | A set of projects declared in `valley.cue` under a permanent identifier, with a URL `name` and optional `aliases`. Every web URL for a project in the group starts with `/<group>/<project>/…`, and each group alias redirects to `<group>`. Group members and stewards are `not built`. | [Groups and web URLs](./architecture.md#groups-and-web-urls), [Host configuration](./reference.md#host-configuration-schemavalleycue) |
301| **Handle** | The shortest prefix of a Change ID (at least 4 letters) unique among changes currently recorded on `origin`; it can lengthen if a colliding Change ID is recorded later. | [A change: ready, approve, submitted](#a-change-ready-approve-submitted), [Naming rules](./reference.md#naming-changes-handles-branches-and-requests) |
302| **Identity registry** | The declarative source of principals, keys, and boundary grants (`identity/*.cue` in the instance repository) that a host can compile (`services.valley.identity.enable`) into SSH `authorized_keys`, `known-signers`, and `grants`. | [Principals and grants](#principals-and-grants), [Identity registry](./reference.md#identity-registry-schemaidentitycue) |
303| **Instance** | A deployment of one or more projects governed by a shared floor verification policy and identity configuration. | [Checks and evidence](#checks-and-evidence), [Policy](./architecture.md#policy) |
304| **Instance floor** | The mandatory baseline verification policy (`policy/instance/`) that the integrator and CLI check tools require every project in an instance to satisfy; project policy (`policy/project/`) is optional and can only narrow (strengthen) the floor. | [Checks and evidence](#checks-and-evidence), [Verification policy](./reference.md#verification-policy-schemaverificationcue) |
305| **Integration request** | The record written by an `approve` grant holder (`valley approve`) authorizing the integrator to verify and land one exact commit onto `<target>` (such as `main`), stored as a commit ref at `refs/the-valley/integration-requests/<target>/<change>`. | [A change: ready, approve, submitted](#a-change-ready-approve-submitted), [Ref layout](./reference.md#project-storage-ref-layout-and-bounds) |
306| **Integrator** | The optional host service (`services.valley.integrator.enable`) that reads integration requests when a push wakes it and at a recovery interval (default `15s`), verifies policy and check evidence, lands passing ready changes onto `main`, writes transfer statements, and records outcomes. | [The host, the hook, and the integrator](#the-host-the-hook-and-the-integrator), [The integrator](./architecture.md#the-integrator) |
307| **Knot** | A single item in a project's plan graph — typed as `outcome` (`oc-*`), `bug` (`bd-*`), `idea` (`ida-*`), or `question` (`qn-*`) — stored as `<type-dir>/<id>-<slug>.md` under `refs/the-valley/knots`. | [Records, project storage, the plan graph, and knots](#records-project-storage-the-plan-graph-and-knots), [Plan graph and knots](./reference.md#plan-graph-and-knots-refsthe-valleyknots) |
308| **Landed / Landed-recorded** | The two states of a submitted change version: `landed` when its commit is on `main`'s first-parent history with no merge commit above it; `landed-recorded` when a single-parent commit on `main` carries a verified transfer statement, the landing record (or, for an older landing, the `land` outcome record) binds that version's head to it, and the head merges to the same tree. | [A change: ready, approve, submitted](#a-change-ready-approve-submitted), [The integrator](./architecture.md#the-integrator) |
309| **Landing record** | The integrator's record that one head landed, naming the commit it landed as and the request name it landed under, stored as a commit at `refs/the-valley/integration-landings/<target>/<head>`; a later landing under the same request name leaves it in place. | [The host, the hook, and the integrator](#the-host-the-hook-and-the-integrator) |
310| **Outcome record** | The integrator's recorded result for an integration request (`land`, `stale`, `reject`, `refused-not-ready`, `refused-merge`, `voided-withdrawn`, or `failed`), stored as a single-line blob at `refs/the-valley/integration-outcomes/<target>/<change>`. | [The host, the hook, and the integrator](#the-host-the-hook-and-the-integrator), [Outcome record](./reference.md#integrator-outcome-record-refsthe-valleyintegration-outcomestargetrequest) |
311| **Path class** | A named group of file glob patterns in verification policy mapped to the checks required when a change modifies matching files and the checks in `follows` set due on `main` after it lands (with unmatched paths falling into `unclassified`). | [Checks and evidence](#checks-and-evidence), [Verification policy](./reference.md#verification-policy-schemaverificationcue) |
312| **Plan graph** | The directed graph of knots stored at `refs/the-valley/knots` and viewed with `valley plan`; local `parent` and local `blocked_by` edges are each checked separately for cycles. | [Records, project storage, the plan graph, and knots](#records-project-storage-the-plan-graph-and-knots), [Plan graph and knots](./reference.md#plan-graph-and-knots-refsthe-valleyknots) |
313| **Principal** | A named human, machine, or service identity (or `anyone` for an unauthenticated web reader) holding grants and, for non-`edge-read` boundaries, SSH public keys or attestation signing keys. | [Principals and grants](#principals-and-grants), [Identity](./architecture.md#identity) |
314| **Project storage** | Operational records kept outside `main` on a valley host — change records, attestations, integration requests, integration outcomes, inputs and landings, restack reports, and knots under `refs/the-valley/*` (not sent by the host's mirror publisher or fetched by a plain `git clone`). | [Records, project storage, the plan graph, and knots](#records-project-storage-the-plan-graph-and-knots), [Ref layout](./reference.md#project-storage-ref-layout-and-bounds) |
315| **Pure check** | A Nix flake check (`runner: "nix"`, built via `nix build`) whose evidence never expires with time and transfers across `main` movement if the landed tree is identical or carries passing evidence of its own (`unmoved`), or if both its input-closure digest (`valley-inputs-v1`) and derivation digest match (`closure`). | [Checks and evidence](#checks-and-evidence), [Policy](./architecture.md#policy) |
316| **Push hold** | A host-wide pause on incoming SSH pushes across all projects, active while the sentinel file `${dataDir}/.valley-hold` (default `/srv/git/.valley-hold`) is present. | [The host, the hook, and the integrator](#the-host-the-hook-and-the-integrator), [valley-init and the push hold](./architecture.md#valley-init-and-the-push-hold) |
317| **Ready** | The change state set by `valley ready`, declaring that the active version is complete and awaiting operator review and approval. | [A change: ready, approve, submitted](#a-change-ready-approve-submitted), [Change records](./architecture.md#change-records) |
318| **Restack report** | A record of an automated restack outcome for a change, displayed by `valley status` and `valley pending` and validated by `valleyhook` (`valley-restack-report/v1`, stored as `report.json` in a commit at `refs/the-valley/restack/<target>/<id>`, written by `valley-restacker`). | [The host, the hook, and the integrator](#the-host-the-hook-and-the-integrator), [Restack report](./reference.md#restack-report-valley-restack-reportv1) |
319| **Submitted** | A change version that has been integrated into `main` (either `landed` or `landed-recorded`). | [A change: ready, approve, submitted](#a-change-ready-approve-submitted), [The integrator](./architecture.md#the-integrator) |
320| **Transfer statement** | A signed attestation (`the-valley/integration/transfer/v1`) signed by the integrator before a landing and stored in the landing's ref transaction, one per landed commit, binding the landed tree and commit to the attested base tree, policy digest, and per-check verdicts. | [Checks and evidence](#checks-and-evidence), [Transfer statement](./reference.md#integrator-transfer-statement-the-valleyintegrationtransferv1) |
321| **Uncertain** | The landing state reported when neither `landed` nor `landed-recorded` holds and either the outcome record says `failed`, or it says `land` while the request ref was consumed, or a landing record names the head (or signer verification environment variables are unset for a recorded landing). | [A change: ready, approve, submitted](#a-change-ready-approve-submitted), [Listing changes](./architecture.md#listing-changes) |
322| **`valley-tree-v1`** | A content digest of a source tree independent of git commit metadata (remaining identical across commit amends or rebases only when the resulting tree's contents, paths, and modes are unchanged), computed with SHA-256 over a canonical manifest of files, executable bits, and symlinks (`<mode> <sha256> <path-len> <path>`). | [Checks and evidence](#checks-and-evidence), [Canonical digest manifests](./reference.md#canonical-digest-manifests-valley-tree-v1-valley-inputs-v1-valley-delta-v1) |
323| **`valleyhook`** | The Go pre-receive hook binary that validates every SSH push to a valley host against ref protection, grants, and record/knot schemas. | [The host, the hook, and the integrator](#the-host-the-hook-and-the-integrator), [Ref layout](./reference.md#project-storage-ref-layout-and-bounds) |
324| **Web name** | The second segment of a project's web URLs, `/<group>/<web name>/…`. It defaults to the project's identifier unless `valley.cue` sets `name`, and it must be unique within the project's group. When a project's web name changes, its old web names in `formerNames` redirect to the new web name. | [Groups and web URLs](./architecture.md#groups-and-web-urls), [Host configuration](./reference.md#host-configuration-schemavalleycue) |
325| **Withdrawn** | A change state set by `valley withdraw`, taking a change off the review queue; the integrator deletes pending requests for a withdrawn change on its next pass if the change is still withdrawn. | [A change: ready, approve, submitted](#a-change-ready-approve-submitted), [Change records](./architecture.md#change-records) |