Skip to content

refactor(schema): derive the punktfunk word sets from vocabulary tables - #20

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

Convert the two inline | word unions in
candy/plugin-punktfunk/schema/punktfunk.cue to 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:

_method  _access          (+ _methodWord / _accessWord)

That is the 11 union rows design/dpat-baseline.tsv records for
plugin-punktfunk/candy/plugin-punktfunk/schema/punktfunk.cue. They are TWO
disjunctions, not 11:
the 43-word method catalog is written one alternative
per line (10 rows carry a |), and access is written on one line (1 row). The
catalog's 43rd word, stream-probe, 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 shape. 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 -10
    187 spec
     16 plugin-egress
     13 plugin-agent-pi
     11 plugin-punktfunk
      8 plugin-pipeline
      8 plugin-lobster
      7 plugin-desktop-kind
      6 plugin-omarchy
      6 plugin-gh
      5 plugin-agent

spec is the producer and out of scope. plugin-egress's 16 rows are 16
separate single-line unions and ~3 are not word lists at all, so its row count
overstates its S3 debt. plugin-agent-pi's 13 rows are one 9-line catalog plus
four one-line word lists — mechanical, and kept as a later candidate. After the
jetkvm (92-row) and cua (30-row) precedents, plugin-punktfunk is the cleanest
remaining leaf repo: two disjunctions, both pure word lists, nothing else.
Every row this repo carried is retired by this PR; no row is left to judgement.

The three accepted sets are IDENTICAL before and after — 43 methods, 3 access
words — read from the compiled CUE on both sides (284-case differential below).
The generated Go does not move either: Method string and Access string are
byte-identical, and the only line the regeneration changes is one doc comment
(the SDD half of the change, and what makes the sweep safe for every Go caller).

Files the diff carries:

M candy/plugin-punktfunk/schema/punktfunk.cue
M candy/plugin-punktfunk/params/cue_types_gen.go
M candy/plugin-punktfunk/plugin_test.go
M candy/plugin-punktfunk/go.mod
A candy/plugin-punktfunk/schema_served_test.go
A candy/plugin-punktfunk/catalog_invariant_test.go
file change
schema/punktfunk.cue the two unions become S3 tables + derived lists; the catalog's false formatting note is replaced by the S3 statement
params/cue_types_gen.go regenerated — one doc comment is the only change
schema_served_test.go new: composes the plugin's own Describe reply, compiles the served body, pins the table → derived list → enum derivation
catalog_invariant_test.go new: the served enum against resolveCall and the client-CLI set, both directions, and every advertised method actually builds
plugin_test.go the enum reader moves from a text parse to the CUE API; the truncating count helper is deleted
go.mod cuelang.org/go becomes a direct requirement (the tests import it)

Head c54b90f6ec74322c5d4accad055709455ac7af33.

How tested

Everything below ran on the committed tree, at that head.

1. The projection is the repo's own generator's output, and a re-run is
byte-identical.
The instrument is cue exp gengotypes at the pinned
[email protected], not the binary's candy params wrapper (which opencharly/plugin-cua#8
measured as diverging on the yaml: retag). Three fresh runs plus the committed
file carry one sha256, and the org gate's own comparison (sed 1,1d on both
sides, exactly as the reusable candy-validate does it) is empty:

$ 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
db5a0c4c00638465aed41bbbe21d7d9df866eaec4966ac7f1d82b104d8aa3d39  /tmp/tmp.pvsexdxxB2/cue_types_params_gen.go
db5a0c4c00638465aed41bbbe21d7d9df866eaec4966ac7f1d82b104d8aa3d39  /tmp/tmp.jkU0bxKadz/cue_types_params_gen.go
db5a0c4c00638465aed41bbbe21d7d9df866eaec4966ac7f1d82b104d8aa3d39  /tmp/tmp.jgDRmjXmJ8/cue_types_params_gen.go

$ sha256sum params/cue_types_gen.go
db5a0c4c00638465aed41bbbe21d7d9df866eaec4966ac7f1d82b104d8aa3d39  params/cue_types_gen.go

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

2. The module gate, on the final tree:

$ go build ./...
rc=0

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

$ gofmt -l .
(no output — all formatted)

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

These ran with GOTOOLCHAIN=go1.26.4, the version go.mod pins. Host note (no
finding): this host's default go is go1.27.3-X:nodwarf5; pinning the module's
own version reproduces the version the gate reads, exactly as the two precedents
did.

3. The schema still LOADS through NewMeta().Describe, and the body it serves
compiles.
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:

$ go test -count=1 -v -run 'TestServedSchemaResolvesItsDefs|TestS3VocabularyTablesDriveTheirEnums|TestServedCatalogCoversTheWholeEnum|TestCatalogHasNoPhantomMethods|TestDispatchHasNoPhantomArms|TestEverySchemaMethodBuilds' .
=== RUN   TestServedCatalogCoversTheWholeEnum
--- PASS: TestServedCatalogCoversTheWholeEnum (0.01s)
=== RUN   TestCatalogHasNoPhantomMethods
--- PASS: TestCatalogHasNoPhantomMethods (0.01s)
=== RUN   TestDispatchHasNoPhantomArms
--- PASS: TestDispatchHasNoPhantomArms (0.01s)
=== RUN   TestEverySchemaMethodBuilds
--- PASS: TestEverySchemaMethodBuilds (0.00s)
=== RUN   TestServedSchemaResolvesItsDefs
--- PASS: TestServedSchemaResolvesItsDefs (0.00s)
=== RUN   TestS3VocabularyTablesDriveTheirEnums
--- PASS: TestS3VocabularyTablesDriveTheirEnums (0.07s)
PASS
ok  	github.com/opencharly/plugin-punktfunk/candy/plugin-punktfunk	0.113s

and the repo's structural check, host-building the plugin from THIS tree:

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

4. The accepted surface did not move: 284 cases, 12 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 with the EXACT operation the host performs (spec/climodel's
ValidateCUEInput, which sdk.SchemaValidator.ValidateJSON delegates to:
input.Unify(def).Validate(cue.Concrete(true))). The case set is derived from the
compiled enums, never restated by hand: six blocks over every method word
(accept; a near-miss suffix; a case mutation; an unknown key; with the access
word; near-miss plus access), the 3 access words and 5 refusals, 6 method-shape
cases, 5 structural cases, 3 full documents, and this repo's own authored forms
(the candy's scalar punktfunk: health desugared, and the skill's three
documented examples).

instrument: 43 methods, 3 access words (identical on both sides)
--- 284 cases across 12 categories ---
  A method accept            43
  B method near-miss         43
  C method case              43
  D method+bogus key         43
  E method+access            43
  F method near-miss+access  43
  G access accept             3
  H access refuse             5
  I method shape              6
  J structural                5
  K full document             3
  L authored docs             4
verdicts: before 96 OK / 188 ERR; after 96 OK / 188 ERR
verdicts moved: 0 (must be 0)
error-texts moved: 134 (CUE's own rendering, not a verdict)

The 134 moved error TEXTS are CUE's own summarising, not the surface: a near-miss
method reports 43 errors in empty disjunction before and 5 errors in empty disjunction after. Same verdict, same failing field path, same refusal.

The rig is not green by construction. Two plants were run against a copy of the
committed schema:

$ # (a) one word moved, count unchanged:  the set check refuses before judging
INSTRUMENT BROKEN: method sets differ
rc=1

$ # (b) `method:` made optional, same word set:  a verdict moves
verdicts moved: 1 (must be 0)
MOVED I method shape	omitted	before=false after=true
rc=1

5. Every new test fails on a planted break — seven plants, each applied to
the committed tree, observed red, then restored from a saved copy:

PLANT 1  dangling reference inside a served def (`or(_methodWordX)`)
  --- FAIL: TestServedSchemaResolvesItsDefs
      schema_served_test.go:118: Describe: plugin schema does not compile: #PunktfunkInput.method: reference "_methodWordX" not found
  --- FAIL: TestServedCatalogCoversTheWholeEnum
      catalog_invariant_test.go:108: Describe: plugin schema does not compile: … reference "_methodWordX" not found

PLANT 2  table kept, enum bound to a literal (`method: "health"`)
  --- FAIL: TestServedCatalogCoversTheWholeEnum
      catalog_invariant_test.go:121: served enum is missing its TAIL (stream-probe) — the derivation is losing rows; got 1 methods: [health]
  --- FAIL: TestDispatchHasNoPhantomArms
      catalog_invariant_test.go:158: resolveCall routes "access", which the served #PunktfunkInput.method enum does NOT accept — the arm is unreachable

PLANT 3  the derived list no longer derived (`_methodWord: ["health"]`)
  --- FAIL: TestServedCatalogCoversTheWholeEnum
      catalog_invariant_test.go:121: served enum is missing its TAIL (stream-probe) — got 1 methods: [health]

PLANT 4  the enum loses its TAIL (the `stream-probe` row deleted)
  --- FAIL: TestServedCatalogCoversTheWholeEnum
      catalog_invariant_test.go:121: served enum is missing its TAIL (stream-probe) — got 42 methods
  --- FAIL: TestResolveCallMapsEveryDeclaredMethod
      plugin_test.go:64: test covers 30 host methods but the served enum declares 29 host methods (42 total minus 13 client) — the enum and the dispatch table have drifted

PLANT 5  a method added to the table, never routed (`teleport: {}`)
  --- FAIL: TestCatalogHasNoPhantomMethods
      catalog_invariant_test.go:143: schema method "teleport" is a PHANTOM: neither resolveCall nor the client CLI routes it — add an implementation or remove it from the schema
  --- FAIL: TestEverySchemaMethodBuilds
      catalog_invariant_test.go:182: schema method "teleport" is routed to the management API but resolveCall rejects it: punktfunk: unknown method "teleport"

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

PLANT 7  the access derived list no longer derived (`_accessWord: ["full"]`)
  --- FAIL: TestS3VocabularyTablesDriveTheirEnums
      schema_served_test.go:162: "access"'s derived list [full] is not its table's row set [controller full view]
      schema_served_test.go:166: "access" word "controller" is refused where an author uses it: #PunktfunkInput.access: conflicting values "full" and "controller"

6. The text-parsed disjunction was found before the sweep. plugin_test.go's
countSchemaMethods read the schema FILE, cut the method: body at the first
blank line, and counted quotes — so it had silently covered only the host half of
the catalog and never the CLIENT half. A derived enum has no body at all, so the
same reader would now find ZERO. It is deleted; both new readers go through the
served schema and the CUE API, and the invariant is two-way (catalog_invariant_test.go).

7. The census gate. The umbrella's design/dpat-baseline.tsv and its
emission are the lead's, by emission, in the change that advances the pin; this
PR touches neither the census nor the umbrella.

Rulebook compliance

  • R0 — skills first. Read this repo's AGENTS.md (via
    git show origin/main:AGENTS.md) and the umbrella's rulebook before the first
    edit; loaded /charly-internals:git-workflow, /charly-internals:plugin,
    /charly-internals:go, /charly-check:punktfunk and /charly-check:check —
    the five the dispatcher selects for a plugin CUE schema plus a PR landing. The
    repo's AGENTS.md also decided the instruments: go build/test in
    candy/plugin-punktfunk/, charly box validate at the root, and the projection
    regeneration.

  • R1 — every anomaly root-caused, then fixed. Two findings, both in scope and
    both fixed here. (a) The first regeneration DROPPED the file's header comment:
    cue exp gengotypes attaches the leading comment to the FIRST declaration, and
    placing the tables above #PunktfunkInput moved that attachment onto a hidden
    _method table, which is not emitted. Root fix: the tables sit at the foot of
    the file, so the header stays on the definition; the regenerated diff is one
    intended doc comment. (b) countSchemaMethods truncated the catalog at the
    first blank line and could not read a derived enum at all — it is deleted and
    replaced by the served-schema reader (finding 6 above). No gate warned: every
    command below exited 0.

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

  • R3 — no workarounds. No sleeps, retries or suppressions. The projection is
    produced by the repo's own pinned generator instead of being hand-edited, and
    the reproducibility check replicates the org gate's comparison (sed 1,1d on
    both sides) rather than normalizing the diff. GOTOOLCHAIN=go1.26.4 runs the
    version go.mod pins instead of hiding a toolchain skew.

  • R4 — product before prose. N/A — no documented command, user-facing
    instruction or emitted page changes here. The one prose edit in the schema
    describes the shape it now has, corrected in the same commit that changed it.

  • R5 — legacy deleted completely, with the grep. The retired form is gone, and
    so is the note that described it:

    $ git grep -n '|' HEAD -- candy/plugin-punktfunk/schema/punktfunk.cue ; echo "rc=$?"
    rc=1
    
    $ git grep -n 'trailing-pipe\|inline CUE union' HEAD ; echo "rc=$?"
    rc=1
    
  • R6 — user work preserved, git safe. git status was read before staging and
    is clean after the commit; the six intended paths were staged by literal
    pathspec; the branch is feat/s3-vocab off fresh origin/main (a9ff745), one
    commit, git commit -F; no force-push, no history rewrite, no hook bypass, no
    direct push to main. The umbrella was never edited: no pin, no
    design/dpat-baseline.tsv, no census row. The identity used is repo-local
    (aitrawog <[email protected]>), matching the sibling repos.

    $ git status --short      (after the commit and after every plant was restored)
    (no output)
    
  • R7 — proved behaviour, and the proof can fail. Seven plants turn the new
    tests red (finding 5); the differential rig turns red on a semantic plant and
    refuses a moved word set (finding 4); the changed artefact is validated at its
    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. N/A — this change crosses no service
    boundary: it moves CUE words and a generated projection, and nothing in it
    contacts a host, a driver or a registry. The verb's live path is untouched, and
    the word sets are proven identical, so no live run could distinguish the before
    and after trees.

  • R9 — binary equals source. No charly source changed and no new runtime OS
    dependency, so no package or binary rebuild is owed. The module's 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 and refactor(schema): derive the cua word sets from vocabulary tables plugin-cua#10 made for the same
    reason. The charly used for box validate is the umbrella tree's
    worktree-local build (2026.306.0314).

  • R10 — fresh proof on the gate that owns the change. This repo declares no
    per-repo candy gate; the gates that own it are the module build/test above, the
    org reusable candy-validate (manifest + projection currency), and the
    served-schema load gate. All ran on the committed tree with zero warnings. The
    two punktfunk beds (check-punktfunk-pod, check-punktfunk-vm) are named, not
    claimed: they live in opencharly/distro-cachyos and compose the RELEASED plugin
    ref, so a run of them would prove the pinned plugin, not this unmerged tree.

  • Cutover and landing. One phase, one commit. The census rows live in the
    umbrella and are lowered there by the lead only after this lands and the pin
    advances, never from this PR — so this repo carries no half-finished state and
    no follow-up.

  • AI attribution (A3). The trailer carries this runtime's exact names. The
    harness's own session descriptor names the model deepseek-v4.1-flash and the
    session, and dsh --version prints the harness version — no config file is the
    evidence:

    $ dsh --version
    0.2.1-rc.2
    
    $ env | grep -E '^DSH_(PROFILE|SESSION_ID)='
    DSH_PROFILE=web
    DSH_SESSION_ID=ca19da03-0b4d-402f-82d4-983ac86138c4
    

    The tier fully tested and validated is the tier the gates above earned on
    this tree.

Change classification

Internal schema refactor — no consumer-visible change. The accepted authored
surface does not move (284 cases, zero verdicts moved); the generated Go API does
not move (identical types, fields and tags, one comment); no definition is renamed
or removed (#PunktfunkInput still resolves and still carries both fields); no
authored word is added or dropped. 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 — the lag both precedents left in
place, since those pages are pinned per plugin version.

Breaking change + rollback: none — no word is added, dropped or renamed, no
definition is renamed, and the generated Go is byte-identical apart from one doc
comment, so no consumer action and no migration is owed; backing the change out is
one inverse commit. The census rows this retires are lowered in the umbrella by the
lead, by emission, in the change that advances the pin.

Filed issues

None — neither R1 finding was separable from this change; both are fixed in this
diff.

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

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)
@aitrawog

Copy link
Copy Markdown
Contributor Author

STATUS — the punktfunk §10.1 S3 sweep is open as this PR.

Head c54b90f6ec74322c5d4accad055709455ac7af33 on feat/s3-vocab, off origin/main a9ff745. The repo's 11 union rows are TWO disjunctions (a 43-word method catalog written one word per line, plus access on one line); both are retired, and nothing is left to judgement. Evidence in the body: the generator's three runs are one sha256, 284 judged cases across 12 categories move ZERO verdicts, the served body is compiled through NewMeta().Describe, seven planted breaks turn the new tests red, and the text-parsed enum reader is replaced.

Next: the validator's verdict. The census and the pin are the lead's, by emission, in the umbrella change that advances the pin.

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

@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: c54b90f6ec74322c5d4accad055709455ac7af33 (branch: feat/s3-vocab)

Security screen: PASS — no injection/instructions, no secrets, no weakened guardrails, cuelang.org/go only promoted indirect→direct at the same pin.

Checklist: All applicable rules PASS or NA. Cross-checks: the 43-word _method table + 3-word _access table reproduce the retired unions exactly; the 284-case differential arithmetic is internally consistent (43×6 + 3 + 5 + 6 + 5 + 3 + 4 = 284, 96 OK / 188 ERR both sides); schema/*.cue and cue_types_gen.go move together (SDD); the S3 test (TestS3VocabularyTablesDriveTheirEnums) fails on the old inline-union schema, so R7 coverage is real; the body's R10 disposition (beds compose the released ref and cannot distinguish the unmerged tree; the differential replicates ValidateCUEInput exactly) is a structural reason, not a forbidden framing, and matches the jetkvm/cua precedents. Placement: candy layer, unchanged. One-commit cutover.

Comments: 1 — the STATUS comment by @aitrawog (coordination metadata, head SHA and evidence match the body, correct Agent:→Assisted-by: order): verified-non-blocking.

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 07:08
@github-actions
github-actions Bot merged commit 2e62749 into main Nov 10, 2026
3 checks passed
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]>
charly-auto-merge Bot added a commit that referenced this pull request Nov 10, 2026
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