gunk-dev/the-valley

policy.cue

source0d275c6b8a51main's published tip history
28.1 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, and the written form and tree digest of the
206 // statement inside it (note/statement/), which the attest class covers
207 // too. The hook and attest both read notes through it, the identity
208 // compiler reads its approval files back with it, the web export's
209 // manifest is a note, which the web server builds with, the vectors
210 // attest-conformance holds are signed notes, and the rebase engine
211 // verifies transfer statements with all of it, as signers-e2e drives
212 // end to end. So a change to it requires their tests as well as its
213 // own.
214 classes: note: {
215 paths: "note/**": true
216 requires: "note-unit": true
217 requires: "valleyhook-unit": true
218 requires: "protect-e2e": true
219 requires: "attest-unit": true
220 requires: "attest-conformance": true
221 requires: "attest-e2e": true
222 requires: "identity-unit": true
223 requires: "approval-unit": true
224 requires: "web-unit": true
225 requires: "web-server-unit": true
226 requires: "rebase-unit": true
227 requires: "signers-e2e": true
228 }
229
230 // The attestation helper, the written form and tree digest it writes
231 // and verifies statements with (note/statement/), and the conformance
232 // vectors under attest/conformance/ that hold the written form fixed.
233 // restack-e2e signs the changes' evidence with attest run.
234 classes: attest: {
235 paths: "attest/**": true
236 paths: "note/statement/**": true
237 requires: "attest-unit": true
238 requires: "attest-conformance": true
239 requires: "attest-e2e": true
240 requires: "restack-e2e": true
241 }
242
243 // The strict JSON reader. The hook reads its push policy with it, the
244 // identity compiler its registry, read access a policy/read, and the
245 // web export, publisher, server and receiver what they are sent, so a
246 // change to it requires their unit tests as well as its own.
247 classes: exactjson: {
248 paths: "exactjson/**": true
249 requires: "exactjson-unit": true
250 requires: "valleyhook-unit": true
251 requires: "identity-unit": true
252 requires: "readaccess-unit": true
253 requires: "web-unit": true
254 requires: "web-server-unit": true
255 requires: "web-receiver-unit": true
256 }
257
258 // Approval statements, their signing and verifying, and the PIV
259 // session signer.
260 classes: approval: {
261 paths: "approval/**": true
262 requires: "approval-unit": true
263 }
264
265 // The identity registry compiler, and the registries it is driven over.
266 classes: identity: {
267 paths: "identity/**": true
268 paths: "examples/identity/**": true
269 requires: "identity-unit": true
270 requires: "identity-e2e": true
271 }
272
273 // Telemetry: the records, streams and command grammar of telemetry/, the
274 // collector built from it, and the host module's half in
275 // nix/telemetry.nix. The git user's shell parses the command with it,
276 // attest, the worker and the integrator write its streams, and the CLI
277 // reads and reports with it, so a change to it requires their unit
278 // tests as well as its own. telemetry-e2e drives all of it on a NixOS
279 // machine; it follows main after a landing, as slow end-to-end checks
280 // do, and gates nothing. module-eval evaluates the module in nix/telemetry.nix, so the
281 // module-eval class requires it for that file. It runs none of the
282 // collector's code, so a change under telemetry/ does not require it.
283 classes: telemetry: {
284 paths: "telemetry/**": true
285 paths: "nix/telemetry.nix": true
286 requires: "telemetry-unit": true
287 follows: "telemetry-e2e": true
288 requires: "valleyhook-unit": true
289 requires: "attest-unit": true
290 requires: "valley-go-unit": true
291 requires: "integrator-unit": true
292 }
293
294 // The producers and the CLI that record and send telemetry: attest's
295 // progress, the worker's and the workstation's records, and approve,
296 // which runs them. telemetry-e2e observes each over ssh, and follows main
297 // after a landing.
298 classes: "telemetry-producers": {
299 paths: "attest/progress.go": true
300 paths: "status/telemetry.go": true
301 paths: "status/workertelemetry.go": true
302 paths: "status/command.go": true
303 follows: "telemetry-e2e": true
304 }
305
306 // The check worker's own code: its pass and its records in status/, the
307 // wake directory it claims, and attest's run, which runs each check a
308 // pass builds, signs and stores the evidence, and reports its progress.
309 // worker-e2e runs those passes on a NixOS machine; it follows main after
310 // a landing, as slow end-to-end checks do, and gates nothing. The rest of status/
311 // and attest/ serves other commands too, and their classes require
312 // their own checks.
313 classes: worker: {
314 paths: "status/worker.go": true
315 paths: "status/workertelemetry.go": true
316 paths: "status/wake.go": true
317 paths: "attest/run.go": true
318 paths: "attest/check.go": true
319 paths: "attest/progress.go": true
320 follows: "worker-e2e": true
321 }
322
323 // The integrator, the end-to-end scenarios under integrator/e2e/, and the
324 // verification schema, which the integrator composes every policy under
325 // and both checks read. restack-e2e runs the real integrator too: it
326 // lands one change and rejects another.
327 classes: integrator: {
328 paths: "integrator/**": true
329 paths: "composed/**": true
330 paths: "schema/verification.cue": true
331 requires: "integrator-unit": true
332 requires: "integrator-e2e": true
333 requires: "restack-e2e": true
334 }
335
336 // The security-key signature verifier.
337 classes: sigverify: {
338 paths: "sigverify/**": true
339 requires: "sigverify-unit": true
340 requires: "sigverify-e2e": true
341 }
342
343 // The web UI's module: the export contract, its shared fixture, the
344 // publisher, the server and its browser state, and the receiver. The
345 // publisher's tests also read each project's policy/read and the
346 // instance's registry under the read and identity schemas.
347 // web-push-e2e runs the three programs as they ship, and
348 // web-reader-state-crash kills valley-web inside its browser state's
349 // transactions. Changes require all five checks.
350 classes: web: {
351 paths: "web/**": true
352 paths: "schema/read.cue": true
353 paths: "schema/identity.cue": true
354 requires: "web-unit": true
355 requires: "web-server-unit": true
356 requires: "web-reader-state-crash": true
357 requires: "web-receiver-unit": true
358 requires: "web-push-e2e": true
359 }
360
361 // What a browser engine runs or is served by on a reader page:
362 // web-reader-browser-e2e runs the packaged valley-web under headless
363 // Chromium. So it is required for the reader script and pages, the
364 // layout and the stylesheet whose hash every policy carries, the
365 // rendering and its policies, the dispatch and headers in server.go,
366 // the reader handlers, the command that sets up the browser state, the
367 // check's own test, and the packaging that builds the binary and its
368 // assets. Its definition is its own class's, check-<name> below. The
369 // publisher, package export, archives and the projection of the graph
370 // are not here: a change to them alone needs no browser.
371 classes: "reader-browser": {
372 paths: "web/server/assets/reader.js": true
373 paths: "web/server/assets/style.css": true
374 paths: "web/server/templates/redeem.tmpl": true
375 paths: "web/server/templates/logout.tmpl": true
376 paths: "web/server/templates/layout.tmpl": true
377 paths: "web/server/render.go": true
378 paths: "web/server/server.go": true
379 paths: "web/server/reader.go": true
380 paths: "web/cmd/valley-web/main.go": true
381 paths: "web/cmd/valley-web/browser_test.go": true
382 paths: "nix/packages.nix": true
383 requires: "web-reader-browser-e2e": true
384 }
385
386 // The real publisher's output that web-server-unit serves:
387 // nix/checks/web-published.sh runs the publisher and the CLI as they
388 // ship, and the server's tests read what it writes.
389 classes: "web-published": {
390 paths: "nix/checks/web-published.sh": true
391 requires: "web-server-unit": true
392 }
393
394 // Read access: the two consents a reader needs, the evaluator that
395 // intersects them, and the coverage report. readaccess-unit reads both
396 // schemas, so a change to either requires it, and the web publisher
397 // reads its consents through the module, so web-unit runs too.
398 classes: readaccess: {
399 paths: "readaccess/**": true
400 paths: "schema/read.cue": true
401 paths: "schema/identity.cue": true
402 requires: "readaccess-unit": true
403 requires: "web-unit": true
404 }
405
406 // The valley CLI: the valley command (status/), the rebase engine it
407 // rebases and reads landings with (rebase/), and its completions.
408 // valley-ready drives ready, withdraw, rebase and the verbs that take a
409 // change's handle, valley-changes drives changes and pending,
410 // valley-walk drives review with no change across a host's projects,
411 // valley-plan drives plan against the golden files under
412 // status/testdata/plan/, and valley-self-update drives --version and
413 // self-update. The web publisher reads the valley through plan, pending and knot
414 // show, and its tests in web-unit run the CLI itself, as web-push-e2e
415 // runs the CLI's package.
416 classes: cli: {
417 paths: "status/**": true
418 paths: "rebase/**": true
419 paths: "completions/**": true
420 requires: "valley-go-unit": true
421 requires: "valley-cli": true
422 requires: "review-notes": true
423 requires: "valley-request": true
424 requires: "valley-status": true
425 requires: "valley-ready": true
426 requires: "valley-changes": true
427 requires: "valley-walk": true
428 requires: "valley-knot": true
429 requires: "valley-plan": true
430 requires: "valley-self-update": true
431 requires: "policy-deriver": true
432 requires: "web-unit": true
433 requires: "web-push-e2e": true
434 requires: "integrator-e2e": true
435 }
436
437 // The push path as it ships: web-push-e2e runs the publisher, the
438 // receiver, valley-web and the CLI as nix/packages.nix builds and wraps
439 // them, and exports its host declaration under schema/valley.cue. The
440 // web and cli classes require it for the code it runs.
441 classes: "web-push": {
442 paths: "nix/packages.nix": true
443 paths: "schema/valley.cue": true
444 requires: "web-push-e2e": true
445 }
446
447 // Self-update: its module (selfupdate/), the policy the package ships
448 // for its smoke test, and the home-manager module that runs it on a
449 // timer. valley-go-unit builds the verb with the module, and
450 // valley-self-update drives the verb through the package and holds the
451 // units the home-manager module renders.
452 classes: selfupdate: {
453 paths: "selfupdate/**": true
454 paths: "examples/policy/smoke/**": true
455 paths: "nix/home-module.nix": true
456 requires: "selfupdate-unit": true
457 requires: "valley-go-unit": true
458 requires: "valley-self-update": true
459 }
460
461 // The rebase engine, with its own tests over real repositories. The
462 // verbs that run it are the cli class's, so its paths are there too.
463 classes: rebase: {
464 paths: "rebase/**": true
465 requires: "rebase-unit": true
466 }
467
468 // The restacker, with its unit tests and its planner end to end. It
469 // reads origin through the rebase engine and the policy through the
470 // composed-policy reader it shares with the integrator, so a change to
471 // either requires its checks too.
472 classes: restack: {
473 paths: "restack/**": true
474 paths: "composed/**": true
475 paths: "rebase/**": true
476 requires: "restack-unit": true
477 requires: "restack-e2e": true
478 }
479
480 // What a client verifies an integrator's transfer statement with: the
481 // host's publisher and the default name it publishes, the unit that
482 // runs it, the client's reading of the signers, the instance discovery
483 // it reads them through, the snapshot that asks for them, and the
484 // verifier and cache it checks statements with.
485 // signers-e2e drives them together over the real integrator.
486 classes: signers: {
487 paths: "integrator/signers.go": true
488 paths: "integrator/main.go": true
489 paths: "nix/valley-host.nix": true
490 paths: "status/signers.go": true
491 paths: "status/list.go": true
492 paths: "rebase/snapshot.go": true
493 paths: "rebase/transfer.go": true
494 paths: "rebase/cache.go": true
495 requires: "signers-e2e": true
496 }
497
498 // The web publisher's module, which runs the publisher on a timer in a
499 // sandbox of its own. web-publisher-e2e runs the unit it renders in a
500 // NixOS machine. module-eval, in the module-eval class, holds what it
501 // renders.
502 classes: "web-publisher": {
503 paths: "nix/web-publisher.nix": true
504 requires: "web-publisher-e2e": true
505 }
506
507 // The verification policy: this layer, the pointer to the owning
508 // valley, the schema a policy is written in, and the example policies
509 // the deriver and cue-vet read.
510 classes: policy: {
511 paths: "policy/**": true
512 paths: "schema/verification.cue": true
513 paths: "examples/policy/**": true
514 requires: "policy-deriver": true
515 requires: "derive-unit": true
516 requires: "cue-vet": true
517 requires: "own-policy": true
518 }
519
520 // What module-eval evaluates: the NixOS modules, the host declarations
521 // it renders and the files they are exported from, and the wiring that
522 // hands them to the check. Nothing else changes its derivation. An edit
523 // to another check's script or definition, to the packages, or to a
524 // program's code leaves it unchanged, so those paths are not here. That
525 // holds for nix/checks/ in general: each file there is its own check's,
526 // by the per-check classes below, and module-eval's own files are
527 // nix/checks/module-eval.sh, nix/checks/host-module.nix and
528 // nix/checks/hosts.nix.
529 classes: "module-eval": {
530 paths: "nix/valley-host.nix": true
531 paths: "nix/telemetry.nix": true
532 paths: "nix/web-publisher.nix": true
533 paths: "nix/web-receiver.nix": true
534 paths: "nix/checks.nix": true
535 paths: "nix/checks/hosts.nix": true
536 paths: "nix/checks/host-module.nix": true
537 paths: "schema/valley.cue": true
538 paths: "flake.nix": true
539 paths: "flake.lock": true
540 paths: "examples/host.cue": true
541 paths: "examples/hosts/protected.cue": true
542 paths: "examples/hosts/no-backup.cue": true
543 paths: "examples/hosts/bus.cue": true
544 paths: "examples/hosts/mirrors.cue": true
545 requires: "module-eval": true
546 }
547
548 // The flake, the NixOS module, the packages and the check definitions,
549 // and the host declarations the module checks are evaluated over.
550 // own-policy is here because renaming or removing a flake check would
551 // leave this layer naming a check that no longer exists. A change to
552 // flake.nix or flake.lock requires these and module-eval, which boots
553 // no machine, so a nixpkgs bump boots none.
554 classes: nix: {
555 paths: "nix/**": true
556 paths: "flake.nix": true
557 paths: "flake.lock": true
558 paths: "examples/host.cue": true
559 paths: "examples/hosts/**": true
560 requires: "valley-darwin-eval": true
561 requires: "cue-vet": true
562 requires: "own-policy": true
563 }
564
565 // The schemas, and the example events, attestations and registries they
566 // are vetted against.
567 classes: schema: {
568 paths: "schema/**": true
569 paths: "examples/events/**": true
570 paths: "examples/attestations/**": true
571 paths: "examples/identity/**": true
572 requires: "cue-vet": true
573 requires: "attest-schema": true
574 requires: "identity-schema": true
575 }
576
577 // The knowledge lint itself: its program, the node schema it holds a
578 // graph to, and the example graphs it must accept and reject. The plan
579 // graph's validator is held to the same two by knot-agree.
580 classes: "knowledge-lint": {
581 paths: "nix/knowledge-lint.*": true
582 paths: "schema/node.cue": true
583 paths: "examples/graphs/**": true
584 requires: "knowledge-lint-consumer": true
585 requires: "knowledge-lint-rejects": true
586 requires: "knot-agree": true
587 }
588
589 // The NixOS module and what its end-to-end checks run. The hook checks
590 // follow the scripts out of the hosts in nix/checks/hosts.nix, which
591 // are made of the three declarations named here; ssh-e2e, publish-e2e,
592 // worker-e2e and restack-host-e2e run the module in NixOS machines.
593 // worker-e2e follows main after a landing and gates nothing.
594 classes: "host-module": {
595 paths: "nix/valley-host.nix": true
596 paths: "nix/checks/hosts.nix": true
597 paths: "examples/hosts/protected.cue": true
598 paths: "examples/hosts/bus.cue": true
599 paths: "examples/hosts/mirrors.cue": true
600 requires: "init-e2e": true
601 requires: "mirror-e2e": true
602 requires: "bus-e2e": true
603 requires: "protect-e2e": true
604 requires: "knots-e2e": true
605 requires: "identity-e2e": true
606 requires: "ssh-e2e": true
607 requires: "publish-e2e": true
608 follows: "worker-e2e": true
609 requires: "restack-host-e2e": true
610 requires: "valley-changes": true
611 requires: "valley-walk": true
612 }
613
614 // A check's own files require that check: its script,
615 // nix/checks/<name>.sh, and its definition, nix/checks/<name>.nix,
616 // where it has a file of its own. One class per check, named
617 // check-<name>. prose-format is the floor's check, but its script is
618 // here. own-policy fails if a script under nix/checks/ requires no
619 // check. A class can only require here, so a change to the script or
620 // definition of worker-e2e or telemetry-e2e still builds it before
621 // landing, though a change to the subject it tests only follows.
622 for n in list.Concat([ownChecks, ["prose-format"]]) {
623 classes: ("check-\(n)"): {
624 paths: ("nix/checks/\(n).sh"): true
625 paths: ("nix/checks/\(n).nix"): true
626 requires: (n): true
627 }
628 }
629
630 // The other files under nix/checks/, and the checks that read each: the
631 // definitions of a subject's checks, and the helpers and rejection lists
632 // a check is given. cli.nix, which defines every check of the CLI,
633 // is left to the nix class, as is nix/checks.nix, which wires them all.
634 // This map can only require, so telemetry.nix keeps requiring
635 // telemetry-e2e: a change to its definition builds it before landing.
636 let checkFiles = {
637 "attest.nix": ["attest-unit", "attest-conformance", "attest-e2e"]
638 "telemetry.nix": ["telemetry-unit", "telemetry-e2e"]
639 "delta.nix": ["delta-unit"]
640 "derive.nix": ["derive-unit", "composed-unit"]
641 "review.nix": ["review-unit"]
642 "identity.nix": ["identity-unit", "identity-e2e"]
643 "approval.nix": ["approval-unit"]
644 "integrator.nix": ["integrator-unit", "integrator-e2e"]
645 "signers.nix": ["signers-e2e"]
646 "sigverify.nix": ["sigverify-unit", "sigverify-e2e"]
647 "web.nix": ["web-unit", "web-server-unit", "web-reader-state-crash", "web-receiver-unit", "web-image", "readaccess-unit"]
648 "schema.nix": ["cue-vet", "attest-schema", "identity-schema"]
649 "knowledge.nix": ["knowledge-lint-consumer", "knowledge-lint-rejects", "prose-format"]
650 "hooks.nix": ["valleyhook-unit", "change-unit", "mirror-e2e", "protect-e2e", "init-e2e", "bus-e2e"]
651 "host-module.nix": ["module-eval"]
652 "fail-nth.sh": ["policy-deriver", "valley-request"]
653 "review-notes-editor.sh": ["review-notes"]
654 "cue-vet-rejected.txt": ["cue-vet"]
655 "identity-rejected.txt": ["identity-schema"]
656 "knowledge-lint-rejected.txt": ["knowledge-lint-rejects"]
657 }
658 for f, ns in checkFiles {
659 classes: ("check-file-\(strings.Replace(f, ".", "-", -1))"): {
660 paths: ("nix/checks/\(f)"): true
661 requires: {for n in ns {(n): true}}
662 }
663 }
664
665 // How far an approval carries across a rebase (#Carry in
666 // schema/verification.cue). Every path not named here is same-paths.
667 //
668 // The hook, the integrator, the signature verifier and the identity
669 // compiler enforce who may do what. An approval of a change to one of
670 // them carries only while no landing has touched the same classes:
671 // same-class. The identity compiler's class is its code and the schema
672 // it holds a registry to. It requires nothing, because the identity and
673 // schema classes already require the checks of its paths.
674 classes: valleyhook: carry: "same-class": true
675 classes: integrator: carry: "same-class": true
676 classes: sigverify: carry: "same-class": true
677 classes: "identity-compiler": {
678 paths: "identity/**": true
679 paths: "schema/identity.cue": true
680 carry: "same-class": true
681 }
682
683 // The policy decides what every change requires, so an approval of a
684 // change to it carries across no landing at all: exact. That is this
685 // layer, the pointer to the owning valley, and the schema a policy is
686 // written in. The example policies are fixtures and stay same-paths. Like
687 // identity-compiler, this class requires nothing: the policy class
688 // requires the checks of its paths.
689 //
690 // This tree holds no registry, grant or secret data of its own. The
691 // registries, grants and keys under examples/ and attest/conformance/
692 // are test fixtures, and the instance's registry is in its instance
693 // repository. So nothing else here is exact.
694 classes: "policy-authority": {
695 paths: "policy/**": true
696 paths: "schema/verification.cue": true
697 carry: exact: true
698 }
699
700 // The restacker's cap is the schema's default of 64 automatic versions
701 // per change.
702}
703
704// What no class above covers falls to the floor's `unclassified` rule and
705// requires prose-format alone. That is the research artefacts under research/,
706// the GitHub mirror's workflow under .github/, and editor settings: files
707// no program here reads.