Repository navigation
feat(spec): add Deploy.VolumeProjectChecked wire field - #96
Conversation
Companion to opencharly/charly#183 round 3. resolveDeployVolumes (candy/plugin-deploy-pod) gated its project-declared-volume fallback on per-host overlay-key EXISTENCE, but the same overlay entry is also written by unrelated charly config stages (the port-resolution block, persistResourceCaps) before the volume fallback ever runs -- so overlay-key existence cannot distinguish "an unrelated write already happened, project never consulted" (silently drops a ported deploy's project-declared volume on its first config) from "the project was consulted and genuinely declares nothing" (must not re-query on every subsequent config). Adds volume_project_checked?: bool @go(VolumeProjectChecked) to #Deploy, same "charly-written state, never authored" pattern as resolved_port/ resolved_image. Regenerated via task cue:gen -- reproducible, no further diff on a second run. GOWORK=off go build/vet/test ./... clean. gofmt -l . clean except the pre-existing, untouched vmshared/cloud_init_iso.go nit (tracked separately). Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
pr-validator — APPROVED ✅Change class: charly-or-sdk Go (schema/codegen only) Independently re-derived against
Comments considered: none. Cross-PR interactions considered: no other open PRs on Decision: APPROVE. Clean, correctly-scoped, pattern-matched schema addition. Proceeding to finalize the merge-time CalVer, merge, and tag. Assisted-by: Claude Code Claude Sonnet 5 (analysed on a live system) |
pr-validator merge-time version stamp for PR #96. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
…ecked (round 3) team-lead's independent RCA of round 2 found a cross-stage ordering hole: config_setup.go's port-resolution block runs BEFORE resolveDeployVolumes and writes the per-host overlay entry (ResolvedPort) the moment a deploy has ANY container port -- so on a PORTED deploy's first charly config, round 2's !ok-gated fix saw the port block's write, concluded "already configured", and silently dropped the project-declared volume again. Overlay-key existence cannot distinguish "an unrelated write already happened" from "the project was consulted and genuinely declares nothing" -- both produce an identical "key exists, Volume empty" shape. Fix: a new persisted marker, Deploy.VolumeProjectChecked (companion opencharly/sdk#96, merged a0d10c02, tag v0.2026205.1021), following the resolved_port/resolved_image "charly-written state, never authored" pattern. resolveDeployVolumes now gates its project fallback on this explicit bit instead of overlay-key presence; persistDeployVolumes sets it unconditionally after every project consult (found or not), closing both round 2 (re-query every config) and round 3 (port block masking the consult) regressions with one bit. New live fixture: check-enc-port-pod (companion opencharly/distro-fedora#9, merged 8c1f9d3f, tag v2026.205.1021) -- reuses the web candy (has a port, auto-allocated, no hardcoded host port) + a project-declared encrypted volume, since check-enc-pod alone (port-less check-pod image) never exercises this ordering hazard. Coverage: TestResolveDeployVolumes_PortedDeployProjectVolumeAppliedOnFirstConfig (unit) + TestConfigFlow_PortResolutionThenResolveDeployVolumes_ProjectVolumeStillApplied (INTEGRATION -- replicates the actual port-block-then-volume-resolve sequence via real kit.ResolveDeployPorts, not just isolated calls) -- both verified to FAIL against the round-2 (!ok-gated) code and PASS against this fix (confirmed via a temporary swap-in/swap-out). R10: check-enc-pod (12/12, re-confirming rounds 1-2) + check-enc-port-pod (12/12, 13/13 check-live steps -- the round-3 fix's live proof), both against a fresh binary + fresh rebuild gate. Both sdk and box/fedora gitlinks repointed to their MERGED shas (not branch tips); charly/go.mod's sdk require bumped to v0.2026205.1021 to match. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
Summary of changes
Adds
Deploy.VolumeProjectChecked— a new persisted "charly-written state, never authored" bool field on#Deploy(schema/deploy.cue), following the exactresolved_port/resolved_imagepattern (same file, same comment convention, same non-authored treatment). Companion toopencharly/charly#183round 3:resolveDeployVolumes(candy/plugin-deploy-pod) needs an explicit "the project's volume declaration was already consulted for this deploy key" bit, because the per-host overlay entry the field lives on is ALSO written by unrelatedcharly configstages (the port-resolution block,persistResourceCaps) before the volume fallback ever runs — so overlay-key existence alone cannot distinguish "an unrelated write already happened, project never consulted" (silently drops a ported deploy's project-declared volume on its first config — the BLOCKING regression this closes) from "the project was consulted and genuinely declares nothing" (must not re-query on every subsequent config).schema/deploy.cue:volume_project_checked?: bool @go(VolumeProjectChecked), placed immediately afterresolved_port/resolved_image.spec/cue_types_gen.go: regenerated viatask cue:gen(2-file diff, reproducible — a second run produces no further changes).Change class
charly-or-sdk Go (schema/codegen only — no proto/wire-RPC change, no runtime logic in this repo)
How R10-tested — exact gate, commands, and pasted output
GOWORK=off go build/vet/test) + thetask cue:genreproducibility gate. This repo carries no runtime beds of its own; the consuming behavior is proven by the companionopencharly/charly#183PR's disposable-bed R10 (check-enc-pod+ the newcheck-enc-port-pod).opencharly/charly#183.task cue:genwas run fresh and is reproducible (see below).opencharly/charly#183's Go code (resolveDeployVolumes/persistDeployVolumes) and its own unit + integration tests + disposable-bed R10 — pasted there, not here (this repo's own change is schema+codegen only, no executable logic of its own beyond the generated struct).Attribution tier
analysed on a live system
Harness rulebook compliance
/charly-internals:go(SDD pipeline — schema-before-code,task cue:gen),/charly-internals:strict-policy(R3 — same field-shape pattern asresolved_port/resolved_image, no new shape invented).go vet/gofmtzero warnings on every touched file (the onevmshared/cloud_init_iso.gogofmt nit is pre-existing and untouched by this diff — see R5 below, not a warning THIS diff introduces).opencharly/charly#183PR per the standard B2 producer→consumer order.resolved_port/resolved_image"charly-written state, never authored" shape and comment convention — no new pattern invented.vmshared/cloud_init_iso.gogofmt nit predates this cutover (confirmed viagit diff --statshowing zero changes to that file in this diff, andgit log -1showing its last touch was an unrelated prior commite6b0208) and is tracked for the next lint-sweep thematic batch per the Cutover Sizing Law — non-blocking per R2's separability test (this PR's own claim — "the field exists, compiles, regenerates reproducibly" — holds true regardless of that unrelated nit).git status/git branchchecked before branching; no destructive git action taken.opencharly/charly#183's disposable bed run.sdkalone.task cue:genrun twice, zero further diff) + the full standalone test battery, both pasted above.task cue:genis the sole generator, no hand-written wire type added (the field lands in the SAME generated#Deploystruct every other field does). RDD: the shape (a plain optional bool, no disjunction) was already proven safe by the two existing sibling fields (resolved_port/resolved_image) — no new spike needed, this is the well-trodden pattern. ADE: N/A (no candyplan:/description:change).#Deployenvelope is not a kernel/plugin boundary concern (it doesn't introduce a per-kind branch anywhere).gofmt -l .clean except the documented pre-existing nit;golangci-lint run ./...0 issues;go vet ./...clean;go test ./...green (all pasted above).CHANGELOG/2026.205.1000.mdstaged (placeholder CalVer; the pr-validator finalizes it at merge).Assisted-by: Claude Code Anthropic Claude Sonnet 5 (analysed on a live system)