Repository navigation
feat(loaderkit): read the per-host clean: section without the deploy projection - #566
Merged
Merged
Conversation
…y projection spec#384 declared `clean:` as a typed per-host section, and no plugin-reachable loader returned it (#565): `LoadDeployConfigViaExecutor` ends with `deploykit.ProjectDeployConfig`, which builds `DeployConfig{Provides, Deploy, Sidecar}` and drops every unnamed per-host section; `LoadHostDeployConfigViaExecutor` delegates to it and inherits the drop; and the materialize's per-document merge (`spec/merge.MergeUnified`) does not carry the sections forward either, so even the unified document yields nil. The end-to-end measurement — a document authoring a 256 GiB ceiling reporting the plugin's 32 GiB fallback in three shapes — is in the issue. `LoadHostCleanSectionViaExecutor` answers the section question directly: one per-host document, one decode, the section (or nil). It is deliberately NOT a widened deploy view — `ProjectDeployConfig` is named for the PROJECT deploy view, and teaching it to carry per-host state would make that name a lie (opencharly/spec#383 records the per-section permission gap one layer up; this is its data half). The contract is the consumer's refusal rule: an absent document, or a document with no `clean:`, answers (nil, nil) so the consumer applies its own fallback (the 32 GiB ceiling lives in the plugin, never in the contract); an unreadable document, a failed bootstrap leg or an unresolvable config path answers (nil, error), because a config that cannot be READ must never be mistaken for one that says NOTHING — that is the failure mode a missing machine-scoped knob hides behind. The decoding path is the loader's, not a second one (R2): `readConfigStack` is the very reader `LoadUnified` uses, the bootstrap phase runs in the same order it runs there, and the decode target is the same `*spec.UnifiedFile` the materialize decodes each document's reserved directives into. What is NOT reused is the walk + merge + projection chain — precisely the chain that loses the section. The tests are the contract's four arms plus the resolved-standard-path and the nil-executor arms; the PR body runs the red arm that replaces the reader's last step with the delegating projection, which is what proves they are not testing a getter. Refs: #565, opencharly/spec#384, opencharly/spec#383 Agent: sdk-store Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
Review — PASSHead SHA: Security screen: PASS — no secrets/egress, no new deps, no guardrail weakening; scope matches the stated "narrow reader only" intent (no schema/wire/deploy behaviour touched). Checklist: All applicable rules PASS or NA.
Tool-limited (non-blocking): the Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
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
spec#384declaredclean:as a typed per-host section and opencharly/plugin-clean reads itsceiling from it — and NO plugin-reachable loader returned it. The mechanism is three layers deep,
and #565 carries the end-to-end measurement (three document shapes, every one
reporting the plugin's 32 GiB fallback):
LoadDeployConfigViaExecutorends withdeploykit.ProjectDeployConfig, which buildsDeployConfig{Provides, Deploy, Sidecar}— every unnamed per-host section is dropped there;LoadHostDeployConfigViaExecutordelegates to it, so it inherits the drop;spec/merge.MergeUnified) does not carry thesections forward either — which is why reading
LoadUnifiedViaExecutor(dir).Cleandirectly isnil too, even though the field decodes from YAML.
This adds the narrow reader, not the widened view:
in
loaderkit, besideLoadHostDeployConfigViaExecutor. It reads the per-host document andreturns the section WITHOUT going through
ProjectDeployConfig.Why narrow rather than teaching
ProjectDeployConfigto carry it. That constructor is namedfor the PROJECT deploy view and is what project-mode commands project; making it a merged
per-host view would make its name a lie, and every caller would silently start receiving state it
never asked for.
opencharly/spec#383records the per-section permission gap one layer up — thehost service promising a plugin its own section; this is that gap's data half, and it belongs at
the section scope, not at the deploy scope.
The contract, which is the consumer's refusal rule. It matches §4.6's "the caller's own
section" and it is the reason a merged view could not have served:
(nil, nil);clean:→(nil, nil)— "unset" is a legitimate answer, and the consumerapplies its own fallback (the 32 GiB ceiling lives in the plugin, never in the contract);
(nil, error).The last line is the whole point of the section scope: through a merged view, "absent" and "not
parsed" become the same nil, so a consumer cannot refuse an invalid ceiling without also refusing a
machine that simply never set one. Here they stay distinguishable.
The decoding path is the loader's (R2).
readConfigStackis the very readerLoadUnifieduses(system layer → in-dir, raw document merge, retired-directive stripping), the bootstrap phase runs
in the same order, and the decode target is the same
*spec.UnifiedFilethatloaderkit.MaterializeLoadedProjectdecodes each document's reserved directives into(
materialize_project.go). There is no second parser, no bespoke struct, and no duplicated fileresolution. What is deliberately NOT reused is the node-form walk +
merge.MergeUnified+ProjectDeployConfigchain — that chain is exactly what loses the section.Not touched: no schema or wire type (the section already exists in
spec v0.2026322.1814, whichgo.modalready requires), noProjectDeployConfigbehaviour, no consumer code, no new fieldanywhere. Two new files, 259 insertions.
Closes #565 (root fix option 1; option 2 — widening
ProjectDeployConfig— isdeliberately not taken, for the reason above).
Head
cd0a679a0f37a2a921f76be26b2291f4bf1b59ad.How tested
The repo's authoritative gate is
.github/workflows/ci.yml(gofmt, vet, golangci-lint v2.13.2,test, and the four-arch cross-compile). Every command ran in
/home/atrawog/Sync/Atrapub/a/dsh/opencharly/.worktrees/clean-section-reader/sdkunderGOWORK=off GOTOOLCHAIN=go1.26.8 GOTMPDIR=~/.cache/go-tmp TMPDIR=/tmp/cs.The six arms of the reader's contract, driven through the real reverse channel
(
sdk.NewInProcExecutor; the only double is the host'sloader-bootstrapleg, which echoes):The red arm that proves these tests are not testing a getter. The reader's last step is
replaced by the delegating projection —
deploykit.ProjectDeployConfig(&uf).Clean— and exactlythe two arms that carry a VALUE go red with the drop's own signature (
the section was dropped),while the four contract arms (absent section, absent document, unreadable, nil executor) still pass
because they never depended on the value. Restoring the committed file makes the package green
again:
go test -count=1 ./...is RED on this host, and the red is pre-existing and environmental.The one failure is
deploykit.TestResolveBoxRef_BoxShortName— two readers of one engine storedisagreeing (#562, open since the previous leg and RCA'd there). It reproduces on a
pristine
origin/maintree and skips on a host with no local images, i.e. on CI's runners. Withthat single arm excluded the suite is green:
Rulebook compliance
plugin,go,install-plan,git-workflow,strict-policy,root-cause-analyzer,cutover-policy,check), plus this repo'sAGENTS.mdin the worktree.TestResolveBoxRef_BoxShortName, which is RCA'd in deploykit: TestResolveBoxRef_BoxShortName fails on any store holding a name the contract's resolver cannot find (two readers of one store disagree) #562 (two readers of one store; it skips on a host with no images) and listed under## Filed issuesrather than absorbed or retried.readConfigStack, the bootstrap phase and thespec.UnifiedFiledirective decode instead of opening its own file read or its own YAML schema, and it adds no second section type —spec.CleanSectionis the only one.ProjectDeployConfigkeeps its single meaning rather than gaining a second.ProjectDeployConfig's behaviour is untouched by design, recorded in the code comment and in this body rather than silently diverged from.git status --shortwas empty before the commit and after every gate; only this worktree's own two new files changed; the mutation round was restored from the committed blob and the tree proved clean (dirty=0) before the push; nothing was force-pushed.*sdk.ExecutorfromNewInProcExecutor, the realreadConfigStack/YAML/bootstraps path); the emitted artifact under test is the section the consumer will read.packaging:is untouched.ci.yml, and every step of it ran on the committed head: gofmt, vet, golangci-lint v2.13.2, go test (with the one pre-existing, environment-dependent arm named and filed), and the four-arch cross-compile.DESIGN.md, cited: opencharly/spec#383's §4.6 section-scope promise is the row this implements the data half of;
D-STORE-7is the ceiling the section carries; the placement (a plugin-reachable read belongs inloaderkit, not indeploykit, which cannot import it) follows the boundary law/charly-internals:pluginstates, and it is why the helper lives besidedeploy_config_executor.gorather than in the constructor it replaces.Change classification
Go library addition (
loaderkit/, two new files) — not documentation, sodocumentation reviewedisnot claimed. The tier claimed is
fully tested and validated: every step of the change-class gatepassed on this head, and the reader's own path executed live through the real reverse-channel
plumbing. One clause diverges — the full suite carries one pre-existing, environment-dependent red
arm (#562), named and filed rather than absorbed.
Breaking change + rollback: none — the change only ADDS an exported function; no existing
signature, behaviour or wire shape moves,
ProjectDeployConfigis untouched, and a consumer thatdoes not call the new reader is byte-identically unaffected. Until a consumer pins this tag, the
machine-scoped ceiling keeps falling back exactly as it does today, which is the behaviour the
issue measured. Rollback is to drop the branch.
Filed issues
deploykit.TestResolveBoxRef_BoxShortNamefails on any store holding a name the contract's resolver cannot find (two readers of one engine store disagree); pre-existing, reproduces on a pristinemain, skips on a host with no local images.Agent: sdk-store
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)