Repository navigation
feat(schema,deploykit,kit): K4 residual pod-deploy sdk leg (F12 wire types + ensure-image seam) - #66
Merged
Merged
Conversation
…nel externalization) Adds the CUE-sourced wire types the K4 keystone RDD spike proved sufficient for candy/plugin-bundle to own the `charly bundle add`/`del` dispatch control flow: DeployTreeResolveRequest/Reply, DeployNodeDispatchRequest/Reply, DeployMembersRequest/Reply, DeployDelResolveRequest/Reply, and DeployNodeDelDispatchRequest/Reply — replacing the monolithic DeployAddRequest/DeployDelRequest pair (deleted; the reconstruct-and-Run()-verbatim pattern they served is gone). Generated via task cue:gen from sdk/schema/seam.cue. Assisted-by: Claude Sonnet 5 (fully tested and validated)
…es → sdk Relocates the genuinely pure, project-loader-free helpers pod_lifecycle_resolve.go's quadlet path and charly core's remaining config_image.go/start.go/service.go/tunnel.go call sites both need, so a plugin candy (candy/plugin-deploy-pod) can import them directly instead of duplicating: the charly bridge-network mechanism (network.go), SSH/GPG agent-forwarding resolution (agent_forward.go), runtime data provisioning (data.go), the pod-security arg builders + direct-mode start argv (security.go, start_args.go), the entrypoint/init-def resolution (entrypoint.go), the quadlet/ systemd path helpers (quadlet_paths.go), the deploy-time engine resolver (box_engine.go), the tunnel label-metadata resolution (tunnel_metadata.go), the direct-deploy marker probe (direct_deploy.go), and a shared append_unique helper. kit cannot import deploykit (deploykit already imports kit), so anything needing a deploykit-only type (ResolvedBindMount, LoadDeployConfigForRead) lives in deploykit; everything else defaults to kit. Each file's owning unit tests moved with it. Claude-Session: https://claude.ai/code/session_01R8UGGr3ui1959oTb5JuSif
…roker set Extracts the resolver primitives K4's pod-deploy subsystem and K5's check harness both need, per the orchestrator's broker decision (union of the two cones' shared-caller traces). Split between sdk/kit and sdk/deploykit per the kit-cannot-import-deploykit constraint (deploykit already imports kit): - sdk/kit: IsHostNetworked/ContainerRunning (container_probe.go), ResolveBoxName + its ref-parsing helpers (remote_ref.go), ExtractMetadata/InspectLabels (box_metadata.go, ~330 lines, fully portable — every dependency resolves to stdlib/kit/spec), SidecarContainerName(Instance) (sidecar_naming.go), and the plugin-primary registry + ResugarPlan (plugin_primary.go, needed by MarshalBundleNode's plan-step round-trip). - sdk/deploykit: ResolveContainer/ResolveSidecarContainer (need ResolveBoxEngineForDeploy's LoadDeployConfigForRead), MarshalBundleNode + its bundleDiscForEntity/scalarFieldValue helpers (need SortedNestedKeys), and a new ResolveDeployBoxName(key, instance, *spec.ResolvedProject) — a portable twin of charly-core's existing LoadUnified-based resolver, for a caller (a plugin) that already holds a ResolvedProject envelope instead of a project loader; charly-core's own resolver stays unchanged (a cheap parse-only lookup every current caller, including the check harness, already uses). Adds the "ensure-image" F11 host-builder (charly/host_build_ensure_image.go, paired here as the CUE-sourced spec.EnsureImageRequest/Reply wire types) — a thin seam wrapping the existing, UNCHANGED EnsureImagePresent/ loadProjectCfgFromCwd, so a plugin's cold-start image-resolution fallback (after checking the two portable kit.LocalImageExists/TransferImage tiers itself) reaches the project-loader-coupled logic without duck-typing Config/ BuildCmd across the module boundary. The existing charly-core function bodies (resolveContainer, resolveBoxName, ExtractMetadata, etc.) are UNCHANGED — the check harness still calls them unqualified and hasn't moved to candy/plugin-check yet; deleting them now would break that cone before it rebases onto this extraction. Verified: go build/vet/test/lint clean (0 issues) on the whole sdk module; TestGenReproducible passes after the seam.cue regeneration. Claude-Session: https://claude.ai/code/session_01R8UGGr3ui1959oTb5JuSif
…om charly Adds the owning unit tests for deploykit.SecurityArgs (10 cases) and deploykit.BuildStartArgs (11 cases, including the 2 encrypted-bind-mount cases) — both functions already lived in sdk/deploykit from earlier K4 work, but their charly-core test coverage hadn't moved with them. Migrated verbatim (repointed to the exported deploykit names + spec.SecurityConfig), enabling charly core's redundant SecurityArgs/buildStartArgs re-definitions to be deleted in the paired charly commit. Verified: go build/test/lint clean (0 issues) on sdk/deploykit. Claude-Session: https://claude.ai/code/session_01R8UGGr3ui1959oTb5JuSif
…+ relocations Adds the deploy-overlay HostBuild seam (DeployOverlayRequest/Reply) the K4 pod-lifecycle inversion needs to fetch the per-host deploy-config overlay from inside the out-of-process plugin (LoadDeployConfigForRead only works in charly-core's own process today). Also adds the resolve-start-direct transitional seam types (ResolveStartDirectRequest, PodStartOpts, PodStopOpts) threading the raw CLI opts instead of a host-resolved plan. Relocates the remaining pure Kind-2 helpers this session classified: - deploykit/provides.go: FilterOwnProvides/AcceptedEnvSet/ResolveTemplate/ ValidateProvidesTemplate/PortMapFromMappings (from charly/provides.go, now deleted). - deploykit/secret_declare.go: SecretDeclaredOnBox/SecretDepNames/ SecretKeyForDep (from charly/config_secret_migration.go's pure third). - deploykit/sidecar_resolve.go: ResolvedSidecarFromSpec/SidecarTemplatesOf/ FindPodSidecarQuadlets/HasTailscaleSidecar (from charly/sidecar.go). - kit/sidecar_naming.go: PodNameInstance/SidecarConfigDir additions. - kit/container_image.go: ContainerImage/ContainerImageRef (from charly/commands.go — shared with check_endpoint_resolve.go, not pod-exclusive). Test coverage migrated with the code throughout. Assisted-by: Claude Sonnet 5 (analysed on a live system)
…odAttachOpts/PodLogsOpts Adds the CUE-sourced wire types for the F12 (charly shell/cmd/logs) plugin-side self-resolution: #PodShellOpts/#PodCmdOpts/#PodAttachOpts/#PodLogsOpts (sdk/schema/seam.cue), consumed by candy/plugin-deploy-pod's new resolve_f12.go. Interactive/WrapPTY are HOST-RESOLVED booleans (force_tty||isTerminal(); force_tty&&!isTerminal()) since the plugin is a subprocess whose own stdout is not the operator's terminal. Removes the now-dead #ResolveStartDirectRequest transitional seam type (its sole consumer, charly/host_build_resolve_start_direct.go, is deleted alongside charly/pod_lifecycle_resolve.go in the paired charly-repo commit) and updates the #PodLifecyclePlan/#PodLiveStdioPlan doc comments, which were stale (claiming host-side resolution after the quadlet-mode inversion already moved it plugin-side). Relocates TestLocalizePort from charly/shell_test.go to deploykit/quadlet_test.go alongside the LocalizePort helper it tests (a pure sdk function that never had a test in its own module). Verified: go build/vet/test/lint clean (0 issues); TestGenReproducible passes on the regenerated CUE types. Assisted-by: Claude Sonnet 5 (analysed on a live system)
… K4 branch Resolved: kit/box_metadata.go took origin/main's version (#64's own PR-validation already deduplicated its InspectLabels default against kit/local_image.go's InspectImageLabels — the R3 fix this exact race needed). kit/sidecar_naming.go took origin/main's base (PodName/SidecarContainerName/SidecarContainerNameInstance, canonical) plus my own PodNameInstance/SidecarConfigDir additions restored on top (unique to this branch, not part of #64's scope; SidecarConfigDir is a load-bearing charly/commands.go caller). Verified the other 7 shared files (box_engine.go, container_resolve.go, deploy_box_name.go, deploy_nodeform.go, container_probe.go, plugin_primary.go, remote_ref.go) auto-merged byte-identical to my prior content.
Renamed CHANGELOG/2026.198.0350.md to the actual merge-time CalVer (evaluator step, computed via date -u). Assisted-by: Claude Sonnet 5 (fully tested and validated)
Contributor
Author
Independent PR validation — PASSFresh worktree off merged main (efeac71, my #64 merge), trusting no author claims.
Renamed the placeholder CHANGELOG to the true merge-time CalVer before merging. Merging. |
atrawog
added a commit
that referenced
this pull request
Jul 17, 2026
…e-ref resolution Producer commits for the W0 subsystem moves (consumer: charly PR #141 — status_collector→plugin-substrate + `charly box merge`→plugin-box): - `ops.go`: `OpStatusCollectAll` ("status-collect-all") — the verb:status-fanout wire selector the relocated flat status collector dispatches on. - `kit/local_image.go`: `kit.ResolveShellImageRef` — shared image-ref resolution (registry/name/tag → full ref, newest-local-CalVer fallback) so the box-merge plugin and `charly/shell.go` share ONE source (R3), with 5-branch test coverage in `kit/local_image_test.go`. - `enginekit/engine_test.go`: `ContainerSnapshot.HostPortFor` coverage ported from `charly/status_test.go` (sdk-only method, zero core coupling). - Brought up to date with sdk main #66 via forward merge (no force-push). Fresh independent validation: `go build`/`go vet`/`go test`/`golangci-lint`/ `go mod verify`/`go mod tidy` all clean on the merged head; consumer-side names confirmed matching against charly PR #141. Assisted-by: Claude Code Anthropic Claude Sonnet 5 (analysed on a live system)
atrawog
added a commit
that referenced
this pull request
Jul 17, 2026
… (main-compat regression) sdk main >= #66 broke charly main's candy/plugin-bundle (spec.DeployAddRequest/ DeployDelRequest undefined) — the 4 wire types were live on the consumer's main and only dead on the unmerged K4 dispatch branch. Restored verbatim (byte-identical to the pre-removal definitions) + task cue:gen; they retire for real with the K4 dispatch.go cutover that removes their seams. #ResolveStartDirectRequest correctly stays removed (zero consumers on charly main). Validated independently: consumer liveness confirmed against real charly origin/main, restored text verified byte-identical, cue:gen reproducible (no-op), all Go gates clean (build/vet/gofmt/test/mod-tidy/mod-verify/lint 0-issues), and an isolated consumer-compile proof (candy/plugin-bundle fails against sdk@ab60ec6, passes clean against this fix) reproduced independently by the validator. Assisted-by: Claude Code Anthropic Claude Sonnet 5 (analysed on a live system)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of changes
Residual sdk leg for the K4 pod-lifecycle inversion, landing after sdk#64 (the
shared 9-function resolver extraction both K4 pod-deploy and K5 check-harness
consume). This branch independently authored the same 9-function extraction
~18 minutes apart from #64; #64 landed as canonical (it carries the extracted
functions' test coverage — R7). This PR merges origin/main (post-#64) and
keeps only what #64 does not carry:
schema/seam.cue+ generatedspec/cue_types_gen.go:#EnsureImageRequest/#EnsureImageReply(the F11 "ensure-image" HostBuild seam — a plugin'scold-start image-resolution fallback reaching the project-loader-coupled
EnsureImagePresentwithout duck-typing across the module boundary), and#PodShellOpts/#PodCmdOpts/#PodAttachOpts/#PodLogsOpts(the F12charly shell/cmd/logsplugin-side self-resolution wire types —Interactive/WrapPTYare host-resolved booleans since the plugin's ownstdout is not the operator's terminal). Removes the now-dead
#ResolveStartDirectRequesttransitional seam type.deploykit/provides.go+ tests: extended provides-template resolutionhelpers (
FilterOwnProvides,AcceptedEnvSet,ResolveTemplate,ValidateProvidesTemplate,PortMapFromMappings, etc.) relocated fromcharly/provides.go(pure, K4).deploykit/secret_declare.go+ tests:SecretDeclaredOnBox/SecretDepNames/SecretKeyForDeprelocated fromcharly/config_secret_migration.go(pure, K4).deploykit/sidecar_resolve.go+ tests:ResolvedSidecarFromSpec/SidecarTemplatesOf/FindPodSidecarQuadlets/HasTailscaleSidecarrelocated from
charly/sidecar.go(pure, K4).kit/sidecar_naming.go:PodNameInstance/SidecarConfigDir(this branch'sadditions on top of feat(kit,deploykit): K4 shared-resolver extraction — the 9-function broker set #64's
PodName/SidecarContainerName/SidecarContainerNameInstancebase) +kit/container_image.go:ContainerImage/ContainerImageRefrelocated fromcharly/commands.go.deploykit/quadlet_test.go: relocatedTestLocalizePortfromcharly/shell_test.goalongside theLocalizePorthelper it tests.Change class
charly-or-sdk Go
How R10-tested — exact gate, commands, and pasted output
module —
GOWORK=off go build ./... && go test ./... && golangci-lint run ./...on the whole module, plusTestGenReproduciblefor the CUEregeneration. This module has no runtime bed of its own; its real gate is
the CONSUMING charly pod-lifecycle chunk's
charly check run check-sidecar-pod, which already passed against this exact tree (see thatPR).
consuming charly chunk's
check-sidecar-podbed (12/12 steps, twice) isthe real-world proof this sdk leg's types work end-to-end; pasted in the
charly pod-lifecycle chunk PR.
#PodShellOpts/#PodCmdOpts/#PodAttachOpts/#PodLogsOptstypes aremarshaled/unmarshaled across the real host↔plugin wire in the
check-sidecar-podbed'scharly cmd/charly logssteps (candy/plugin-deploy-pod, the consuming PR).
#EnsureImageRequestexercises on everybed run that reaches
resolvePodRuntimeImage's cold-start fallback.Attribution tier
analysed on a live system
Harness rulebook compliance
/charly-internals:go(CUE schema pipeline),/charly-internals:git-workflow(this landing sequence).sdk-wt-val64) that no longer exists — RCA'd as a stale golangci-lint cache entry from a concurrent lint run in another worktree (V-133's validator), confirmed bygolangci-lint cache clean+ re-run → 0 issues. Not a real code issue.git diff origin/main...HEAD --statthat none of feat(kit,deploykit): K4 shared-resolver extraction — the 9-function broker set #64's 9 files appear as new/changed (onlykit/sidecar_naming.go's 22-line delta, my unique additions on top of feat(kit,deploykit): K4 shared-resolver extraction — the 9-function broker set #64's base).#ResolveStartDirectRequestfully removed;git grepconfirms zero remaining references outside historical-provenance comments in the consuming charly repo (verified there, this PR carries only the sdk-side removal).git status/no stash needed before the merge; resolved the two real ADD/ADD conflicts (kit/box_metadata.go,kit/sidecar_naming.go) deliberately, verified the other 7 shared files auto-merged byte-identical viadiffagainst my prior commit.check-sidecar-podbed.TestGenReproducible+ the relocated unit tests (provides/secret_declare/sidecar_resolve/quadlet all ported alongside their code).schema/seam.cuechanges regeneratedspec/cue_types_gen.goviatask cue:gen;TestGenReproducibleconfirms the regeneration is a no-op on a clean run.gofmt -l .clean (part of the build),golangci-lint run ./...0 issues,go vetclean (part of build),go test ./...green.CHANGELOG/2026.198.0350.mdstaged (placeholder CalVer).Assisted-by: Claude Sonnet 5 (analysed on a live system)