Skip to content

feat(deploy): externalize pod config-WRITE to candy/plugin-deploy-pod (P11) - #86

Merged
atrawog merged 2 commits into
mainfrom
feat/p11-pod-plugin
Jul 13, 2026
Merged

atrawog merged 2 commits into
mainfrom
feat/p11-pod-plugin

Conversation

@atrawog

@atrawog atrawog commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

The superproject half of P11 — pod config-WRITE externalized to candy/plugin-deploy-pod.
Generating + writing the quadlet .container / .pod / sidecar .container / cloudflare
tunnel .service files moves out of charly core into the deploy:pod plugin, completing the
pod-substrate externalization under the kernel/plugin boundary law (Ruling C: the plugin
OWNS config-write; the host keeps config-RESOLVE + the side-effects).

Cross-repo (consumer half). The sdk half landed first — sdk #34 MERGED (merged main
2716be0, tag v0.2026194.615). This PR bumps the sdk gitlink f0f37fa → 2716be0 and
charly/go.mod require → v0.2026194.615 (in-tree resolution rides replace => ../sdk; the
require matters for out-of-tree consumers).

Change class

Code (charly core rewiring + candy + sdk gitlink). Runtime tier.

What's in it

Mechanism (in sdk/deploykit, via the bumped gitlink): GenerateQuadlet + section emitters,
the QuadletConfig/CollectedSecret/ResolvedBindMount/ResolvedSidecar types, the
pod/sidecar/tunnel generators, the pure helpers, and the enc-coupled ResolveVolumeBacking +
enc-path cluster. Core's former lowercase copies are gone; the remaining call sites bind the
deploykit versions via deploykit_pod_aliases.go / deploykit_state_aliases.go.

How it runs now (Q1=(a)): charly config stays a HOST command — it resolves the full
QuadletConfig, provisions podman secrets, computes the target PATHS, provisions dirs, then
connects deploy:pod ON-DEMAND (connectPluginByWordRef(ClassDeployTarget, "pod", …) —
the credential/vm/kube adapter pattern; idempotent/cached) and Invokes its new OpConfigWrite
with a spec.PodConfigWriteRequest (the resolved QuadletConfig as an opaque RawBody +
host-computed absolute paths). The plugin (config_write.go) renders CONTENTS and os.WriteFiles
at the exact modes (.container/.pod/sidecar 0600, tunnel .service 0644) — byte-identical
to the former in-core write phase. Host side-effects (cloudflareTunnelSetup, daemon-reload,
enc-mount, seed, tunnel enable) stay in charly config. deploy:pod stays out-of-process,
connected on-demand (config_write_host.go, Option-B) — not compiled-in.

R5 claim-keyed sweep (folded in per the batch directive — comment/description-only): corrected
the location claims this relocation made stale — charly/deploy.go no longer self-contradicts
(ResolveVolumeBacking/resolveVolumeHostPath documented as relocated, not "stay core"), and
candy/plugin-tunnel (tunnel_exec.go/plugin.go/charly.yml) no longer claims charly/tunnel.go
keeps the schemeTarget/tailscaleFlag/isTCPFamily helpers (moved to sdk/deploykit with the
emitter). The go/tunnel SKILL residue routes to the batched docs cutover.

R10 acceptance — pod roster, fresh charly update, deploy:pod built from this branch (CHARLY_REPO_OVERRIDE) — GREEN 3/3

check-pod (-C box/fedora): PASS steps=11, total 306s, ok:true, CHARLY_EXIT=0
  image-build 77s ✓ / check-image ✓ / deploy-add ✓ / config 13s ✓ (the NEW plugin write path)
  / start ✓ / bring-up-members ✓ / check-live ✓ / feature-run ✓ / update 77s ✓ (fresh rebuild)
  / feature-run-rebuild ✓ / cleanup ✓

check-sway-browser-vnc-pod (-C box/fedora): PASS steps=11, 535s, ok:true, CHARLY_EXIT=0

check-sidecar-pod: PASS steps=11, 219s, ok:true, CHARLY_EXIT=0  (SOLO — the earlier concurrent
  check-image failure reproduced as a PRE-EXISTING podman store-contention race in probe infra,
  exit-127 during triple-concurrent build churn; identical code+binary passes solo → NOT P11,
  filed as its own cutover)

Live proof of the mechanism (config.log): plugin-deploy-pod wrote
  charly-check-sidecar-pod.container + reloaded the systemd user daemon.

Non-bed gates (this worktree): charly go build/go test ./... green · byte-parity
TestPodConfigWrite_ByteParity + _MinimalOnlyContainer pass · golangci-lint 0 (charly /
plugin-deploy-pod / plugin-tunnel) · gofmt clean · task cue:gen reproducible · charly box validate exit 0 · R5 grep of the deleted core ids clean.

Tier

Assisted-by: Claude (fully tested and validated) — all 10 standards met; the pod roster ran
on a fresh charly update with the changed config-write path (config step) + the fresh-rebuild
(update step) both exercised and GREEN, verdict pasted above.

R0–R10 checklist

  • R1 — no failures on P11's path; the one concurrent check-image failure was RCA'd to a
    pre-existing store-contention race (its own cutover), not P11.
  • R2 — the surfaced R5/doc divergences fixed in this tree (deploy.go + plugin-tunnel).
  • R3 — generators single-sourced in deploykit; core binds via aliases.
  • R5 — deleted-core-id grep clean (only the accepted "relocated"/"former core" provenance).
  • R7/R8/R9 — real image build + fresh charly update + charly check live; the deployed
    per-tree binary built the plugin from this branch.
  • R10 — GREEN 3/3 pod roster on fresh rebuild, pasted above; final transitional-free code.
  • Cross-repo order (B6) — sdk refactor(charly): externalize deploy/IR machinery to sdk (P4) #34 merged FIRST; this bumps the gitlink to the merged commit.

Do NOT self-merge — a fresh, independent pr-validator re-validates + merges + tags main.

Assisted-by: Claude (fully tested and validated)

… (P11)

The pod config-WRITE — generating + writing the quadlet .container / .pod / sidecar
.container / cloudflare tunnel .service files — moves out of charly core into the
deploy:pod plugin (candy/plugin-deploy-pod), completing the pod-substrate externalization
under the kernel/plugin boundary law (Ruling C: the plugin OWNS config-write; the host
keeps config-RESOLVE + the side-effects). This is the superproject half; the sdk half (the
deploykit config-write mechanism + the #PodConfigWriteRequest seam + OpConfigWrite) landed
in sdk #34 — the sdk gitlink bumps to the merged 2716be0 and charly/go.mod requires
v0.2026194.615.

What moved:
- The config-write MECHANISM is sdk/deploykit now: GenerateQuadlet + its section emitters +
  the QuadletConfig/CollectedSecret/ResolvedBindMount/ResolvedSidecar resolved-runtime input
  types, the pod/sidecar/tunnel generators (GeneratePodQuadlet/GenerateSidecarQuadlet/
  GenerateTunnelUnit), the pure size/port/tunnel helpers, and the enc-coupled volume resolver
  (ResolveVolumeBacking + the enc-path cluster). Core's former lowercase copies are gone; the
  remaining call sites bind the deploykit versions via deploykit_pod_aliases.go /
  deploykit_state_aliases.go.

How the pod config-WRITE runs now (Q1=(a)):
- charly config stays a HOST command: it resolves the full QuadletConfig, provisions podman
  secrets, computes the exact target PATHS (its unchanged filename helpers), provisions the
  dirs, then connects the deploy:pod plugin ON-DEMAND (connectPluginByWordRef(ClassDeployTarget,
  "pod", …) — the same host-out-call the credential/vm/kube adapters use; idempotent/cached)
  and Invokes its new OpConfigWrite with a spec.PodConfigWriteRequest (the resolved
  QuadletConfig as an opaque RawBody envelope + the host-computed absolute paths). The plugin
  (config_write.go, podConfigWrite) renders the file CONTENTS and os.WriteFiles them at the
  exact modes (.container/.pod/sidecar 0600, tunnel .service 0644) — byte-identical to the
  former in-core write phase (the process boundary changes no bytes). Every host side-effect
  (cloudflareTunnelSetup, systemctl --user daemon-reload, enc-mount, data-seed, tunnel enable)
  stays in charly config, unchanged.
- deploy:pod stays OUT-OF-PROCESS (the external-provider direction), connected on-demand — NOT
  compiled-in. Option-B connect via config_write_host.go.

R5 claim-keyed sweep (folded in per the batch directive — comment/description-only, no behavior
change): corrected the location claims this relocation made stale — charly/deploy.go no longer
self-contradicts (ResolveVolumeBacking/resolveVolumeHostPath documented as relocated, not "stay
core"), and candy/plugin-tunnel (tunnel_exec.go/plugin.go/charly.yml) no longer claims
charly/tunnel.go keeps the schemeTarget/tailscaleFlag/isTCPFamily helpers — those moved to
sdk/deploykit with the quadlet emitter. The go/tunnel SKILL residue (plugins repo) routes to the
batched docs cutover.

Byte-parity is locked by the deploykit generator goldens + the plugin write-parity test
(candy/plugin-deploy-pod/config_write_test.go: TestPodConfigWrite_ByteParity +
TestPodConfigWrite_MinimalOnlyContainer — content == generators, exact modes, exact write order).
The residual host-side pod-knowledge (config RESOLVE in config_image.go, the filename helpers,
directPodmanArgs direct-run) is the documented Q1=(a) consequence for the P16 floor.

R10 ACCEPTANCE — the pod roster on a fresh charly update, deploy:pod built from this worktree
(CHARLY_REPO_OVERRIDE), GREEN 3/3:
- check-pod (-C box/fedora): PASS steps=11, 306s — image-build 77s / check-image / deploy-add /
  config 13s (the NEW plugin write path) / start / bring-up-members / check-live / feature-run /
  update 77s (fresh rebuild) / feature-run-rebuild / cleanup — ok:true, exit 0.
- check-sway-browser-vnc-pod (-C box/fedora): PASS steps=11, 535s, ok:true, exit 0.
- check-sidecar-pod: PASS steps=11, 219s, ok:true, exit 0 (solo — the earlier concurrent-run
  check-image failure reproduced as a PRE-EXISTING podman store-contention race in probe infra,
  not P11; filed separately).
Live proof of the mechanism: plugin-deploy-pod wrote charly-check-sidecar-pod.container +
reloaded the systemd user daemon.

Verification: charly go build/test ./... green; go test ./candy/plugin-deploy-pod parity green;
golangci-lint 0 (charly / plugin-deploy-pod / plugin-tunnel); gofmt clean; task cue:gen
reproducible; charly box validate exit 0; R5 grep of the deleted core ids clean.

Assisted-by: Claude (fully tested and validated)
Claude-Session: https://claude.ai/code/session_017pgC6VEfHBCNTku1JQXkLq
@atrawog

atrawog commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Change class: charly/sdk Go + candy config + cross-repo (sdk gitlink bump) — RUNTIME tier

Independent re-derivation (trusted no author claim):

Gitlink safety — PR head records sdk @ 2716be0 (forward from main's f0f37fa); 2716be0 IS sdk origin/main HEAD; tag v0.2026194.615 dereferences to exactly 2716be0; charly/go.mod require matches. Feat branch up-to-date with main (BLOCKED only on the missing status).

Bed evidence (opened summary.yml on disk — corroborates the pasted table):

  • check-pod 2026.194.0545: ok:true, 11 steps, 306s (config=13s = new plugin write path, update=77s = fresh rebuild) ✓
  • check-sway-browser-vnc-pod 2026.194.0545: ok:true, 11 steps, 535s ✓
  • check-sidecar-pod 2026.194.0555: ok:true, 11 steps, 219s (solo) ✓
  • Live proof (0555 config.log): plugin-deploy-pod connected on-demand + Wrote …/charly-check-sidecar-pod.container — the new OpConfigWrite path executed live.
  • The 0545 concurrent check-sidecar-pod failed at check-image (step 2, probe infra P11 does not touch) with exit-127 creating temporary passwd file for container / unmounting container — the pre-existing podman store-contention race under triple-concurrent churn, tracked as its own cutover fix(hooks): key late staging on ANY index-mutating verb, not just add/stage #44. R2-separable (sidecar's own R10 passes solo); NOT dismissed as flake — RCA'd to a named root mechanism. Concurrency mandate satisfied: P11's own change passed under the concurrent roster (check-pod + check-sway green at 0545).

Isolated re-build/test (fresh worktree @ 4bed20a, sdk @ 2716be0, my own run): gofmt clean · go build ./charly/... exit 0 · go vet clean · go test ./charly/ ok (71s) · PodConfigWrite byte-parity harness PASS (ByteParity + MinimalOnlyContainer) · plugin-tunnel test ok · golangci-lint 0 (charly / plugin-deploy-pod / plugin-tunnel, go.work active) · TestPluginsGenReproducible ok (no drift).

SDD — PodConfigWriteRequest/Reply in spec/cue_types_gen.go (generated, DO NOT EDIT) sourced from schema/seam.cue (opaque RawBody envelope + host paths). No *_gen.go hand-edit in the diff. The former hand-written tunnel wire mirror was deleted → aliased to CUE-sourced spec.TunnelConfig/TunnelPort — a net wire-mandate improvement.

R5 — deleted core ids (generatePodQuadlet/generateSidecarQuadlet/generateTunnelUnit/SortedSidecarEnv/emit*Section/normalizeCgroupSize/formatCPUQuota/schemeTarget/tailscaleFlag/isTCPFamily/…) → 0 live core refs. No transitional/dual-mode write path (the old core write phase is gone; one path through the plugin).

Kernel/plugin boundary — host keeps RESOLVE + side-effects (Ruling C, Q1=(a)); plugin owns render+write. connectPluginByWordRef + hostInvoke are pre-existing generic seams reused (R3), word-dispatched ("pod", OpConfigWrite); no new concrete-kind switch/map/field-read leak — the change reduces core's pod knowledge.

Decision: All 19 checklist items PASS (security screen, R0–R10, RDD/ADE/SDD, concurrency anti-cheat, hard-cutover, boundary law, clean-arch/go-gates, CHANGELOG). Proceeding to finalize the merge-time CalVer, squash-merge, and tag main.

Assisted-by: Claude (fully tested and validated)

Merge-time version stamp applied by the fresh pr-validator: CHANGELOG
placeholder 2026.193.2345 -> 2026.194.0637 (filename + H1).

Assisted-by: Claude (fully tested and validated)
@atrawog
atrawog merged commit 1a7e62a into main Jul 13, 2026
@atrawog
atrawog deleted the feat/p11-pod-plugin branch July 13, 2026 06:39
github-actions Bot pushed a commit that referenced this pull request Nov 28, 2026
* fix(box): advance box/arch to the head its distro repo serves

The umbrella's distro-arch edge is DERIVED-EDGE-blocked on this nested gitlink:
charly records box/arch at c068d35b9f (the CHANGELOG for distro-arch#83) while the
repo serves 54625aad44 (the CHANGELOG for #86). Until charly carries the served head,
the umbrella's sync cannot re-derive the edge, so the seventh pin wave reports
'blocked-by charly:box/arch (behind)' - a live warning in a gate that must paste none.

Same mechanism #1302 performed for box/cachyos.

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)

* chore(pr): re-freeze the head so the required gate re-arms

Every check on the previous head is green (validate, lint, go, pin-currency, arm=success) and
auto-merge was never set - the ARMED-AND-SILENT class, whose one cure is a new head. The tree
is unchanged; the body's Head reference is re-keyed.

Agent: cdi-audit · Claude Code session f760307f-53b4-4f48-87da-00f95e5300ed
Assisted-by: Claude Code deepseek-v4.1-flash:cloud (fully tested and validated)

* chore(pr): re-freeze the head so the required gate re-arms

All five checks on the previous head are completed/success, including arm=success, and auto-merge
was never set - the ARMED-AND-SILENT class, whose one cure is a new head. The tree is unchanged;
the body's Head reference is re-keyed.

Agent: cdi-audit · Claude Code session f760307f-53b4-4f48-87da-00f95e5300ed
Assisted-by: Claude Code deepseek-v4.1-flash:cloud (fully tested and validated)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant