gunk-dev/the-valley

policy.cue

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