gunk-dev/the-valley

policy.cue

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