gunk-dev/the-valley

policy.cue

sourcedbe26c5ba15amain'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: "bin/valley": 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 script, its Go verbs (status/), the rebase engine
397 // they rebase and read 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: "bin/valley": true
408 paths: "status/**": true
409 paths: "rebase/**": true
410 paths: "completions/**": true
411 requires: "valley-go-unit": true
412 requires: "valley-cli": true
413 requires: "review-notes": true
414 requires: "valley-request": true
415 requires: "valley-status": true
416 requires: "valley-ready": true
417 requires: "valley-changes": true
418 requires: "valley-walk": true
419 requires: "valley-knot": true
420 requires: "valley-plan": true
421 requires: "valley-self-update": true
422 requires: "policy-deriver": true
423 requires: "web-unit": true
424 requires: "web-push-e2e": true
425 requires: "integrator-e2e": true
426 }
427
428 // The push path as it ships: web-push-e2e runs the publisher, the
429 // receiver, valley-web and the CLI as nix/packages.nix builds and wraps
430 // them, and exports its host declaration under schema/valley.cue. The
431 // web and cli classes require it for the code it runs.
432 classes: "web-push": {
433 paths: "nix/packages.nix": true
434 paths: "schema/valley.cue": true
435 requires: "web-push-e2e": true
436 }
437
438 // Self-update: its module (selfupdate/), the policy the package ships
439 // for its smoke test, and the home-manager module that runs it on a
440 // timer. valley-go-unit builds the verb with the module, and
441 // valley-self-update drives the verb through the package and holds the
442 // units the home-manager module renders.
443 classes: selfupdate: {
444 paths: "selfupdate/**": true
445 paths: "examples/policy/smoke/**": true
446 paths: "nix/home-module.nix": true
447 requires: "selfupdate-unit": true
448 requires: "valley-go-unit": true
449 requires: "valley-self-update": true
450 }
451
452 // The rebase engine, with its own tests over real repositories. The
453 // verbs that run it are the cli class's, so its paths are there too.
454 classes: rebase: {
455 paths: "rebase/**": true
456 requires: "rebase-unit": true
457 }
458
459 // The restacker, with its unit tests and its planner end to end. It
460 // reads origin through the rebase engine and the policy through the
461 // composed-policy reader it shares with the integrator, so a change to
462 // either requires its checks too.
463 classes: restack: {
464 paths: "restack/**": true
465 paths: "composed/**": true
466 paths: "rebase/**": true
467 requires: "restack-unit": true
468 requires: "restack-e2e": true
469 }
470
471 // What a client verifies an integrator's transfer statement with: the
472 // host's publisher and the default name it publishes, the unit that
473 // runs it, the client's reading of the signers, the instance discovery
474 // it reads them through, and the snapshot that asks for them.
475 // signers-e2e drives them together over the real integrator.
476 classes: signers: {
477 paths: "integrator/signers.go": true
478 paths: "integrator/main.go": true
479 paths: "nix/valley-host.nix": true
480 paths: "status/signers.go": true
481 paths: "status/list.go": true
482 paths: "rebase/snapshot.go": true
483 requires: "signers-e2e": true
484 }
485
486 // The web publisher's module, which runs the publisher on a timer in a
487 // sandbox of its own. web-publisher-e2e runs the unit it renders in a
488 // NixOS machine. module-eval, in the module-eval class, holds what it
489 // renders.
490 classes: "web-publisher": {
491 paths: "nix/web-publisher.nix": true
492 requires: "web-publisher-e2e": true
493 }
494
495 // The verification policy: this layer, the pointer to the owning
496 // valley, the schema a policy is written in, and the example policies
497 // the deriver and cue-vet read.
498 classes: policy: {
499 paths: "policy/**": true
500 paths: "schema/verification.cue": true
501 paths: "examples/policy/**": true
502 requires: "policy-deriver": true
503 requires: "derive-unit": true
504 requires: "cue-vet": true
505 requires: "own-policy": true
506 }
507
508 // What module-eval evaluates: the NixOS modules, the host declarations
509 // it renders and the files they are exported from, and the wiring that
510 // hands them to the check. Nothing else changes its derivation. An edit
511 // to another check's script or definition, to the packages, or to a
512 // program's code leaves it unchanged, so those paths are not here. That
513 // holds for nix/checks/ in general: each file there is its own check's,
514 // by the per-check classes below, and module-eval's own files are
515 // nix/checks/module-eval.sh, nix/checks/host-module.nix and
516 // nix/checks/hosts.nix.
517 classes: "module-eval": {
518 paths: "nix/valley-host.nix": true
519 paths: "nix/telemetry.nix": true
520 paths: "nix/web-publisher.nix": true
521 paths: "nix/web-receiver.nix": true
522 paths: "nix/checks.nix": true
523 paths: "nix/checks/hosts.nix": true
524 paths: "nix/checks/host-module.nix": true
525 paths: "schema/valley.cue": true
526 paths: "flake.nix": true
527 paths: "flake.lock": true
528 paths: "examples/host.cue": true
529 paths: "examples/hosts/protected.cue": true
530 paths: "examples/hosts/no-backup.cue": true
531 paths: "examples/hosts/bus.cue": true
532 paths: "examples/hosts/mirrors.cue": true
533 requires: "module-eval": true
534 }
535
536 // The flake, the NixOS module, the packages and the check definitions,
537 // and the host declarations the module checks are evaluated over.
538 // own-policy is here because renaming or removing a flake check would
539 // leave this layer naming a check that no longer exists. A change to
540 // flake.nix or flake.lock requires these and module-eval, which boots
541 // no machine, so a nixpkgs bump boots none.
542 classes: nix: {
543 paths: "nix/**": true
544 paths: "flake.nix": true
545 paths: "flake.lock": true
546 paths: "examples/host.cue": true
547 paths: "examples/hosts/**": true
548 requires: "valley-darwin-eval": true
549 requires: "cue-vet": true
550 requires: "own-policy": true
551 }
552
553 // The schemas, and the example events, attestations and registries they
554 // are vetted against.
555 classes: schema: {
556 paths: "schema/**": true
557 paths: "examples/events/**": true
558 paths: "examples/attestations/**": true
559 paths: "examples/identity/**": true
560 requires: "cue-vet": true
561 requires: "attest-schema": true
562 requires: "identity-schema": true
563 }
564
565 // The knowledge lint itself: its program, the node schema it holds a
566 // graph to, and the example graphs it must accept and reject. The plan
567 // graph's validator is held to the same two by knot-agree.
568 classes: "knowledge-lint": {
569 paths: "nix/knowledge-lint.*": true
570 paths: "schema/node.cue": true
571 paths: "examples/graphs/**": true
572 requires: "knowledge-lint-consumer": true
573 requires: "knowledge-lint-rejects": true
574 requires: "knot-agree": true
575 }
576
577 // The NixOS module and what its end-to-end checks run. The hook checks
578 // follow the scripts out of the hosts in nix/checks/hosts.nix, which
579 // are made of the three declarations named here; ssh-e2e, publish-e2e,
580 // worker-e2e and restack-host-e2e run the module in NixOS machines.
581 // worker-e2e follows main after a landing and gates nothing.
582 classes: "host-module": {
583 paths: "nix/valley-host.nix": true
584 paths: "nix/checks/hosts.nix": true
585 paths: "examples/hosts/protected.cue": true
586 paths: "examples/hosts/bus.cue": true
587 paths: "examples/hosts/mirrors.cue": true
588 requires: "init-e2e": true
589 requires: "mirror-e2e": true
590 requires: "bus-e2e": true
591 requires: "protect-e2e": true
592 requires: "knots-e2e": true
593 requires: "identity-e2e": true
594 requires: "ssh-e2e": true
595 requires: "publish-e2e": true
596 follows: "worker-e2e": true
597 requires: "restack-host-e2e": true
598 requires: "valley-changes": true
599 requires: "valley-walk": true
600 }
601
602 // A check's own files require that check: its script,
603 // nix/checks/<name>.sh, and its definition, nix/checks/<name>.nix,
604 // where it has a file of its own. One class per check, named
605 // check-<name>. prose-format is the floor's check, but its script is
606 // here. own-policy fails if a script under nix/checks/ requires no
607 // check. A class can only require here, so a change to the script or
608 // definition of worker-e2e or telemetry-e2e still builds it before
609 // landing, though a change to the subject it tests only follows.
610 for n in list.Concat([ownChecks, ["prose-format"]]) {
611 classes: ("check-\(n)"): {
612 paths: ("nix/checks/\(n).sh"): true
613 paths: ("nix/checks/\(n).nix"): true
614 requires: (n): true
615 }
616 }
617
618 // The other files under nix/checks/, and the checks that read each: the
619 // definitions of a subject's checks, and the helpers and rejection lists
620 // a check is given. cli.nix, which defines every check of bin/valley,
621 // is left to the nix class, as is nix/checks.nix, which wires them all.
622 // This map can only require, so telemetry.nix keeps requiring
623 // telemetry-e2e: a change to its definition builds it before landing.
624 let checkFiles = {
625 "attest.nix": ["attest-unit", "attest-conformance", "attest-e2e"]
626 "telemetry.nix": ["telemetry-unit", "telemetry-e2e"]
627 "delta.nix": ["delta-unit"]
628 "derive.nix": ["derive-unit", "composed-unit"]
629 "review.nix": ["review-unit"]
630 "identity.nix": ["identity-unit", "identity-e2e"]
631 "approval.nix": ["approval-unit"]
632 "integrator.nix": ["integrator-unit", "integrator-e2e"]
633 "signers.nix": ["signers-e2e"]
634 "sigverify.nix": ["sigverify-unit", "sigverify-e2e"]
635 "web.nix": ["web-unit", "web-server-unit", "web-reader-state-crash", "web-receiver-unit", "web-image", "readaccess-unit"]
636 "schema.nix": ["cue-vet", "attest-schema", "identity-schema"]
637 "knowledge.nix": ["knowledge-lint-consumer", "knowledge-lint-rejects", "prose-format"]
638 "hooks.nix": ["valleyhook-unit", "change-unit", "mirror-e2e", "protect-e2e", "init-e2e", "bus-e2e"]
639 "host-module.nix": ["module-eval"]
640 "fail-nth.sh": ["policy-deriver", "valley-request"]
641 "review-notes-editor.sh": ["review-notes"]
642 "cue-vet-rejected.txt": ["cue-vet"]
643 "identity-rejected.txt": ["identity-schema"]
644 "knowledge-lint-rejected.txt": ["knowledge-lint-rejects"]
645 }
646 for f, ns in checkFiles {
647 classes: ("check-file-\(strings.Replace(f, ".", "-", -1))"): {
648 paths: ("nix/checks/\(f)"): true
649 requires: {for n in ns {(n): true}}
650 }
651 }
652
653 // How far an approval carries across a rebase (#Carry in
654 // schema/verification.cue). Every path not named here is same-paths.
655 //
656 // The hook, the integrator, the signature verifier and the identity
657 // compiler enforce who may do what. An approval of a change to one of
658 // them carries only while no landing has touched the same classes:
659 // same-class. The identity compiler's class is its code and the schema
660 // it holds a registry to. It requires nothing, because the identity and
661 // schema classes already require the checks of its paths.
662 classes: valleyhook: carry: "same-class": true
663 classes: integrator: carry: "same-class": true
664 classes: sigverify: carry: "same-class": true
665 classes: "identity-compiler": {
666 paths: "identity/**": true
667 paths: "schema/identity.cue": true
668 carry: "same-class": true
669 }
670
671 // The policy decides what every change requires, so an approval of a
672 // change to it carries across no landing at all: exact. That is this
673 // layer, the pointer to the owning valley, and the schema a policy is
674 // written in. The example policies are fixtures and stay same-paths. Like
675 // identity-compiler, this class requires nothing: the policy class
676 // requires the checks of its paths.
677 //
678 // This tree holds no registry, grant or secret data of its own. The
679 // registries, grants and keys under examples/ and attest/conformance/
680 // are test fixtures, and the instance's registry is in its instance
681 // repository. So nothing else here is exact.
682 classes: "policy-authority": {
683 paths: "policy/**": true
684 paths: "schema/verification.cue": true
685 carry: exact: true
686 }
687
688 // The restacker's cap is the schema's default of 64 automatic versions
689 // per change.
690}
691
692// What no class above covers falls to the floor's `unclassified` rule and
693// requires prose-format alone. That is the research artefacts under research/,
694// the GitHub mirror's workflow under .github/, and editor settings: files
695// no program here reads.