Repository navigation
fix(pod): carry the image on every PrepareVenue state patch - #98
Conversation
An add_candy overlay build with no authored engine selector emitted a state patch carrying ONLY resolved_image. The node-form writer then produced a `pod:` body with no `image:` (it classifies on resolved_image), the loader dropped that entry (ValidateDeployRequiresBox), and the resulting degraded load made sdk's SaveDeployConfig refuse EVERY later write to the host config: refusing to write …/charly.yml — it holds 2 deploy entr(y|ies) but only 1 load which locks the operator out of `charly config` until the file is hand-edited. The patch now carries box + target on every emitted state, not only when engine is set; baseName was already in scope at the call site. The pre-existing test that called the helper with an empty box is updated, and a regression test asserts the overlay-only patch carries the image — it fails without this change. Refs #84 *Agent: `cdi-audit` · Claude Code session `f760307f-53b4-4f48-87da-00f95e5300ed`* *Assisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)*
Review — BLOCKHead SHA: Change class: code change — Go lifecycle logic in a candy plugin ( Security screen: PASS — no secrets, no exfiltration, no guardrail weakening, no scope mismatch; the diff does exactly what the body says (drop the Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Change class: code change — Go lifecycle logic in Comment disposition (the single prior comment by @github-actions[bot], same head SHA): it reviewed an older body (it quotes a
Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS — no secrets, no exfiltration, no guardrail weakening, no scope mismatch; the diff does exactly what the body states (drop the Comments considered:
Checklist: All applicable rules PASS or NA. The regression test fails without the fix and passes with it (R7/R10), the engine-only branch is removed rather than kept beside the new one (R5), the RCA and the missed-control explanation (the old test passing an empty box and asserting only Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
An
add_candy:overlay build with no authoredengine:selector wrote aPrepareVenuestatepatch carrying only
resolved_image.applyDeployStatepersists that unconditionally, the node-formwriter emits a
pod:body (it classifies onresolved_image) with noimage:, and the loaderthen drops the entry (
ValidateDeployRequiresBox). The degraded load makesSaveDeployConfigrefuse every later write to the host config:
That message names two remedies and neither can be executed for this entry:
charly deploy reset <name>mutates only the loaded map (no-op), and a barecharly deploy resetdeletes the whole file,taking the good entries with it. The host is locked out of
charly configuntil the file ishand-edited.
The fix: the patch carries
box+targeton every emitted state, not only the engine path.baseNamewas already in scope at the call site.Head:
9faddfeee0318be51bb96a4fd6bf683c85c96c6eDiff: 2 files changed, 49 insertions(+), 13 deletions(-)
Relates to: #84 (claimed; its write-lockout half was untracked)
How tested
Spike — the three candidates for this cause
box/targetapplyDeployStaterefuses to persistResolvedImageon an entry with noImageimage:fromresolved_imageat loadresolved_imageis the OVERLAY ref; back-filling it as the entry's image records the wrong box and the next rebuild resolves from it.The regression test fails without the fix (run, then reverted, then restored)
TestPrepareVenueState_DecodesIntoTheHostsWireTypeused to call the helper with an empty box andassert only
ResolvedImage— it locked the broken shape in; it now passes a box and the newtest asserts the wire fields the host applies.
Gates on this head
The consumed path is the host's:
deploykit.applyDeployStateseedsentry.Imagefrom the patch'sbox, then the node-form writer emitsimage:. The live witness is a pod bed(
check-pod-overlay/check-sidecar-pod) or anycharly deploy addwith--add-candy, which nowwrites a loadable entry.
Runtime witness — the bed that exercises this path, on a disposable target
check-pod-overlayis adisposable: truepod bed whose deploy performs anadd_candy:overlaybuild — the exact path this change alters — and the run below served THIS BRANCH's plugin:
The
LOCAL OVERRIDEline is the proof the branch was loaded rather than the pinned module.Candidate C, measured (R12)
C would back-fill
image:fromresolved_imageat load. Run against a fixture whose only key is anoverlay ref, the entry loads with the OVERLAY as its image — i.e. C records the wrong box:
So C FAILS its requirement: it loads the entry, but with the overlay ref recorded as the image — the
next rebuild resolves from the wrong box. (The command exits 0 because
deploy showprints; whatfails is C as a fix, not the command.)
Candidate B, spiked (R12)
B would add a guard in sdk's
applyDeployStaterefusing to persistResolvedImageon an entry withno
Image. sdk ALREADY has such a guard for the degraded-load case, and its own test is green — soB's outcome is measurable as "the refusal the operator actually hit":
That is the guard WORKING — and it is exactly the
refusing to write … only 1 loadwall in theissue. A guard-only fix therefore leaves the state patch wrong and the operator locked out; it
converts silent corruption into the error already observed. B is rejected on that run, not on taste.
Rulebook compliance
/charly-internals:plugin,/charly-pod:pod,/charly-core:deploy,/charly-internals:git-workflow(this repo's AGENTS.md requirement) before editing.mechanism and the untracked write-lockout half.
origin/main,git statusclean before the branch.go build/go test/box validategreen on this head; the live consumer is the pod bednamed above.
SaveDeployStateInputalready carriesbox/target).Change classification
No breaking change. The patch gains fields the host already applies (
box,target); an entrywritten by an older plugin keeps loading exactly as before, and
applyDeployStatestill seedsImage/Targetonly when the entry has none.Filed issues
Agent:
cdi-audit· Claude Code sessionf760307f-53b4-4f48-87da-00f95e5300edAssisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)