gunk-dev/the-valley

policy.cue

sourcec4c1671e1d82main's published tip history
27.4 KiB
1// the-valley's project layer: what this one project declares above the
2// floor. The floor is the owning valley's policy/instance; this
3// layer binds the-valley alone, and a project can only add to its own
4// layer (dcr-f41f718).
5package verification
6
7import (
8 "list"
9 "strings"
10)
11
12project: {
13 // the-valley takes no knowledge lint of its own tree. The docs
14 // template's lint checks a knowledge graph kept in the source, and
15 // the-valley's source holds none: its plan graph is project storage, at
16 // refs/the-valley/knots, and the push hook holds it to the knot
17 // module's rules. The nodes under archive/.the-valley/ are history that
18 // never changes, so linting them against today's schema protects
19 // nothing. The lint itself stays covered: the knowledge-lint class
20 // below requires its consumer and rejection checks.
21
22 // Every check below is the flake check of the same name in
23 // nix/checks.nix, built for the runner's own system. own-policy holds
24 // this list to that: a name here that the flake does not define fails
25 // it.
26 let ownChecks = [
27 "valleyhook-unit",
28 "protect-e2e",
29 "knots-e2e",
30 "note-unit",
31 "exactjson-unit",
32 "change-unit",
33 "knot-unit",
34 "knot-agree",
35 "delta-unit",
36 "derive-unit",
37 "composed-unit",
38 "review-unit",
39 "attest-unit",
40 "attest-conformance",
41 "attest-e2e",
42 "identity-unit",
43 "identity-e2e",
44 "approval-unit",
45 "integrator-unit",
46 "integrator-e2e",
47 "restack-unit",
48 "restack-e2e",
49 "signers-e2e",
50 "sigverify-unit",
51 "sigverify-e2e",
52 "web-unit",
53 "web-server-unit",
54 "web-reader-state-crash",
55 "web-reader-browser-e2e",
56 "web-receiver-unit",
57 "readaccess-unit",
58 "rebase-unit",
59 "valley-go-unit",
60 "valley-cli",
61 "review-notes",
62 "valley-request",
63 "valley-status",
64 "valley-ready",
65 "valley-changes",
66 "valley-walk",
67 "valley-knot",
68 "valley-plan",
69 "valley-darwin-eval",
70 "selfupdate-unit",
71 "valley-self-update",
72 "policy-deriver",
73 "own-policy",
74 "module-eval",
75 "cue-vet",
76 "attest-schema",
77 "identity-schema",
78 "knowledge-lint-consumer",
79 "knowledge-lint-rejects",
80 "init-e2e",
81 "mirror-e2e",
82 "bus-e2e",
83 "ssh-e2e",
84 "publish-e2e",
85 "worker-e2e",
86 "telemetry-unit",
87 "telemetry-e2e",
88 "restack-host-e2e",
89 "web-publisher-e2e",
90 "web-image",
91 "web-push-e2e",
92 ]
93 for n in ownChecks {
94 checks: (n): {
95 runner: "nix"
96 attribute: n
97 }
98 }
99
100 // The integrator's scenarios take about a minute, and ssh-e2e,
101 // publish-e2e, worker-e2e, telemetry-e2e, restack-host-e2e and
102 // web-publisher-e2e boot
103 // NixOS machines. web-reader-browser-e2e boots no machine, but its
104 // closure holds Chromium, and it runs a browser in about 2 GiB.
105 // Every other check here takes seconds once its packages are built.
106 checks: "integrator-e2e": cost: "slow"
107 checks: "ssh-e2e": cost: "slow"
108 checks: "publish-e2e": cost: "slow"
109 checks: "worker-e2e": cost: "slow"
110 checks: "telemetry-e2e": cost: "slow"
111 checks: "restack-host-e2e": cost: "slow"
112 checks: "web-publisher-e2e": cost: "slow"
113 checks: "web-reader-browser-e2e": cost: "slow"
114
115 // Each class below is one part of the tree and the checks that read it.
116 // A path in two classes requires both sets. A Go module's unit check is
117 // its package built again with its tests, which runs `go test`. The
118 // package itself runs no tests (nix/packages.nix).
119
120 // The pre-receive hook and the git user's login shell. protect-e2e
121 // pushes to bare repositories wired with the hook a host renders,
122 // valley-ready pushes change records through that hook, and knots-e2e
123 // pushes the plan graph through it.
124 classes: valleyhook: {
125 paths: "valleyhook/**": true
126 requires: "valleyhook-unit": true
127 requires: "protect-e2e": true
128 requires: "valley-ready": true
129 requires: "knots-e2e": true
130 }
131
132 // The change record, which the hook guards, the CLI's Go verbs and the
133 // rebase engine write, and the integrator and the review module read.
134 // Each reads a record through it, so a change to it requires their tests
135 // as well as its own.
136 classes: change: {
137 paths: "change/**": true
138 requires: "change-unit": true
139 requires: "review-unit": true
140 requires: "valleyhook-unit": true
141 requires: "protect-e2e": true
142 requires: "rebase-unit": true
143 requires: "valley-go-unit": true
144 requires: "valley-ready": true
145 requires: "valley-changes": true
146 requires: "integrator-unit": true
147 requires: "integrator-e2e": true
148 requires: "approval-unit": true
149 }
150
151 // The plan graph's module, which the CLI's Go verbs write the graph
152 // with and the hook validates it with. knot-agree holds its validator
153 // to the node schema and the knowledge lint, valley-knot and
154 // valley-plan drive the verbs that use it, and knots-e2e pushes
155 // through the hook. The web export reads names and knot IDs by its
156 // rules, and the web server reads a claim's age by them, so
157 // web-unit and web-server-unit are here too.
158 classes: knot: {
159 paths: "knot/**": true
160 requires: "knot-unit": true
161 requires: "knot-agree": true
162 requires: "valley-go-unit": true
163 requires: "valley-knot": true
164 requires: "valley-plan": true
165 requires: "valleyhook-unit": true
166 requires: "knots-e2e": true
167 requires: "web-unit": true
168 requires: "web-server-unit": true
169 }
170
171 // valley-delta-v1, which the CLI's Go verbs compare a version with its
172 // approved version through, and which the review module recomputes a
173 // review's binding with. delta-unit holds it to its conformance vectors,
174 // valley-go-unit builds the verbs with it, valley-ready and review-notes
175 // drive review over the comparison, and review-unit binds reviews with
176 // its bounded reading.
177 classes: delta: {
178 paths: "delta/**": true
179 requires: "delta-unit": true
180 requires: "valley-go-unit": true
181 requires: "valley-ready": true
182 requires: "review-notes": true
183 requires: "review-unit": true
184 }
185
186 // Review records: the record, its binding to the version it judged, and
187 // its append-only history. review-unit runs its tests against real git.
188 classes: review: {
189 paths: "review/**": true
190 requires: "review-unit": true
191 }
192
193 // The deriver of required checks, and the composed-policy reader it reads
194 // the whole policy through. derive-unit holds the deriver's answers,
195 // composed-unit holds the reader's layer reads, and valley-go-unit builds
196 // the verb that prints its answer with both.
197 classes: derive: {
198 paths: "derive/**": true
199 paths: "composed/**": true
200 requires: "derive-unit": true
201 requires: "composed-unit": true
202 requires: "valley-go-unit": true
203 }
204
205 // The note envelope. The hook and attest both read notes through it,
206 // the identity compiler reads its approval files back with it, and the
207 // web export's manifest is a note, which the web server builds with,
208 // so a change to it requires their tests as well as its own.
209 classes: note: {
210 paths: "note/**": true
211 requires: "note-unit": true
212 requires: "valleyhook-unit": true
213 requires: "protect-e2e": true
214 requires: "attest-unit": true
215 requires: "attest-e2e": true
216 requires: "identity-unit": true
217 requires: "approval-unit": true
218 requires: "web-unit": true
219 requires: "web-server-unit": true
220 }
221
222 // The attestation helper, and the conformance vectors under
223 // attest/conformance/ that hold its written form fixed. restack-e2e
224 // signs the changes' evidence with attest run.
225 classes: attest: {
226 paths: "attest/**": true
227 requires: "attest-unit": true
228 requires: "attest-conformance": true
229 requires: "attest-e2e": true
230 requires: "restack-e2e": true
231 }
232
233 // The strict JSON reader. The hook reads its push policy with it, the
234 // identity compiler its registry, read access a policy/read, and the
235 // web export, publisher, server and receiver what they are sent, so a
236 // change to it requires their unit tests as well as its own.
237 classes: exactjson: {
238 paths: "exactjson/**": true
239 requires: "exactjson-unit": true
240 requires: "valleyhook-unit": true
241 requires: "identity-unit": true
242 requires: "readaccess-unit": true
243 requires: "web-unit": true
244 requires: "web-server-unit": true
245 requires: "web-receiver-unit": true
246 }
247
248 // Approval statements, their signing and verifying, and the PIV
249 // session signer.
250 classes: approval: {
251 paths: "approval/**": true
252 requires: "approval-unit": true
253 }
254
255 // The identity registry compiler, and the registries it is driven over.
256 classes: identity: {
257 paths: "identity/**": true
258 paths: "examples/identity/**": true
259 requires: "identity-unit": true
260 requires: "identity-e2e": true
261 }
262
263 // Telemetry: the records, streams and command grammar of telemetry/, the
264 // collector built from it, and the host module's half in
265 // nix/telemetry.nix. The git user's shell parses the command with it,
266 // attest, the worker and the integrator write its streams, and the CLI
267 // reads and reports with it, so a change to it requires their unit
268 // tests as well as its own. telemetry-e2e drives all of it on a NixOS
269 // machine; it follows main after a landing, as slow end-to-end checks
270 // do, and gates nothing. module-eval evaluates the module in nix/telemetry.nix, so the
271 // module-eval class requires it for that file. It runs none of the
272 // collector's code, so a change under telemetry/ does not require it.
273 classes: telemetry: {
274 paths: "telemetry/**": true
275 paths: "nix/telemetry.nix": true
276 requires: "telemetry-unit": true
277 follows: "telemetry-e2e": true
278 requires: "valleyhook-unit": true
279 requires: "attest-unit": true
280 requires: "valley-go-unit": true
281 requires: "integrator-unit": true
282 }
283
284 // The producers and the CLI that record and send telemetry: attest's
285 // progress, the worker's and the workstation's records, and approve,
286 // which runs them. telemetry-e2e observes each over ssh, and follows main
287 // after a landing.
288 classes: "telemetry-producers": {
289 paths: "attest/progress.go": true
290 paths: "status/telemetry.go": true
291 paths: "status/workertelemetry.go": true
292 paths: "status/command.go": true
293 follows: "telemetry-e2e": true
294 }
295
296 // The check worker's own code: its pass and its records in status/, the
297 // wake directory it claims, and attest's run, which runs each check a
298 // pass builds, signs and stores the evidence, and reports its progress.
299 // worker-e2e runs those passes on a NixOS machine; it follows main after
300 // a landing, as slow end-to-end checks do, and gates nothing. The rest of status/
301 // and attest/ serves other commands too, and their classes require
302 // their own checks.
303 classes: worker: {
304 paths: "status/worker.go": true
305 paths: "status/workertelemetry.go": true
306 paths: "status/wake.go": true
307 paths: "attest/run.go": true
308 paths: "attest/check.go": true
309 paths: "attest/progress.go": true
310 follows: "worker-e2e": true
311 }
312
313 // The integrator, the end-to-end scenarios under integrator/e2e/, and the
314 // verification schema, which the integrator composes every policy under
315 // and both checks read. restack-e2e runs the real integrator too: it
316 // lands one change and rejects another.
317 classes: integrator: {
318 paths: "integrator/**": true
319 paths: "composed/**": true
320 paths: "schema/verification.cue": true
321 requires: "integrator-unit": true
322 requires: "integrator-e2e": true
323 requires: "restack-e2e": true
324 }
325
326 // The security-key signature verifier.
327 classes: sigverify: {
328 paths: "sigverify/**": true
329 requires: "sigverify-unit": true
330 requires: "sigverify-e2e": true
331 }
332
333 // The web UI's module: the export contract, its shared fixture, the
334 // publisher, the server and its browser state, and the receiver. The
335 // publisher's tests also read each project's policy/read and the
336 // instance's registry under the read and identity schemas.
337 // web-push-e2e runs the three programs as they ship, and
338 // web-reader-state-crash kills valley-web inside its browser state's
339 // transactions. Changes require all five checks.
340 classes: web: {
341 paths: "web/**": true
342 paths: "schema/read.cue": true
343 paths: "schema/identity.cue": true
344 requires: "web-unit": true
345 requires: "web-server-unit": true
346 requires: "web-reader-state-crash": true
347 requires: "web-receiver-unit": true
348 requires: "web-push-e2e": true
349 }
350
351 // What a browser engine runs or is served by on a reader page:
352 // web-reader-browser-e2e runs the packaged valley-web under headless
353 // Chromium. So it is required for the reader script and pages, the
354 // layout and the stylesheet whose hash every policy carries, the
355 // rendering and its policies, the dispatch and headers in server.go,
356 // the reader handlers, the command that sets up the browser state, the
357 // check's own test, and the packaging that builds the binary and its
358 // assets. Its definition is its own class's, check-<name> below. The
359 // publisher, package export, archives and the projection of the graph
360 // are not here: a change to them alone needs no browser.
361 classes: "reader-browser": {
362 paths: "web/server/assets/reader.js": true
363 paths: "web/server/assets/style.css": true
364 paths: "web/server/templates/redeem.tmpl": true
365 paths: "web/server/templates/logout.tmpl": true
366 paths: "web/server/templates/layout.tmpl": true
367 paths: "web/server/render.go": true
368 paths: "web/server/server.go": true
369 paths: "web/server/reader.go": true
370 paths: "web/cmd/valley-web/main.go": true
371 paths: "web/cmd/valley-web/browser_test.go": true
372 paths: "nix/packages.nix": true
373 requires: "web-reader-browser-e2e": true
374 }
375
376 // The real publisher's output that web-server-unit serves:
377 // nix/checks/web-published.sh runs the publisher and the CLI as they
378 // ship, and the server's tests read what it writes.
379 classes: "web-published": {
380 paths: "nix/checks/web-published.sh": true
381 requires: "web-server-unit": true
382 }
383
384 // Read access: the two consents a reader needs, the evaluator that
385 // intersects them, and the coverage report. readaccess-unit reads both
386 // schemas, so a change to either requires it, and the web publisher
387 // reads its consents through the module, so web-unit runs too.
388 classes: readaccess: {
389 paths: "readaccess/**": true
390 paths: "schema/read.cue": true
391 paths: "schema/identity.cue": true
392 requires: "readaccess-unit": true
393 requires: "web-unit": true
394 }
395
396 // The valley CLI: the valley command (status/), the rebase engine it
397 // rebases and reads landings with (rebase/), and its completions.
398 // valley-ready drives ready, withdraw, rebase and the verbs that take a
399 // change's handle, valley-changes drives changes and pending,
400 // valley-walk drives review with no change across a host's projects,
401 // valley-plan drives plan against the golden files under
402 // status/testdata/plan/, and valley-self-update drives --version and
403 // self-update. The web publisher reads the valley through plan, pending and knot
404 // show, and its tests in web-unit run the CLI itself, as web-push-e2e
405 // runs the CLI's package.
406 classes: cli: {
407 paths: "status/**": true
408 paths: "rebase/**": true
409 paths: "completions/**": true
410 requires: "valley-go-unit": true
411 requires: "valley-cli": true
412 requires: "review-notes": true
413 requires: "valley-request": true
414 requires: "valley-status": true
415 requires: "valley-ready": true
416 requires: "valley-changes": true
417 requires: "valley-walk": true
418 requires: "valley-knot": true
419 requires: "valley-plan": true
420 requires: "valley-self-update": true
421 requires: "policy-deriver": true
422 requires: "web-unit": true
423 requires: "web-push-e2e": true
424 requires: "integrator-e2e": true
425 }
426
427 // The push path as it ships: web-push-e2e runs the publisher, the
428 // receiver, valley-web and the CLI as nix/packages.nix builds and wraps
429 // them, and exports its host declaration under schema/valley.cue. The
430 // web and cli classes require it for the code it runs.
431 classes: "web-push": {
432 paths: "nix/packages.nix": true
433 paths: "schema/valley.cue": true
434 requires: "web-push-e2e": true
435 }
436
437 // Self-update: its module (selfupdate/), the policy the package ships
438 // for its smoke test, and the home-manager module that runs it on a
439 // timer. valley-go-unit builds the verb with the module, and
440 // valley-self-update drives the verb through the package and holds the
441 // units the home-manager module renders.
442 classes: selfupdate: {
443 paths: "selfupdate/**": true
444 paths: "examples/policy/smoke/**": true
445 paths: "nix/home-module.nix": true
446 requires: "selfupdate-unit": true
447 requires: "valley-go-unit": true
448 requires: "valley-self-update": true
449 }
450
451 // The rebase engine, with its own tests over real repositories. The
452 // verbs that run it are the cli class's, so its paths are there too.
453 classes: rebase: {
454 paths: "rebase/**": true
455 requires: "rebase-unit": true
456 }
457
458 // The restacker, with its unit tests and its planner end to end. It
459 // reads origin through the rebase engine and the policy through the
460 // composed-policy reader it shares with the integrator, so a change to
461 // either requires its checks too.
462 classes: restack: {
463 paths: "restack/**": true
464 paths: "composed/**": true
465 paths: "rebase/**": true
466 requires: "restack-unit": true
467 requires: "restack-e2e": true
468 }
469
470 // What a client verifies an integrator's transfer statement with: the
471 // host's publisher and the default name it publishes, the unit that
472 // runs it, the client's reading of the signers, the instance discovery
473 // it reads them through, and the snapshot that asks for them.
474 // signers-e2e drives them together over the real integrator.
475 classes: signers: {
476 paths: "integrator/signers.go": true
477 paths: "integrator/main.go": true
478 paths: "nix/valley-host.nix": true
479 paths: "status/signers.go": true
480 paths: "status/list.go": true
481 paths: "rebase/snapshot.go": true
482 requires: "signers-e2e": true
483 }
484
485 // The web publisher's module, which runs the publisher on a timer in a
486 // sandbox of its own. web-publisher-e2e runs the unit it renders in a
487 // NixOS machine. module-eval, in the module-eval class, holds what it
488 // renders.
489 classes: "web-publisher": {
490 paths: "nix/web-publisher.nix": true
491 requires: "web-publisher-e2e": true
492 }
493
494 // The verification policy: this layer, the pointer to the owning
495 // valley, the schema a policy is written in, and the example policies
496 // the deriver and cue-vet read.
497 classes: policy: {
498 paths: "policy/**": true
499 paths: "schema/verification.cue": true
500 paths: "examples/policy/**": true
501 requires: "policy-deriver": true
502 requires: "derive-unit": true
503 requires: "cue-vet": true
504 requires: "own-policy": true
505 }
506
507 // What module-eval evaluates: the NixOS modules, the host declarations
508 // it renders and the files they are exported from, and the wiring that
509 // hands them to the check. Nothing else changes its derivation. An edit
510 // to another check's script or definition, to the packages, or to a
511 // program's code leaves it unchanged, so those paths are not here. That
512 // holds for nix/checks/ in general: each file there is its own check's,
513 // by the per-check classes below, and module-eval's own files are
514 // nix/checks/module-eval.sh, nix/checks/host-module.nix and
515 // nix/checks/hosts.nix.
516 classes: "module-eval": {
517 paths: "nix/valley-host.nix": true
518 paths: "nix/telemetry.nix": true
519 paths: "nix/web-publisher.nix": true
520 paths: "nix/web-receiver.nix": true
521 paths: "nix/checks.nix": true
522 paths: "nix/checks/hosts.nix": true
523 paths: "nix/checks/host-module.nix": true
524 paths: "schema/valley.cue": true
525 paths: "flake.nix": true
526 paths: "flake.lock": true
527 paths: "examples/host.cue": true
528 paths: "examples/hosts/protected.cue": true
529 paths: "examples/hosts/no-backup.cue": true
530 paths: "examples/hosts/bus.cue": true
531 paths: "examples/hosts/mirrors.cue": true
532 requires: "module-eval": true
533 }
534
535 // The flake, the NixOS module, the packages and the check definitions,
536 // and the host declarations the module checks are evaluated over.
537 // own-policy is here because renaming or removing a flake check would
538 // leave this layer naming a check that no longer exists. A change to
539 // flake.nix or flake.lock requires these and module-eval, which boots
540 // no machine, so a nixpkgs bump boots none.
541 classes: nix: {
542 paths: "nix/**": true
543 paths: "flake.nix": true
544 paths: "flake.lock": true
545 paths: "examples/host.cue": true
546 paths: "examples/hosts/**": true
547 requires: "valley-darwin-eval": true
548 requires: "cue-vet": true
549 requires: "own-policy": true
550 }
551
552 // The schemas, and the example events, attestations and registries they
553 // are vetted against.
554 classes: schema: {
555 paths: "schema/**": true
556 paths: "examples/events/**": true
557 paths: "examples/attestations/**": true
558 paths: "examples/identity/**": true
559 requires: "cue-vet": true
560 requires: "attest-schema": true
561 requires: "identity-schema": true
562 }
563
564 // The knowledge lint itself: its program, the node schema it holds a
565 // graph to, and the example graphs it must accept and reject. The plan
566 // graph's validator is held to the same two by knot-agree.
567 classes: "knowledge-lint": {
568 paths: "nix/knowledge-lint.*": true
569 paths: "schema/node.cue": true
570 paths: "examples/graphs/**": true
571 requires: "knowledge-lint-consumer": true
572 requires: "knowledge-lint-rejects": true
573 requires: "knot-agree": true
574 }
575
576 // The NixOS module and what its end-to-end checks run. The hook checks
577 // follow the scripts out of the hosts in nix/checks/hosts.nix, which
578 // are made of the three declarations named here; ssh-e2e, publish-e2e,
579 // worker-e2e and restack-host-e2e run the module in NixOS machines.
580 // worker-e2e follows main after a landing and gates nothing.
581 classes: "host-module": {
582 paths: "nix/valley-host.nix": true
583 paths: "nix/checks/hosts.nix": true
584 paths: "examples/hosts/protected.cue": true
585 paths: "examples/hosts/bus.cue": true
586 paths: "examples/hosts/mirrors.cue": true
587 requires: "init-e2e": true
588 requires: "mirror-e2e": true
589 requires: "bus-e2e": true
590 requires: "protect-e2e": true
591 requires: "knots-e2e": true
592 requires: "identity-e2e": true
593 requires: "ssh-e2e": true
594 requires: "publish-e2e": true
595 follows: "worker-e2e": true
596 requires: "restack-host-e2e": true
597 requires: "valley-changes": true
598 requires: "valley-walk": true
599 }
600
601 // A check's own files require that check: its script,
602 // nix/checks/<name>.sh, and its definition, nix/checks/<name>.nix,
603 // where it has a file of its own. One class per check, named
604 // check-<name>. prose-format is the floor's check, but its script is
605 // here. own-policy fails if a script under nix/checks/ requires no
606 // check. A class can only require here, so a change to the script or
607 // definition of worker-e2e or telemetry-e2e still builds it before
608 // landing, though a change to the subject it tests only follows.
609 for n in list.Concat([ownChecks, ["prose-format"]]) {
610 classes: ("check-\(n)"): {
611 paths: ("nix/checks/\(n).sh"): true
612 paths: ("nix/checks/\(n).nix"): true
613 requires: (n): true
614 }
615 }
616
617 // The other files under nix/checks/, and the checks that read each: the
618 // definitions of a subject's checks, and the helpers and rejection lists
619 // a check is given. cli.nix, which defines every check of the CLI,
620 // is left to the nix class, as is nix/checks.nix, which wires them all.
621 // This map can only require, so telemetry.nix keeps requiring
622 // telemetry-e2e: a change to its definition builds it before landing.
623 let checkFiles = {
624 "attest.nix": ["attest-unit", "attest-conformance", "attest-e2e"]
625 "telemetry.nix": ["telemetry-unit", "telemetry-e2e"]
626 "delta.nix": ["delta-unit"]
627 "derive.nix": ["derive-unit", "composed-unit"]
628 "review.nix": ["review-unit"]
629 "identity.nix": ["identity-unit", "identity-e2e"]
630 "approval.nix": ["approval-unit"]
631 "integrator.nix": ["integrator-unit", "integrator-e2e"]
632 "signers.nix": ["signers-e2e"]
633 "sigverify.nix": ["sigverify-unit", "sigverify-e2e"]
634 "web.nix": ["web-unit", "web-server-unit", "web-reader-state-crash", "web-receiver-unit", "web-image", "readaccess-unit"]
635 "schema.nix": ["cue-vet", "attest-schema", "identity-schema"]
636 "knowledge.nix": ["knowledge-lint-consumer", "knowledge-lint-rejects", "prose-format"]
637 "hooks.nix": ["valleyhook-unit", "change-unit", "mirror-e2e", "protect-e2e", "init-e2e", "bus-e2e"]
638 "host-module.nix": ["module-eval"]
639 "fail-nth.sh": ["policy-deriver", "valley-request"]
640 "review-notes-editor.sh": ["review-notes"]
641 "cue-vet-rejected.txt": ["cue-vet"]
642 "identity-rejected.txt": ["identity-schema"]
643 "knowledge-lint-rejected.txt": ["knowledge-lint-rejects"]
644 }
645 for f, ns in checkFiles {
646 classes: ("check-file-\(strings.Replace(f, ".", "-", -1))"): {
647 paths: ("nix/checks/\(f)"): true
648 requires: {for n in ns {(n): true}}
649 }
650 }
651
652 // How far an approval carries across a rebase (#Carry in
653 // schema/verification.cue). Every path not named here is same-paths.
654 //
655 // The hook, the integrator, the signature verifier and the identity
656 // compiler enforce who may do what. An approval of a change to one of
657 // them carries only while no landing has touched the same classes:
658 // same-class. The identity compiler's class is its code and the schema
659 // it holds a registry to. It requires nothing, because the identity and
660 // schema classes already require the checks of its paths.
661 classes: valleyhook: carry: "same-class": true
662 classes: integrator: carry: "same-class": true
663 classes: sigverify: carry: "same-class": true
664 classes: "identity-compiler": {
665 paths: "identity/**": true
666 paths: "schema/identity.cue": true
667 carry: "same-class": true
668 }
669
670 // The policy decides what every change requires, so an approval of a
671 // change to it carries across no landing at all: exact. That is this
672 // layer, the pointer to the owning valley, and the schema a policy is
673 // written in. The example policies are fixtures and stay same-paths. Like
674 // identity-compiler, this class requires nothing: the policy class
675 // requires the checks of its paths.
676 //
677 // This tree holds no registry, grant or secret data of its own. The
678 // registries, grants and keys under examples/ and attest/conformance/
679 // are test fixtures, and the instance's registry is in its instance
680 // repository. So nothing else here is exact.
681 classes: "policy-authority": {
682 paths: "policy/**": true
683 paths: "schema/verification.cue": true
684 carry: exact: true
685 }
686
687 // The restacker's cap is the schema's default of 64 automatic versions
688 // per change.
689}
690
691// What no class above covers falls to the floor's `unclassified` rule and
692// requires prose-format alone. That is the research artefacts under research/,
693// the GitHub mirror's workflow under .github/, and editor settings: files
694// no program here reads.