Skip to content

refactor(schema): derive the cua word sets from vocabulary tables - #10

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/s3-vocab
Nov 10, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
feat/s3-vocab

Conversation

@aitrawog

Copy link
Copy Markdown
Contributor

Summary

Replace the three inline | word unions in candy/plugin-cua/schema/cua.cue with the §10.1 S3
vocabulary-table idiom, so each closed set of words has ONE home and the enum an author meets is
or() of that table's keys:

_delivery  _permissionMode  _method          (+ _deliveryWord / _permissionModeWord / _methodWord)

That is the 30 union rows design/dpat-baseline.tsv records for
plugin-cua/candy/plugin-cua/schema/cua.cue. They are THREE disjunctions, not 30: delivery
and permission_mode are each written on one line (one row each), and the method catalog is
written one alternative per line, which is the other 28 rows — its 29th word, call, closes the
disjunction and carries no |, so it never had a row. A union's row count is a property of its
formatting, so the row number is the only honest way to compare repos and it is not a count of
disjunctions.

How this repo was picked, by measurement, not by guess. The umbrella's union rows, grouped by
owner, on origin/main:

$ git show origin/main:design/dpat-baseline.tsv | grep -v '^#' | awk -F'\t' '$2=="union"{split($1,a,"/"); print a[1]}' | sort | uniq -c | sort -rn | head -9
    187 spec
     30 plugin-cua
     16 plugin-egress
     13 plugin-agent-pi
     11 plugin-punktfunk
      8 plugin-pipeline
      8 plugin-lobster
      7 plugin-desktop-kind
      6 plugin-omarchy

spec holds the most but is the producer, whose rows may need the experimental-flag work, so it is
out of consideration for this sweep. Among the leaf plugin repos plugin-cua is first with 30 rows
(the next, plugin-egress, has 16 — and most of ITS rows are not word lists at all: two are
null | {…} heterogeneous pairs and one is #ContainerdConfigV2 | #ContainerdConfigV4, a
struct-alternative union that S3 does not cover). plugin-cua was therefore both the largest
remaining leaf set and a wholly mechanical one: three pure string word lists, nothing else.

$ git show origin/main:design/dpat-baseline.tsv | grep -v '^#' | awk -F'\t' '$2=="union" && $1 ~ /^plugin-cua\//' | wc -l
30

Nothing was left censused by judgement. All three unions in this repo's schema are word lists;
there is no scalar-type union, no heterogeneous alternative and no struct alternative anywhere in
the file after the sweep, and the census gate agrees (0 findings of every rule, below). The whole
of this repo's union debt is retired by this PR.

No word moves: the three accepted sets are IDENTICAL before and after, read from the compiled CUE
(245-case differential, below), and the umbrella leg — the pin plus the emission-diffed census — is
the lead's, by emission; this PR touches neither design/dpat-baseline.tsv nor the umbrella.

Refs opencharly/opencharly#945 (the census), #950 (the sequence), #962 (the precedent umbrella leg)
and opencharly/plugin-jetkvm#15 (the proven recipe).

Files the diff carries:

M candy/plugin-cua/schema/cua.cue
M candy/plugin-cua/params/cue_types_gen.go
M candy/plugin-cua/go.mod
A candy/plugin-cua/schema_served_test.go
A candy/plugin-cua/catalog_invariant_test.go

Head 1c87b931cc632709381cbaf2a6b77b5c1a5aaf32.

How tested

Everything below was run on the committed tree, at that head, in this worktree.

1. The projection is the repo's own generator's output, and a re-run is byte-identical. The
instrument matters: the org reusable runs cue exp gengotypes at [email protected], NOT the binary's
candy params wrapper, which #8 measured as diverging on the yaml: retag.
Three fresh runs, plus the committed file, carry ONE sha256:

$ for i in 1 2 3; do w=$(mktemp -d); printf 'package params\n' > "$w/pkg.cue"; cat schema/*.cue >> "$w/pkg.cue"; ( cd "$w" && ~/go/bin/cue exp gengotypes . ); sha256sum "$w/cue_types_params_gen.go"; done
befa90cf0a0e610fbe7d221a03c86f8b7f93f4dd2b50abbbe960dc803b9b1437  /tmp/cs/tmp.ajHP5XIdu1/cue_types_params_gen.go
befa90cf0a0e610fbe7d221a03c86f8b7f93f4dd2b50abbbe960dc803b9b1437  /tmp/cs/tmp.sQCD4hi2do/cue_types_params_gen.go
befa90cf0a0e610fbe7d221a03c86f8b7f93f4dd2b50abbbe960dc803b9b1437  /tmp/cs/tmp.jNIEIrKAtG/cue_types_params_gen.go

$ sha256sum params/cue_types_gen.go
befa90cf0a0e610fbe7d221a03c86f8b7f93f4dd2b50abbbe960dc803b9b1437  params/cue_types_gen.go

and the org gate's own comparison (line 1 excluded, exactly as candy-validate.yml does it) is
empty:

$ diff <(sed 1,1d "$w/cue_types_params_gen.go") <(sed 1,1d params/cue_types_gen.go); echo "diff rc=$?"
diff rc=0

The generated Go does not move either: the only line the regeneration changes is the stale doc
comment on CuaMethod. Method CuaMethod, Delivery string and PermissionMode string are
byte-identical, because a derived or() still generates the same named string type — that is the
SDD half of this change, and it is what makes the sweep safe for every Go caller.

2. The module gate (this repo's ci.yml), on the final tree:

$ go build ./...
build ok (rc=0)

$ go vet ./...
vet clean (rc=0)

$ gofmt -l .
gofmt -l . -> no files

$ go test -count=1 ./...
ok  	github.com/opencharly/plugin-cua/candy/plugin-cua	0.124s
?   	github.com/opencharly/plugin-cua/candy/plugin-cua/cmd/serve	[no test files]
ok  	github.com/opencharly/plugin-cua/candy/plugin-cua/params	0.003s

3. The schema still LOADS, through NewMeta().Describe, and the body it serves compiles —
and it splices onto the core base.
charly box validate does NOT compile a served schema
(opencharly/spec#301), so the load gate is the plugin's own Describe reply, compiled with the same
CUE library the runtime links, then unified onto spec/schema.FS exactly as
registerPluginUnitSchema does:

$ go run ./zz_splice_check
served body: 8868 bytes, caps=2
served schema composes AS A UNIT: ok
splice base & plugin: ok
spliced value resolves #CuaInput, #CuaDeviceInput, #CuaMethod: ok
  authored step, every method        against #CuaInput        accepted=true (want true) ok
  authored step, near-miss method    against #CuaInput        accepted=false (want false) ok
  authored step, delivery            against #CuaInput        accepted=true (want true) ok
  authored device node               against #CuaDeviceInput  accepted=true (want true) ok
  authored device node, bad mode     against #CuaDeviceInput  accepted=false (want false) ok
ALL SPLICED-VALIDATION CASES MATCH

(that main is a throwaway the run needed and deleted before the commit; it is not in the diff.
The committed schema_served_test.go is the same gate, made permanent.)

$ charly box validate
charly box validate: OK — checked 1 candy, 2 deploys, 7 distros, 7 builders; 0 warnings, 0 errors

4. The accepted surface did not move: 245 cases, 14 categories, ZERO verdicts moved in either
direction.
Both schemas are compiled from source — BEFORE from origin/main, AFTER from this
tree — and the same documents are judged against each. The case set is derived from the served
table, never restated by hand: 6 blocks over every one of the 29 method words (word alone; with
the safety gate open; with the delivery word set; a near-miss suffix; a case mutation; an
undeclared key), a near-miss delivery for every method, the 2 delivery words and 5 refusals, the 3
permission words and 5 refusals, 15 structural cases on #CuaInput, 6 on #CuaDeviceInput, and
THE REPO'S OWN AUTHORED DOCUMENTS — this repo's cua-entity device node body and both acceptance
steps as authored, plus the scalar-sugar form.

$ ./zv before.cue after.cue
instrument: after  #CuaMethod alternatives = 29
instrument: before #CuaMethod alternatives = 29
--- 245 cases across 14 categories ---
  A method accept          29
  B method+allow_control   29
  C method+delivery        29
  D method near-miss       29
  E method case            29
  F method+bogus key       29
  G method+bad delivery    29
  H delivery accept        2
  H delivery refuse        6
  I permission accept      3
  I permission refuse      6
  J structural             15
  K device structural      6
  L authored docs          4
verdicts moved: 0 (must be 0)
error-texts moved: 59 (CUE's own rendering of a derived enum: the disjunction summary count and the echoed constraint form; not a verdict)

The 59 moved error TEXTS are the one honest difference, and they are CUE's own message rendering,
not the surface: a near-miss method reports 29 errors in empty disjunction before and
6 errors in empty disjunction after, and a null document echoes
permission_mode?:("standard"|"bounded"|"unrestricted") before and
permission_mode?:or(_permissionModeWord) after. Same verdict, same failing field path, same
refusal — only the summary count and the echoed constraint spelling differ.

The rig is not green by construction: a planted single-word move (call → teleport, both sides
29 words so its own instrument check passes) turns it red.

$ ./zv before.cue after-planted.cue
MOVED A method accept        method=call                        before=true after=false
  before-err: -
  after-err:  #CuaInput.method: 6 errors in empty disjunction: (and 6 more errors)
...
verdicts moved: 3 (must be 0)

5. Every new test fails on a planted break — seven plants, each applied to the committed tree,
observed red, then restored (git checkout --):

PLANT 1  dangling reference inside a served def (`or(_deliveryWordX)`)
  --- FAIL: TestServedSchemaResolvesItsDefs
      schema_served_test.go:123: Describe: plugin schema does not compile: #CuaInput.delivery: reference "_deliveryWordX" not found
  --- FAIL: TestS3VocabularyTablesDriveTheirEnums
      schema_served_test.go:136: Describe: plugin schema does not compile: #CuaInput.delivery: reference "_deliveryWordX" not found

PLANT 2  table kept, enum bound to a literal (`delivery?: "background"`)
  --- FAIL: TestS3VocabularyTablesDriveTheirEnums
      schema_served_test.go:171: "delivery" word "foreground" is refused where an author uses it: #CuaInput.delivery: conflicting values "foreground" and "background"

PLANT 3  the derived list no longer derived (`_deliveryWord: ["background"]`)
  --- FAIL: TestS3VocabularyTablesDriveTheirEnums
      schema_served_test.go:167: "delivery"'s derived list [background] is not its table's row set [background foreground]
      schema_served_test.go:171: "delivery" word "foreground" is refused where an author uses it: #CuaInput.delivery: conflicting values "background" and "foreground"

PLANT 4  the enum loses its TAIL (the `call` row deleted)
  --- FAIL: TestServedCatalogCoversTheWholeEnum
      catalog_invariant_test.go:80: served enum is missing its TAIL (call) — the derivation is losing rows; got 28 methods: [bring-to-front click doctor double-click drag get-desktop-state get-screen-size get-window-state hotkey kill-app launch-app list-apps list-tools list-windows move-cursor press-key recording-render recording-start recording-status recording-stop right-click screenshot scroll set-value set-window-frame status type version]

PLANT 5  a method added to the table, never routed (`teleport: {}`)
  --- FAIL: TestCatalogHasNoPhantomMethods
      catalog_invariant_test.go:96: schema method "teleport" is a PHANTOM: not routed by dispatch — remove it from the schema or implement it

PLANT 6  a route arm for a word the enum does not accept (`case "teleport":`)
  --- FAIL: TestDispatchHasNoPhantomArms
      catalog_invariant_test.go:111: dispatch routes "teleport", which the served #CuaMethod enum does NOT accept — the arm is unreachable

PLANT 7  a stale entry in the mutating allowlist (`"teleport": true`)
  --- FAIL: TestMutatingAllowlistIsASubsetOfTheCatalog
      catalog_invariant_test.go:131: "teleport" is classified MUTATING but the served #CuaMethod enum does not accept it — the classification is stale

6. The census gate, read with its own scanner, over this repo at this repo's pin. The umbrella's
design/dpat-baseline.tsv and its emission are the lead's; what belongs here is the repo-local
before/after, measured by running scripts/design-dpat.sh (from the umbrella's origin/main)
against a scratch root that pins plugin-cua at the two commits — the gate reads pins from the
index and reads each pinned module from its own object store, so the schema it judges is the schema
that ships:

$ bash /tmp/dpat-bin/design-dpat.sh /tmp/dpat-cua 2>&1 | grep -c 'union:'      # BEFORE, pin 4b2c71b (origin/main)
30

$ bash /tmp/dpat-bin/design-dpat.sh /tmp/dpat-cua 2>&1 | tail -1             # BEFORE
design-dpat: FAILED (30 finding(s))

$ bash /tmp/dpat-bin/design-dpat.sh /tmp/dpat-cua 2>&1 | grep 'union:' | sed -n '1p;30p'   # the two ends of the 30
  FAIL plugin-cua/candy/plugin-cua/schema/cua.cue:73: 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-cua/candy/plugin-cua/schema/cua.cue:164: 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)

$ bash /tmp/dpat-bin/design-dpat.sh /tmp/dpat-cua                             # AFTER, pin 1c87b93 (this head)
design-dpat: 1 pinned modules, 1 CUE files in scope, 0 under a vendor/ tree (foreign mirrors, out of scope)
design-dpat: 0 known violations (close 0, absence 0, open 0, opaque 0, dup 0, union 0) — tracked by opencharly/opencharly#945
design-dpat: no new violation, and the census matches the tree

The gate's own scanner finds exactly the 30 rows the census records for this file, and none of any
other rule — so the sweep neither hides a second violation nor leaves one behind.

7. The repo's two disposable beds, run and reported rather than skipped quietly. Both are
host: local, so cua: status takes the real driver path, finds no cua-driver on this host and
fails — IDENTICALLY at origin/main, which is what makes it visible as a bed-shape defect rather
than a regression here (filed as #9):

$ charly check run cua-verb-probe
  [deploy-add] PASS | [bring-up-members] PASS | [check-live] FAIL | [cleanup] PASS | [cleanup-members] PASS
  FAIL  cua: status: exit=1, want 0 (stderr: cua-driver status: exit 127: bash: line 1: /usr/local/bin/cua-driver: No such file or directory)

$ charly check run cua-entity-probe
  [check-live] FAIL — the same missing-binary line

$ git -C plugin-cua worktree add /tmp/cua-base2 origin/main && cd /tmp/cua-base2 && charly check run cua-entity-probe
  [check-live] FAIL — the same missing-binary line          (baseline: unchanged before this diff)

The live-desktop beds for this plugin are the check-cua-* ones in opencharly/distro-omarchy,
which compose it against a running Cua desktop; no such desktop is available in this environment, so
they are named here and not claimed as run.

8. The attribution evidence, from the harness's own session descriptor (not a config file):

$ dsh --version
0.2.1-rc.2

$ zstd -dc /home/atrawog/.dsh/sessions/--home-atrawog-Sync-Atrapub-lo-dsh-opencharly--/a4cd0c80-d915-4a66-897a-06843e3aa821/session.v4.jsonl.zstd | head -2
{"type":"session","version":4,"id":"a4cd0c80-d915-4a66-897a-06843e3aa821","createdAt":1794274276336,"cwd":"/home/atrawog/Sync/Atrapub/lo/dsh/opencharly","parentSession":"session-f8a0eb3b-2677-47a9-8139-49b1ba39440c","isSeeded":false,"origin":"subagent","delegationDepth":1,"agentPreset":"standard"}
{"type":"subagent/descriptor","seq":0,"time":1794274276339,"data":{"version":3,"mode":"continuable","provider":"spawn","label":"Sweep the next S3 repo","agentProvider":"ollama-cloud","agentModel":"deepseek-v4.1-flash"}}

Rulebook compliance

  • R0 — skills first, before any code change. Read this repo's AGENTS.md (via
    git show origin/main:AGENTS.md) and the umbrella's rulebook first; loaded
    /charly-internals:git-workflow, /charly-internals:plugin, /charly-internals:go and
    /charly-check:cua — the four the dispatcher selects for a plugin CUE schema plus a PR landing —
    before the first edit. The repo's AGENTS.md also decides the instrument: it names the candy
    manifest check, the ci.yml Go gate, and params/ regeneration.

  • R1 — every anomaly root-caused, then fixed or filed. Two findings, both pre-existing and
    separable, both FILED rather than papered over: the cua skill in
    opencharly/layer-charly-check lists recording-status as needing allow_control while this
    plugin's allowlist (and its own two-directional test) classifies it read-only —
    cua skill lists recording-status as needing allow_control, but plugin-cua classifies it read-only layer-charly-check#56; and both local beds fail on a host with no cua-driver because
    a host: local bed is a LIVENESS claim, not a skip — cua-verb-probe fails on a host without cua-driver: it asserts the box-mode skip from a live local shell #9. The bed failure
    got its RCA plus a baseline run at origin/main proving the same failure before this diff
    (## Filed issues). One environment condition is disclosed rather than disguised: the
    golangci-lint on this host is a go1.27 build whose loader cannot read go1.27 export data
    (export data version 5 is greater than maximum supported version 4), so it cannot typecheck ANY
    package here — including untouched ones, at origin/main — and the linter gate that owns this
    surface is this repo's ci.yml, whose run on origin/main's head is success:
    gh run list -R opencharly/plugin-cua --workflow ci → 4b2c71be77f9a9031b5bc5371a067ec057e913e1 success.

  • R2 — no duplication. Each word set has ONE home: the _x table. The derived _xWord list is
    the only other mention, and it is a comprehension, not a copy; the enum is or() of it. The new
    test helpers (servedSchema, schemaWordList) live once, in schema_served_test.go, and
    catalog_invariant_test.go calls them instead of recompiling the schema its own way.

  • R3 — no workarounds. No sleeps, retries or suppressions. The projection is produced by the
    repo's own pinned generator at the pinned version instead of being hand-edited, and the
    reproducibility check replicates candy-validate.yml's comparison (sed 1,1d on both sides)
    rather than normalizing the diff. The golangci-lint gap above is reported as an environment
    condition, not routed around with a disabled linter set.

  • R4 — product before prose, and docs never route around a defect. No documented command
    changes here: the verb's authoring surface, its primary, its acceptance steps and the
    kind: cua device node are untouched, which the 245-case differential proves. The one prose
    divergence found (the skill's recording-status claim) is filed against the repo that authors it
    instead of being restated or softened in this diff.

  • R5 — legacy deleted completely, with the grep. The retired spelling's own note is GONE: the
    "written as a bare trailing-pipe disjunction, NOT (...)-wrapped … breaks cue exp gengotypes"
    comment described a form that no longer exists, and the schema now carries no | at all:

    $ git grep -n 'bare trailing-pipe' -- . ; echo "rc=$?"
    rc=1
    
    $ git grep -n '|' HEAD -- candy/plugin-cua/schema/cua.cue ; echo "rc=$?"
    rc=1
    
  • R6 — user work preserved, git safe. git status was read before every edit, before the
    commit and after each planted break; the branch is feat/s3-vocab off fresh origin/main
    (4b2c71b), one commit, no force-push, no bypass, no destructive action, and no file outside
    this diff was staged. The identity used is repo-local
    (aitrawog <[email protected]>), matching the sibling repos, so the host's global
    git configuration is untouched.

    $ git status --short      (before the commit)
     M candy/plugin-cua/go.mod
     M candy/plugin-cua/params/cue_types_gen.go
     M candy/plugin-cua/schema/cua.cue
    ?? candy/plugin-cua/catalog_invariant_test.go
    ?? candy/plugin-cua/schema_served_test.go
    
    $ git status --short      (after the commit, and after every plant was restored)
    (no output)
    
  • R7 — proved behaviour, and the proof can fail. Every new test was planted against and turned
    red (seven plants, §5 above); the differential rig was turned red by a single moved word; the
    changed artefacts are validated at their boundary — the served body as the host receives it, and
    the projection against the generator that owns it. Commands, outputs and exit codes are pasted.

  • R8 — live or skip, never fake. This change crosses no service boundary: it moves CUE words and
    a generated projection, and nothing in it contacts a driver, a container or a registry. The one
    live path an author can take with these words — a mutating cua: step — keeps its
    allow_control gate untouched, and a run without a desktop keeps reporting its documented skip
    instead of being mocked. The two local beds that DO cross the boundary were run for real and
    failed loudly for a missing binary rather than being silenced (§7).

  • R9 — binary equals source. No charly source changes and no new runtime OS dependency, so no
    package or binary rebuild is owed here. The plugin module's own dependency block moves one line:
    cuelang.org/go v0.16.1 becomes a DIRECT requirement because the new tests import the CUE API —
    the same promotion refactor(schema): derive the jetkvm word lists from vocabulary tables plugin-jetkvm#15 made for the same reason. The charly used for
    box validate is the umbrella tree's worktree-local build (2026.306.0314), and the plugin it
    judged was host-built from THIS tree, which its own output names:
    source …/.worktrees/s3-cua/plugin-cua/candy/plugin-cua.

  • R10 — fresh, disposable proof on the gate that owns the change. This repo declares no per-repo
    candy gate; the gates that own it are the org reusable candy-validate (manifest + projection
    currency) and ci.yml (build, vet, format, tests). Both were run on the committed tree (§1–§3)
    with zero warnings, and the two disposable beds were driven through charly check run and
    reported (§7). The live-desktop consumer beds are named, not claimed.

Change classification

Docs and schema only — the authoring surface an existing document meets is byte-for-byte the same
set of words: no authored cua: step or kind: cua device node that validated before is refused
now, and none that was refused is accepted (245 cases, 0 verdicts moved, §4). The generated Go
keeps every field, type and tag, so no Go consumer recompiles differently. What DOES change is the
served CUE TEXT (the schema a host splices), so a published page that renders that text verbatim
will show the derived form after its own regeneration — exactly the lag the jetkvm precedent left in
place, since those pages are pinned per plugin version. The census rows this retires are advanced by
the umbrella's pin leg, not here.

Filed issues

Agent: charly
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

Replace the three inline `|` word unions in candy/plugin-cua/schema/cua.cue with
the §10.1 S3 vocabulary-table idiom, so each closed set of words has ONE home and
the enum an author meets is `or()` of that table's keys:

  _delivery  _permissionMode  _method      (+ each _*Word derived list, @vocab(cua))

That is the 30 `union` rows design/dpat-baseline.tsv records for
plugin-cua/candy/plugin-cua/schema/cua.cue — three disjunctions: `delivery` and
`permission_mode` written on one line each, and the method catalog written one
alternative per line (28 of the 30 rows; the 29th word, `call`, carries no `|`).
No word moves: the three accepted sets are IDENTICAL before and after, read from
the compiled CUE.

The generated Go does not move either. Regenerated with THIS repo's own
instrument — `cue exp gengotypes` at [email protected], not the binary's wrapper, which
#8 measured as diverging on the yaml retag — the projection
rewrites exactly one doc comment (the stale "bare trailing-pipe disjunction" note
on #CuaMethod); the Method/Delivery/PermissionMode field types are byte-identical,
because a derived `or()` still generates the same named string type.

Two test files are added. schema_served_test.go composes the plugin's own Describe
reply and compiles the body the host receives — the load gate `charly box validate`
does not provide (a dangling reference inside a served def is green at plugin load,
opencharly/spec#301) — and pins the S3 derivation: for every table the derived word
list IS the row set, each word is accepted where an author uses it, a non-word is
refused. catalog_invariant_test.go reads the SERVED enum through the CUE library
instead of its text (a text parse of a derived enum finds zero words and leaves
every check vacuous) and pins that no method is advertised-but-unrouted, that no
route is unreachable, and that the mutating allowlist names only catalog words.

How tested (all on this tree):
- cue exp gengotypes at v0.16.1 (x3)        -> committed file IS the generator's
                                               output (sha256 befa90cf…, 3/3 runs)
- charly box validate                       -> OK, 1 candy / 2 deploys, 0 warnings
- gofmt -l / go vet / go test ./...          -> clean / clean / ok
- go build ./...                            -> ok (module compiles)
- base splice, served body                  -> base & plugin unifies; both input
                                               defs resolve; 5 authored docs judged
- differential surface, 245 cases            -> 0 verdicts moved, both directions
- design-dpat.sh over the repo's pin         -> 30 union findings before, 0 after
- charly check run cua-verb-probe           -> check-live FAILS, identically on
                                               origin/main: no cua-driver on this
                                               host (filed as #9, not this diff)

Refs opencharly/opencharly#945, #950, #962.

Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 1c87b931cc632709381cbaf2a6b77b5c1a5aaf32 (branch: feat/s3-vocab)

Security screen: PASS
Checklist: All applicable rules PASS or NA (schema/S3 refactor: SDD source+gen both changed, new tests proven to fail without the change, 245-case differential shows 0 verdict moves, arithmetic of the 30→3 unions reconciles, bed failures filed as #9 with baseline evidence; no comment thread).

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) November 10, 2026 01:44
@github-actions
github-actions Bot merged commit cfed3bf into main Nov 10, 2026
4 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Nov 10, 2026
github-actions Bot pushed a commit to opencharly/opencharly that referenced this pull request Nov 10, 2026
`opencharly/plugin-cua#10` merged as `cfed3bf3b64400302d6d461a479213a8ae7e9cbd`, tagged
`v2026.314.0145`. It converted the plugin's three inline `|` word unions to §10.1 S3
vocabulary tables — `_delivery`, `_permissionMode`, and `_method` (a 29-word catalog written
one alternative per line) — each with a derived `_…Word` list and an `or()` enum tagged
`@vocab(cua)`.

The umbrella still pinned the pre-merge `4b2c71be77f9a9031b5bc5371a067ec057e913e1`, so
`charly task sync` advanced the gitlink to the CHANGELOG tip the tag-on-merge workflow wrote
above the merge, `09ced48ba8403ada9042d1dccde137abb2801c17`. One pin moved: the wave reports
`1 pin(s) moved` and nothing else in the 409-pin set was behind.

MEASURED FIRST, IN A WORKTREE. With `plugin-cua` unmaterialized — the light tree's normal
shape — `charly task pins --param MODE=currency` reported the pin as
`differs (no checkout to judge ancestry)` and `producer-first legs: none reachable from this
repo`: it withheld the advance it could not judge. After `CHARLY_INIT_PATHS=plugin-cua
charly task init` materialized the checkout at the recorded gitlink, the SAME pin against the
SAME remotes read `1 behind` and named the leg `plugin-cua (4b2c71be77 -> 09ced48ba8)`. A pin
whose checkout is absent is a pin whose currency this control cannot answer.

Because the pin's CUE now derives its unions from vocabulary tables, the 30 `union` rows the
census recorded for plugin-cua's inline disjunctions no longer exist in the tree the pin
serves. The census was REGENERATED, never hand-edited: `bash scripts/design-dpat.sh
--emit-census` at the old pin reproduces the committed file byte for byte (which calibrates
the instrument), and at the new pin it removes exactly those 30 rows and adds nothing. So
`design/dpat-baseline.tsv` goes from 583 lines to 553, and the tree's known-violation count
from 617 to 587 (union 382 -> 352). The gate then agrees with the tree in both directions:
`design-dpat: no new violation, and the census matches the tree`.

The same rewrite moved lines in the pinned `cua.cue`, so the two `design/dulling.tsv` rows
that cite it by line were re-anchored to the constructs they name — `#CuaMethod` at :167 and
`#CuaDeviceInput` at :173-191. Neither the `29 Cua Driver operations` count nor any word those
rows name changed in the rewrite, so only the anchors moved.

**Breaking change + rollback:** none — the pointers move to a commit `plugin-cua` already
merged and tagged, the census emission removes 30 rows and adds none, and no schema, command
or config OF THIS REPO changes. Rolling back is `git revert` of this one commit: it restores
the previous gitlink and the 30 census rows together, which is the only state the gate
accepts on that pin.

Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

Co-authored-by: aitrawog <[email protected]>
github-actions Bot pushed a commit to opencharly/plugin-punktfunk that referenced this pull request Nov 10, 2026
…es (#20)

Convert the two inline `|` word unions in
candy/plugin-punktfunk/schema/punktfunk.cue — the 43-word `method`
catalog and the 3-word `access` set — to the §10.1 S3 vocabulary-table
idiom: a `_method` / `_access` table keyed by word, a derived
`_methodWord` / `_accessWord` list, and the field as `or()` of that list,
each table tagged `@vocab(punktfunk)`.

The accepted word sets are IDENTICAL before and after (43 methods,
3 access words), read from the compiled CUE on both sides; the generated
params type is byte-identical except for one doc comment, so no Go
field, type or tag moves.

The catalog test no longer parses the enum's TEXT. A derived enum has no
body to parse, so the old reader would have found ZERO methods and left
its invariant passing vacuously. It now reads the SERVED schema through
the CUE API, and a new schema_served_test.go composes the plugin's own
Describe reply and compiles the body the host receives — the load gate
`charly box validate` does not provide (opencharly/spec#301).

Refs opencharly/opencharly#945 (the census), opencharly/opencharly#950
(the sequence), opencharly/plugin-jetkvm#15 and opencharly/plugin-cua#10.

Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

Co-authored-by: aitrawog <[email protected]>
github-actions Bot pushed a commit to opencharly/plugin-agent-pi that referenced this pull request Nov 10, 2026
* refactor(schema): derive the pi word sets from vocabulary tables

Convert the five inline `|` word unions in
candy/plugin-agent-pi/schema/pi.cue to the §10.1 S3 vocabulary-table
idiom: a `_`-prefixed table keyed by word, a derived `_…Word` list, and
the field as `or()` of that list, each table tagged `@vocab(pi)`.

Two sets are new tables — `_commandType` (the 32-word Pi RPC command
catalog) and `_streamingBehavior` (2 words). The third is ONE table for
the ONE upstream enum Pi renders in three fields: the command's `mode`
and the state's `steeringMode` / `followUpMode` all accept
`all | one-at-a-time`, so `_mode` has one home and all three fields are
`or(_modeWord)` — the second occurrence is extracted, not copied.

The accepted word sets are IDENTICAL before and after (32 commands,
2 streamingBehavior words, 2 mode words), read from the compiled CUE on
both sides; the generated params type is byte-identical except for one
doc comment, so no Go field, type or tag moves.

The projection is regenerated with `charly candy params`, the generator
that owns THIS repo's file: its documented retag contract adds the
`yaml:` tag beside every `json:` one (plugin-candy's params_test.go),
and raw `cue exp gengotypes` at v0.16.1 drops those tags, so the raw
form is the one that does not reproduce the committed projection here.

A new schema_served_test.go composes the plugin's own Describe reply and
compiles the body the host receives — the load gate `charly box validate`
does not provide (opencharly/spec#301) — and pins the table → derived
list → enum derivation for all three tables and all five fields.

Refs opencharly/opencharly#945 (the census), opencharly/opencharly#950
(the sequence), opencharly/plugin-jetkvm#15 and opencharly/plugin-cua#10.

Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

* fix(schema): keep the pi schema diff to the five word unions

The previous commit carried two formatting collateral changes that are
not part of the §10.1 S3 sweep: `images?: [..._]` lost its `_` element
type (cue fmt rewrote it to `[...]`), and every field label in
#PiRPCCommand and #PiRPCState was re-aligned. Neither is a word set and
neither was stated in the body.

Restore the file's original formatting and the `[..._]` element type so
the diff against origin/main is exactly the five unions replaced by
three vocabulary tables. The generated projection is unchanged by this
commit (it already compiled from the same schema semantics) and a
second `charly candy params` run is still `current`.

Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

---------

Co-authored-by: aitrawog <[email protected]>
github-actions Bot pushed a commit to opencharly/plugin-gh that referenced this pull request Nov 10, 2026
* refactor(schema): derive the gh word sets from vocabulary tables

Convert the six inline `|` word unions in
candy/plugin-gh/schema/gh.cue to the §10.1 S3 vocabulary-table idiom: a
`_`-prefixed table keyed by word, a derived `_…Word` list, and the
field as `or()` of that list, each table tagged `@vocab(gh)`.

Five tables cover six fields. `_op` (8 words), `_format` (2), `_state`
(3) and `_kind` (3) are one field each; `_target` (2) covers BOTH the
input's `target` selector and the emitted `#GhDocument.kind`, because
those are the same two-word artifact kind, and extracting on the second
occurrence keeps the single home.

The accepted word sets are IDENTICAL before and after (8 ops, 2 target,
2 format, 3 state, 3 kind, 2 document-kind words), read from the
compiled CUE on both sides. The generated projection does not move at
all: `charly candy params --check` is current, so this diff carries no
`params/cue_types_gen.go` change — every generated type, field and tag
is byte-identical.

Two tests are added. schema_served_test.go composes the plugin's own
Describe reply and compiles the body the host receives — the load gate
`charly box validate` does not provide (opencharly/spec#301) — and pins
the table -> derived list -> enum derivation for all five tables and all
six fields. catalog_invariant_test.go keeps the served `op` enum and
runOp's switch in step in both directions, so an advertised op cannot be
unrouted and a routed arm cannot be unreachable.

Refs opencharly/opencharly#945 (the census), opencharly/opencharly#950
(the sequence), opencharly/plugin-jetkvm#15 and opencharly/plugin-cua#10.

Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

* fix(candy): resolve the bed's self-test binary from the active charly

The `plugin-gh-document-self-test` plan step ran a bare `charly gh
--self-test`, so on a host with no `charly` on PATH (only the worktree
build) the step failed exit 127 and the `gh-issues-repo` R10 bed failed —
a real gate failure surfaced by the S3 sweep, not an environment note.

Resolve the ACTIVE binary the runner stamps instead: the step now runs
`${CHARLY_BIN} gh --self-test`, so it proves the plugin under test
wherever the runner is. Re-ran `charly check run gh-issues-repo` with NO
PATH override: PASS, and the self-test step reads `exit=0` (it was
exit 127 before).

Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

---------

Co-authored-by: aitrawog <[email protected]>
github-actions Bot pushed a commit to opencharly/plugin-omarchy that referenced this pull request Nov 10, 2026
…y table (#11)

* refactor(schema): derive the omarchy method word set from a vocabulary table

Convert the 17-word `#OmarchyInput.method` catalog in
candy/plugin-omarchy/schema/omarchy.cue to the §10.1 S3 vocabulary-table
idiom: a `_`-prefixed table keyed by word, a derived `_methodWord` list,
and the field as `or()` of that list, the table tagged `@vocab(omarchy)`.

That is the 6 `union` rows design/dpat-baseline.tsv records for this file
— ONE disjunction written one alternative per line, so five of the six
rows carry a trailing `|` and the 17th word, `version`, closes it and
carries none. A union's row count is a property of its formatting, not a
count of disjunctions.

The `*"cli"` default is PRESERVED, written inline as `*"cli" |
or(_methodWord)`: S3 permits a literal default, and the default is a
value choice the table does not carry. So `{}` still validates and still
resolves to `cli`, which is also what the verb does with an omitted
method (the Go zero value) — one test pins those two together.

The accepted set is IDENTICAL before and after — 17 method words and the
same default — read from the compiled CUE on both sides. The generated
params projection moves by exactly one doc comment (the S3 statement on
the method field); every generated type, field and tag is byte-identical,
and `cue exp gengotypes` at the pinned [email protected] reproduces the
committed file byte-for-byte on a re-run.

Two tests are added. schema_served_test.go composes the plugin's own
Describe reply and compiles the body the host receives — the load gate
`charly box validate` does not provide (opencharly/spec#301, measured
here: a dangling `or(_methodWordX)` inside the served def leaves box
validate at "OK — 0 warnings, 0 errors") — and pins the table -> derived
list -> enum derivation, plus the default against the verb's own
zero-value arm. catalog_invariant_test.go keeps the served enum and
omarchyCommand's switch in step in both directions, so an advertised
method cannot be unrouted and a routed arm cannot be unreachable.

The repo's own `go:generate` line could not run: `cue exp gengotypes` has no
`-o` flag at the pinned [email protected] (`unknown shorthand flag: 'o' in -o`), and
a served schema has to stay package-less anyway, so the directive could never
have produced this file. It now stages a `package params` copy and generates
from that — the same mechanism the org's candy-validate projection check runs
— so `go generate ./...` exits 0 and leaves the committed projection
byte-identical.

Refs opencharly/opencharly#945 (the census), opencharly/opencharly#950
(the sequence), opencharly/plugin-jetkvm#15, opencharly/plugin-cua#10,
opencharly/plugin-punktfunk#20 and opencharly/plugin-gh#13.

Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

* fix(candy): make gen.sh generate in a fresh dir, and pin the @vocab owner

Two BLOCK findings from the round-1 verdict, both fixed here.

**Block 2 — gen.sh did not demonstrably write the projection.** It generated
into params/ itself, so `[ -f cue_types_gen.go ]` and `gofmt -w` both passed
vacuously against the file that was already there; the "unchanged sha" evidence
was therefore equally consistent with cue never having run. gen.sh now
generates inside a FRESH EMPTY temp dir and the only write to params/ is the
final `mv`, so the output's existence is a real proof that cue ran and a
generator failure leaves the committed projection untouched. Verified by
tampering: the file is restored to its committed sha, `ls` shows no stray
`cue_types_params_gen.go`, and a second run is a no-op.

**Block 1 — the pasted R5 grep was false.** The body claimed
`git grep -n '|' head -- schema/omarchy.cue` exits 1, but the new line
`method: *"cli" | or(_methodWord)` carries the S3-permitted literal default, so
a bare `|` grep matches it and exits 0. The claim was transcribed from a
precedent instead of run against this tree. The PR body now carries the real
greps: no line ENDS in `|` (the multi-line union is gone), no retired word is an
alternative any more, and the ONE surviving `|` is named and is the default this
change is required to keep.

Also, from the verdict's notes: the `@vocab(omarchy)` ownership tag is now
PINNED by a test rather than asserted in prose — `TestVocabularyTablesNameTheirOwner`
fails on a table tagged for another plugin (proved by that plant).

Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

* fix(candy): make gen.sh name-agnostic about the emitted projection

The round-2 BLOCK found the two section-1 evidence blocks naming different files:
the org mechanism's `cue exp gengotypes .` emits cue_types_params_gen.go while
gen.sh's `cue exp gengotypes schema.cue` emits cue_types_gen.go, and the body
never reconciled them, so the fix's proof looked self-contradictory.

The two names are real and both are correct, which is now MEASURED rather than
implied: the generator names its output from the INPUT it was handed, per its
own help (the package name is omitted from the filename if it is implied by the
import path). A package input keeps the package name in the filename, a
single-file input drops it, and the two files are byte-identical, one sha256.

gen.sh no longer depends on that rule at all: it requires the fresh output dir to
hold EXACTLY ONE cue_types_star_gen.go match and installs that one. Both refusals
are proved: a generator that emits nothing exits 1 and leaves the committed
projection untouched, and one that emits two files exits 1 naming both.

Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

* fix(candy): make the projection comment true in both files, and sweep the script header

Two comment-accuracy findings from the round-3 verdict, both real.

**The schema's S3 note described constructs that exist only in the schema.** It said
the table is "at the foot of this file" and "the enum below", which is accurate in
schema/omarchy.cue and misleading in the generated Go it is carried verbatim into:
params/cue_types_gen.go has no table and no enum, only a plain string field. Reworded
so it is true in BOTH places, and the projection regenerated.

**gen.sh's header still described the pre-round-1 script.** Its first paragraph said
the generator "writes cue_types_gen.go into THIS directory" while the code generates in
a fresh temp dir and moves the output in, and its own third paragraph said the
opposite. The stale sentence survived the commit that moved the generation, which is
exactly the unswept claim R5 is for. Rewritten to describe the staged copy and the
generation in its own directory.

The three commits before this one each left a claim that a later commit invalidated; the
fix here is that the two comments now describe the mechanism the code has, so nothing in
the tree contradicts the body.

Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

---------

Co-authored-by: aitrawog <[email protected]>
github-actions Bot pushed a commit to opencharly/plugin-agent that referenced this pull request Nov 10, 2026
)

* refactor(schema): derive the agent word sets from vocabulary tables

Convert the five inline `|` word unions in candy/plugin-agent/schema/agent.cue to
the §10.1 S3 vocabulary-table idiom: a `_`-prefixed table keyed by word, a derived
`_...Word` list, and the field as `or()` of that list, each table tagged
`@vocab(agent)`.

The five census rows are five single-line disjunctions across five defs — `mode`
(#AgCredentialMount, 2 words), `evidence_policy` (#AgentTeamInput, 3), `transport`
(#AtTargetHop, 5), `persistence` (#AtTerminalProfile, 3) and `transcript`
(#AtTerminalProfile, 4). Every one is a pure word list: no default, no
scalar-type alternative, no heterogeneous or struct alternative. Nothing is left
to judgement.

The two inline literal defaults this schema already carries (`prompt_via:
*"argv" | "file"` and `output_format: *"" | "stream-json"`) are NOT unions
written out alternative by alternative — S3 permits a literal default inline — so
they stay exactly as they are, and a test pins both.

The accepted sets are IDENTICAL before and after (2/3/5/3/4 words), read from the
compiled CUE on both sides, and the differential is zero-verdict: 185 cases across
43 categories, no verdict moved in either direction.

The generated projection does not move at all: `charly candy params plugin-agent
--check` says current on the pristine tree and after the sweep, so this diff
carries no params/cue_types_gen.go change. Raw `cue exp gengotypes` would NOT
reproduce it — it drops the `yaml:` retag the wrapper adds to all 53 tagged
fields, 212 diff lines — so the wrapper is the instrument that owns the file, and
a tamper test proves it rewrites it.

Two tests are added. schema_served_test.go composes the plugin's own Describe
reply and compiles the body the host receives (the load gate `charly box validate`
does not provide, opencharly/spec#301), pins the table -> derived list -> enum
derivation for all five tables and the @vocab owner, and MUTATES a table to prove
each field is derived from it rather than merely equal to it. The second file,
capability_invariant_test.go, keeps the two advertised input defs and the served
`#...Input` set in step in both directions: a capability naming a def the body
lacks fails, and a def no capability advertises fails.

Refs opencharly/opencharly#945 (the census), opencharly/opencharly#950 (the
sequence), opencharly/plugin-jetkvm#15, opencharly/plugin-cua#10,
opencharly/plugin-punktfunk#20, opencharly/plugin-gh#13 and
opencharly/plugin-omarchy#11.

Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

* fix(candy): wire schemaWordList into the field-enum assertion it was written for

Two BLOCK findings from the round-1 verdict, both real and both about this file.

**Dead code.** schemaWordList and its only callee collectWords were defined and never
called: the derived-list comparison reads the harness's decoded Words map, and the
accept/refuse probe goes through Unify, so nothing used the reader. Rather than delete a
reader that asserts something real, it is now WIRED IN: for every vocabulary table the
test asserts that the FIELD's own enum equals the table's row set, not merely that it
accepts every row today — the direction that catches a field bound to a literal list.

**The body's R2 claim named a helper that does not exist here.** schemaFieldWordList is
the sibling plugin-task draft's reader; this file has schemaWordList, and
capability_invariant_test.go calls only servedSchema. The body now names the helpers that
exist and their actual callers.

Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

---------

Co-authored-by: aitrawog <[email protected]>
github-actions Bot pushed a commit to opencharly/plugin-task that referenced this pull request Nov 10, 2026
…es (#65)

Convert the five `mode` word unions in candy/plugin-task/schema/task.cue to the
§10.1 S3 vocabulary-table idiom: a `_`-prefixed table keyed by word, a derived
`_...Word` list, and the field as `or()` of that list, each table tagged
`@vocab(task)`.

That is the 4 `union` rows design/dpat-baseline.tsv records for this file, and the
row count is a property of the OLD file's FORMATTING: four distinct lines, five
FIELD SITES — `mode?: "sync" | "check"` appears twice (#SpliceRegionInput and
#ModulePinsInput, written identically) and the census records it once with a
count of 2. So THREE tables cover FIVE fields:

  _submodulesMode   status bump verify currency   #GitSubmodulesInput.mode
  _checkSync        check sync                    #FileParityInput.mode
                                                 #SpliceRegionInput.mode
                                                 #ModulePinsInput.mode
  _pruneMode        report prune                  #PruneInput.mode

`_checkSync` is the one two-word set three verbs share, so it has ONE home and
three consumers rather than three copies that could drift apart (R2). No union in
this file carried a default, a scalar-type alternative, or a heterogeneous or
struct alternative; nothing is left to judgement.

The accepted sets are IDENTICAL before and after (4/2/2/2/2 words), read from the
compiled CUE on both sides, and the differential is zero-verdict: 163 cases across
46 categories, no verdict moved in either direction.

The generated projection does not move at all: `charly candy params plugin-task
--check` says current on the pristine tree and after the sweep, so this diff
carries no params/cue_types_gen.go change. Raw `cue exp gengotypes` would NOT
reproduce it — it drops the `yaml:` retag the wrapper adds to all 28 tagged
fields, 112 diff lines — so the wrapper is the instrument that owns the file.

Two tests are added. schema_served_test.go composes the plugin's own Describe
reply and compiles the body the host receives (the load gate `charly box validate`
does not provide, opencharly/spec#301), pins the table -> derived list -> field-enum
derivation for all three tables and the @vocab owner, and mutates a table to prove
each field is DERIVED from it rather than merely equal to it. mode_dispatch_test.go
keeps each of the five `mode` fields and the Go function that dispatches on it in
step in BOTH directions, and pins the four Go-level defaults for an omitted mode
against the words the schema accepts.

Refs opencharly/opencharly#945 (the census), opencharly/opencharly#950 (the
sequence), opencharly/plugin-jetkvm#15, opencharly/plugin-cua#10,
opencharly/plugin-punktfunk#20, opencharly/plugin-gh#13, opencharly/plugin-agent-pi#11,
opencharly/plugin-omarchy#11 and opencharly/plugin-agent#15.

Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

Co-authored-by: aitrawog <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant