Repository navigation
fix(merge): delete the dead layered-config-stack wrapper - #142
Conversation
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)
Review — BLOCKHead SHA: Change class: charly/sdk Go — pure dead-code deletion in the Security screen: PASS — the diff is exactly the two deletions the body claims (105/134 lines, matching the Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Change class: charly/sdk Go — pure dead-code deletion in the Blocks
Comment disposition:
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Change class: charly/sdk Go — pure dead-code deletion in the Blocks
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS — diff is exactly the two claimed deletions ( Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS — the diff is exactly the two claimed deletions ( Comment dispositions:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary of changes
Deletes the dead layered-config-stack wrapper
merge.MergeConfigStackand its test.merge.MergeConfigStack(system, user, project, …)merges a three-layer stack into onespec.UnifiedFile. It is:grep -rn MergeConfigStackacross opencharly/sdk, opencharly/charly, and every local repo returns only this function's ownmerge_stack_test.go. Neither charly nor sdk ever imported it; the live config stack issdk/loaderkit/config_stack.go, which the loader actually drives. It rode along in spec#112 (§3.5) as a "wrapper" that was never wired.~/.config/charly/charly.yml) as a project document layer. That overlay is aDeployConfig— 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, whichFoldMembersrejects (peer name "..." collides with an existing deploy/bed/peer entry).One canonical implementation (R3):
sdk/loaderkit/config_stack.goowns the project stack (system + in-dir); the overlay's ONE application is the per-field deploy-node merge (deploykit.MergeDeployConfigs→deploy.MergeDeployNode), whose lookup recurses into theMembertree and cannot create a stray top-level key.Concrete edits:
merge/merge_stack.go— deleted (105 lines:MergeConfigStack+ privatecloneUnified/cloneRawMap/cloneDeployMap/clonePluginKinds).merge/merge_stack_test.go— deleted (134 lines).merge/merge_unified.go— untouched;MergeUnifiedis still the live document merge.Change class
charly-or-sdk Go (spec contract module, pure dead-code deletion).
Closes / relates to: relates to opencharly/sdk#270 (the live fix this pairs with — the same superseded layer design removed from the sdk). No ordering dependency: this deletion is dead code (zero production callers), so it may merge before, after, or independently of sdk#270. relates to #112 (introduced it).
Breaking change + rollback: removes the exported
merge.MergeConfigStacksymbol. It has zero production callers (only its own deleted test), so no consumer breaks. Rollback: revert this commit; the dead wrapper returns.How R10-tested — exact gate, commands, and pasted output
/charly-check:check,beds-and-r10.md: "a gate that cannot fail on the change proves nothing") means the honest gate is the two things that CAN fail on it: (a) the cross-repo grep proving zero callers (if any caller existed, the deletion would be wrong) and (b) the consumer rebuild (if a consumer referenced the symbol,go build ./...of the consumer would fail with a dangling reference). A bed run alone cannot be the gate for a deletion, so I do not claim it as one — it is corroborating live-execution evidence that the consumer still works end-to-end.check-pod | pod | ok | 14 steps | ~200s(opencharly/plugin-pod) — a NON-member bed, deliberately chosen so the run isolates THIS change (the sdk member-collision fix is a separate leg; a member bed would confound the two). It proves the consumer's full lifecycle (build → check → deploy → live → rebuild → tear down) is intact after the deletion.charly version= 2026.249.2125, consumer built fromopencharly/charlyorigin/main48daeec1withreplace github.com/opencharly/spec => <this spec @ the deletion, checked out at charly's PINNED tag v0.2026259.2033>. Calver.check/check-pod/2026.265.2044/.GOWORK=off go build ./..., exit 0;go vet ./..., exit 0) and its binary re-stamped (charly version= 2026.249.2125). The deletion removing a referenced symbol would have failed this build; it did not, proving zero dangling references.analysed on a live system, not the top tier.Evidence — put each item in the block whose label names it.
1. Fresh-rebuild gate output (
charly version+ the gate run, at zero warnings):2. Each changed code path executing: N/A — the changed path is a deletion of code with zero callers (proven in block 1(a)); there is no branch of the deleted symbol to execute. The proof that the deletion is correct and non-breaking is the caller sweep + the consumer rebuild + the full live bed, all in block 1.
3. Docs-only evidence: N/A — code change class (deletion). The transitive claim sweep WAS run: the only remaining "system → user → project / MergeConfigStack" prose is the historical
CHANGELOG/0.2026250.632.mdentry (R5 permits historical CHANGELOG context). No README or live doc referenced the symbol.Attribution tier
analysed on a live system. The consumer was rebuilt from source against this deletion and a full live
disposable: truebed (check-pod, 14 steps, zero un-allowlisted warnings) ran green on it — so a live system was exercised and retained. But the deletion's own changed path has no executable branch, and no fresh-rebuild R10 of a changed runtime path is possible for dead code, so the honest tier isanalysed on a live system, notfully tested and validated.Harness rulebook compliance — state HOW each is satisfied (or
N/A — <reason>)go(spec is a Go contract module),root-cause-analyzer,strict-policy,git-workflow;plugin/install-plancover the spec module's role.sdk/loaderkit/config_stack.go) and the ONE overlay application (the per-fieldMergeDeployNodemerge).git grepoutput pasted in block 1(a) —MergeConfigStackreturns only the historicalCHANGELOG/0.2026250.632.mdcontext (permitted); the deleted symbol and its private helpers have ZERO live references. Fully deleted in this commit — no transitional/dual-mode path.git statuschecked before branch/reset; commit re-homed from a local-onlymainto afix/branch — nothing force-pushed, PR-only.MergeUnified(the live merge) is untouched and exercised by every load.charly version= 2026.249.2125); no new runtime OS deps.disposable: truebed (check-pod, 14 steps) on a fresh consumer rebuild at zero un-allowlisted warnings; the deleted symbol has no callers (grep-proven), so the honest gate is the caller sweep + consumer rebuild, with the bed as live corroboration.merge_stack.gois hand-written Go,task cue:genunaffected).f587ff7; trailingdocs: re-freeze the PR body against the final headempty commit(s) only re-trigger the validator); the duplicate is gone in full, no Phase-2.gofmt -l .empty;go vet ./merge/clean;go test ./...green (18 packages) atGOWORK=off.CHANGELOG/is written from the PR body by the merge workflow (existing entries are dated CalVer files authored at merge). No file staged.Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (analysed on a live system)