Skip to content

schema: the §10.1 S3 shape gate and DESIGN.cue were developed against different shapes — first collision, measured #355

Open

Description

@aitrawog

Finding

The shipped schema's shape laws (schema/vocab_s3_test.go, the §10.1 S3 gate) and DESIGN.cue have never been exercised against each other. Porting DESIGN.cue's §8 capability surface into schema/capability.cue is the FIRST place they meet, and they do not meet: four independent refusals, all from the gate, all against shapes DESIGN.cue uses throughout.

Nobody could have noticed earlier because the shipped schema had never carried any of the three shapes DESIGN's §8 is written in:

$ git grep -n '\[#[A-Za-z]*\]:' origin/main -- 'schema/*.cue'     # a regex-keyed collection
$ git grep -n '^\w*: {[a-z_]*: {}, }$' origin/main -- 'schema/*.cue'  # a one-row table
$ git grep -n 'for .* in _[a-z]* {(t)?:' origin/main -- 'schema/*.cue'  # a comprehension-shaped table

all empty before the port. DESIGN.cue's §8 uses all three, and its own toolchain acceptance is a separate matter (DESIGN.cue does not compile under the module's pinned CUE v0.16.1 either: it writes embeddings with the postfix ..., which requires @experiment(explicitopen) — 9+ errors).

The four refusals, measured on the port

capability.cue:46 and capability.cue:47 both declare _device — a table is one home (D-PAT-2)
capability.cue:60: table _isolation has 1 row(s) — a one-word table is not a closed set of words, it is a constant
capability.cue:62: table _privilege has 1 row(s)
capability.cue:66: table _cpu has 1 row(s)
capability.cue:68: table _storage has 1 row(s)
capability.cue:98 cites _leasableWord, which no file declares
capability.cue:121: table _role is cited by no field or definition — its rows constrain nothing
capability.cue:138: table _capability has 1 row(s) / is cited by no field or definition

Four distinct causes:

  1. The two-declaration table. DESIGN writes _device: [#Word]: #NativeRow and then _device: {kvm: …, …}. The gate reads that as two homes for one table. (Mergeable — but see the collision below first.)
  2. The one-row table. _isolation: {microvm}, _privilege: {rootful}, _cpu: {core}, _storage: {root} are not standalone vocabularies: they are ROWS of _capability, and they have one legal value because the capability has one implementation. The gate's rule is right for a standalone vocabulary and wrong for a table row.
  3. The filter-derived word list. _leasableWord: [for w, r in _capability if r.lease {w}] is the R2-correct form — the leasable set derives from the one table that declares leases, so a row added later cannot drift from the list. The gate only recognises [for w, _ in _x {w}], so it reports "cites _leasableWord, which no file declares".
  4. The comprehension-shaped table. The gate's row parser cannot see the rows of a table whose body is a comprehension (it counts _capability as ONE row) nor a citation that lives inside one (so _capability and _role read as "cited by no field or definition").

And the collision underneath

Three of DESIGN.cue's generic mechanism words had already been spent by other files on vendor detail, and CUE merges same-name definitions SILENTLY (cue eval exits 0):

_device/_deviceWord  → schema/vm.cue:1063,1071   libvirt VIDEO device names
_driver/_driverWord  → schema/vm.cue:1085,1086   libvirt FILESYSTEM driver names
_access/_accessWord  → schema/deploy.cue:1104    VOLUME access modes (a vocabulary DESIGN.cue does not contain)

Each is being renamed so every concept has one name (the _access rename is up; the two vm.cue ones follow). But the pattern is the finding: a refusal-half test is the only thing that sees it — cue eval exits 0 for both the right and the merged vocabulary.

Asks

  1. Gate, one-row tables: exempt a table that is named as a value in another table's rows (here _capability's). The rule stays for standalone vocabularies.
  2. Gate, derived lists: accept a word list defined as a comprehension over another table (cite _leasableWord).
  3. Gate, citations: see a citation that lives inside a comprehension.
  4. Design/contract: decide whether §10.1's S3 shape is the whole truth for DESIGN.cue too, or whether DESIGN.cue's row-table + comprehension form is a second legal shape that the module must learn to generate and gate. The cue exp gengotypes collapse of pattern-keyed maps (cue-gen: generate Go from the design grammar with charly's own CUE-API generator, retiring gengotypes and the hand mirrors #271) is the same question on the generator side.

Evidence branch: feat/capability-port (local, unpushed), schema/capability.cue + schema/capability_port_test.go.

Agent: audit-protocol
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (syntax check only)

Activity

  1. added
    category:runtime
    type:chore
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    category:runtimetype:chore

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions