Repository navigation
Description
The rule
design-dpat.sh's union and absence rules implement DESIGN §10.1's D-PAT-3: "no union is written out alternative by alternative: derive it from one tag table (S4) or one vocabulary table (S3)." The gate counts every such construct and the census (design/dpat-baseline.tsv) ratchets them toward zero — 39 union and 30 absence rows over spec/schema alone.
The boundary I can now state, because the compiler decides it
Two constructs the remedy names cannot be written as a derivation in CUE. Both measured with cue vet, not inferred:
1. A * default cannot live inside or()
$ cue vet t.cue
_arms2: preference mark not allowed at this position:
./t.cue:8:10
while the derivation itself compiles (this line produces no error):
#VmSource: or([for k, a in _arm {a & {kind: k}}])So an arm table works for shapes; a default-bearing enum does not, because the default needs a | and or() refuses a preference mark. Affected rows in spec/schema/vm.cue alone: key_source?: *"auto" | "generate" | "none" | (string & =~"^/"), the port_auto arm.
2. _|_ cannot be produced dynamically
The absence-discriminated idiom — {#Op, run: string & !="", check?: _|_, …}, "each arm requires its keyword and forbids the other four via _|_" — is the one CUE offers for exactly-one-of in a struct that also declares the other keys optional. Producing those bottom fields from a table is refused:
$ cue vet t.cue
explicit error (_|_ literal) in source:
./t.cue:19:82
with the minimal form:
x: {for f in ["a", "b"] {(f): _|_}} // explicit error (_|_ literal) in sourceA static _|_ inside a literal disjunct is fine (every current arm does it); a computed one is not. So #Step's five arms (5 absence + 5 union rows in spec/schema/00_common.cue) and #VmSource's forbidden cross-branch fields (19 absence rows in vm.cue) cannot be lowered by derivation at all.
3. Two more shapes the rule names but a tag table cannot express
- a value union —
qemu_override?: {[string]: {[string]: string | bool | int}}: alternatives over VALUE TYPES, not shapes, so there is no tag to key a table by; - a heterogeneous container —
#LibvirtListen: (string | #LibvirtListenOne | [...#LibvirtListenOne]): a scalar, a record, and a list of records — the tag would be the Go type, and CUE has no such table.
Why this needs a DESIGN decision rather than a schema PR
D-PAT-3 as written has no exception for these four classes, and the gate's baseline cannot reach zero while they remain: a spec-only PR cannot lower them. The choices are contract choices:
- state the exception — D-PAT-3 gains a bounded list of shapes that are written inline because CUE cannot derive them (default-bearing enum, absence-discriminated arm, value union, heterogeneous container), each with the
cue vetverdict that proves the boundary; - change the shapes — e.g.
#Step's five intents become oneintent:field plus aprose:field, so no arm has to forbid its siblings; defaults become table entries with an explicit "default" row; - keep the baseline — accept the rows as permanent and say so in the census header, so the ratchet's target is "zero except these" rather than an unstated exception.
Same shape as opencharly/charly#1108 (the schemaretag question): a control that cannot be satisfied by the code it judges needs its boundary written down, or it will be argued with on every future PR.
Found while attempting TODO row 2.16's first ratchet unit; cross-referenced there.
Agent: audit-schema
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (documentation reviewed)
Activity
aitrawog commentedon Nov 18, 2026
The strongest evidence for the boundary: the repo's own test refusing its own rule
The four
cue vetverdicts above are CUE-the-language refusing a derivation. This one isspecrefusing it, which is a different and better kind of proof.While attempting to lower
#StrVal(string | number | bool) and#PackageItem(scalar-or-record) as S3 vocabulary tables, the repo's own convention control refused both:The rule that test enforces is stated in
schema/vocab_s3_test.go:7: a table is_x, its derived list is_xWord: [for w, _ in _x {w}], and the enum an author meets isor(_xWord). That shape yields WORDS — so a row that is a TYPE (#StrVal's arms) or a CONSTRAINT (#PackageItem's arms) cannot be a table row, and the test says so at the point of use rather than in prose.So the boundary is drawn by the code that would otherwise be violated. Two of the four classes in this issue are provable by a test command, not only by a compiler verdict:
or()refuses a preference markcannot convert non-concrete valueBoth rows were therefore reverted from #387, which is why that PR says it touches neither line — measured, not asserted, with
git diff origin/main...HEAD -- schema/00_common.cue | grep -cE '^[-+].*(StrVal|PackageItem)'printing0.Agent: audit-schema
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (documentation reviewed)
chore(pins): advance the XDG chain, and admit the pattern debt the pi…
chore(pins)!: advance 40 pins to the post-cutover schema, and re-anch…