Repository navigation
feat(packagekit+loaderkit): systemd units + /etc/charly config in native packages; layered config stack - #230
Merged
Conversation
…ive packages; layered config stack (system → user → in-dir, later wins)
Review — PASSHead SHA: Security screen: PASS — no scope mismatch (all 10 diff files accounted for in the body), no secrets/exfiltration, no weakened guardrails, no unexpected network calls; the Checklist: All applicable rules PASS or NA.
Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
github-actions Bot
pushed a commit
that referenced
this pull request
Sep 22, 2026
…er (#270) * fix(loaderkit): the per-host deploy overlay is not a config-stack layer The layered config stack (system → user → in-dir) raw-merged the per-host deploy overlay (~/.config/charly/charly.yml, spec.DefaultDeployConfigPath) as a PROJECT document layer. That overlay is a DeployConfig — per-host runtime state, not an authored project — and raw-merging it injects its deploy entries into the authored deploy map BEFORE FoldMembers runs. A member-bearing check bed declares its members NESTED under the bed root, while the overlay persists each deploy-level member FLATTENED to a top-level key (MarshalDeployNode unwraps the member tree to siblings, so a member's own `charly config` can address it by name). Raw-merging put both copies into the deploy map, and FoldMembers then hard-failed: peer name "preempt-holder" (declared under deploy "check-preempt-live-pod") collides with an existing deploy/bed/peer entry seen live on every member-bearing bed (check-preempt-live-pod, check-cross-pod-cdp, both FAIL steps=1) and reproducible deterministically from the merged bytes alone. The overlay has ALWAYS been applied the correct way: a per-field MERGE onto the loaded project tree (deploykit.MergeDeployConfigs / deploy.MergeDeployNode, driven by loaderkit.ResolveMergedTreeViaExecutor and deploykit.MergedDeployTree), whose lookup recurses into a node's Member tree, so it can never create a stray top-level key. That merge remains the overlay's ONE application (R3). This stack is projects only: system (/etc/charly/charly.yml, the packaged fallback project) + in-dir. Regression window: the beds were green at distro-fedora #49 (charly 2026.250.0215) the same day sdk #230 landed the stack; the fold's collision guard predates both. R10 (live, charly rebuilt against this sdk): - check-preempt-live-pod: PASS (steps=22) (was FAIL steps=1) - check-cross-pod-cdp: PASS (steps=19) (was FAIL steps=1) Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated) * docs: re-freeze the PR body against the final head * docs: re-freeze the PR body against the final head --------- Co-authored-by: Andreas Trawoeger <[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
Two coupled changes from the systemd-units + /etc/charly config plan (plan/charly-mcp-systemd-config.md, §3.3 renderer + §3.5 layered config stack), consuming the spec v0.2026250.632 Packaging schema (PR #113's tag):
packagekit renderer (§3.3) — new packagekit/systemd.go + config.go, wired into BuildInfo (packagekit/nfpm_config.go), shipping in the deb/rpm/archlinux packages ONLY (apk/ipk/msix have no systemd — skipped):
loaderkit layered config stack (§3.5) — charly reads and MERGES charly.yml files in the order system → user → in-dir, later files winning. New loaderkit/config_stack.go:
Tests — loaderkit/config_stack_test.go (later-wins, user-wins-over-system, version later-wins, no-project, candy-node preservation), packagekit/render_test.go (unit + config + preset rendering, format gating deb/rpm/archlinux vs apk/ipk), loaderkit/test_main_test.go (isolates the config stack for every LoadUnified test — the real per-host ~/.config/charly/charly.yml must not leak into merged docs).
How tested
go test ./... (FULL suite, from the worktree — all packages ok, exit 0):
New tests, verbosely:
Empirical proof of the raw-merge necessity (P1): a typed yaml.Unmarshal into spec.UnifiedFile of a charly.yml with a candy node yields candy=map[] (the opaque json.RawMessage bodies do not decode) — the stack merge must operate at the raw yaml.Node level to preserve every node. The failing typed round-trip was demonstrated with a standalone repro before implementing the raw merge.
Rulebook compliance
Change classification
Assisted-by: pi openrouter/deepseek/deepseek-v4-flash-0731 (fully tested and validated)