Skip to content

feat(deploykit,kit,schema): DEPLOY-wave pod command-seam wire types + relocations - #78

Merged
atrawog merged 17 commits into
mainfrom
feat/deploy-wave
Jul 20, 2026
Merged

atrawog merged 17 commits into
mainfrom
feat/deploy-wave

Conversation

@atrawog

@atrawog atrawog commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Companion sdk-repo leg of the charly-repo DEPLOY wave, which ported the 11 pod-lifecycle CLI commands (start/stop/restart/logs/remove/shell/service/volume/cp/config/update) from hardcoded core Kong fields into the new compiled-in candy candy/plugin-pod (landing in a follow-up charly-repo PR once this leg merges, per B2 cross-repo landing order).

  • 11 new CUE-sourced wire types (sdk/schema/seam.cue → generated sdk/spec): #Pod{Start,Stop,Logs,Remove,Shell,Service,Update,ConfigSetup,ConfigStatus,ConfigMount,ConfigUnmount,ConfigPasswd,ConfigRemove}Request/Reply pairs — the wire envelopes for each HostBuild("pod-<word>") seam, mirroring candy/plugin-bundle's established deploy-add/deploy-del shape.
  • 2 genuine relocations completing prior waves' cutovers: sdk/kit/quadlet_paths.go (pod quadlet path helpers) and sdk/deploykit/pod_service.go (pod service start/stop/restart bodies, split-consumer between the resource arbiter and the pod-deploy lifecycle).
  • R1 archaeology: while auditing for already-existing sdk equivalents (the DEPLOY wave found and swept 4 incomplete-cutover duplicates in the charly repo), this leg folds in the one missing test (TestResolveGPGAgentForward_ContainerHome) that kit.ResolveAgentForwarding's coverage lacked, and corrects 2 header comments (sdk/deploykit/container_resolve.go, sdk/kit/agent_forward.go) that asserted a completed migration verified false by grep.

Verification

  • GOWORK=off go build ./... — clean.
  • GOWORK=off go test ./... (every package) — clean.
  • golangci-lint run ./kit/... ./deploykit/... ./spec/... — 0 issues.
  • task cue:gen — verified true no-op (zero diff on a fresh run); the reproducibility gate (TestGenReproducible) passes.
  • Exercised live via the companion charly-repo leg's R10 bed roster, all PASS / zero warnings:
    • check-exampledeploy [2026.201.xxxx]: PASS (steps=6), 139s, exit 0
    • check-charly-vm: PASS (steps=8), 336s, exit 0 — the worktree-built opencharly-git (carrying all 11 ported commands) pacman-installed fresh in the disposable guest
    • check-sidecar-pod: PASS (steps=12), 437s, exit 0
    • check-group: PASS, 408s, exit 0

Test plan

  • go build ./... / go test ./... clean on this branch
  • golangci-lint run clean
  • task cue:gen reproducibility verified (no drift)
  • Live R10 bed roster (4 beds) run against the companion charly-repo leg — all PASS

https://claude.ai/code/session_018QNXbstqVZTfyD4w9TZmjF

atrawog added 14 commits July 20, 2026 10:41
… (K4 deploy-wave prep)

Pure filename/path formatting used by both plugin-deploy-pod (in progress) and
P13-kernel deploy code that stays core until its own wave — moved to sdk/kit
alongside the existing ContainerName/sidecar naming helpers rather than
duplicated, so both call it directly.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
… (K4 deploy-wave prep)

stopPodService/startPodService were pure quadlet/engine orchestration shared
between the resource arbiter (preempt.go, out of this wave's scope) and the
pod-deploy lifecycle (candy/plugin-deploy-pod, moving). Homed in deploykit
rather than kit — they need ResolveBoxEngineForDeploy, a deploykit-only
mechanism (kit cannot import deploykit) — mirroring the existing
container_resolve.go / box_engine.go precedent exactly.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
kit.StripURLScheme already existed (relocated from charly/remote_image.go in
an earlier K4 wave) but shipped with no test of its own — charly core still
carried a leftover duplicate definition (R5 incomplete cutover) plus its
test. Adds the test here; the charly-side fix removes the duplicate.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
…wire types (DEPLOY wave CLI-struct port)

RestartPodService extends pod_service.go with the restart body (mirrors
Stop/StartPodService — quadlet-mode systemctl restart, else engine restart).
NOT registry-bound, so candy/plugin-pod's RestartCmd calls it directly.

#PodStartRequest / #PodStopRequest (sdk/schema/seam.cue → generated into
spec/cue_types_gen.go via task cue:gen, reproducibility-verified) are the
CUE-sourced wire types for the host_build_pod_start.go / host_build_pod_stop.go
seams the DEPLOY wave's start/stop CLI-struct port forwards through — the SDD
mandate (wire types are CUE-sourced without exception).

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
…ort)

CUE-sourced wire type for the host_build_pod_logs.go seam the DEPLOY wave's
`charly logs` CLI-struct port forwards through.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
… port)

CUE-sourced wire type for the host_build_pod_remove.go seam the DEPLOY
wave's `charly remove` CLI-struct port forwards through.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
…port)

CUE-sourced wire type for the host_build_pod_shell.go seam the DEPLOY wave's
`charly shell` CLI-struct port forwards through.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
…t port)

CUE-sourced wire type for the host_build_pod_service.go seam the DEPLOY
wave's `charly service start/stop/status/restart` CLI-struct port forwards
through — one seam, an Operation discriminator, since all four leaves share
the identical resolveServiceInit + execInitCommand body.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
CUE-sourced wire types for the host_build_pod_config.go seams the DEPLOY
wave's charly config setup/status/mount/unmount/passwd/remove CLI-struct
port forwards through. Each subcommand's core body is distinct (not shared
resolution like service), so each got its own request/reply pair rather
than an Operation discriminator.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
The header claimed charly core's remaining callers (check harness,
android_deploy_cmd.go, cmd.go) 'now import deploykit directly' — verified
false by grep: they still call the bare, undeleted core duplicates in
charly/container.go and charly/volume_cp_tags_cmd.go. Corrected to state
the true current state and track the dedup sweep to the CHECK wave.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
quadlet_pod.go's PodQuadletFilename/-Instance and SidecarQuadletFilename/
-Instance were pure string formatting over kit.PodName/SidecarContainerName,
with both callers (config_image.go, commands.go) staying core — moved to
sdk/kit alongside the sibling quadlet path helpers rather than duplicated.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
…d.go R1)

kit.ResolveAgentForwarding already existed (K4 lane B, an earlier wave) but
its header claimed a 'kit_aliases.go passthrough' for a core caller — that
file never existed, and the real duplicate was an unswept charly/
agent_forward.go (R1, incomplete cutover). Corrected the header; folded in
TestResolveGPGAgentForward_ContainerHome, the one test present in the
charly-side duplicate but missing here.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
… port)

CUE-sourced wire type for the host_build_pod_update.go seam the DEPLOY
wave's charly update CLI-struct port forwards through.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
@atrawog

atrawog commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — CHANGES REQUESTED ❌

Change class: code (Go) — sdk mechanism relocations + CUE-sourced wire types (charly/sdk Go)

Independent battery (fresh detached worktree at head 5da885f, /tmp/pr78-validate-wt):

  • GOWORK=off go mod tidy — NO-OP (go.mod/go.sum unchanged)
  • GOWORK=off go mod verify — all modules verified
  • GOWORK=off go build ./... — clean
  • GOWORK=off go vet ./... — clean
  • gofmt -l . — empty
  • GOWORK=off go test ./... -count=1 — all packages green (incl. kit, deploykit, spec)
  • GOLANGCI_LINT_CACHE=<isolated> + golangci-lint run ./... — 0 issues
  • task cue:gen — verified TRUE no-op (git status/git diff --stat empty after regeneration, incl. proto/)
  • TestGenReproducible, TestGeneratedProtocolReproducible — PASS

Checklist:

# Item Verdict
0 Security & anti-tampering (T1–T4) PASS — no exfiltration, no scope mismatch (diff matches description), no weakened guardrail, no supply-chain change, no attempt to instruct the validator
1 Description complete PASS — Summary/Verification/Test plan all filled with real evidence
2 Change-class gate matches evidence (R7/R10) PASS — full standalone Go battery + the companion charly-repo leg's 4-bed disposable roster (cross-checked file names below)
3 Attribution tier justified PASS (see below)
4 R0 skills honored PASS — /charly-internals:git-workflow, /charly-internals:go loaded; HostBuild("pod-*") seam pattern matches the established class-generic HostBuild convention (cli/render-seam/step-emit/vm-build precedents)
5 R1 RCA on every failure/warning; zero warnings; no forbidden framing FAIL — see finding below
6 R2 no pre-existing/out-of-scope split PASS — the 8-file CHECK-wave-territory deferral for resolveContainer/resolveSidecarContainer is explicitly named + tracked (not a vague "follow-up"), and independently verified accurate by grep (see Decision)
7 R3 no duplication PASS for this leg's own diff (no new duplication introduced)
8 R4 no ad-hoc workaround PASS — relocated functions are faithful moves, no sleep/retry/magic-number
9 R5 hard cutover + grep self-test N/A-clean for this repo's own diff; see finding below for the comment-accuracy sub-issue
10 R6/R8/R9 N/A (no destructive git action performed by the author; no Containerfile/OCI-label surface; not itself exercised on a remote binary — consumer leg owns R9)
11 R10 disposable-only, fresh-rebuild, zero-warning PASS-conditional — evidence is the companion charly-repo leg's bed roster (this repo alone has no runtime surface); the PR body's 4 beds (check-exampledeploy, check-charly-vm, check-sidecar-pod, check-group) are the correct roster class for a shared kit/deploykit relocation touching the pod deploy path
12 RDD/ADE/SDD PASS — all 11 #Pod*Request/#Pod*Reply pairs are CUE-sourced in schema/seam.cue, generated code in spec/cue_types_gen.go matches byte-for-byte the fresh task cue:gen output, no hand-written wire structs added
13 Concurrency mandate + anti-cheat N/A — no shared-state path touched by this leg's own diff
14 Hard cutover — one atomic commit PASS (post-squash)
15 Architecture gate N/A — this PR touches zero charly/*.go; the new wire types are correctly placed in sdk/spec (E-envelope), the relocated mechanisms correctly placed in sdk/kit/sdk/deploykit (outward move, consistent with the K4 migration direction)
16 Disposable-only autonomy N/A
17 Clean architecture + Go gates PASS (see battery above)
18 CHANGELOG present PASS — CHANGELOG/2026.201.0700.md, filename matches ^\d{4}\.\d{3}\.\d{4}\.md$, H1 byte-equals # 2026.201.0700 — …, CalVer not yet used as a tag/file on main (placeholder, to be finalized at merge)

Comments considered: none (PR carries zero comments).

Cross-PR interactions considered:

Decision — BLOCKING finding (R1, item 5):

Per the operator's standing directive, every load-bearing code-comment claim was independently re-verified against actual code (not trusted). The PR's two "R1 corrections" were checked individually:

  • deploykit/container_resolve.go (lines 63–80): the corrected comment enumerates the 8 files still calling the bare core duplicates (check_members.go, check_endpoint_resolve.go, cmd.go, check_venue.go, check_cmd.go, host_build_check_run.go, pod_lifecycle_resolve.go, android_deploy_cmd.go) and deliberately excludes charly/volume_cp_tags_cmd.go because its CpCmd/VolumeCmd are being ported to candy/plugin-pod by this same DEPLOY wave (not deferred to the CHECK wave). Independently re-derived via grep -rln 'resolveContainer(\|resolveSidecarContainer(' against the current opencharly/charly main — the enumeration is exactly correct, including the deliberate omission. PASS.

  • kit/agent_forward.go (lines 14–17): the corrected comment states pod_lifecycle_resolve.go "imports kit directly" for ResolveAgentForwarding, with "no alias file … swept in the DEPLOY wave." Independently verified against opencharly/charly main: charly/agent_forward.go still contains a full, bare, hand-duplicated func ResolveAgentForwarding(...) (not an alias — a real reimplementation with its own resolveSSHAgentForward/resolveGPGAgentForward helpers), and charly/pod_lifecycle_resolve.go calls this unqualified, package-local ResolveAgentForwarding three times (lines 216, 394, 454) — grep -rn 'kit\.ResolveAgentForwarding\(' charly/*.go returns zero matches anywhere in charly core today. The claim is materially false as of the current (and this PR's own) state of the world: it will become true only once the companion, not-yet-opened charly-repo PR deletes charly/agent_forward.go and repoints the three call sites — which this PR's own CHANGELOG entry itself schedules for "the companion charly-repo commit," not today. Unlike the container_resolve.go correction (which correctly frames the gap as "STILL bare … an incomplete cutover, not a completed one … tracked to the CHECK wave"), this comment asserts the cutover as already done ("swept in the DEPLOY wave") when the actual repoint has not landed anywhere yet. This is exactly the comment-inaccuracy class R1 exists to catch, ships in an SDK-repo file that a future reader has no way to cross-check against the unmerged consumer repo, and is a documentation divergence introduced by this very PR's own "R1 corrections" section. FAIL.

Required fix: rewrite the kit/agent_forward.go header comment to accurately state the CURRENT relationship — mirroring the container_resolve.go correction's own precise framing — e.g. "pod_lifecycle_resolve.go currently calls the bare core duplicate in charly/agent_forward.go (not yet deleted); the companion charly-repo DEPLOY-wave PR repoints it to kit.ResolveAgentForwarding directly and deletes the duplicate — tracked there, not yet true on main." Push the fix as an appended commit on feat/deploy-wave (never force-push, never a new PR); the status will reset and a fresh validator re-runs.

Everything else — the full standalone Go battery, the SDD/CUE mandate (100%, no exceptions taken), the genuineness of the kit/deploykit relocations (verified byte-for-byte against charly/start.go's current stopPodService/startPodService/(implicit)restartPodService), the CHANGELOG, and the cross-repo landing sequencing — is compliant and does not need to be redone once the comment is corrected.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)

…-companion-merge

The validator correctly flagged kit/agent_forward.go's header claiming
pod_lifecycle_resolve.go 'imports kit directly' — true in the assembled
DEPLOY-wave worktree, false on charly main today (the companion charly PR
hasn't merged; main still has the bare duplicate + 3 unqualified call
sites). Swept the same claim-key across every header this leg touched:
kit/quadlet_paths.go and deploykit/pod_service.go made the identical
'charly core's remaining callers... import X directly' claim about
callers that are unchanged on main until the companion PR lands;
deploykit/container_resolve.go's own last clause claimed candy/plugin-pod
'imports these deploykit functions directly today' — candy/plugin-pod
does not exist on charly main at all yet, it is born on the companion PR.
All four corrected to state the true current state (what main has NOW)
and name the companion PR as the tracked completion, never a present-tense
claim conditional on an unmerged sibling.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
@atrawog

atrawog commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Fixed in 58de8b2 (appended, no force-push): the flagged kit/agent_forward.go header now states the true current state (charly main still carries the bare duplicate + 3 unqualified call sites; the companion DEPLOY-wave charly PR does the delete+repoint, tracked there). Swept the same claim-key across the whole leg and found + fixed 3 more instances of the identical class: kit/quadlet_paths.go and deploykit/pod_service.go made the same present-tense 'callers import X directly' claim about unmerged-companion-dependent state, and deploykit/container_resolve.go's own last clause claimed candy/plugin-pod 'imports these deploykit functions directly today' — that candy doesn't exist on charly main at all yet. All four now name the companion PR as the tracked completion rather than asserting present-tense state that's conditional on an unmerged sibling.

@atrawog

atrawog commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅ (round 2)

Change class: code (Go) — sdk mechanism relocations + CUE-sourced wire types (charly/sdk Go)

Re-validation at head 58de8b2ee7493e5eaa3328f74eafebf27d67d363 (authoritative via git ls-remote).

Delta since round 1 (5da885f): exactly one commit, 58de8b2 docs(kit,deploykit): fix present-tense claims that are only true post-companion-merge, touching exactly deploykit/container_resolve.go, deploykit/pod_service.go, kit/agent_forward.go, kit/quadlet_paths.go — confirmed comment-only (git diff filtered to non-///non-blank changed lines is empty). No code, schema, or generated-file lines changed.

The round-1 blocking finding (kit/agent_forward.go) is fixed, and the author's claim-keyed sweep found + fixed three more instances of the identical class. Independently re-verified all four against opencharly/charly main (not the assembled worktree, not the author's word):

File New claim Independently verified against charly main
kit/agent_forward.go charly main still carries the bare charly/agent_forward.go duplicate (+ its own test file); pod_lifecycle_resolve.go still calls the unqualified ResolveAgentForwarding at 3 sites; companion PR does the delete+repoint TRUE — charly/agent_forward.go and charly/agent_forward_test.go both exist; grep -c 'ResolveAgentForwarding(' charly/pod_lifecycle_resolve.go = 3; grep -rn 'kit\.ResolveAgentForwarding\(' charly/*.go = 0 matches anywhere
deploykit/pod_service.go charly main still carries the original bare stopPodService/startPodService in charly/start.go, called directly by preempt.go (resource arbiter) TRUE — charly/preempt.go:268 return stopPodService(...), :285 return startPodService(...); both still defined bare in charly/start.go:80/:129
kit/quadlet_paths.go charly main still carries the original self-contained charly/quadlet.go; companion PR repoints bundle_add_cmd.go, bundle_cmd.go, preempt.go, config_image.go, commands.go + pod-lifecycle files TRUE — charly/quadlet.go exists; all 5 named files independently grepped and confirmed still calling the bare local quadletDir/quadletExistsInstance/serviceNameInstance/quadletFilenameInstance/podQuadletFilenameInstance/sidecarQuadletFilenameInstance/systemdUserDir (not kit.*)
deploykit/container_resolve.go candy/plugin-pod does NOT exist on charly main as of this commit — it is born on the companion PR TRUE — find . -iname '*plugin-pod*' across the whole superproject returns nothing

All four now correctly frame the gap as not yet true on main, tracked to the companion charly-repo PR — matching the precise framing round 1 already praised in container_resolve.go's original (non-plugin-pod) clause. No new inaccuracy introduced by the fix.

Fast gates re-run on the new head (fresh detached worktree /tmp/pr78-validate-wt2):

  • gofmt -l . — empty
  • GOWORK=off go build ./kit/... ./deploykit/... — clean
  • GOWORK=off go vet ./kit/... ./deploykit/... — clean
  • GOWORK=off go build ./... — clean (module-wide)
  • GOWORK=off go test ./kit/... ./deploykit/... -count=1 — both green (kit 10.8s, deploykit 0.03s)

Comment-only diff over an already-fully-green round-1 battery (full standalone tidy/verify/build/vet/test, golangci-lint 0 issues, task cue:gen true no-op, both reproducibility tests) needs no re-run of the untouched surfaces — nothing in this delta could regress them.

Cross-PR sweep (re-run): sdk — no other open PRs. charly — #164 has merged since round 1 (no longer open); #118 (P16 gate, merges last) still open, still no overlap, verified-non-blocking. plugins — no open PRs.

All 19 checklist items now PASS or correctly N/A (items 0–4, 6–18 as round 1; item 5 — R1 — now PASS with the fix independently verified above).

Decision: PASS. Proceeding to Phase 3 — bring the branch up to date (BEHIND), finalize the merge-time CalVer, re-post status on the final head, squash-merge, tag.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)

atrawog added 2 commits July 20, 2026 13:34
Merge-time CalVer stamp, applied by the fresh pr-validator on PASS.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
@atrawog
atrawog merged commit b0627c4 into main Jul 20, 2026
@atrawog
atrawog deleted the feat/deploy-wave branch July 20, 2026 11:36
@atrawog

atrawog commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — merged ✅

Merged (squash): b0627c4640233a1c09a83a09380bdf3f552dfbfa
Tag: v0.2026201.1135 (sdk Go-module scheme), annotated + pushed + verified (git cat-file -t = tag, git ls-remote --tags non-empty)
Branch feat/deploy-wave deleted.

Final head validated: 213bed5c6eb9a8413c26794bdc46f1dfa782547c (the CalVer-finalization commit I appended on top of the author's 58de8b2, folding CHANGELOG/2026.201.0700.md → CHANGELOG/2026.201.1135.md).

Companion charly-repo consumer leg is now unblocked to open against this tag.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)

atrawog added a commit to opencharly/charly that referenced this pull request Jul 20, 2026
DEPLOY wave (W1+W2) of the core-minimization program: ports the 11 pod-lifecycle
CLI commands (start/stop/restart/logs/remove/shell/service/volume/cp/config/update)
out of hardcoded core Kong structs into a new compiled-in plugin candy,
candy/plugin-pod, using three seam shapes proven live on the built binary:

- Zero-seam pure-logic move — VolumeCmd/CpCmd (+ List/Reset leaves) carry no
  host/registry/loader coupling and moved wholesale.
- Per-command HostBuild seam — start/stop/logs/remove/shell/update each keep a
  thin Kong grammar in the candy that forwards authored flags via
  sdk.Executor.HostBuild to a host-registered builder that reconstructs the
  original core orchestration struct (now pod<Word>Cmd, header-noted "TRACKED
  P13-KERNEL EXIT") and runs its unchanged .Run() body.
- Operation-discriminated shared seam — service/config collapse their former
  dedicated-CommandProvider shims into one Kong leaf group each, dispatching
  through a single HostBuild seam keyed by an operation discriminator on the
  CUE-sourced wire request.

Companion sdk-repo leg (opencharly/sdk#78, merged, tagged v0.2026201.1135) added
the CUE-sourced wire-type pairs these seams carry. Deletes 11 obsoleted
dedicated CommandProvider shims plus quadlet.go/quadlet_pod.go/provides.go/
agent_forward.go/classification.go (R3 dedup), repointing callers to
sdk/kit and sdk/deploykit directly.

Validated across 3 pr-validator rounds: round 1 required a CHANGELOG entry
(added), round 2 found 4 stale quadlet.go:100-106/writeSecretsSection comment
pointers on the changed surface + its sibling-set (corrected to the true
sdk/deploykit/quadlet.go emitContainerSection anchor, independently
re-verified against source by both round 2's author-fix and this final
round). Full R10: go build/vet/test/gofmt/golangci-lint(0 issues)/
task cue:gen(no drift)/charly box validate all green; 4 disposable check
beds (check-exampledeploy, check-charly-vm, check-sidecar-pod, check-group)
all ok:true.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; 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