gunk-dev/the-valley

verification-policy.cue

source794d0244d5d5main's published tip history
1.6 KiB
1// A sample verification policy: qinling's, the docs-only project the
2// staged rollout in dcr-f41f718 exercises first. It is a sample, not an
3// installed file โ€” the real one would live in qinling's own repository,
4// because the policy travels with the project (ida-3e87f5c).
5//
6// Validate: cue vet -c schema/verification.cue examples/verification-policy.cue
7package verification
8
9// prose-format ships today, as a nix flake check in this repo: the check
10// is formatter idempotence, so it is deterministic and judgment-free
11// (ida-1ec03b1). knowledge-lint does not exist yet in either repository โ€”
12// building it is the first step of the staged rollout, and naming it here
13// is what makes the gap concrete rather than notional.
14checks: {
15 "prose-format": {
16 runner: "nix"
17 attribute: "prose-format"
18 }
19 "knowledge-lint": {
20 runner: "nix"
21 attribute: "knowledge-lint"
22 }
23}
24
25// Two classes that overlap on purpose, so composition does real work here
26// rather than only in the schema's comments. A knowledge node is markdown
27// under `.the-valley/`, so it matches both classes and requires both
28// checks; a README edit matches only `prose`, and the knowledge lint is
29// not required โ€” visible as an absence, not asserted anywhere.
30classes: [
31 {
32 name: "knowledge"
33 paths: [".the-valley/**"]
34 requires: ["knowledge-lint"]
35 },
36 {
37 name: "prose"
38 paths: ["**/*.md"]
39 requires: ["prose-format"]
40 },
41]
42
43// qinling is markdown-only today, so any other path is the project growing
44// past its policy. Paying both checks is the cheap failure; the expensive
45// one is a path that quietly requires nothing.
46unclassified: ["knowledge-lint", "prose-format"]