gunk-dev/the-valley

ida-5006606-a-project-names-its-owning-valley.md

sourceedde5dd8af83main's published tip history
4.5 KiB · Rendered
1---
2type: idea
3id: ida-5006606
4status: adopted
5title: A project names its owning valley in its own tree
6created: 2026-08-22
7source: review of the asker's policy defaults, 2026-08-22
8---
9
10# A project names its owning valley
11
12A project names its owning valley in one line in its own tree, at `policy/valley`, holding that
13valley's repository as `git fetch` takes it. Anything that derives the project's policy reads that
14line, fetches the repository, and takes the floor from `policy/instance` at its integrated tip. A
15valley's own config repository carries `policy/instance` and uses its own, so it needs no pointer.
16
17The 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))).
21The integrator learns which repository that is from the host it runs on, because it runs on the
22host. Nothing gave that answer to a checkout on a contributor's machine — and a checkout is exactly
23where `valley checks` reports what a change owes and where review's `[a]sk` derives the same thing
24before filing a request. The pointer is what supplies it, and fetch is all it asks for: anyone the
25valley 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
30by naming it.** A tool with no way to find the floor will be given one anyway, and the tempting
31substitute is whatever policy directory the tree already contains. That is how the asker came to
32derive a change's required checks from the worked example under `examples/policy/`: the example
33composes, so the derivation succeeded and reported a check no one had written, named after a
34demonstration. A derivation that succeeds against the wrong layers is worse than one that refuses,
35because nothing about the output says which layers it read. So each of the two layers now defaults
36to 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
41Every source the derivation reads is a source the integrator reads. The project's own layer comes
42from the target's tip. The pointer naming the owning valley comes from the target's tip. The floor
43comes from that valley's integrated tip. None of them comes from the working tree.
44
45The working tree is the wrong source entirely, and not only for the reason a branch is: a change
46never supplies the policy that gates it, and neither does whoever happens to be reviewing it. A
47reviewer's checkout is whatever branch they were last on. Reading policy from it makes the answer a
48function of that, which is how `[a]sk` came to read `policy/project` from a checkout that predated
49the layer landing and refuse a change nothing was wrong with. The rule also buys something
50positive: review works identically from any branch, however stale, so there is nothing to
51synchronize before reviewing.
52
53Absence has to agree too, layer by layer, because a client that refuses where the integrator
54composes is as wrong as one that composes where the integrator refuses. A target carrying no
55project layer is derived under the floor alone; a floor that is not there is refused.
56
57The schema is not one of these sources. It is the shape a policy is written in rather than a layer
58of policy, it ships with the tool, and the integrator takes its own from its deployment for the
59same reason.
60
61## The pointer is never the gate
62
63A change can edit `policy/valley`, because it is a file in the tree like any other. That costs
64nothing, because the pointer is not what gates anything. The integrator composes the policy from its
65own configuration and from the target ref's tip, so a branch that repoints its own floor is judged
66under the floor it tried to leave — the same shape as every other part of the policy a change cannot
67supply for itself. What the pointer buys is that the operator's local reading agrees with the
68integrator'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.