Repository navigation
fix(schema): #DistroInput had drifted behind spec's #Distro - #4
Merged
github-actions[bot] merged 1 commit intoAug 30, 2026
Merged
Conversation
This plugin validates an authored `distro:` body against its OWN
self-contained #DistroInput before dispatching. That duplication is
sanctioned — the plugin schema must compile standalone while spec's
#Distro must generate Go — but it means the two can drift, and when they
do the failure is actively misleading: charly's core accepts a field and
this plugin rejects it with
#DistroInput.disk_layout: field not allowed
which reads like the field does not exist anywhere.
Two fields were missing:
- installer, added to spec in spec#71. Already drifted: an authored
installer: block has been rejected here since that landed.
- disk_layout, added in spec#72, and the one that surfaced this — a
charly build with an omarchy distro entity failed to validate.
Add #DsDiskLayout, #DsSubvolume, #DsInstaller and #DsInstallerFile
mirroring their spec counterparts, and wire both fields into
#DistroInput.
Add a parity test so the NEXT omission fails here, next to the fix,
rather than in a consumer's build log. It compares #DistroInput's
top-level field set against the set spec's #Distro authorises, and
verified to discriminate: deleting the disk_layout line makes it fail
with a readable got/want diff. A second test catches a #Ds* reference
that has no definition, which would otherwise only fail at use.
Inner defs are deliberately NOT compared: they differ in name
(#DsBootloader vs #Bootloader) and carry no @go annotations, so
comparing them would be noise. What matters is that every field a distro
entity can author is authorable here.
Claude-Session: https://claude.ai/code/session_01YKF2VLqeHHbrBDz8XftaD3
Review — PASSHead SHA: Security screen: PASS — CUE schema + test change only; no secrets, exfiltration, network calls, scope mismatch, or guardrail weakening. No embedded directives aimed at the reviewer. Checklist: All applicable rules PASS or NA.
Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
This was referenced Aug 30, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This plugin serves
kind: distroand validates an authoreddistro:body against itsown self-contained
#DistroInputbefore dispatching. That duplication is sanctioned —the plugin schema must compile standalone while spec's
#Distromust generate Go — but itmeans the two can drift, and when they do the failure is actively misleading: charly's
core accepts a field and this plugin rejects it with
which reads like the field does not exist anywhere.
Two fields were missing:
installerinstaller:block has been rejected here since that landeddisk_layoutEvery file in the diff
candy/plugin-distro/schema/distro.cue#DsDiskLayout,#DsSubvolume,#DsInstaller,#DsInstallerFileadded;disk_layout?andinstaller?wired into#DistroInputcandy/plugin-distro/schema_parity_test.goHow this stops recurring
The parity test compares
#DistroInput's top-level field set against the set spec's#Distroauthorises, so the next omission fails here, next to the fix rather than in aconsumer's build log.
Inner defs are deliberately not compared: they differ in name (
#DsBootloadervs#Bootloader) and carry no@goannotations, so comparing them would be noise. Whatmatters is that every field a distro entity can author is authorable here.
The
wantlist is a literal rather than something read from thespecmodule. Importingspec to check the standalone schema would defeat the property being checked — this def
exists precisely so the plugin compiles without it.
How tested
The guard was verified to discriminate, not merely to pass. Deleting the
disk_layoutline reproduces the exact failure this PR fixes, with a readable diff:
The line was then restored and the suite re-run green. A test that cannot fail is not a
gate, and this one was made to fail on purpose before being trusted.
The originating symptom is also reproducible:
charly box validatein the charly repo,with an omarchy distro entity carrying
disk_layout:, reportedwhich is what sent me here.
Rulebook compliance
/charly-internals:git-workflow; the sanctionedspec-def/plugin-input duplication was read before a third copy was considered.
field not allowederror was root-caused to schemadrift rather than treated as "the field is unsupported". Chasing it turned up a
second, older instance (
installer) that nothing had reported, and both are fixedhere — not deferred as out of scope.
the guard that prevents a third, land together.
plugin input def must compile standalone. The guard is what makes carrying two copies
safe, which is the honest answer to "why is this allowed to be duplicated at all".
#DistroInputto an open struct would have silenced this and every future typo with it.N/A — purely additive; nothing is removed or renamed.main, PR-only,no force-push, no direct push to
main, no hook bypass.fix is proven by the originating
charly box validateerror going away.N/A — no generated artifact in this repo.go test -count=1from this worktree.N/A — no bed in this repo. Its gate is the unit suite on the final tree.in step with spec was false, and testing it is what found the older
installergap.N/A — no roster.Change classification
go test -count=1 ./..., plus a deliberate negative run showingthe guard fails on drift.
reproduced, the fix removes it, and the guard was proven to catch a regression.
Assisted-by: Claude Code claude-opus-5[1m] (fully tested and validated)