gunk-dev/the-valley

verification-instance.cue

sourcecb6c77e7517bmain's published tip history
2.1 KiB
1// The instance layer of a sample verification policy: the floor every
2// project in the group must clear, and the project-type templates a
3// project can start from. It is a sample, not an installed file — the real
4// one lives in the instance repository, which for the gunk-dev instance is
5// qinling (dcr-f41f718).
6//
7// Validate, composed with a project policy:
8// cue vet -c schema/verification.cue \
9// examples/verification-instance.cue examples/verification-project.cue
10package verification
11
12// prose-format ships today, as a nix flake check in this repo: the check
13// is formatter idempotence, so it is deterministic and judgment-free
14// (ida-1ec03b1). knowledge-lint does not exist yet in either repository —
15// building it is the first step of the staged rollout, and naming it here
16// is what makes the gap concrete rather than notional.
17floor: {
18 checks: "prose-format": {
19 runner: "nix"
20 attribute: "prose-format"
21 }
22
23 // Every markdown file in every project in the group is formatted, and
24 // no project can decide otherwise: both the coverage and the
25 // requirement are concrete, so a project supplying `false` for either
26 // conflicts.
27 classes: prose: {
28 paths: "**/*.md": true
29 requires: "prose-format": true
30 }
31
32 // A path no class covers is the policy falling behind the tree. The
33 // floor answers that case for the whole group rather than leaving each
34 // project to remember.
35 unclassified: "prose-format": true
36}
37
38// A project type for the group's documentation projects. Everything here
39// is a default rather than a rule: a docs project gets the knowledge lint
40// by saying `type: "docs"` and nothing else, and a project that has reason
41// to opt out can.
42templates: docs: {
43 checks: "knowledge-lint": {
44 runner: "nix"
45 attribute: "knowledge-lint"
46 }
47
48 // Knowledge nodes are markdown under `.the-valley/`, so they match the
49 // floor's `prose` class as well as this one and require both checks.
50 // The union of two overlapping classes is visible here rather than only
51 // in the schema's comments.
52 classes: knowledge: {
53 paths: ".the-valley/**": bool | *true
54 requires: "knowledge-lint": bool | *true
55 }
56}