Repository navigation
feat(schema): #Packaging systemd units + config file, and the layered config-stack merge wrapper - #112
Conversation
… config-stack merge wrapper Adds the systemd: (list of #PackagingSystemdUnit) and config: (#PackagingConfig) fields to the #Packaging shape (candy.cue) plus the two closed sub-shapes, regenerated via task cue:gen (Packaging gains Systemd []*PackagingSystemdUnit + Config *PackagingConfig). Adds merge.MergeConfigStack: merges the layered config stack (system -> user -> project) into one spec.UnifiedFile, later files winning (project > user > system), reusing MergeUnified (dst-wins) with the later file as dst. Each layer is pre-anchored to its own dir (spec.AnchorScanSpecs) and copied before merging (caller files never mutated); nil layers are skipped. Tests: later-wins per node, nil-layer skipping, per-layer discover anchoring, version later-wins.
Review — BLOCKHead SHA: Change class: code/config (Go + CUE schema — additive Security screen: PASS — no scope mismatch (all 4 files accounted for in the body), no secrets/exfiltration, no weakened guardrails, no supply-chain changes, no embedded directives. Blocks
Placement: CORRECT — Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
…s under /tmp (worktree)
Review — BLOCKHead SHA: Change class: code/config (Go + CUE schema + test) Security screen: PASS — no secrets/exfiltration, no weakened guardrails, no supply-chain changes, no embedded directives. (The unaccounted Blocks
Placement: CORRECT — Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
…ed, full rulebook, green suite)
Review — PASSHead SHA: Security screen: PASS — no scope mismatch (all 5 files accounted for in the body), no secrets/exfiltration, no weakened guardrails, no supply-chain changes, no embedded directives. Checklist: All applicable rules PASS or NA. Comments considered:
Placement: CORRECT — Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
Summary
Two coupled changes from the systemd-units + /etc/charly config plan (plan/charly-mcp-systemd-config.md, §3.2 + §3.5), plus one in-tree test-robustness fix the validator's R1/R2 gate surfaced:
Schema (§3.2) —
#Packaginggains two fields (afterformats:):systemd?: [...#PackagingSystemdUnit]— non-autostarting systemd units shipped in the package (system + user scope), rendered to/usr/lib/systemd/{system,user}/<name>.service, NEVER enabled at install.config?: #PackagingConfig— a system-wide project charly.yml shipped in the package (e.g./etc/charly/charly.yml) carrying the plugin config the systemd MCP server uses.Two new CLOSED sub-shapes:
#PackagingSystemdUnit(name/scope/exec/description?/restart?/after?/wants?/environment?/working_directory?) and#PackagingConfig(path/version/description/plugins?).Regenerated via
task cue:gen:PackaginggainsSystemd []*PackagingSystemdUnit+Config *PackagingConfig; the two new Go types exist in spec/cue_types_gen.go.Merge wrapper (§3.5) —
merge.MergeConfigStack(system, user, project, systemDir, userDir, projectDir)merges the layered config stack (system → user → project) into onespec.UnifiedFile, LATER files winning (project > user > system). ReusesMergeUnified(dst-wins) with the later file as dst — no new merge logic (R3). Each layer's Discover specs are pre-anchored to its own dir viaspec.AnchorScanSpecsbefore merging (so MergeUnified's srcDir re-anchoring is a no-op); each layer is copied before merging (caller files never mutated); nil layers are skipped.In-tree proc test fix (R1/R2) —
proc/temphold_test.goaltTempRootrequired a checkout NOT under /tmp (its premise: a temp root the sweeper's hardcoded "/tmp" glob does not cover). A worktree under /tmp broke that premise and the twoHonoursTMPDIRtests failed. Fixed in-tree:altTempRootnow falls back to/var/tmp(still outside the hardcoded "/tmp" glob) when the package dir is under /tmp — the premise holds from any checkout location. Full suite is green from the /tmp worktree.How tested
task cue:gen(first run, exit 0):task cue:gen(second run, reproducibility — no diff on the second run):go test -count=1 ./merge/... ./spec/... ./schema/...(exit 0):go test -count=1 ./...(FULL suite, from the /tmp worktree — exit 0, no failures):The proc tests that previously failed from the /tmp worktree now pass in-tree (the
altTempRoot/var/tmp fallback, commit 8f646f2).Rulebook compliance
task cue:gen).altTempRoot's premise requires a checkout outside /tmp, broken by the /tmp worktree; fixed in-tree (fallback to /var/tmp), full suite green. No forbidden framing.MergeConfigStackis a thin wrapper over the existingMergeUnified— no new merge logic.cue_types_gen.gois validated at the generated boundary (reproducible regeneration, no diff on the second run).go test+cue:gen(no runtime bed applies to a pure schema/merge change).schema/candy.cue) and generated viatask cue:gen— no hand-transcribed wire structs; clean regeneration is a no-op (verified).mergepackage (reusesMergeUnified); no misplaced behavior.Change classification
#Packagingstays CLOSED with only optional additions).task cue:genidempotent + fullgo test ./...green on the final committed tree (from the worktree).Assisted-by: pi openrouter/deepseek/deepseek-v4-flash-0731 (fully tested and validated)