Skip to content

fix(desktop): idiomatic Go names for the desktop-kind fields - #75

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix/desktop-kind-go-names
Aug 30, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
fix/desktop-kind-go-names

Conversation

@atrawog

@atrawog atrawog commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

The four desktop kinds landed in #74 without
@go() annotations
, so cue:gen produced snake-cased identifiers with a leading capital:

Entry_name       string
Browser_arg      []string
Mime_type        []string
Startup_wm_class string
Config_path_template string
Url              string

Every other def in this schema annotates, and these are types a plugin consumer writes
against directly — the plugin-desktop-kind provider decodes into them field by field —
so leaving them non-idiomatic makes every consumer read wrong.

Every file in the diff

File What changed
schema/desktop.cue 18 @go() annotations
spec/cue_types_gen.go regenerated by task cue:gen
authored key was now
entry_name Entry_name EntryName
url Url URL
browser_arg Browser_arg BrowserArgs
mime_type Mime_type MimeTypes
startup_wm_class Startup_wm_class StartupWMClass
config_path_template Config_path_template ConfigPathTemplate
*_template *_template *Template
cursor_theme / icon_theme Cursor_theme / Icon_theme CursorTheme / IconTheme
extra_file Extra_file ExtraFiles
session_desktop Session_desktop SessionDesktop
theme_render Theme_render ThemeRender

No shape change, so nothing migrates

@go() renames only the Go identifier. The yaml: and json: tags — and therefore the
authored wire surface — are byte-identical, so no manifest changes, nothing needs a migration
op, and #SchemaVersion does not move.

How it was found

Writing the plugin-desktop-kind provider against these types. The compiler said
e.URL undefined (type *spec.DesktopEntry has no field or method URL, but does have field Url) — which is the schema telling a consumer it was authored carelessly.

How tested

$ task cue:gen
cue:gen: regenerated spec/{cue_types_gen.go,vocab_gen.go,version_gen.go}
$ go build ./...
$ go test -count=1 ./schema/...
ok  	github.com/opencharly/spec/schema	1.026s

The corpus-and-teeth suite from #74 passes unchanged — 41 assertions across 11 tests.
That is the substantive check here: those tests unify authored bodies against the shipped
schema, so if an annotation had altered the wire surface rather than just the Go name, they
would fail. They do not.

$ sed -n '<DesktopEntry struct>' spec/cue_types_gen.go
EntryName   string   `yaml:"entry_name,omitempty" json:"entry_name"`
Exec        string   `yaml:"exec,omitempty" json:"exec,omitempty"`
URL         string   `yaml:"url,omitempty" json:"url,omitempty"`
BrowserArgs []string `yaml:"browser_arg,omitempty" json:"browser_arg,omitempty"`
MimeTypes   []string `yaml:"mime_type,omitempty" json:"mime_type,omitempty"`

Go names changed, tags identical.

Rulebook compliance

  • R0 — skills first. /charly-internals:git-workflow.
  • R1 — RCA every anomaly. The compiler error naming Url was traced to a missing
    annotation in my own merged PR rather than worked around in the consumer with a local
    alias — the consumer is right and the schema was wrong.
  • R2 — finish the whole cutover. All 18 fields, not only the four the compiler happened
    to reach.
  • R3 — no duplication. @go() is the existing mechanism; no second naming scheme is
    introduced.
  • R4 — no workarounds. The alternative — writing e.Url in every consumer — would have
    spread the defect instead of fixing it.
  • R5 — delete legacy completely. The non-idiomatic names are gone; none survives.
  • R6 — preserve user work and Git safety. Feature branch off current main, PR-only, no
    force-push, no direct push to main, no hook bypass.
  • R7 — prove behavior, not compilation. The feat(desktop): the theme, session, displaymanager and desktopentry kinds #74 suite passing unchanged is what proves
    the wire surface did not move; a build alone would not.
  • R8 — preserve emitted artifacts. Generated Go committed as generated.
  • R9 — binary equals source. task cue:gen from this worktree; tests -count=1.
  • R10 — fresh disposable proof. N/A — schema repo, no bed.
  • ADE / SDD / concurrency mandate. N/A — a naming fix; no new claim, no roster.

Change classification

  • Change class: Go identifier annotations + regenerated types. No wire change.
  • Verification gate: task cue:gen, go build, and feat(desktop): the theme, session, displaymanager and desktopentry kinds #74's corpus-and-teeth suite passing
    unchanged.
  • Attribution tier: fully tested and validated — the regenerated types compile and the
    authored-surface tests confirm nothing but the Go names moved.

Assisted-by: Claude Code claude-opus-5[1m] (fully tested and validated)

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
@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: aeed7dde2b498d14d47ebf1e7967d0e3afcc84d3 (branch: fix/desktop-go-names)

Security screen: PASS — no secrets, exfiltration, scope mismatch, guardrail weakening, or supply-chain change. The diff does exactly what the description claims.

Checklist: All applicable rules PASS or NA.

  • Change class: CUE @go() annotations + regenerated Go types (schema repo, no bed — R10 N/A correctly).
  • SDD (B13): schema/desktop.cue and spec/cue_types_gen.go change in the same commit; all 18 @go(Name) annotations map 1:1 to the regenerated Go identifiers (verified each: CursorTheme, IconTheme, ConfigPathTemplate, MonitorTemplate…StartupWMClass, URL, BrowserArgs, MimeTypes). No @go(-) tags, no hand-written schema-shaped types. yaml/json tags byte-identical → wire surface unchanged.
  • R5 (B10): old non-idiomatic names fully removed in the diff; body's discovery mechanism (compiler error while writing the fresh plugin-desktop-kind provider) confirms no existing consumer code references the old identifiers; go build ./... passing confirms no in-repo references survive.
  • A1/A2/A3: body accounts for both files, supplies pasted task cue:gen / go build / go test output, names the change-class gate, and the fully tested and validated tier is justified (regenerated types compile and the authored-surface suite passes unchanged). Attribution footer present in the required form.
  • Architecture (B16): placement CORRECT — schema defs in schema/*.cue, generated types in spec/; no core/sdk/candy misplacement.
  • B18: generated Go is gofmt-clean; no dead code or lint issues visible in the diff.

No comments on the thread to intake.

Verdict: PASS


ollama/deepseek-v4-flash — pi-review-action.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) August 30, 2026 09:42
@github-actions
github-actions Bot merged commit 2efae44 into main Aug 30, 2026
1 check passed
charly-auto-merge Bot added a commit that referenced this pull request Aug 30, 2026
@aitrawog
aitrawog deleted the fix/desktop-kind-go-names branch September 25, 2026 19:10
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