Repository navigation
feat(desktop): the theme, session, displaymanager and desktopentry kinds - #74
Merged
Merged
Conversation
Four defs describing a graphical session the way init:/service: describes
a supervised process: the KIND is a renderer VOCABULARY, the authored
entity is DATA. One theme entity renders into a Hyprland config, a sway
config and a GTK settings file without naming any of them.
All four are FLAT (Structural:false): none deploys or nests a deploy
member, so none earns a DeployTraits row. Scalars, small records and
inline templates -- the plugin-harness-kind shape, not candy/substrate.
WHY KINDS AND NOT `write:` STEPS. Each could be a write: with a heredoc.
What a kind buys is a validator and cross-references a write: cannot
express:
- theme: the token vocabulary is CLOSED, so a template naming a token
the theme does not define is rejected at load. An undefined token
renders as an EMPTY STRING -- a terminal with no background, a bar
with an invisible accent -- which no build step reports.
- displaymanager: `session` must match a session's session_desktop.id.
An autologin naming a session file nothing installed is a black
screen at boot with an empty journal.
- desktopentry: categories is closed to the freedesktop registered
MAIN categories, because a typo there errors nowhere -- the entry
just silently vanishes from every menu. And startup_wm_class/window
are read BY the session renderer, so one entity feeds both the
applications menu and the compositor's window rules. That last point
is the ONLY thing that makes desktopentry worth being a kind; without
it a .desktop file is a trivial INI and this would be write:
duplication.
Nothing in #Theme or #DesktopEntry names a compositor, so the same
entity serves Hyprland, sway, labwc and KDE.
Two shapes chosen against the obvious alternative:
- the 16 ANSI colours are named fields, not a list, so a template says
{{.Token.color4}} and a missing one is a load error rather than an
index panic at render time.
- #ThemeRender.distro is [...string], not [...#DistroID]: these are
the free-form TAGS a candy's distro: list carries (box.cue does the
same), not the closed guest-distro id a VM source is validated
against. #DistroID is also @go(-) and generates no Go type, so a list
of it emits a reference to a type that does not exist -- caught by
the build, not guessed.
No #SchemaVersion bump: purely additive optional defs with nothing to
migrate, the same shape as the iso VmSource arm and #DiskLayout.
Claude-Session: https://claude.ai/code/session_01YKF2VLqeHHbrBDz8XftaD3
Review — PASSHead SHA: Security screen: PASS — no scope mismatch (all 3 files accounted for in the body), no secrets/exfiltration, no weakened guardrails, no new dependencies, no embedded directives. Checklist: All applicable rules PASS or NA.
Minor non-blocking note: the body's "41 assertions" count is slightly higher than the 37 Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
github-actions Bot
pushed a commit
that referenced
this pull request
Aug 30, 2026
The four desktop kinds landed in #74 without @go() annotations, so cue:gen produced snake-cased identifiers with a leading capital: Entry_name, Browser_arg, Mime_type, Startup_wm_class, Config_path_template, and a bare Url. Every other def in this schema annotates, and these are types a plugin consumer writes against directly -- the desktop-kind provider decodes into them field by field -- so leaving them non-idiomatic makes every consumer read wrong. 18 annotations, no shape change: the yaml/json tags and therefore the authored wire surface are byte-identical, so nothing needs migrating and #SchemaVersion does not move. entry_name -> EntryName url -> URL browser_arg -> BrowserArgs mime_type -> MimeTypes startup_wm_class -> StartupWMClass config_path_template -> ConfigPathTemplate *_template -> *Template cursor_theme -> CursorTheme icon_theme -> IconTheme extra_file -> ExtraFiles session_desktop -> SessionDesktop theme_render -> ThemeRender Found while writing the plugin-desktop-kind provider against them. Claude-Session: https://claude.ai/code/session_01YKF2VLqeHHbrBDz8XftaD3 Co-authored-by: atrawog <[email protected]>
github-actions Bot
pushed a commit
that referenced
this pull request
Sep 16, 2026
…LLMParams) (#136) Adds schema/llm.cue — the SHARED LLM contract with TWO consumers: the generic pipeline engine's agent stages (candy/plugin-pipeline) and the `vision:` check verb (candy/plugin-vision), which validates a screenshot by sending it to the same endpoint. R3 puts the vocabulary in ONE place; the boundary law puts authored CUE in this contract module. Same shape as schema/desktop.cue (plugin-facing vocabulary in spec, generating the Go types a plugin imports). - #LLMSpec: endpoint + connection config (base_url, model, api_key, organization, project, timeout, idle_timeout, max_retries, headers, params). - #LLMParams: the general chat-completions request block (temperature, top_p, max_tokens, max_completion_tokens, frequency/presence_penalty, seed, stop, response_format, reasoning_effort, reasoning, stream_options, parallel_tool_calls, tool_choice, logprobs, top_logprobs, user, metadata, logit_bias, extra). Both CLOSED; `extra` is the one legal unknown-key path. - #LLMResponseFormat / #LLMReasoning / #LLMStreamOptions / #LLMNamedToolChoice. NO #SchemaVersion bump: purely additive optional defs with nothing to migrate — the same shape as the iso VmSource arm, #DiskLayout, and the desktop kinds (spec PR #74, which likewise added plugin-facing vocabulary without a bump). Why the LLM defs are named #LLM* and not #ResponseFormat etc.: spec and the plugin-pipeline mirror both compile in ONE CUE instance; a bare #ResponseFormat would be a name that could collide with any future base def. The #LLM prefix namespaces the shared vocabulary. Tests (schema/llm_test.go, the desktop_test.go shape — CORPUS via unifyDef, TEETH via unifyDefFinal): an ollama corpus block (env-referenced key, sampling + structured output + reasoning + extra), a vision corpus block, an int literal for a `number` param, closedness on both defs (each rejection NAMES the field), the numeric ranges, the reasoning_effort enum (exactly ollama's accepted high|medium|low|none), and the response_format type enum. Verification: $ task cue:gen # GEN_EXIT=0; version_gen.go unchanged $ go build ./... # ok $ go test ./... # 18/18 packages ok (incl. TestGenReproducible) $ go test ./schema -run TestLLM # ok $ gofmt -l . ; go vet ./... # clean Rulebook compliance: R1 (the one test failure was root-caused — an unquoted hyphenated CUE key in the test fixture, fixed by quoting); R3 (one canonical LLM vocabulary); R5 (nothing left beside it); SDD (CUE single source, generated Go reproducible, no hand-written types). Change classification: contract/schema (additive, no wire-key change to an existing surface, no version bump). Verification gate: task cue:gen + TestGenReproducible + the new schema tests. Attribution: fully tested and validated. *Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)* Co-authored-by: atrawog <[email protected]>
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
Four defs describing a graphical session the way
init:/service:describes a supervisedprocess: the kind is a renderer vocabulary, the authored entity is data. One theme
entity renders into a Hyprland config, a sway config and a GTK settings file without naming
any of them.
#Theme#Session#DisplayManager#DesktopEntry.desktopfile, in both its command and web-app formsAll four are flat (
Structural:false): none deploys or nests a deploy member, so noneearns a
DeployTraitsrow. Scalars, small records and inline templates — theplugin-harness-kindshape, not the candy/substrate one.Every file in the diff
schema/desktop.cueschema/desktop_test.gospec/cue_types_gen.gotask cue:gen— never hand-editedWhy these are kinds and not
write:stepsEvery one of these could be hand-rolled as a
write:with a heredoc. What a kind buys is avalidator and cross-references that a
write:cannot express:not define is rejected at load. An undefined token renders as an empty string: a
terminal with no background colour, a bar with an invisible accent. No build step reports
that; it is a subtly wrong desktop rather than a failure.
sessionmust match a session'ssession_desktop.id. An autologinnaming a session file nothing installed is a black screen at boot with an empty journal,
which is the worst failure this surface has.
categoriesis closed to the freedesktop registered main categories,because a typo there errors nowhere: the entry silently vanishes from every menu. And
startup_wm_class/windoware read by the session renderer, so one entity feeds boththe applications menu and the compositor's window rules. That last point is the only
thing making
desktopentryworth being a kind — without it a.desktopfile is a trivialINI and this would be
write:duplication, and should be dropped.Nothing in
#Themeor#DesktopEntrynames a compositor, so the same entity servesHyprland, sway, labwc and KDE.
Two shapes chosen against the obvious alternative
{{.Token.color4}}and a missing one is a load error, not an index panic at rendertime.
#ThemeRender.distrois[...string], not[...#DistroID]. These are the free-formtags a candy's
distro:list carries (box.cuedoes the same), not the closedguest-distro id a VM source is validated against.
#DistroIDis also@go(-)and generatesno Go type, so a list of it emits a reference to a type that does not exist — caught by the
build rather than guessed.
Why no
#SchemaVersionbumpPurely additive optional defs with nothing to migrate — the same shape as the
isoVmSourcearm (#71) and
#DiskLayout(#72). Every bump recorded inversion.cueis an authoredwire-key change or removal.
How tested
41 assertions across 11 tests, unified against the shipped schema via
schemaconcat.ConcatSchema(schema.FS, …)— the same bytes charly loads.The corpus cases are real. The theme is a bundled Omarchy palette with the per-app files
the distribution actually renders; the session is Hyprland as Omarchy ships it (Lua syntax,
assembly model,
uwsm start hyprland.desktop); the displaymanager is the sddm autologin anOmarchy machine boots into; the desktop entries are both shapes — the shipped
dua i /command and the browser--app=web-app form.The teeth are the reason the defs are closed. A sample:
accent: "blue"#fff/#ffffffffaccnt: "#123456"categories: ["Utilities"]session: "Hyprland Session"session_desktop.idcould never matchwindow: {size: "large"}#Sessionwith nocompositor/ noconfig_path_templateTestDesktopKinds_AreDefinedAndClosedasserts all six structs reject an unknown field —without that, every "unknown field is a typo" case above would pass for the wrong reason.
One correction worth recording. The teeth initially used
unifyDef(structuralvalidation) and four required-field cases passed when they should have failed: a structural
unify accepts a
#Themewith notoken, since the field is merely not yet concrete. Theynow use
unifyDefFinal, and the genuinely-required fields carry the!marker in the schema— the test was not weakened to match the schema, the schema was corrected to match the
intent.
The helpers are reused from
box_init_test.gorather than re-declared: one helper, oneconcatenation contract.
Rulebook compliance
/charly-internals:git-workflow;plugin-harness-kind'sskill/hook/marketplace defs were read as the flat-kind precedent before a fifth surface was
added.
(a)
cue:genfailed withexpected label or ':'— schema files carry nopackageclause; the concatenator adds it, and mine had one. (b) The build then failed with
undefined: DistroID—#DistroIDis@go(-), so a generated struct cannot reference it.(c) Four teeth passed when they should have failed, traced to structural vs FINAL
validation, fixed in the schema by marking the fields required.
and the tests land together.
#ThemeRenderis reused by#Session.extra_fileand#DisplayManager.configrather than copied three times; the test helpers come from theexisting file.
required, not by loosening the assertion.
N/A — new defs; nothing removed or renamed.main, PR-only, noforce-push, no direct push to
main, no hook bypass.shipped schema and assert both acceptance and rejection. A def that only compiled would
prove nothing.
task cue:genfrom this worktree; tests-count=1.N/A — a schema repo has no bed; its gate is the corpus-and-teeth suite on the final tree.The consumer isplugin-desktop-kind, whoseprovider serves these words out-of-process — the next unit, named rather than deferred.
the required fields, the registered categories, the slug shapes, the hex format.
Omarchy 4.0.1 image — the bundled theme tokens, the Hyprland session exec line, the shipped
Disk Usagedesktop entry — not invented.task cue:gensecond, no hand-written wire type.N/A — no roster.Change classification
go test -count=1 ./schema/...(41 assertions) and the fullspecsuite (18 ok, 0 fail).
against the shipped schema, with corpus values taken from a real Omarchy image.
Assisted-by: Claude Code claude-opus-5[1m] (fully tested and validated)