| 1 | --- |
| 2 | type: bug |
| 3 | id: bd-eaefe82 |
| 4 | status: open |
| 5 | title: A change supplies the definitions of the checks that gate it |
| 6 | created: 2026-08-02 |
| 7 | source: design review of dcr-f41f718, 2026-08-02 |
| 8 | --- |
| 9 | |
| 10 | # Check definitions come from the branch being gated |
| 11 | |
| 12 | The integrator reads the verification policy at the target ref's tip — the policy that is already |
| 13 | integrated — 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)). |
| 15 | Weakening the policy takes two landings. |
| 16 | |
| 17 | That 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 |
| 19 | being gated. A change can therefore satisfy a mandated check by redefining what that check computes: |
| 20 | the policy from the target tip requires a check by name, the branch supplies a derivation that does |
| 21 | nothing, and the attestation truthfully records that it passed. The gate is sound about which checks |
| 22 | run and unsound about what they do. |
| 23 | |
| 24 | This is a known class rather than a novel discovery. Hosted forges gate edits to |
| 25 | continuous-integration definitions behind a permission distinct from the permission to change code, |
| 26 | precisely 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 | |
| 30 | Reading the check definitions from the target tip as well would close the hole and break something |
| 31 | necessary. A change could then never introduce a check, repair a broken one, or demonstrate that a |
| 32 | change to a check works, because its own version would never run against it. The two requirements |
| 33 | are in genuine tension, and any resolution has to serve both. |
| 34 | |
| 35 | ## The instance-supplied case, one level down |
| 36 | |
| 37 | A check supplied by the instance rather than by the project — arriving in a consuming project as a |
| 38 | flake 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, |
| 41 | so a change can repoint the input at a fork whose check computes nothing. Closing the hole requires |
| 42 | the integrator to resolve an instance-mandated check from the instance's own pin rather than from |
| 43 | the pin the branch carries. |
| 44 | |
| 45 | ## Why it is acceptable today |
| 46 | |
| 47 | The enforcement point now exists — Phase 3's integrator |
| 48 | ([integration.md](../../design/integration.md)) — so the half of this the integrator can close is |
| 49 | closed and the half it cannot is live. The policy it gates a change under is composed from its own |
| 50 | checkout at the target tip and from the instance layer it is configured to find, never from the |
| 51 | submitted tree. But a pure check's input closure is recomputed over the tree that would land, and |
| 52 | the derivation naming that closure is in that tree. So the gate is sound about which checks are |
| 53 | required and still unsound about what they compute. |
| 54 | |
| 55 | What holds in place of a fix: every contributor is the operator, and the projects are few and read |
| 56 | in full. The defect is a live exposure now rather than a structural one, and the gate below is where |
| 57 | it stops being tolerable. |
| 58 | |
| 59 | ## The gate |
| 60 | |
| 61 | The mechanism needs a resolution before either of these becomes true: |
| 62 | |
| 63 | - a project is served whose changes the group does not read in full, or |
| 64 | - the policy is relied on to enforce compliance across projects rather than to describe it. |
| 65 | |
| 66 | cosmo 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. |