gunk-dev/the-valley

bd-eaefe82-check-definitions-come-from-the-branch.md

source8d1b8d9b3656main's published tip history
4.7 KiB · Rendered
1---
2type: bug
3id: bd-eaefe82
4status: open
5title: A change supplies the definitions of the checks that gate it
6created: 2026-08-02
7source: design review of dcr-f41f718, 2026-08-02
8---
9
10# Check definitions come from the branch being gated
11
12The integrator reads the verification policy at the target ref's tip — the policy that is already
13integrated — so a change never supplies the policy that gates it ([[dcr-f41f718]],
14[decisions/dcr-f41f718-declared-verification-policy.md](../decisions/dcr-f41f718-declared-verification-policy.md)).
15Weakening the policy takes two landings.
16
17That soundness does not extend to the checks themselves. The same decision ends by saying the policy
18"says which ones apply where, not what a check is". The derivations a policy names live in the tree
19being gated. A change can therefore satisfy a mandated check by redefining what that check computes:
20the policy from the target tip requires a check by name, the branch supplies a derivation that does
21nothing, and the attestation truthfully records that it passed. The gate is sound about which checks
22run and unsound about what they do.
23
24This is a known class rather than a novel discovery. Hosted forges gate edits to
25continuous-integration definitions behind a permission distinct from the permission to change code,
26precisely because a proposed change that can edit its own checks has neutered its own gate.
27
28## The tension any resolution has to serve
29
30Reading the check definitions from the target tip as well would close the hole and break something
31necessary. A change could then never introduce a check, repair a broken one, or demonstrate that a
32change to a check works, because its own version would never run against it. The two requirements
33are in genuine tension, and any resolution has to serve both.
34
35## The instance-supplied case, one level down
36
37A check supplied by the instance rather than by the project — arriving in a consuming project as a
38flake input, which is how the knowledge lint is now consumed ([[ida-a9e274c]],
39[ideas/ida-a9e274c-mandated-checks-come-from-the-instance.md](../ideas/ida-a9e274c-mandated-checks-come-from-the-instance.md))
40— does not by itself close this. The lock file pinning that input is also in the tree being gated,
41so a change can repoint the input at a fork whose check computes nothing. Closing the hole requires
42the integrator to resolve an instance-mandated check from the instance's own pin rather than from
43the pin the branch carries.
44
45## Why it is acceptable today
46
47The enforcement point now exists — Phase 3's integrator
48([integration.md](../../design/integration.md)) — so the half of this the integrator can close is
49closed and the half it cannot is live. The policy it gates a change under is composed from its own
50checkout at the target tip and from the instance layer it is configured to find, never from the
51submitted tree. But a pure check's input closure is recomputed over the tree that would land, and
52the derivation naming that closure is in that tree. So the gate is sound about which checks are
53required and still unsound about what they compute.
54
55What holds in place of a fix: every contributor is the operator, and the projects are few and read
56in full. The defect is a live exposure now rather than a structural one, and the gate below is where
57it stops being tolerable.
58
59## The gate
60
61The mechanism needs a resolution before either of these becomes true:
62
63- a project is served whose changes the valley does not read in full, or
64- the policy is relied on to enforce compliance across projects rather than to describe it.
65
66cosmo depending on this for its build gate makes the second true.
67
68## Directions, not decisions
69
70- **A path class covering the check definitions** — the flake, the check derivations, the policy
71 documents, the lock file — whose required set includes human approval. This is the forge
72 permission expressed in machinery this design already has: [[ida-1ec03b1]]
73 ([ideas/ida-1ec03b1-path-scoped-verification-policy.md](../ideas/ida-1ec03b1-path-scoped-verification-policy.md))
74 makes policy path-scoped, and [[ida-b7025b5]]
75 ([ideas/ida-b7025b5-human-decisions-are-signed-acts.md](../ideas/ida-b7025b5-human-decisions-are-signed-acts.md))
76 supplies an approval that an agent cannot manufacture. Branch definitions still run, so a change
77 can still improve its own checks, but weakening one becomes a deliberate gated act.
78- **The integrator resolving instance-mandated checks from the instance's pin**, so the floor's
79 derivations are not branch-controlled.
80- **Accepting it**, on the architecture's existing bet:
81 [architecture.md](../../design/architecture.md) chooses attestation with revocation over CI as a
82 gate, and Phase 6's witness re-derivation ([roadmap.md](../../design/roadmap.md)) is what would
83 eventually detect a check that computes nothing.