gunk-dev/the-valley

policy.cue

source533c1d7e7da4main's published tip history
27.3 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-knot",
67 "valley-plan",
68 "valley-darwin-eval",
69 "selfupdate-unit",
70 "valley-self-update",
71 "policy-deriver",
72 "own-policy",
73 "module-eval",
74 "cue-vet",
75 "attest-schema",
76 "identity-schema",
77 "knowledge-lint-consumer",
78 "knowledge-lint-rejects",
79 "init-e2e",
80 "mirror-e2e",
81 "bus-e2e",
82 "ssh-e2e",
83 "publish-e2e",
84 "worker-e2e",
85 "telemetry-unit",
86 "telemetry-e2e",
87 "restack-host-e2e",
88 "web-publisher-e2e",
89 "web-image",
90 "web-push-e2e",
91 ]
92 for n in ownChecks {
93 checks: (n): {
94 runner: "nix"
95 attribute: n
96 }
97 }
98
99 // The integrator's scenarios take about a minute, and ssh-e2e,
100 // publish-e2e, worker-e2e, telemetry-e2e, restack-host-e2e and
101 // web-publisher-e2e boot
102 // NixOS machines. web-reader-browser-e2e boots no machine, but its
103 // closure holds Chromium, and it runs a browser in about 2 GiB.
104 // Every other check here takes seconds once its packages are built.
105 checks: "integrator-e2e": cost: "slow"
106 checks: "ssh-e2e": cost: "slow"
107 checks: "publish-e2e": cost: "slow"
108 checks: "worker-e2e": cost: "slow"
109 checks: "telemetry-e2e": cost: "slow"
110 checks: "restack-host-e2e": cost: "slow"
111 checks: "web-publisher-e2e": cost: "slow"
112 checks: "web-reader-browser-e2e": cost: "slow"
113
114 // Each class below is one part of the tree and the checks that read it.
115 // A path in two classes requires both sets. A Go module's unit check is
116 // its package built again with its tests, which runs `go test`. The
117 // package itself runs no tests (nix/packages.nix).
118
119 // The pre-receive hook and the git user's login shell. protect-e2e
120 // pushes to bare repositories wired with the hook a host renders,
121 // valley-ready pushes change records through that hook, and knots-e2e
122 // pushes the plan graph through it.
123 classes: valleyhook: {
124 paths: "valleyhook/**": true
125 requires: "valleyhook-unit": true
126 requires: "protect-e2e": true
127 requires: "valley-ready": true
128 requires: "knots-e2e": true
129 }
130
131 // The change record, which the hook guards, the CLI's Go verbs and the
132 // rebase engine write, and the integrator and the review module read.
133 // Each reads a record through it, so a change to it requires their tests
134 // as well as its own.
135 classes: change: {
136 paths: "change/**": true
137 requires: "change-unit": true
138 requires: "review-unit": true
139 requires: "valleyhook-unit": true
140 requires: "protect-e2e": true
141 requires: "rebase-unit": true
142 requires: "valley-go-unit": true
143 requires: "valley-ready": true
144 requires: "valley-changes": true
145 requires: "integrator-unit": true
146 requires: "integrator-e2e": true
147 requires: "approval-unit": true
148 }
149
150 // The plan graph's module, which the CLI's Go verbs write the graph
151 // with and the hook validates it with. knot-agree holds its validator
152 // to the node schema and the knowledge lint, valley-knot and
153 // valley-plan drive the verbs that use it, and knots-e2e pushes
154 // through the hook. The web export reads names and knot IDs by its
155 // rules, and the web server reads a claim's age by them, so
156 // web-unit and web-server-unit are here too.
157 classes: knot: {
158 paths: "knot/**": true
159 requires: "knot-unit": true
160 requires: "knot-agree": true
161 requires: "valley-go-unit": true
162 requires: "valley-knot": true
163 requires: "valley-plan": true
164 requires: "valleyhook-unit": true
165 requires: "knots-e2e": true
166 requires: "web-unit": true
167 requires: "web-server-unit": true
168 }
169
170 // valley-delta-v1, which the CLI's Go verbs compare a version with its
171 // approved version through, and which the review module recomputes a
172 // review's binding with. delta-unit holds it to its conformance vectors,
173 // valley-go-unit builds the verbs with it, valley-ready and review-notes
174 // drive review over the comparison, and review-unit binds reviews with
175 // its bounded reading.
176 classes: delta: {
177 paths: "delta/**": true
178 requires: "delta-unit": true
179 requires: "valley-go-unit": true
180 requires: "valley-ready": true
181 requires: "review-notes": true
182 requires: "review-unit": true
183 }
184
185 // Review records: the record, its binding to the version it judged, and
186 // its append-only history. review-unit runs its tests against real git.
187 classes: review: {
188 paths: "review/**": true
189 requires: "review-unit": true
190 }
191
192 // The deriver of required checks, and the composed-policy reader it reads
193 // the whole policy through. derive-unit holds the deriver to bin/valley's,
194 // composed-unit holds the reader's layer reads, and valley-go-unit builds
195 // the verb that prints its answer with both.
196 classes: derive: {
197 paths: "derive/**": true
198 paths: "composed/**": true
199 requires: "derive-unit": true
200 requires: "composed-unit": true
201 requires: "valley-go-unit": true
202 }
203
204 // The note envelope. The hook and attest both read notes through it,
205 // the identity compiler reads its approval files back with it, and the
206 // web export's manifest is a note, which the web server builds with,
207 // so a change to it requires their tests as well as its own.
208 classes: note: {
209 paths: "note/**": true
210 requires: "note-unit": true
211 requires: "valleyhook-unit": true
212 requires: "protect-e2e": true
213 requires: "attest-unit": true
214 requires: "attest-e2e": true
215 requires: "identity-unit": true
216 requires: "approval-unit": true
217 requires: "web-unit": true
218 requires: "web-server-unit": true
219 }
220
221 // The attestation helper, and the conformance vectors under
222 // attest/conformance/ that hold its written form fixed. restack-e2e
223 // signs the changes' evidence with attest run.
224 classes: attest: {
225 paths: "attest/**": true
226 requires: "attest-unit": true
227 requires: "attest-conformance": true
228 requires: "attest-e2e": true
229 requires: "restack-e2e": true
230 }
231
232 // The strict JSON reader. The hook reads its push policy with it, the
233 // identity compiler its registry, read access a policy/read, and the
234 // web export, publisher, server and receiver what they are sent, so a
235 // change to it requires their unit tests as well as its own.
236 classes: exactjson: {
237 paths: "exactjson/**": true
238 requires: "exactjson-unit": true
239 requires: "valleyhook-unit": true
240 requires: "identity-unit": true
241 requires: "readaccess-unit": true
242 requires: "web-unit": true
243 requires: "web-server-unit": true
244 requires: "web-receiver-unit": true
245 }
246
247 // Approval statements, their signing and verifying, and the PIV
248 // session signer.
249 classes: approval: {
250 paths: "approval/**": true
251 requires: "approval-unit": true
252 }
253
254 // The identity registry compiler, and the registries it is driven over.
255 classes: identity: {
256 paths: "identity/**": true
257 paths: "examples/identity/**": true
258 requires: "identity-unit": true
259 requires: "identity-e2e": true
260 }
261
262 // Telemetry: the records, streams and command grammar of telemetry/, the
263 // collector built from it, and the host module's half in
264 // nix/telemetry.nix. The git user's shell parses the command with it,
265 // attest, the worker and the integrator write its streams, and the CLI
266 // reads and reports with it, so a change to it requires their unit
267 // tests as well as its own. telemetry-e2e drives all of it on a NixOS
268 // machine; it follows main after a landing, as slow end-to-end checks
269 // do, and gates nothing. module-eval evaluates the module in nix/telemetry.nix, so the
270 // module-eval class requires it for that file. It runs none of the
271 // collector's code, so a change under telemetry/ does not require it.
272 classes: telemetry: {
273 paths: "telemetry/**": true
274 paths: "nix/telemetry.nix": true
275 requires: "telemetry-unit": true
276 follows: "telemetry-e2e": true
277 requires: "valleyhook-unit": true
278 requires: "attest-unit": true
279 requires: "valley-go-unit": true
280 requires: "integrator-unit": true
281 }
282
283 // The producers and the CLI that record and send telemetry: attest's
284 // progress, the worker's and the workstation's records, and approve,
285 // which runs them. telemetry-e2e observes each over ssh, and follows main
286 // after a landing.
287 classes: "telemetry-producers": {
288 paths: "attest/progress.go": true
289 paths: "status/telemetry.go": true
290 paths: "status/workertelemetry.go": true
291 paths: "bin/valley": true
292 follows: "telemetry-e2e": true
293 }
294
295 // The check worker's own code: its pass and its records in status/, the
296 // wake directory it claims, and attest's run, which runs each check a
297 // pass builds, signs and stores the evidence, and reports its progress.
298 // worker-e2e runs those passes on a NixOS machine; it follows main after
299 // a landing, as slow end-to-end checks do, and gates nothing. The rest of status/
300 // and attest/ serves other commands too, and their classes require
301 // their own checks.
302 classes: worker: {
303 paths: "status/worker.go": true
304 paths: "status/workertelemetry.go": true
305 paths: "status/wake.go": true
306 paths: "attest/run.go": true
307 paths: "attest/check.go": true
308 paths: "attest/progress.go": true
309 follows: "worker-e2e": true
310 }
311
312 // The integrator, the end-to-end scenarios under integrator/e2e/, and the
313 // verification schema, which the integrator composes every policy under
314 // and both checks read. restack-e2e runs the real integrator too: it
315 // lands one change and rejects another.
316 classes: integrator: {
317 paths: "integrator/**": true
318 paths: "composed/**": true
319 paths: "schema/verification.cue": true
320 requires: "integrator-unit": true
321 requires: "integrator-e2e": true
322 requires: "restack-e2e": true
323 }
324
325 // The security-key signature verifier.
326 classes: sigverify: {
327 paths: "sigverify/**": true
328 requires: "sigverify-unit": true
329 requires: "sigverify-e2e": true
330 }
331
332 // The web UI's module: the export contract, its shared fixture, the
333 // publisher, the server and its browser state, and the receiver. The
334 // publisher's tests also read each project's policy/read and the
335 // instance's registry under the read and identity schemas.
336 // web-push-e2e runs the three programs as they ship, and
337 // web-reader-state-crash kills valley-web inside its browser state's
338 // transactions. Changes require all five checks.
339 classes: web: {
340 paths: "web/**": true
341 paths: "schema/read.cue": true
342 paths: "schema/identity.cue": true
343 requires: "web-unit": true
344 requires: "web-server-unit": true
345 requires: "web-reader-state-crash": true
346 requires: "web-receiver-unit": true
347 requires: "web-push-e2e": true
348 }
349
350 // What a browser engine runs or is served by on a reader page:
351 // web-reader-browser-e2e runs the packaged valley-web under headless
352 // Chromium. So it is required for the reader script and pages, the
353 // layout and the stylesheet whose hash every policy carries, the
354 // rendering and its policies, the dispatch and headers in server.go,
355 // the reader handlers, the command that sets up the browser state, the
356 // check's own test, and the packaging that builds the binary and its
357 // assets. Its definition is its own class's, check-<name> below. The
358 // publisher, package export, archives and the projection of the graph
359 // are not here: a change to them alone needs no browser.
360 classes: "reader-browser": {
361 paths: "web/server/assets/reader.js": true
362 paths: "web/server/assets/style.css": true
363 paths: "web/server/templates/redeem.tmpl": true
364 paths: "web/server/templates/logout.tmpl": true
365 paths: "web/server/templates/layout.tmpl": true
366 paths: "web/server/render.go": true
367 paths: "web/server/server.go": true
368 paths: "web/server/reader.go": true
369 paths: "web/cmd/valley-web/main.go": true
370 paths: "web/cmd/valley-web/browser_test.go": true
371 paths: "nix/packages.nix": true
372 requires: "web-reader-browser-e2e": true
373 }
374
375 // The real publisher's output that web-server-unit serves:
376 // nix/checks/web-published.sh runs the publisher and the CLI as they
377 // ship, and the server's tests read what it writes.
378 classes: "web-published": {
379 paths: "nix/checks/web-published.sh": true
380 requires: "web-server-unit": true
381 }
382
383 // Read access: the two consents a reader needs, the evaluator that
384 // intersects them, and the coverage report. readaccess-unit reads both
385 // schemas, so a change to either requires it, and the web publisher
386 // reads its consents through the module, so web-unit runs too.
387 classes: readaccess: {
388 paths: "readaccess/**": true
389 paths: "schema/read.cue": true
390 paths: "schema/identity.cue": true
391 requires: "readaccess-unit": true
392 requires: "web-unit": true
393 }
394
395 // The valley CLI: the script, its Go verbs (status/), the rebase engine
396 // they rebase and read landings with (rebase/), and its completions.
397 // valley-ready drives ready, withdraw, rebase and the verbs that take a
398 // change's handle, valley-changes drives changes and pending,
399 // valley-plan drives plan against the golden files under
400 // status/testdata/plan/, and valley-self-update drives --version and
401 // self-update. derive-unit holds the script's deriver to the Go one.
402 // The web publisher reads the valley through plan, pending and knot
403 // show, and its tests in web-unit run the CLI itself, as web-push-e2e
404 // runs the CLI's package.
405 classes: cli: {
406 paths: "bin/valley": true
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-knot": true
418 requires: "valley-plan": true
419 requires: "valley-self-update": true
420 requires: "policy-deriver": true
421 requires: "derive-unit": 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 derivers 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 }
599
600 // A check's own files require that check: its script,
601 // nix/checks/<name>.sh, and its definition, nix/checks/<name>.nix,
602 // where it has a file of its own. One class per check, named
603 // check-<name>. prose-format is the floor's check, but its script is
604 // here. own-policy fails if a script under nix/checks/ requires no
605 // check. A class can only require here, so a change to the script or
606 // definition of worker-e2e or telemetry-e2e still builds it before
607 // landing, though a change to the subject it tests only follows.
608 for n in list.Concat([ownChecks, ["prose-format"]]) {
609 classes: ("check-\(n)"): {
610 paths: ("nix/checks/\(n).sh"): true
611 paths: ("nix/checks/\(n).nix"): true
612 requires: (n): true
613 }
614 }
615
616 // The other files under nix/checks/, and the checks that read each: the
617 // definitions of a subject's checks, and the helpers and rejection lists
618 // a check is given. cli.nix, which defines every check of bin/valley,
619 // is left to the nix class, as is nix/checks.nix, which wires them all.
620 // This map can only require, so telemetry.nix keeps requiring
621 // telemetry-e2e: a change to its definition builds it before landing.
622 let checkFiles = {
623 "attest.nix": ["attest-unit", "attest-conformance", "attest-e2e"]
624 "telemetry.nix": ["telemetry-unit", "telemetry-e2e"]
625 "delta.nix": ["delta-unit"]
626 "derive.nix": ["derive-unit", "composed-unit"]
627 "review.nix": ["review-unit"]
628 "identity.nix": ["identity-unit", "identity-e2e"]
629 "approval.nix": ["approval-unit"]
630 "integrator.nix": ["integrator-unit", "integrator-e2e"]
631 "signers.nix": ["signers-e2e"]
632 "sigverify.nix": ["sigverify-unit", "sigverify-e2e"]
633 "web.nix": ["web-unit", "web-server-unit", "web-reader-state-crash", "web-receiver-unit", "web-image", "readaccess-unit"]
634 "schema.nix": ["cue-vet", "attest-schema", "identity-schema"]
635 "knowledge.nix": ["knowledge-lint-consumer", "knowledge-lint-rejects", "prose-format"]
636 "hooks.nix": ["valleyhook-unit", "change-unit", "mirror-e2e", "protect-e2e", "init-e2e", "bus-e2e"]
637 "host-module.nix": ["module-eval"]
638 "fail-nth.sh": ["policy-deriver", "valley-request"]
639 "review-notes-editor.sh": ["review-notes"]
640 "cue-vet-rejected.txt": ["cue-vet"]
641 "identity-rejected.txt": ["identity-schema"]
642 "knowledge-lint-rejected.txt": ["knowledge-lint-rejects"]
643 }
644 for f, ns in checkFiles {
645 classes: ("check-file-\(strings.Replace(f, ".", "-", -1))"): {
646 paths: ("nix/checks/\(f)"): true
647 requires: {for n in ns {(n): true}}
648 }
649 }
650
651 // How far an approval carries across a rebase (#Carry in
652 // schema/verification.cue). Every path not named here is same-paths.
653 //
654 // The hook, the integrator, the signature verifier and the identity
655 // compiler enforce who may do what. An approval of a change to one of
656 // them carries only while no landing has touched the same classes:
657 // same-class. The identity compiler's class is its code and the schema
658 // it holds a registry to. It requires nothing, because the identity and
659 // schema classes already require the checks of its paths.
660 classes: valleyhook: carry: "same-class": true
661 classes: integrator: carry: "same-class": true
662 classes: sigverify: carry: "same-class": true
663 classes: "identity-compiler": {
664 paths: "identity/**": true
665 paths: "schema/identity.cue": true
666 carry: "same-class": true
667 }
668
669 // The policy decides what every change requires, so an approval of a
670 // change to it carries across no landing at all: exact. That is this
671 // layer, the pointer to the owning valley, and the schema a policy is
672 // written in. The example policies are fixtures and stay same-paths. Like
673 // identity-compiler, this class requires nothing: the policy class
674 // requires the checks of its paths.
675 //
676 // This tree holds no registry, grant or secret data of its own. The
677 // registries, grants and keys under examples/ and attest/conformance/
678 // are test fixtures, and the instance's registry is in its instance
679 // repository. So nothing else here is exact.
680 classes: "policy-authority": {
681 paths: "policy/**": true
682 paths: "schema/verification.cue": true
683 carry: exact: true
684 }
685
686 // The restacker's cap is the schema's default of 64 automatic versions
687 // per change.
688}
689
690// What no class above covers falls to the floor's `unclassified` rule and
691// requires prose-format alone. That is the research artefacts under research/,
692// the GitHub mirror's workflow under .github/, and editor settings: files
693// no program here reads.