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