Skip to content

schema: migration.cue writes its op vocabulary as a close()d union, not one derived table (D-PAT-1 / D-PAT-3) #38

Open

Description

@aitrawog

What

candy/plugin-migrate/schema/migration.cue writes the migration-op vocabulary in the two shapes DESIGN §10.1 forbids:

$ git show e58478d2f7fec7b7c642a85d50b7035e53bedf6f:candy/plugin-migrate/schema/migration.cue | sed -n '36p;39p;50p'
#MigrationOp: #RenameKey | #DeleteKey | #RemapScalar | #MoveKey | #RemoveListValue @go(-)
#RenameKey: close({op: "rename_key", from: string, to: string, scope: #Scope | *"any", under_kind?: string}) @go(-)
#RemoveListValue: close({op: "remove_list_value", key: string, value: string, under_kind?: string}) @go(-)
  • D-PAT-3 (union): #MigrationOp is a union written out alternative by alternative. The arm set is derivable — or([for k, a in _arm {a & {op: k}}]) over one arm table, the shape spec#385 records as derivable (a definition union is not one of the four shapes CUE cannot derive).
  • D-PAT-1 (close): all five arms are close({...}). CUE closes a definition recursively, so the shape belongs in the definition and close( is never written.

Surfaced by the umbrella pin wave (the plugin-migrate gitlink advanced to e58478d), where scripts/design-dpat.sh reports both:

FAIL plugin-migrate/candy/plugin-migrate/schema/migration.cue:36: union: a union written out alternative by alternative — derive it from one tag table (S4) or one vocabulary table (S3); only a two-value literal default is written inline (D-PAT-3)
FAIL plugin-migrate/candy/plugin-migrate/schema/migration.cue:50: close: a close() call — write the shape as a definition (#Name: {...}); CUE closes a definition recursively, so close() is never written (§10.1 S1)

Fix

Rewrite migration.cue in the §10.1 form: one _op arm table (op word → arm definition), #MigrationOp derived from it through or(...), and the arms declared as plain definitions (no close(). Then the umbrella's design/dpat-admission.tsv rows citing this issue are deleted, which is what the census ratchet asks.

Why it is filed rather than fixed here

The umbrella pin wave is the change that surfaced it; the shape lives in this repo's schema and the rewrite is this repo's to make and gate. The umbrella records it as admitted debt with this issue number so the gate stays honest instead of blessing the shape in the dark.

Agent: image-lane-vram · Claude Code session 739c9baf-e4cc-465c-9028-0a77b9ea7617
Assisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)

Activity

  1. added
    category:runtime
    type:design
    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:design

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions