Repository navigation
fix(deploy): reset can remove an entry the loader dropped - #57
Conversation
`charly deploy reset <box>` mutated only the LOADED DeployConfig. An entry the loader
dropped (e.g. a pod body written with no `image:`) is absent from that map, so the
command printed `No overrides for box "…"` and exited 0 — while the entry stayed in the
file and kept SaveDeployConfig refusing EVERY later write ("holds 2 deploy entries but
only 1 load"). The refusal's own suggested remedies were both unreachable: the per-entry
reset was a no-op, and the bare reset deletes the whole file.
The miss branch now removes the raw node-form key for that entry: exactly one key, with
the loadable entries and the config's other sections untouched, and an unparseable file
left alone for `charly migrate`. A test fixture with one good and one unloadable entry
asserts the good one and a non-deploy section survive.
Refs #56
*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: Blocks
(Non-blocking QUAL note: Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
The first verdict's QUAL finding: removeDroppedEntry matched a top-level key by name alone, so a reset aimed at a box named cache/provides/ledger/system/defaults would delete that section. A deploy entry cannot share those names; refuse them, with a test. Refs #56
|
STATUS STATUS — both findings addressed, one still owes a run I cannot produce in this repo. QUAL note (fixed): R12 (B and C): C is demonstrable on this tree, and I ran it — the bare so C's rejection is measured, not asserted: it destroys the good entry along with the bad one. B ("fail NONZERO with a migrate remedy") is a behaviour this tree does not have and is rejected by design — it leaves the operator exactly as blocked as the current silent no-op, which the issue's own evidence shows. R10: the reviewer is right that a Agent: Agent: |
Review — BLOCKHead SHA: Change class: code change (Go; Blocks
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Change class: code change (Go; Blocks
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS (no secrets, no egress, no guardrail weakening; placement is a plugin capability in Comment dispositions: 7192681058 (bot) R10 and R12 findings stale-superseded by the current live proof + in-body spike; QUAL collision note resolved (guard + test present). 7192719091 (@aitrawog) QUAL fix verified; "will produce that run" stale-superseded (run now in body). 7192753841 (bot) A1/A2/R10/R1 blocks stale-superseded (head/diff updated, live proof pasted, RCA present). 7205026083 (bot) R12 and R1/R2 blocks stale-superseded (C now in body with exit code, B explicitly justified as non-candidate, and the body now states the raw Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
charly deploy reset <box>could not remove an entry the LOADER had dropped (a pod body written withno
image:). The entry is absent from the loadedDeployConfig, so the loaded-side mutation printedNo overrides for box "…"and exited 0 — a silent no-op — while the entry sat in the file and madeSaveDeployConfig's round-trip guard refuse every later write. The only escape wascharly deploy resetwith no box, which deletes the whole file.The fix removes the raw top-level key from the config's YAML node form — precisely that one entry,
leaving the good entries and the config's other sections intact — with a guard so a box named after a
reserved section (
cache,provides,ledger,system,defaults) can never delete that section.Head:
92ce9c757c1e82d78c0f6e0cbd83acf820c8c74bDiff: 2 files changed, 196 insertions(+) —
candy/plugin-fleet/config_cmd.go(+65),candy/plugin-fleet/config_reset_dropped_test.go(+131)How tested
Unit coverage (four tests, one of them the reserved-section guard):
The live proof of the changed path (R10), both arms. A charly binary carrying this branch's
plugin-fleetthrough a localreplace, run against a deliberately degraded per-host config(
good:with animage:,broken:with onlyresolved_image:):That is the reviewer's asked-for run: the dropped key removed, the good entry intact, and a following
SaveDeployConfigwrite accepted.Spike
Removed the unloadable entry "broken", the good entry intact, the next write acceptedthe good entry is destroyed with the bad one — the whole state goes to remove one key |
B — "fail NONZERO with a
charly migrateremedy" — is not a candidate: it does not remove thedropped entry, which is the cause, so the operator is exactly as blocked as with the current silent
no-op. The remedy text would describe a path that cannot unblock; there is no run that makes it a
solution.
Rulebook compliance
/charly-internals:git-workflow,/charly-internals:goand the plugin-fleet repo rulesloaded.
tests only, never a live
deploy resetagainst a degraded config, so the case the change exists forwas never executed — and the QUAL collision (a section named like the key) was not exercised by any
test. Both controls are now in place: the live run above, and
TestRemoveDroppedEntry_NeverTouchesAReservedSection.removeDroppedEntry. It deliberately does not go throughSaveDeployConfig— that function's round-trip guard is the control this fix has to escape, and itrefuses any write while the dropped key is present — so the helper reads the YAML node form and
removes exactly one key itself (
os.ReadFile/os.WriteFile). The bypass is the point.origin/main; no force-push.replace, and its run is pasted.its Go module, and the runtime path is exercised through the rebuilt binary.
Change classification
No breaking change. A reset of a dropped entry now succeeds where it silently failed; every other
reset path is unchanged.
Filed issues
None filed by this change; it resolves
opencharly/plugin-fleet#56.Agent:
cdi-audit· Claude Code sessionf760307f-53b4-4f48-87da-00f95e5300edAssisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)