Skip to content

fix(loaderkit): the per-host deploy overlay is not a config-stack layer - #270

Merged
github-actions[bot] merged 3 commits into
mainfrom
fix/config-stack-overlay-not-a-layer
Sep 22, 2026
Merged

github-actions[bot] merged 3 commits into
mainfrom
fix/config-stack-overlay-not-a-layer

Conversation

@aitrawog

@aitrawog aitrawog commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary of changes

The layered config stack (loaderkit/config_stack.go) 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 (deploy entries + cache/ledger/system), not an authored project. Raw-merging its deploy entries into the authored deploy map before FoldMembers runs injects top-level keys that duplicate the project's nested members, and FoldMembers then hard-fails:

peer name "preempt-holder" (declared under deploy "check-preempt-live-pod")
collides with an existing deploy/bed/peer entry — peer names must be globally unique

This breaks every member-bearing check bed (check-preempt-live-pod, check-cross-pod-cdp, …), which fail at steps=1 on the first member build.

The overlay has ALWAYS had its own correct application path: a per-field MERGE onto the loaded project tree (deploykit.MergeDeployConfigs → deploy.MergeDeployNode, driven by loaderkit.ResolveMergedTreeViaExecutor and deploykit.MergedDeployTree), whose lookup (deploykit.FindDeployNode) recurses into a node's Member tree — so it can never create a stray top-level key.

Concrete edits:

  • loaderkit/config_stack.go — the stack is now system → in-dir (projects only). readConfigStack no longer reads spec.DefaultDeployConfigPath(). File + function headers document why the overlay is not a layer and name its ONE application path.
  • loaderkit/load_unified.go — the config-stack comment corrected (system → in-dir).
  • loaderkit/config_stack_test.go — tests updated to the two-layer stack; new TestConfigStack_DeployOverlayIsNotALayer is the R1 regression (a project bed root with a NESTED member + an overlay that persists the same member TOP-LEVEL; asserts the overlay does NOT leak into the merged project doc). TestConfigStack_UserWinsOverSystem → TestConfigStack_SystemLayerFormsProject (the packaged /etc/charly fallback, the feature feat(packagekit+loaderkit): systemd units + /etc/charly config in native packages; layered config stack #230 actually added).
  • loaderkit/test_main_test.go — comment corrected; CHARLY_DEPLOY_CONFIG still isolated (the per-field merge path must not pick up the operator's real overlay).

Change class

charly-or-sdk Go (sdk library: loaderkit).

Closes / relates to: relates to #230 (introduced the layer), opencharly/spec#142 (companion: deletes the dead sibling merge.MergeConfigStack — see below), and the member-bearing bed failures in opencharly/distro-fedora and opencharly/plugin-preempt.

Companion leg — opencharly/spec#142 (already open): spec/merge/merge_stack.go carries a zero-production-caller duplicate merge.MergeConfigStack implementing the same superseded three-layer design. It is dead code, so it has no ordering dependency on this PR — it can merge before, after, or independently. Its own R1/R5 disposition is its own PR's; this PR only needs it NAMED (it is: opencharly/spec#142).

The charly test-comment sweep — opencharly/charly (to land in the sdk re-pin PR): three charly test files carry the comment "sdk v0.2026250.702+ LoadUnified merges system → user → in-dir" plus a defensive t.Setenv("XDG_CONFIG_HOME", …) that the comment justifies. These comments are NOT currently false — they describe charly's pinned sdk (v0.2026260.1434), which still merges the user layer. They become stale only once THIS PR merges AND charly re-pins the sdk; sweeping them in this commit would make them FALSE (they would name a stack the pinned sdk does not have). R5 sweeps false/outdated claims; there is no false claim here. The sweep is filed as opencharly/charly#630 and rides the charly sdk-re-pin PR — the PR that bumps github.com/opencharly/sdk to this PR's merge tag, changing exactly these three files: charly/charly/layers_test.go:561, charly/charly/plugin_bootstrap_test.go:47, charly/charly/unified_test.go:26. Measured now against this branch: removing the three t.Setenv("XDG_CONFIG_HOME", …) lines and running the FULL charly package (go test -count=1 ., sdk patched) passes (238s, 0 failures), proving the isolation is already unnecessary post-fix.

Breaking change + rollback: no exported Go symbol is removed (readConfigStack/mergeConfigStackRaw are package-private). The BEHAVIOR change: a project directory with no charly.yml whose only content was the per-host overlay no longer forms a project from the overlay alone (the overlay is applied by the per-field merge instead). Rollback: revert this commit; the collision returns.

How R10-tested — exact gate, commands, and pasted output

  • The gate for this change class: charly check run <bed> for the touched code path — the loader/config-stack change is exercised by every member-bearing bed; the two that regressed are check-preempt-live-pod (plugin-preempt) and check-cross-pod-cdp (distro-fedora).
  • Eval beds run — the EXACT beds + per-bed results:
    • check-preempt-live-pod | pod | ok | 22 steps | ~430s (plugin-preempt)
    • check-cross-pod-cdp | pod | ok | 19 steps | ~900s (distro-fedora)
    • Both ran on charly version = 2026.249.2125 (built from opencharly/charly origin/main 48daeec1 with replace github.com/opencharly/sdk => <this branch>); shared calvers .check/check-preempt-live-pod/2026.265.1919/ and .check/check-cross-pod-cdp/2026.265.1927/.
  • Fresh rebuild: the binary was rebuilt from the charly source tree with this sdk branch (GOWORK=off go build -buildvcs=false -ldflags "-X main.BuildCalVer=2026.249.2125"), charly version = 2026.249.2125; the beds ran steps=22/steps=19 at zero un-allowlisted warnings (one allowlisted dev-worktree-binary-notice per step, the expected dev-worktree notice).
  • Did the CHANGED code path execute live? Yes — readConfigStack is on the load path of every charly subprocess. The pre-fix failure was at image-build-preempt-holder/image-build-chrome (steps=1, the FoldMembers collision); post-fix those steps PASS and the full bed runs to verdict. See evidence block 2.
  • Concurrency (shared-state changes only): N/A — this change touches the config-stack read of one process; it is not the loader/discover walk, ledger, podman store, arbiter, or a build lock. The two beds were run sequentially on one host; each bed's own isolation (per-bed CHARLY_DEPLOY_CONFIG) was exercised.

Evidence — put each item in the block whose label names it.

1. Fresh-rebuild gate output (charly version + the gate run, at zero warnings):

$ /tmp/opencode/charly-r10/bin/charly version
2026.249.2125

$ charly check run check-preempt-live-pod
charly check run check-preempt-live-pod: PASS (steps=22) — repo override active

$ charly check run check-cross-pod-cdp
charly check run check-cross-pod-cdp: PASS (steps=19) — repo override active

2. Each changed code path executing (the lines proving the changed branch ran, not that it built):

# PRE-FIX (installed charly, unchanged sdk): the fold collision at the first member build
charly check run check-preempt-live-pod: [image-build-preempt-holder] FAIL after 2.4s: exit 1
  -> charly.yml: peer name "preempt-holder" (declared under deploy "check-preempt-live-pod")
     collides with an existing deploy/bed/peer entry — peer names must be globally unique
charly check run check-preempt-live-pod: FAIL (steps=1)

# POST-FIX (rebuilt charly against this branch): the member builds now pass, bed runs green
charly check run check-preempt-live-pod: [image-build-preempt-holder] PASS after 11.6s
charly check run check-preempt-live-pod: [image-build-preempt-taker] PASS after 11.3s
charly check run check-preempt-live-pod: PASS (steps=22)

# The overlay's own designed per-field merge still carries the member roles live
# (the arbiter checks pass, so preemptible/requires_exclusive still reach `charly start`):
  PASS  the CLAIMANT member's exclusive test-lock lease was recorded  [preemptor-lease-recorded]
  PASS  the RUNNING preemptible holder was actually preempted  [preemptor-stopped-the-holder]

# The regression test fails WITHOUT the fix (R7 — behavior, not compilation):
$ git stash push -- loaderkit/config_stack.go loaderkit/load_unified.go
$ go test ./loaderkit/ -run TestConfigStack_DeployOverlayIsNotALayer -v
--- FAIL: TestConfigStack_DeployOverlayIsNotALayer (0.00s)   # overlay leaked as top-level 'holder'
$ git stash pop

# R5 grep self-test (B14(d)) — real commands, real RAW output:
$ cd <this branch> && git grep -n "MergeConfigStack" -- . ; echo "exit=$?"
exit=1          # NO match in the sdk — the identifier never lived in this repo
$ cd <charly @ origin/main> && git grep -n "MergeConfigStack" -- . ; echo "exit=$?"
exit=1          # NO match in charly either — zero production callers, ever
$ cd <spec @ opencharly/spec#142 head> && git grep -n "MergeConfigStack" -- . ; echo "exit=$?"
CHANGELOG/0.2026250.632.md:13:2. **Merge wrapper (§3.5)** — `merge.MergeConfigStack(...)` ...
CHANGELOG/0.2026250.632.md:53:- **R3 (no duplication):** `MergeConfigStack` is a thin wrapper ...
exit=0          # both hits historical (spec#112's merged entry); live definition deleted by spec#142
$ cd <this branch> && git grep -n "system → user → in-dir" -- loaderkit/ ; echo "exit=$?"
exit=1          # NO stale three-layer claim survives in the sdk (config_stack.go now says system → in-dir)
# The only remaining live hits are the THREE charly test comments named in the Summary, which go stale
# only after this PR merges + charly re-pins; their sweep is tracked by opencharly/charly#630 and rides the charly sdk-re-pin PR.

3. Docs-only evidence: N/A — code change class.

Attribution tier

fully tested and validated. The changed path (readConfigStack) executed live in every charly subprocess of both bed runs from a fresh rebuild; the beds that regressed now pass end-to-end (steps=22, steps=19), and the new regression test was proven to FAIL without the change.

Harness rulebook compliance — state HOW each is satisfied (or N/A — <reason>)

  • R0 skills: loaded go (sdk Go module + gates), root-cause-analyzer (the R1 mandate), strict-policy (R1–R5 operationalization), git-workflow, cache (ruled out a cache artifact).
  • R1 RCA + zero warnings: the collision was RCA'd (8-step, evidence-backed): config stack raw-merges the runtime overlay → duplicate top-level member keys → FoldMembers collision; reproduced deterministically from the merged bytes and in the beds' original distro-fedora home; regression window pinned to sdk feat(packagekit+loaderkit): systemd units + /etc/charly config in native packages; layered config stack #230 (beds green at distro-fedora fix(deploykit): ignore empty builder-backed base #49 the same day). Gate output has zero un-allowlisted warnings (one allowlisted dev-worktree notice).
  • R2 no out-of-scope: the surfaced sibling spec/merge.MergeConfigStack is a different repo and cannot live in this commit — it is named as the concrete companion fix(merge): delete the dead layered-config-stack wrapper spec#142 (already open, dead code, no ordering dependency). The three charly test-comment hits become stale only after this merges + charly re-pins, so they are tracked by sweep the stale config-stack test comments in the sdk re-pin PR charly#630, swept in the charly sdk-re-pin PR (a concrete named target) — with the post-fix full-package go test (238s, 0 failures, isolation lines removed) as the measured proof the sweep is correct.
  • R3 no duplication: the overlay's ONE application is the existing per-field merge (MergeDeployConfigs/MergeDeployNode); this change RESTORES that single path by deleting the duplicate raw-merge of the overlay. The dead spec duplicate is deleted in fix(merge): delete the dead layered-config-stack wrapper spec#142.
  • R4 no workaround: no sleep/retry/magic-number/env-shim; the fix removes the stray-key injection rather than tolerating it.
  • R5 hard cutover + grep: real git grep output pasted in block 2 — MergeConfigStack has ZERO hits in the sdk (exit 1); the stale system → user → in-dir claim has ZERO hits in loaderkit/ (exit 1). The claim-keyed sweep is complete for every surface whose truth THIS commit changes; the three charly comments are truth-preserved until this merges (swept in the named re-pin PR). No transitional/dual-mode path.
  • R6 git safety: git status + git stash pop verified around the R7 stash experiment; commit on fix/ branch, PR-only, no force-push.
  • R7 runtime gate: the end-to-end bed gate ran (two member-bearing beds), not just go test; plus the regression test proven to fail without the fix.
  • R8 artifact invariants: N/A — no generation/label change.
  • R9 binary == source + deps: binary rebuilt from source with this sdk branch; charly version matches (2026.249.2125); no new runtime OS deps.
  • R10 disposable + coverage: proven on disposable: true beds only, fresh rebuild, zero un-allowlisted warnings; ships TestConfigStack_DeployOverlayIsNotALayer, which fails without the change.
  • RDD / ADE / SDD: RDD — the raw-merge hazard was proven on a live bed BEFORE the fix (the deterministic repro), not doc-read; the overlay's designed merge was proven to still carry the member roles live (the arbiter checks pass). ADE — N/A (no candy). SDD — N/A (no schema/.cue edit).
  • Hard cutover: ONE atomic code commit (dc937e2, the fix(loaderkit): commit); the trailing docs: re-freeze the PR body against the final head empty commit(s) only re-trigger the validator; no Phase-2/TODO left in scope.
  • Kernel/plugin boundary law: N/A — loaderkit is a generic loader Mechanism; no concrete-kind schema/switch leaked.
  • Disposable-only autonomy: N/A — no autonomous destroy/rebuild of a non-disposable target; the beds self-manage as disposable: true.
  • Clean architecture + Go gates: gofmt -l loaderkit/ empty; go vet ./loaderkit/ clean; go test ./... green (all 14 packages ok) at GOWORK=off.
  • CHANGELOG: N/A — this repo's CHANGELOG/ is written by the charly-auto-merge bot from the PR body at merge (verified: ef5283a is a bot commit). No file staged.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

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

Copy link
Copy Markdown

Review — BLOCK

Head SHA: dc937e2af611abee09b50f96d81a2f18df06ba8d (branch: fix/config-stack-overlay-not-a-layer)

Change class: code/config (sdk Go library — loaderkit).

Security screen: no T1–T4 finding (diff does not touch the validator spec, rulebook, gates, or supply chain; the scope matches the body's 4-file accounting).

Blocks

  1. B14(d) — unexecuted sweep/grep claim (R5). The body's R5 section asserts git grep 'MergeConfigStack' in sdk "returns nothing (the identifier never lived here)" — a grep-and-found-none claim with no pasted command output. B14(d) is explicit: "I grepped for callers and found none" is not evidence unless the real command and its real output appear; the body relies on this claim to justify R5 compliance. Note the asymmetry: the R7 regression block does paste real output (the --- FAIL: line), so the omission is not a formatting choice. Fix: paste the actual git grep invocation and its real output (in sdk, and the named hits in spec/charly), or drop the claim and the R5 disposition that depends on it.

  2. B6/B10 (R2/R5) — stale claims parked to an unnamed "companion wave". R5 states the remaining live "system → user → in-dir" hits are "in charly test COMMENTS (harmless, but swept in the companion wave)". This is (a) a same-commit sweep failure — R5/B10 require every false/outdated claim to be swept in the SAME commit — dismissed with the forbidden low-risk framing ("harmless"), and (b) an R2 deferral to a vague "wave", not a NAMED batch/task. R2 permits routing only to a specifically named batch/task. Fix: either sweep them here, or name the exact target (repo + PR/task id) that carries the charly comment sweep.

  3. A1/B6 — spec companion leg is internally contradictory. The body calls spec/merge.MergeConfigStack "dead (zero callers)" in the same breath as "that leg must merge FIRST or in the same wave". A zero-caller duplicate cannot require ordering, and no spec PR/task is named for it (only the repo). Fix: reconcile the ordering claim with the "dead" claim and name the concrete spec leg (PR/task id) rather than "begun now".

Verdict: BLOCK


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: 8f51affeb60fb268b383a4712a6f280cb51a967e (branch: fix/config-stack-overlay-not-a-layer)

Change class: code/config (sdk Go library — loaderkit).

Security screen: no T1–T4 finding. The diff does not touch the validator spec, the rulebook, any gate, or the supply chain, and the scope matches the body's 4-file accounting. Placement (B16): the change lives in the sdk loaderkit loader mechanism and only deletes a layer from an existing mechanism — no new core/sdk alias, no new capability brought inward. placement: CORRECT.

Blocks

  1. B14(d) — unexecuted grep claim (R5). Body R5 asserts git grep 'MergeConfigStack' in sdk "returns nothing (the identifier never lived here)" with no pasted command and no output, and the body leans on that claim to dispose of R5 ("No transitional/dual-mode path"). B14(d) makes a described-but-unrun grep-and-found-none claim a FRAUD-class finding. Fix: paste the real git grep invocation and its real output, or drop the claim and the R5 disposition that depends on it.

  2. B6/B10 — stale claims left unswept and routed to an unnamed "wave" with forbidden low-risk framing. Body R5: "the remaining live hits are in the separate spec repo (companion leg) and in charly test COMMENTS (harmless, but swept in the companion wave)." This (a) leaves the now-false system → user → in-dir claims unswept in the same commit (R5/B10), (b) routes them to a vague "companion wave" rather than a NAMED batch/task (R2/B6), and (c) dismisses them with the forbidden "harmless" low-risk framing. Fix: sweep them here, or name the exact target (repo + PR/task id) that carries the charly comment sweep.

  3. A1/B6 — the spec companion leg is unnamed and internally inconsistent. The body calls spec/merge.MergeConfigStack "dead (zero callers)" yet also "must merge FIRST or in the same wave"; a zero-caller duplicate cannot impose merge ordering, and no concrete spec PR/task id is given ("begun now" is not a name). Fix: reconcile the ordering claim with the dead-code claim, and name the concrete spec leg (PR/task id).

Comment intake

  • Comment 5783072463 (github-actions[bot], reviewed head dc937e2af611): its three findings are re-derived against the current head/body and still reproduce — i.e. verified-blocking, not stale. (The intervening 8f51aff re-freeze did not change the R5 grep claim, the "harmless / companion wave" deferral, or the unnamed spec leg.)

Verdict: BLOCK


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: c39951e617709c84dc3df778929eabffc12ce388 (branch: fix/config-stack-overlay-not-a-layer)

Security screen: PASS — no T1–T4 finding (4-file scope matches the body's accounting; no change to the validator spec, rulebook, gates, or supply chain).
Checklist: All applicable rules PASS or NA. Placement: CORRECT — the change lives in the sdk loaderkit loader Mechanism and only deletes a stack layer; no new core/sdk alias, no capability moved inward.

Comment intake:

  • Comment 5783072463 (github-actions[bot], head dc937e2) and Comment 5783982231 (head 8f51aff) — both stale-superseded against the current head c39951e. Re-derived each of their three findings:
    1. R5 grep claim with no pasted output → resolved: the current body's evidence block 2 now pastes the real git grep -n "MergeConfigStack" -- . / git grep -n "system → user → in-dir" -- loaderkit/ invocations with their real outputs (exit=1 in sdk, exit=1 in loaderkit; the spec CHANGELOG hits), internally consistent with the diff.
    2. stale claims parked to an unnamed "wave" with "harmless" framing → resolved: the charly comment sweep is now routed to the named target opencharly/charly#630, riding the named charly sdk-re-pin PR, with a reasoned (non-parking) justification — the comments describe charly's still-pinned sdk v0.2026260.1434 and are therefore not currently false; sweeping them here would make them false (R4a), so deferral is correct, not a forbidden R2 split.
    3. spec companion unnamed + ordering contradiction → resolved: opencharly/spec#142 is now named (already open), and the "dead code / no ordering dependency — can merge before, after, or independently" reconciliation removes the contradiction.

No surviving blocking finding; the diff, the body, and the pasted evidence are internally consistent.

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) September 22, 2026 21:03
@github-actions
github-actions Bot merged commit e8cd330 into main Sep 22, 2026
6 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Sep 22, 2026
github-actions Bot pushed a commit to opencharly/charly that referenced this pull request Sep 22, 2026
…tale test comments (#631)

Bumps github.com/opencharly/sdk to v0.2026265.2104 (the merged fix from
opencharly/sdk#270: the per-host deploy overlay is no longer raw-merged as a
config-stack PROJECT layer) and sweeps the three test comments that documented
the OLD three-layer merge.

opencharly/sdk#270 removed `spec.DefaultDeployConfigPath()` from
loaderkit/config_stack.go's stack. Before it, a per-host deploy overlay was
raw-merged as a project document layer, injecting a deploy-level member's
top-level persisted copy next to the member its owner still declares nested —
which FoldMembers rejects (`peer name "..." collides with an existing
deploy/bed/peer entry`). Every member-bearing bed failed at steps=1.

With the pin advanced, three test comments asserting the OLD behavior are now
false, and the per-test `t.Setenv("XDG_CONFIG_HOME", t.TempDir())` they justified
is no longer needed (TestMain already sets XDG_CONFIG_HOME package-wide; the
per-test isolation existed ONLY to shield against the user-layer merge, which is
gone). Swept (#630):
- charly/layers_test.go
- charly/plugin_bootstrap_test.go
- charly/unified_test.go

`go mod tidy` also advances github.com/opencharly/spec to v0.2026262.957 (the
version the bumped sdk requires).

R10 (live, charly rebuilt against the bumped pin):
- check-preempt-live-pod: PASS (steps=22)
- full charly package: go test -count=1 . = ok (252.777s); go build ./... exit 0;
  go vet . exit 0; gofmt -l . empty

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

Co-authored-by: Andreas Trawoeger <[email protected]>
github-actions Bot pushed a commit to opencharly/spec that referenced this pull request Sep 22, 2026
* fix(merge): delete the dead layered-config-stack wrapper

merge.MergeConfigStack (with its private cloneUnified/cloneRawMap/cloneDeployMap/
clonePluginKinds helpers) merges a (system, user, project) layered stack into one
spec.UnifiedFile. It is DEAD: zero production callers anywhere in the ecosystem —
neither charly nor sdk ever imported it, and grep across every repo returns only
its own test. The live config stack is sdk/loaderkit/config_stack.go (raw
yaml.Node, in-dir wins), which the loader actually drives.

It is also WRONG: like the sdk stack before opencharly/sdk#270, it models the
per-host DEPLOY OVERLAY (~/.config/charly/charly.yml) as a project layer. That
overlay is a DeployConfig — per-host runtime state — and merging it as a document
layer puts a deploy-level member's TOP-LEVEL persisted copy next to the member its
owner still declares nested, which FoldMembers rejects:
  peer name "..." collides with an existing deploy/bed/peer entry

One canonical implementation (R3): the sdk's config_stack.go owns the project
stack; the overlay's ONE application is the per-field deploy-node merge
(deploykit.MergeDeployConfigs / deploy.MergeDeployNode), which recurses into the
Member tree and cannot create a stray top-level key. The dead duplicate and its
test are deleted in full (R5).

merge.MergeUnified is UNTOUCHED — it remains the live document merge.

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

* docs: re-freeze the PR body against the final head

---------

Co-authored-by: Andreas Trawoeger <[email protected]>
github-actions Bot pushed a commit to opencharly/plugin-deploy-vm that referenced this pull request Sep 23, 2026
… overlay fix (#21)

* fix: re-pin sdk so the in-plugin project load honors the config-stack overlay fix

Bump github.com/opencharly/sdk v0.2026253.1947 -> v0.2026265.2104 (and the spec
require it carries) so this plugin's OWN project self-load stops raw-merging the
per-host deploy overlay as a config-stack PROJECT layer.

WHY. This plugin is an out-of-process deploy:vm substrate: it self-loads the
project (loaderkit.LoadUnifiedViaExecutor, lifecycle.go) to resolve the VM entity
for PrepareVenue. Under the pin above, that load used the pre-fix config stack:
it raw-merged ~/.config/charly/charly.yml (a DeployConfig — per-host RUNTIME
state) as a project document layer. For a member-bearing bed that injects a
deploy-level member's TOP-LEVEL persisted copy next to the member its owner still
declares nested, and FoldMembers rejects it:

  peer name "preempt-vm-taker" (declared under deploy "check-preempt-vm-live")
  collides with an existing deploy/bed/peer entry

Observed live on check-preempt-vm-live (distro-fedora AND the relocated
plugin-preempt copy), failing at bring-up-members (steps=9). charly core and the
compiled-in plugins got this fix via opencharly/sdk#270 + the charly re-pin
(opencharly/charly#631); an OUT-OF-PROCESS plugin vendors its OWN loaderkit, so
each must re-pin in its own repo. This is that re-pin for plugin-deploy-vm.

R10 (live): check-preempt-vm-live re-run against a charly binary whose
CHARLY_REPO_OVERRIDE points this repo at the bumped tree:
- bring-up-members: FAIL (steps=9) before -> PASS after
- bed verdict: PASS (steps=20), 0 FAIL; the VM-venue arbiter assertions
  preemptor-vm-lease-recorded + preemptor-vm-stopped-the-holder both PASS,
  proving the pluginHolderStop/pluginHolderStart addr.Vm!="" dispatch live.
- go build ./... exit 0; go vet ./... exit 0; go test ./... ok

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

* docs: re-freeze the PR body against the final head

---------

Co-authored-by: Andreas Trawoeger <[email protected]>
@aitrawog
aitrawog deleted the fix/config-stack-overlay-not-a-layer branch September 25, 2026 19:08
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.

2 participants