| 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 | yet 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** ([change/record.go:19-33](../change/record.go), [97-120](../change/record.go)), and the |
| 17 | `main` commit that version was branched or rebased from (`git merge-base origin/main <head>`) is its |
| 18 | **base**. If the author needs to revise further before the change lands, they can pause it back to |
| 19 | `draft` (`valley unready`), or mark it `withdrawn` (`valley withdraw`) to abandon it; readying a |
| 20 | `draft` or `withdrawn` change again at its active version's head re-readies that same version number |
| 21 | without creating a new version ([status/ready.go:223-232](../status/ready.go), |
| 22 | [valleyhook/record.go:281-319](../valleyhook/record.go)). |
| 23 | |
| 24 | An operator inspects a ready change with `valley review <change>`, which offers an interactive |
| 25 | prompt. When the change was revised after an earlier approval, `valley review` compares the active |
| 26 | version against that **approved version** ([status/compare.go:1-46](../status/compare.go), |
| 27 | [bin/valley:968-1033](../bin/valley)): if the file delta is unchanged (a clean restack), it prints a |
| 28 | short summary with any landings between the two bases and pages nothing; if the version changed |
| 29 | files, it pages the comparison (the files whose change differs, the range-diff between the two |
| 30 | versions, and the shown version's diff of those files); and if there is no approved version or no |
| 31 | comparison can be made, it pages the full diff (`[v]iew full diff` is available at the prompt in |
| 32 | every case). The operator approves the change with `valley approve <change>` (or by selecting |
| 33 | `[a]pprove` in `valley review`), which runs and signs all required checks |
| 34 | ([attest/run.go:85](../attest/run.go)) and writes an integration request binding that one exact |
| 35 | commit. |
| 36 | |
| 37 | Once the integrator verifies that commit's required check evidence and integrates it into `main`, |
| 38 | the change version is **submitted**: `landed` when its commit is on `main`'s first-parent history |
| 39 | with no merge commit above it, or `landed-recorded` when the integrator merged it onto a newer |
| 40 | `main` as a single-parent commit carrying a verified transfer statement and a `land` outcome record |
| 41 | that merges to the same tree ([rebase/snapshot.go:10-34](../rebase/snapshot.go), |
| 42 | [164-191](../rebase/snapshot.go), [242-299](../rebase/snapshot.go)). If neither `landed` nor |
| 43 | `landed-recorded` holds and the outcome record says `failed`, or says `land` after the request ref |
| 44 | was consumed (including when signer verification environment variables are unset for a merged |
| 45 | landing), the CLI reports the state as **uncertain** so no tooling acts on a guess |
| 46 | ([rebase/snapshot.go:250-255](../rebase/snapshot.go)). |
| 47 | |
| 48 | _How git realizes this:_ Each change has a 32-letter **Change ID** drawn from `k`–`z` |
| 49 | ([change/id.go:19-46](../change/id.go)) and a short CLI **handle** — the shortest prefix (at least 4 |
| 50 | letters) unique among changes currently recorded on `origin`, which can lengthen if a colliding |
| 51 | Change ID is recorded later ([change/id.go:92-112](../change/id.go)). Without `--stamp` or `--head`, |
| 52 | `valley ready [<branch>]` records the remote branch tip (`origin/<branch>`), which must already be |
| 53 | pushed to `origin` ([status/ready.go:146-165](../status/ready.go)). For a brand-new change |
| 54 | (`before == nil`) whose local head commit is not yet on `origin`, `valley ready --stamp` amends the |
| 55 | local commit with a `Change-Id: <id>` trailer and pushes the branch before writing `v1` |
| 56 | ([status/ready.go:192-204](../status/ready.go), [451-453](../status/ready.go)). Across later |
| 57 | revisions or rebases, `valley ready` keeps the same Change ID if the commit carries a `change-id` |
| 58 | commit header (written by `jj`) or `Change-Id` trailer, or if you pass `--change <id>` |
| 59 | ([status/ready.go:386-415](../status/ready.go)). Change records live as `record.json` commits at |
| 60 | `refs/the-valley/changes/main/<id>` (`valleyhook` accepts change records only for `target: "main"`; |
| 61 | [change/id.go:15-30](../change/id.go), [valleyhook/record.go:188-193](../valleyhook/record.go)), and |
| 62 | approvals write an **integration request** ref at |
| 63 | `refs/the-valley/integration-requests/<target>/c-<id>` (or `<branch>` with `/` replaced by `-` for |
| 64 | an unrecorded branch; [valleyhook/policy.go:37-39](../valleyhook/policy.go)). |
| 65 | |
| 66 | ## Checks and evidence |
| 67 | |
| 68 | Every change **requires** a set of checks determined by the files it modifies. Two CUE policy layers |
| 69 | govern verification in `valley checks`, `valley approve`, and the integrator: an **instance floor** |
| 70 | (`policy/instance/`) required of every project the integrator judges on the host, and an optional |
| 71 | **project policy** (`policy/project/`) that can only add checks or tighten rules, never weaken the |
| 72 | floor ([composed/composed.go:46-106](../composed/composed.go), |
| 73 | [integrator/policy.go:81-121](../integrator/policy.go)). If a project has no `policy/project/` |
| 74 | directory, the instance floor governs verification alone |
| 75 | ([integrator/policy.go:21-23](../integrator/policy.go)). Policy maps file globs to **path classes**, |
| 76 | and any changed path that matches no declared class falls under `unclassified` and requires its |
| 77 | checks ([schema/verification.cue:62-67](../schema/verification.cue), |
| 78 | [integrator/policy.go:273-276](../integrator/policy.go)). Policy can also declare a `carry` mode |
| 79 | (`same-paths`, `same-class`, or `exact`) on each path class; `valley checks` reports the composed |
| 80 | carry mode, while acting on `carry` to carry approval automatically across restacks is **not built |
| 81 | yet** ([schema/verification.cue:300-308](../schema/verification.cue), |
| 82 | [docs/architecture.md:1808](./architecture.md#policy)). |
| 83 | |
| 84 | Checks come in two kinds: **pure checks** (`runner: "nix"`), which run `nix build` on a flake check |
| 85 | attribute (`<root>#checks.<system>.<attr>`; [attest/check.go:138](../attest/check.go), relying on |
| 86 | the machine's Nix configuration for sandboxing), and **effectful checks** (`runner: "command"`), |
| 87 | which run commands that may touch external state and carry a policy-defined `validity` time window. |
| 88 | Running a check via `attest` (invoked during `valley approve`) produces **evidence**: a |
| 89 | cryptographic **attestation** signed with the supplied SSH key (`--key` or `VALLEY_ATTEST_KEY`) over |
| 90 | the content digest of the source tree (`valley-tree-v1`); `valleyhook` verifies that the signature |
| 91 | matches the note's self-declared key hash on push, and the integrator checks that the signer appears |
| 92 | in its trusted `known-signers` file when verifying evidence. When `main` has moved ahead of a |
| 93 | change's base, the integrator never re-executes checks itself; instead, it reuses existing evidence |
| 94 | if the check transfers: a pure check transfers if the landed tree is identical (`unmoved`) or if |
| 95 | recomputing the check's Nix evaluation on the landed tree yields both the same input-closure digest |
| 96 | (`valley-inputs-v1`) and the same Nix derivation digest (`closure`; |
| 97 | [integrator/refs.go:388-390](../integrator/refs.go), |
| 98 | [integrator/verdict/verdict.go:406-417](../integrator/verdict/verdict.go)); an effectful check |
| 99 | transfers (`untouched`) only if the net diff on `main` between the attested base and current `main` |
| 100 | tip (`base..tip`) touches none of the path classes that required that check for this change, the |
| 101 | policy sets a non-zero `validity` window, and the attestation age is strictly within that window |
| 102 | ([integrator/refs.go:377-382](../integrator/refs.go), |
| 103 | [integrator/verdict/verdict.go:425-440](../integrator/verdict/verdict.go)). |
| 104 | |
| 105 | _How git realizes this:_ Signed notes live under |
| 106 | `refs/the-valley/attestations/<tree-digest>/<key-hash>`. After `git update-ref` advances `main` on a |
| 107 | landing — whether fast-forward or merged onto a newer `main` — the integrator countersigns the |
| 108 | contributor's notes and writes a signed **transfer statement** |
| 109 | (`the-valley/integration/transfer/v1`) recording the landed tree, the attested base tree, the policy |
| 110 | digest, and the per-check verdicts ([integrator/refs.go:465-515](../integrator/refs.go), |
| 111 | [integrator/transfer.go:43-97](../integrator/transfer.go)). Because those writes follow `update-ref` |
| 112 | rather than sharing an atomic multi-ref transaction, a failure after `update-ref` leaves `main` |
| 113 | advanced and causes the landing to report as `uncertain` until reconciled. |
| 114 | |
| 115 | ## The host, the hook, and the integrator |
| 116 | |
| 117 | A **valley host** is a server (configured on NixOS via `services.valley`) that stores repositories |
| 118 | and enforces project rules. Like a valley, the host is the low place where streams of work meet. Two |
| 119 | components guard it: |
| 120 | |
| 121 | - **The pre-receive hook (`valleyhook`)** inspects every SSH push before git accepts it |
| 122 | ([valleyhook/policy.go:88-221](../valleyhook/policy.go)). If the **push hold** sentinel file |
| 123 | (`${dataDir}/.valley-hold`, default `/srv/git/.valley-hold`) is present on the host, the hook |
| 124 | refuses all pushes across all projects until the hold is cleared |
| 125 | ([nix/valley-host.nix:489-495](../nix/valley-host.nix)). Whether a branch such as |
| 126 | `refs/heads/main` is protected is a **deployment choice** in `valley.cue`: if a project declares a |
| 127 | `protection` block, `protection.refs` defaults to `["refs/heads/main"]` and only principals listed |
| 128 | in `protection.writers` may push to those refs over SSH; if `protection.refs` matches |
| 129 | `refs/heads/main` and `protection.writers` is empty, no SSH push may update `main`, whereas a |
| 130 | project with no `protection` block leaves all branches open |
| 131 | ([valleyhook/policy.go:12-16](../valleyhook/policy.go), [186-188](../valleyhook/policy.go)). |
| 132 | Unprotected topic branches (`refs/heads/*`) are open to any authorized key; refs outside |
| 133 | `refs/heads/*` and the four open `refs/the-valley/*` namespaces (including `refs/tags/*`) are |
| 134 | closed by default unless authorized by a project-level ref grant (`grants.<name>: {refs, writers}` |
| 135 | in `valley.cue`; [valleyhook/policy.go:18-24](../valleyhook/policy.go), |
| 136 | [139-145](../valleyhook/policy.go), [199-219](../valleyhook/policy.go)). On `refs/the-valley/*`, |
| 137 | the hook enforces schema and permission rules: any named principal may create a change record |
| 138 | (becoming its `owner`); only the change's `owner` or a `request` grant holder may update a change |
| 139 | record, except that a `restack` grant holder may add a single version to a `ready` change keeping |
| 140 | its active branch and title ([valleyhook/record.go:160-198](../valleyhook/record.go), |
| 141 | [264-272](../valleyhook/record.go)); only a `request` holder may delete a change record or |
| 142 | write/delete integration requests ([valleyhook/policy.go:151-158](../valleyhook/policy.go), |
| 143 | [valleyhook/record.go:361-370](../valleyhook/record.go)); and nobody may push to |
| 144 | `integration-outcomes` or `projects` ([valleyhook/policy.go:147-150](../valleyhook/policy.go)). |
| 145 | - **The integrator** is an optional host service (`services.valley.integrator.enable`) that runs on |
| 146 | a configurable timer (`services.valley.integrator.interval`, default `15s`; |
| 147 | [nix/valley-host.nix:1220-1230](../nix/valley-host.nix)). On each pass, it deletes pending |
| 148 | requests for changes that are currently `withdrawn` and records `voided-withdrawn` (if a withdrawn |
| 149 | change is readied again before that pass runs, the old request remains standing and can land; to |
| 150 | revoke an approval immediately, a `request` holder must delete the request ref; |
| 151 | [status/ready.go:350-355](../status/ready.go), [integrator/refs.go:118](../integrator/refs.go), |
| 152 | [integrator/records.go:385-442](../integrator/records.go)). For each remaining request, the |
| 153 | integrator refuses if the request's commits include a merge (`refused-merge`) or a version head of |
| 154 | a `draft` or `withdrawn` change, or if a `c-<id>` request's change is not `ready` or does not list |
| 155 | the requested head among its versions (`refused-not-ready`; |
| 156 | [integrator/records.go:286-320](../integrator/records.go), [454-466](../integrator/records.go)). |
| 157 | Otherwise it evaluates policy and signed check evidence (and Nix closure equivalence when `main` |
| 158 | has moved) and lands the change on `main` via local `git update-ref` (which runs on the host and |
| 159 | bypasses `pre-receive`). If `main` has not moved since the change's base, it advances `main` |
| 160 | directly to the approved commit; if `main` has moved, it merges the tree via `git merge-tree` and |
| 161 | creates a **new single-parent commit** on top of `main` |
| 162 | ([integrator/refs.go:399-439](../integrator/refs.go)). It re-reads the change records right before |
| 163 | advancing `main`, though an `unready` or `withdraw` push arriving in the narrow instant between |
| 164 | that final read and `update-ref` will not stop the landing |
| 165 | ([integrator/refs.go:475-490](../integrator/refs.go)). Finally, it writes an **outcome record** |
| 166 | (`land`, `stale`, `reject`, `refused-not-ready`, `refused-merge`, `voided-withdrawn`, or `failed`) |
| 167 | at `refs/the-valley/integration-outcomes/<target>/<change>` |
| 168 | ([integrator/refs.go:43-44](../integrator/refs.go), |
| 169 | [rebase/outcome.go:10-52](../rebase/outcome.go)). |
| 170 | |
| 171 | ## Records, project storage, the plan graph, and knots |
| 172 | |
| 173 | A repository has two parts: **the source** (`main` and release tags) and **project storage** (the |
| 174 | operational records around the source: change records, check attestations, integration requests, |
| 175 | integration outcomes, restack reports, and the plan graph). Keeping project storage outside `main` |
| 176 | means updating a plan item, recording a check attestation, or marking a change ready never dirties |
| 177 | `main` or triggers source-level rebuilds. |
| 178 | |
| 179 | Within project storage, the **plan graph** tracks what the project intends to do and why. Each item |
| 180 | in the graph is a **knot** — named after the knotted cords used to keep records before writing. A |
| 181 | knot has one of four types, with `owner` optional on every type |
| 182 | ([knot/model.go:19-139](../knot/model.go)): |
| 183 | |
| 184 | - **`outcome`** (`oc-*` in `outcomes/`) — a target result or piece of work to complete (`open`, |
| 185 | `in-progress`, `done`, `abandoned`); root `outcome` knots (those with no `parent`) are displayed |
| 186 | as milestones in `valley plan` ([status/plan.go:6-7](../status/plan.go)). |
| 187 | - **`bug`** (`bd-*` in `bugs/`) — a defect to fix (`open`, `closed`). |
| 188 | - **`idea`** (`ida-*` in `ideas/`) — an exploration or proposal (`raw`, `exploring`, `adopted`, |
| 189 | `graduated`, `superseded`, `discarded`); when `graduated`, its `graduated_into` field names the |
| 190 | local `outcome` or `question` it became ([knot/model.go:130-132](../knot/model.go), |
| 191 | [knot/graph.go:395-404](../knot/graph.go)). |
| 192 | - **`question`** (`qn-*` in `questions/`) — an open decision work can wait on (`open`, `answered`, |
| 193 | `dropped`). |
| 194 | |
| 195 | Knots connect through `parent` edges (to a local `outcome`), `blocked_by` edges (on `outcome` and |
| 196 | `bug`, naming local knots or `<project>:<id>` across projects), `graduated_into` links (on a |
| 197 | `graduated` `idea`), `changes` links (`valley:<project>/<change-id>` on `outcome`, `bug`, and |
| 198 | `question`), and `[[id]]` wiki-links in prose ([knot/model.go:84-139](../knot/model.go), |
| 199 | [knot/graph.go:376-409](../knot/graph.go)). Local `parent` edges and local `blocked_by` edges are |
| 200 | each checked separately for cycles — so a parent `outcome` may be `blocked_by` one of its own child |
| 201 | knots — while cross-project `blocked_by` references are checked for syntax only |
| 202 | ([knot/graph.go:376-470](../knot/graph.go)). |
| 203 | |
| 204 | _How git realizes this:_ Project storage lives under `refs/the-valley/*`, and knots live as Markdown |
| 205 | files with canonical YAML frontmatter (`<type-dir>/<id>-<slug>.md`, plus append-only comments at |
| 206 | `comments/<id>/<stamp>-<op>.md`) in a commit tree at `refs/the-valley/knots` |
| 207 | ([knot/model.go:46-77](../knot/model.go), [knot/graph.go:45-64](../knot/graph.go)). Because a plain |
| 208 | `git clone` fetches only `refs/heads/*` and `refs/tags/*`, and the host's mirror publisher sends |
| 209 | only `main` and tags (`refs/heads/main` and `refs/tags/*`; |
| 210 | [nix/valley-host.nix:252-265](../nix/valley-host.nix)), cloning from a push mirror (such as GitHub) |
| 211 | does not fetch the host's plan graph or change records; running `valley plan` or `valley status` |
| 212 | against a valley host clone fetches the `refs/the-valley/*` refs each command needs directly from |
| 213 | `origin`. |
| 214 | |
| 215 | ## Principals and grants |
| 216 | |
| 217 | A **principal** is a named actor — a human or an agent — authenticated by an SSH key when pushing |
| 218 | over SSH, or identified by a cryptographic signing key when verifying check attestations. When an |
| 219 | SSH key is tagged with a principal name in `authorized_keys`, the host passes that name to |
| 220 | `valleyhook`; an untagged key in `services.valley.authorizedKeys` can still push to open topic |
| 221 | branches and attestations as an anonymous pusher, but cannot write change records, restack reports, |
| 222 | integration requests, or knots ([nix/valley-host.nix:506-507](../nix/valley-host.nix), |
| 223 | [valleyhook/policy.go:151-173](../valleyhook/policy.go), |
| 224 | [valleyhook/record.go:160-163](../valleyhook/record.go)). A **grant** is a capability assigned to a |
| 225 | principal at a named **boundary**. Two boundary grants govern `valleyhook` on `refs/the-valley/*`: |
| 226 | |
| 227 | - **`request`** — allows a principal to write or delete integration requests |
| 228 | (`refs/the-valley/integration-requests/<target>/<change>`), update any change record, and delete |
| 229 | change records ([valleyhook/policy.go:151-158](../valleyhook/policy.go), |
| 230 | [valleyhook/record.go:194-198](../valleyhook/record.go), [361-370](../valleyhook/record.go)). Who |
| 231 | holds `request` is a **deployment choice** (for example, in the reference deployment only the |
| 232 | human operator holds `request`). |
| 233 | - **`restack`** — allows a principal to push restack reports |
| 234 | (`refs/the-valley/restack/<target>/<id>`) and add a single restacked version to another owner's |
| 235 | `ready` change while keeping its active branch and title |
| 236 | ([valleyhook/policy.go:165-169](../valleyhook/policy.go), |
| 237 | [valleyhook/record.go:268-272](../valleyhook/record.go)). (The restack report schema, hook |
| 238 | validation, CLI display, and the read-only planner `valley-restacker once --report-only` are |
| 239 | implemented; the restacker's write pass and host service are **not built yet**.) |
| 240 | |
| 241 | _How Nix and CUE realize this:_ A host can declare keys, grants, and trusted signers statically in |
| 242 | NixOS (`services.valley.authorizedKeys`, `services.valley.grants`, |
| 243 | `services.valley.integrator.knownSignersFile`), or enable `services.valley.identity.enable` to |
| 244 | compile `identity/*.cue` from the instance repository on a timer into `/var/lib/valley-identity/` |
| 245 | (compiled `authorized_keys` and `grants` supplement any static `authorizedKeys` and `grants`, while |
| 246 | compiled `known-signers` replaces `services.valley.integrator.knownSignersFile`, which must be unset |
| 247 | when both `identity.enable` and `integrator.enable` are true; |
| 248 | [nix/valley-host.nix:624-635](../nix/valley-host.nix), [988-1010](../nix/valley-host.nix), |
| 249 | [1260-1280](../nix/valley-host.nix), [1416-1420](../nix/valley-host.nix), |
| 250 | [1449-1455](../nix/valley-host.nix)). In `identity/*.cue`, boundaries use four kinds |
| 251 | ([schema/identity.cue:143](../schema/identity.cue)): `git-push` (compiled into `authorized_keys`), |
| 252 | `request` and `restack` (compiled into `grants`), and `registry`, which is checked at compile time |
| 253 | only to ensure at least one unexpired principal holds a grant there (`governanceOrphaned`; |
| 254 | [identity/render.go:100-143](../identity/render.go)); neither `valleyhook` nor the integrator |
| 255 | enforces `registry` grants on pushes or landings. |
| 256 | |
| 257 | ## Glossary |
| 258 | |
| 259 | | Term | Plain definition | Full explanation | |
| 260 | | :--------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 261 | | **Active version** | The active version (`vN`) in a change record (`versions[active-1]`, 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) | |
| 262 | | **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) | |
| 263 | | **Attestation** | A signed statement (`the-valley/attestation/v1`) stored under `refs/the-valley/attestations/<tree-digest>/<key-hash>` recording that a check passed on a specific content tree (`valley-tree-v1`). | [Checks and evidence](#checks-and-evidence), [Evidence: attest and notes](./architecture.md#evidence-attest-and-notes) | |
| 264 | | **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) | |
| 265 | | **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](./architecture.md#identity) | |
| 266 | | **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) | |
| 267 | | **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), [Change records](./architecture.md#change-records) | |
| 268 | | **Change record** | The JSON document (`valley-change-record/v1`, stored as `record.json` in a commit at `refs/the-valley/changes/main/<id>`) tracking a change's target branch (`main`), owner, state, and version history. | [A change: ready, approve, submitted](#a-change-ready-approve-submitted), [Change records](./architecture.md#change-records) | |
| 269 | | **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), [Policy](./architecture.md#policy) | |
| 270 | | **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) | |
| 271 | | **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) | |
| 272 | | **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) | |
| 273 | | **Grant** | A capability (`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), [Identity](./architecture.md#identity) | |
| 274 | | **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), [Change records](./architecture.md#change-records) | |
| 275 | | **Identity registry** | The directory of CUE files (`identity/*.cue`) in the instance repository that an instance can compile (`services.valley.identity.enable`) into SSH `authorized_keys`, `known-signers`, and `grants`. | [Principals and grants](#principals-and-grants), [Identity](./architecture.md#identity) | |
| 276 | | **Instance** | A deployment of one or more projects governed by a shared floor verification policy and identity configuration (in the reference deployment, the `qinling` repository). | [Checks and evidence](#checks-and-evidence), [Policy](./architecture.md#policy) | |
| 277 | | **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), [Policy](./architecture.md#policy) | |
| 278 | | **Integration request** | A commit ref at `refs/the-valley/integration-requests/<target>/<change>` written by a `request` grant holder (`valley approve`) authorizing the integrator to verify and land that exact commit onto `<target>` (such as `main`). | [A change: ready, approve, submitted](#a-change-ready-approve-submitted), [The integrator](./architecture.md#the-integrator) | |
| 279 | | **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) | |
| 280 | | **Knot** | A single Markdown record (`<type-dir>/<id>-<slug>.md` under `refs/the-valley/knots`) in a project's plan graph, typed as `outcome` (`oc-*`), `bug` (`bd-*`), `idea` (`ida-*`), or `question` (`qn-*`). | [Records, project storage, the plan graph, and knots](#records-project-storage-the-plan-graph-and-knots), [The plan graph](./architecture.md#the-plan-graph) | |
| 281 | | **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) | |
| 282 | | **Outcome record** | A single-line blob written by the integrator at `refs/the-valley/integration-outcomes/<target>/<change>` recording `land`, `stale`, `reject`, `refused-not-ready`, `refused-merge`, `voided-withdrawn`, or `failed` for an integration request. | [The host, the hook, and the integrator](#the-host-the-hook-and-the-integrator), [The integrator](./architecture.md#the-integrator) | |
| 283 | | **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), [Policy](./architecture.md#policy) | |
| 284 | | **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), [The plan graph](./architecture.md#the-plan-graph) | |
| 285 | | **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) | |
| 286 | | **Project storage** | The `refs/the-valley/*` namespace on a valley host holding change records, attestations, integration requests, integration outcomes, restack reports, and knots outside `main` (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), [The source and project storage](./architecture.md#the-source-and-project-storage) | |
| 287 | | **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) | |
| 288 | | **Push hold** | The sentinel file (`${dataDir}/.valley-hold`, default `/srv/git/.valley-hold`) on a valley host that pauses all incoming SSH pushes across all projects while 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) | |
| 289 | | **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) | |
| 290 | | **Restack report** | A JSON record (`valley-restack-report/v1`, stored as `report.json` in a commit at `refs/the-valley/restack/<target>/<id>`) validated by `valleyhook` and displayed by `valley status` and `valley pending` to report an automated restack outcome (the read-only planner `valley-restacker once --report-only` is implemented; the write pass and host restacker service are not built yet). | [The host, the hook, and the integrator](#the-host-the-hook-and-the-integrator), [Restack reports](./architecture.md#restack-reports) | |
| 291 | | **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) | |
| 292 | | **Transfer statement** | A signed attestation (`the-valley/integration/transfer/v1`) written by the integrator after `update-ref` 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), [The integrator](./architecture.md#the-integrator) | |
| 293 | | **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) | |
| 294 | | **`valley-tree-v1`** | The SHA-256 content-addressing scheme over a canonical manifest of a tree's files, executable bits, and symlinks (`<mode> <sha256> <path-len> <path>`), independent of git commit metadata. | [Checks and evidence](#checks-and-evidence), [attest/digest.go:5-18](../attest/digest.go) | |
| 295 | | **`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), [What a push may write](./architecture.md#what-a-push-may-write) | |
| 296 | | **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) | |