Repository navigation
refactor(schema): derive three word enums and type two open structs (TODO 2.16) - #389
Conversation
…s #Opaque (TODO 2.16)
Seven census rows in two files, all reachable without the derivation boundary filed as spec#385.
The three word enums become S3 vocabulary tables in this schema's own idiom -- `_x` carrying
`@vocab(spec)`, the derived list `_xWord`, the enum cited as `or(_xWord)` -- so a new extract
policy, cgroup namespace or IPC mode is one row rather than a new alternative on a declaration
line. The four open structs (`plugin_input` in 00_common.cue and twice in instrument.cue,
`#RepoBlock`) become `#Opaque` with the S10 marker, which is the rule's own remedy: only #Opaque
is open.
Two rows the census also lists are NOT touched, and the compiler is why: `#StrVal` is a value
union (string | number | bool) and `#PackageItem` is scalar-or-record. The S3 convention test
refuses both -- a table's rows must be words, and these rows are types and constraints
("cannot convert non-concrete value") -- so they belong to the four shape classes spec#385 asks
DESIGN to decide, not to this cutover.
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
…at the diff does
The revert that put #StrVal and #PackageItem back changed two things it had no business changing:
#StrVal's trailing comment lost its own container reference (`{[string]: #StrVal} maps`, which is
exactly what the next line, #StrMap, is), and #PackageItem's closing `})` gained a leading tab.
Both are restored verbatim. Neither row's definition differed from origin/main — only the
transcription of their comments did — so the diff now touches neither line, which is what the body
already claimed and what the reviewer correctly measured it had not.
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
…#Opaque
Converting the def to `#Opaque & {name: string & !=""}` replaced the old
`@go(-)` comment wholesale, and that comment carried the one fact a reader
needs to understand the Go side: `RepoBlock` is a hand-written ALIAS
(`type RepoBlock = map[string]any` in spec/scalar_aliases.go), so
`[]RepoBlock` IS `[]map[string]any` for toMapSlice / template rendering.
That is a relocation that deleted provenance (R1/A1): the definition moved to
`#Opaque` and the alias contract went with it. Restored verbatim beside the S10
marker, which keeps both facts in one line.
`charly task cue-gen` reports 2 steps, 0 failed and `TestGenReproducible`
passes, so the regenerated artefacts are byte-identical and nothing outside
this comment moved.
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
Review — PASSHead SHA: Security screen: PASS — no secrets, network egress, dependency/CI edits, or guardrail weakening; diff scope (3 enums → vocab tables, 4 open structs → Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
Successor to
#387, which auto-closed at the five-verdict threshold. That PR's diff and bodywere correct from its first push; it spent its rounds on evidence defects (a
#RepoBlockaliascomment the conversion dropped, and a stat pasted from
git show HEADinstead ofgit diff origin/main...HEAD), both fixed in its last commit7d9add7. This PR carries the sametree and restarts the verdict count — nothing was re-derived.
TODO row 2.16's first ratchet unit, cut down to what the language actually permits. Seven census
rows in two schema files:
schema/00_common.cueunionextract?: "tar.gz" | "tar.xz" | "tar.zst" | "zip" | "none" | "sh" | ""schema/00_common.cueunioncgroupns?: "host" | "private" | ""schema/00_common.cueunionipc_mode?: "host" | "private" | "shareable" | ""schema/00_common.cueopenplugin_input?: {...}schema/00_common.cueopen#RepoBlock: {schema/instrument.cueopenplugin_input?: {...}The three word enums become S3 vocabulary tables in this schema's own idiom —
_xcarrying@vocab(spec), the derived list_xWord: [for w, _ in _x {w}], the enum cited asor(_xWord)—so a new extract policy, cgroup namespace or IPC mode is ONE row rather than a new alternative on
a declaration line. The four open structs become
#Opaquewith theS10marker, which is therule's own remedy: only
#Opaqueis open.#RepoBlock's@go(-)comment keeps its alias contract. The conversion replaced the oldcomment wholesale, and the old comment carried the fact a reader needs:
RepoBlockis ahand-written ALIAS (
type RepoBlock = map[string]anyinspec/scalar_aliases.go), so[]RepoBlockIS[]map[string]anyfortoMapSliceand template rendering. That is restoredverbatim beside the
S10marker, in the same commit as the conversion, because a relocation thatdrops provenance is a deletion wearing a move's clothes.
What this deliberately does not do, and why
Two rows the same census lists are not touched:
#StrVal(string | number | bool) and#PackageItem(scalar-or-record). I converted both, ran the suite, and the S3 convention testrefused them, because a vocabulary table's rows must be words and these rows are a type and a
constraint:
So they are two of the four shape classes filed as #385 — a value union and a
heterogeneous container — and they wait for that DESIGN decision rather than being forced here.
Neither line is touched by this branch's diff, which is measured rather than asserted:
(An earlier revision of this branch restored both definitions but transcribed their trailing
comment and closing indentation differently from
origin/main; that is repaired in446e8e58, andthe count above is the measurement that the repair is complete.)
The other two classes in #385 (a default-bearing enum refused by
or(), an absence-discriminatedarm refused by a computed
_|_) are what keep#Stepand#VmSourceout of this PR entirely.The remaining
unionandabsencerows in these two files, and every row invm.cue, fall intoone of those four classes;
#385is where that is recorded.How tested
The census reads the PINNED commit, so it still shows the old counts until the pin advances. The
symbol greps below are the tip-tree answer, and the census rows lower in the umbrella PR that
follows the pin advance (this body names the commit the census was taken at:
dd6bde8's parenttree is irrelevant here; the baseline file itself is umbrella-side and unchanged by this PR).
Two columns, both refs, every symbol — the
origin/maincolumn is what makes theHEADcolumn evidence rather than assertion (R5: the parent is the control):
plugin_inputreads 3 because the construct had three sites — one inschema/00_common.cueand twoin
schema/instrument.cue, which the census records as two separate rows (1 and 2). Every count iszero at
HEAD, which is this branch's tree.Two notes on the instrument, because a fixed string is not the identifier:
The identifier-level counts are wider than the census symbols (1 each), which is the point: the
census keys on the offending LINE, so the full line is the right instrument here, and the wider
count is context rather than a second claim. None of the five before-counts is zero, so no looser
anchor is needed to attribute one.
and the replacement forms are present where the symbols were:
The S3 shape is itself gated by two tests in this repo, and they are the control that caught my
first attempt (a table whose rows were not words):
TestEveryTableDerivesItsWordListandTestInjectedRowReachesTheDerivedListboth pass on the committed tree.The generator, twice, and the class gate — the class is a negative claim about beds, so it is
proven rather than assumed:
The whole-diff stat is
git diff --stat origin/main...HEAD, notgit show HEAD: this branch carriesthe unit commit plus one review-round fix commit, and
git show HEADreports only the last ofthem.
Rulebook compliance
/charly-internals:go,/charly-internals:pluginand/charly-internals:git-workflowwere loaded before the first git action, and this repo'sAGENTS.mdwas read first.#Opaquefor the open shapes, instead of the same construct spelled per declaration.#Opaqueare the schema's own mechanisms, and no generated file was hand-edited.git grep -cFper symbol at both refs, pasted above: every symbol is non-zero atorigin/mainand zero atHEAD, and the two siblingplugin_inputsites inschema/instrument.cuewere converted in the same phase rather than left as a follow-up.git status --shortwas clean before the branch was cut; the work is onfeat/common-s3-rowsin a worktree, never the tracked checkout; no force-push, no bypass, no direct push tomain.disposable:grep pasted above proves no bed venue exists in this tree, so nocharly check runapplies.Change classification
No consumer breakage and nothing to roll back. The three enums accept exactly the same words as
before and the open structs accept exactly the same bodies;
spec/cue_types_gen.gois unchanged bythis PR (the generator ran, and
git statusafter it lists only the two schema files). A consumerbumping its pin compiles as before.
Filed issues
cue vetverdict. Two of them are why#StrVal/#PackageItemare untouched here and why#Step/#VmSourceare out of scope.Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)