| 1 | --- |
| 2 | type: idea |
| 3 | id: ida-5006606 |
| 4 | status: adopted |
| 5 | title: A project names its owning valley in its own tree |
| 6 | created: 2026-08-22 |
| 7 | source: review of the asker's policy defaults, 2026-08-22 |
| 8 | --- |
| 9 | |
| 10 | # A project names its owning valley |
| 11 | |
| 12 | A project names its owning valley in one line in its own tree, at `policy/valley`, holding that |
| 13 | valley's repository as `git fetch` takes it. Anything that derives the project's policy reads that |
| 14 | line, fetches the repository, and takes the floor from `policy/instance` at its integrated tip. A |
| 15 | valley's own config repository carries `policy/instance` and uses its own, so it needs no pointer. |
| 16 | |
| 17 | The floor is the owning valley's, and it lives in that valley's repository ([[dcr-f41f718]] |
| 18 | ([decisions/dcr-f41f718-declared-verification-policy.md](../decisions/dcr-f41f718-declared-verification-policy.md)), |
| 19 | [[dcr-9b5da04]] |
| 20 | ([decisions/dcr-9b5da04-hosts-serve-isolated-valleys.md](../decisions/dcr-9b5da04-hosts-serve-isolated-valleys.md))). |
| 21 | The integrator learns which repository that is from the host it runs on, because it runs on the |
| 22 | host. Nothing gave that answer to a checkout on a contributor's machine — and a checkout is exactly |
| 23 | where `valley checks` reports what a change owes and where review's `[a]sk` derives the same thing |
| 24 | before filing a request. The pointer is what supplies it, and fetch is all it asks for: anyone the |
| 25 | valley governs holds fetch on the valley. |
| 26 | |
| 27 | ## The rule this exists to keep |
| 28 | |
| 29 | **A gate's default sources are the ones that govern the project. Every other layer is reachable only |
| 30 | by naming it.** A tool with no way to find the floor will be given one anyway, and the tempting |
| 31 | substitute is whatever policy directory the tree already contains. That is how the asker came to |
| 32 | derive a change's required checks from the worked example under `examples/policy/`: the example |
| 33 | composes, so the derivation succeeded and reported a check no one had written, named after a |
| 34 | demonstration. A derivation that succeeds against the wrong layers is worse than one that refuses, |
| 35 | because nothing about the output says which layers it read. So each of the two layers now defaults |
| 36 | to a real source and refuses loudly when it is not there, and the options that point elsewhere stay |
| 37 | — reading the worked example is a thing a person asks for by name. |
| 38 | |
| 39 | ## The client derives from exactly the sources the integrator uses |
| 40 | |
| 41 | Every source the derivation reads is a source the integrator reads. The project's own layer comes |
| 42 | from the target's tip. The pointer naming the owning valley comes from the target's tip. The floor |
| 43 | comes from that valley's integrated tip. None of them comes from the working tree. |
| 44 | |
| 45 | The working tree is the wrong source entirely, and not only for the reason a branch is: a change |
| 46 | never supplies the policy that gates it, and neither does whoever happens to be reviewing it. A |
| 47 | reviewer's checkout is whatever branch they were last on. Reading policy from it makes the answer a |
| 48 | function of that, which is how `[a]sk` came to read `policy/project` from a checkout that predated |
| 49 | the layer landing and refuse a change nothing was wrong with. The rule also buys something positive: |
| 50 | review works identically from any branch, however stale, so there is nothing to synchronize before |
| 51 | reviewing. |
| 52 | |
| 53 | Absence has to agree too, layer by layer, because a client that refuses where the integrator |
| 54 | composes is as wrong as one that composes where the integrator refuses. A target carrying no project |
| 55 | layer is derived under the floor alone; a floor that is not there is refused. |
| 56 | |
| 57 | The schema is not one of these sources. It is the shape a policy is written in rather than a layer |
| 58 | of policy, it ships with the tool, and the integrator takes its own from its deployment for the same |
| 59 | reason. |
| 60 | |
| 61 | ## The pointer is never the gate |
| 62 | |
| 63 | A change can edit `policy/valley`, because it is a file in the tree like any other. That costs |
| 64 | nothing, because the pointer is not what gates anything. The integrator composes the policy from its |
| 65 | own configuration and from the target ref's tip, so a branch that repoints its own floor is judged |
| 66 | under the floor it tried to leave — the same shape as every other part of the policy a change cannot |
| 67 | supply for itself. What the pointer buys is that the operator's local reading agrees with the |
| 68 | integrator's, which is the whole reason the local reading is printed. |
| 69 | |
| 70 | ## Open |
| 71 | |
| 72 | - Nothing caches the fetch. Every derivation reaches the valley's repository again, which is right |
| 73 | for a verb a person runs and wrong for anything run per commit. |
| 74 | - The pointer names a repository and takes the ref as given (`refs/heads/main`). A valley whose |
| 75 | integrated tip is some other ref has no way to say so yet. |