Skip to content

feat(deploy): K4 lifecycle deep-body move — start/stop/service → the pod plugin over F6 (+ #52) - #105

Merged
atrawog merged 3 commits into
mainfrom
feat/k4-collection
Jul 14, 2026
Merged

atrawog merged 3 commits into
mainfrom
feat/k4-collection

Conversation

@atrawog

@atrawog atrawog commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

The K4 deploy-lifecycle deep-body move. charly start / charly stop / charly service no longer carry their pod-lifecycle BODIES in core — the host RESOLVES a plan and the deploy:pod plugin EXECUTES it over the F6 substrate-lifecycle channel. Core keeps only kind-blind dispatch + the host-process arbiter bracket. Folds in the shared command-plugin --help fix (#52).

Depends on sdk PR opencharly/sdk#43 (the clidispatch primitive + #PodLifecyclePlan/#PodExecReply carriers). Land sdk first; the staged sdk gitlink (baa6c68) is finalized to the merged sdk#43 commit at merge (B2).

The move

  • start/stop → startViaLifecycle/stopViaLifecycle → ResolveTarget → LifecycleTarget.Start/Stop → F6 → the plugin's podStart/podStop (host resolves spec.PodLifecyclePlan; enc→verb:enc, tunnel→verb:tunnel via InvokeProvider). Inline runDirect/runQuadlet/stopUnmountIfRequested DELETED (R5 grep clean).
  • service → execInitCommand host-resolves the <engine> exec <ctr> <tool> <op> <svc> argv → LifecycleTarget.Shell → the plugin's podExec RunCaptures it → spec.PodExecReply {output, exit_code}; the host reprints output + propagates the EXACT exit code via *sdk.ExitCodeError (passthrough→capture, exit-code-faithful).
  • arbiter stays a host-process BRACKET (acquire before Start + release-on-failure; release after Stop).
  • shell/logs-follow/cmd = M-core rows (F12/refactor(build)!: the render engine moves to sdk/deploykit; charly keeps the host-side ENGINE (P8 consumer) #62 — can't ride Invoke-and-reply); restart thin-core (K5). Named exits, not incomplete seams.
  • refactor(check): core consumes the kit tag-expression surface (P5-unit-1 consumer) #52 fixed at the ONE sdk clidispatch root, wired across alias/box/bundle/check/migrate/status/vm.

Change class

Code / config — runtime tier.

R10 evidence (fresh-rebuild bed roster, all green)

  • charly check run check-sidecar-pod: PASS (steps=11) — service-status-output-present (reprinted keepalive RUNNING) + explicit charly stop→start both-directions, through a fresh charly update rebuild.
  • charly check run check-commands-local: PASS (steps=5) — refactor(check): core consumes the kit tag-expression surface (P5-unit-1 consumer) #52 --help paths.
  • Direct live proof on the real pod (fresh binary): charly service status (keepalive RUNNING, exit 0), stop/start/post-restart — all exit 0.
  • The orchestrator's VM lanes (banked): check-substrate / check-charly-vm / check-local-vm / check-k3s-vm — all EXIT 0.

Static gates

go build ./... + go test ./... (exit 0, pluginsgen reproducible) + golangci-lint (0) + charly box validate (0) + gofmt + R5 grep clean. Rebased onto origin/main (1dacada).

Rebase-integration fix (R2, surfaced by the post-rebase re-gate)

#102 (already on main) added plugin-box/inspect_list.go calling parseLeaf with the old 1-value signature; my #52 change made it return (done, err). Fixed both call sites (inspect_list.go + its test) with the shared (done, err) pattern — this also correctly extends the #52 --help fix to charly box inspect.

R0–R10

Tier: fully tested and validated.

Assisted-by: Claude (fully tested and validated)

https://claude.ai/code/session_01LEPDwaNUu2J5zk5Doyamqu

…pod plugin over F6 (+ #52)

charly start / stop / service no longer carry their pod-lifecycle BODIES in core: the host RESOLVES a spec.PodLifecyclePlan (quadlet/direct, container/svc, run_argv, engine, enc, tunnel) and the deploy:pod plugin EXECUTES it over the F6 substrate-lifecycle channel (podStart/podStop). service is a captured in-container exec (podExec RunCaptures the host-resolved argv, returns spec.PodExecReply {output, exit_code}; the host reprints output + propagates the exact exit code via *sdk.ExitCodeError — a passthrough->capture semantics change that stays exit-code-faithful). The inline runDirect/runQuadlet/stopUnmountIfRequested bodies are DELETED (R5 grep clean).

The arbiter stays a host-process BRACKET (acquire before Start + release-on-failure; release after Stop) — CHARLY_PREEMPT_LEASE is host-process state a placement-agnostic plugin cannot own. Interactive/streaming verbs stay CORE with named exits: shell/logs-follow/cmd = M-core rows (F12/#62 — cannot ride Invoke-and-reply); restart = thin-core (K5 verb-dispersal).

#52: the shared command-plugin subcommand --help fall-through (exit 80 -> 0) is fixed at the ONE sdk clidispatch root (RunInProcCLI/ParseInProcCLI), wired across alias/box/bundle/check/migrate/status/vm command plugins (R3).

Check-coverage: check-k8s-deploy-app composes check-keepalive (a queryable supervisord program, replacing a zero-program init); check-sidecar-pod gains service-status-output-present (a swallowing capture bug -> empty -> FAILS) + explicit charly stop->start both-directions steps. Boundary law (P16): core keeps only kind-blind dispatch + the DATA-projection plan FILL + the arbiter host-bracket; IMPORT-PURITY + ZERO-ALIASES intact (new files import sdk/spec only). FINDING-2: kong v1.15.0 propagated across 80 plugin go.mod/go.sum (approved).

R10 fresh-rebuild bed roster (all green): check-sidecar-pod PASS (steps=11) + check-commands-local PASS (steps=5), plus direct live proof (service capture+reprint / stop / start / post-restart, all exit 0 on the real pod). go build + go test ./... (exit 0, pluginsgen reproducible) + golangci-lint (0) + charly box validate (0) + gofmt + R5 grep clean. NOTE: the staged sdk gitlink (baa6c68) is finalized to the merged sdk PR #43 commit at merge (B2).

Assisted-by: Claude (fully tested and validated)

Claude-Session: https://claude.ai/code/session_01LEPDwaNUu2J5zk5Doyamqu
@atrawog

atrawog commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — CHANGES REQUESTED ❌

Change class: code / config (charly core + candy plugins; cross-repo — depends on sdk#43)

Fresh independent re-validation (new context, author claims not trusted). Two blocking items; the code-level move itself is sound.

🔴 BLOCKING-a (chain) — depends on the unmerged, currently-FAILING sdk#43

Per B2 the staged sdk gitlink (baa6c68) must be finalized to the merged sdk#43 commit at merge time. sdk#43 is CHANGES-REQUESTED (its go.sum is incomplete and the module doesn't build standalone) and unmerged, so this PR cannot be assembled or merged this round. The authoritative assembled-pair gates (go build/test both module roots, golangci-lint 0, charly box validate, task cue:gen + pluginsgen reproducibility) are deferred to re-validation on the fixed+merged sdk.

🔴 BLOCKING-b (own defect) — untidy charly/go.sum from the kong bump

charly/go.mod bumps alecthomas/kong v1.14.0 → v1.15.0. The go.sum diff removes both v1.14.0 lines but adds only kong v1.15.0 h1: — it drops the kong v1.15.0/go.mod line (on main the v1.14.0 entry had both). So charly/go.sum is now untidy — a new regression from this PR's bump. Its practical impact is workspace-masked (the super go.work.sum does not carry it, but the command-plugin member modules' go.sums do, covering it in the workspace union — so task build:charly still passes), but the committed go.sum is not tidy and a clean-tree gate requires it.

Fix (same round): cd charly && go mod tidy, commit charly/go.sum, re-push in place. (Do not pre-bump the sdk gitlink — the validator finalizes it to the merged sdk#43 at merge, B2.)

✅ Confirmed sound at code level (unlikely to change with the go.sum fix)

  • R5 grep CLEAN: runDirect / runQuadlet survive only in provenance comments ("relocated VERBATIM from StartCmd.runDirect"); stopUnmountIfRequested fully deleted; the inline start/stop bodies are gone (start.go −227). startPodService/stopPodService are legitimately retained as the host-process arbiter bracket (preempt.go), matching the PR's stated "arbiter stays a host BRACKET" design — no live core call to a deleted body.
  • R2/R3 — the parseLeaf fix: plugin-box/inspect_list.go (if done, err := parseLeaf("inspect", &g, args); err != nil || done) correctly adopts the new (done, err) signature and is in scope — it extends the #52 --help discipline to charly box inspect (an interaction with feat(check,box)!: check-config seam death + inspect/list -> plugin-box off the resolved-project envelope (Collection A) #102 already on main), fixed in-tree per R2. Not scope creep.
  • Architecture / placement: CORRECT. The move takes pod-lifecycle bodies out of core into the deploy:pod plugin over the F6 substrate-lifecycle channel; core keeps only kind-blind dispatch (pod_lifecycle_{dispatch,resolve,verb}.go host-resolve the #PodLifecyclePlan) + the host-process arbiter bracket (correct — the CHARLY_PREEMPT_LEASE is host-process state a placement-agnostic plugin cannot own). Net core-LOC negative; advances the plugin-host end-state (K4). shell/logs/cmd documented as M-core rows (F12/refactor(build)!: the render engine moves to sdk/deploykit; charly keeps the host-side ENGINE (P8 consumer) #62), restart thin-core (K5) — named exits, not incomplete seams. No new/grown alias, no new kit import into core. (Full re-derivation on the assembled pair deferred to re-validation.)

Checklist

  • [PASS] 0. security & anti-tampering
  • [PASS] 1. description complete (thorough)
  • [FAIL] 2. change-class gate — assembled-pair gate not runnable (chain)
  • [PASS] 5. R1 · [PASS] 6. R2 · [PASS] 7. R3 · [N/A] 8. R4 · [PASS] 9. R5
  • [FAIL] 11/17. build integrity / go gates — untidy charly/go.sum (+ assembled-pair gate deferred)
  • [PASS] 14. one atomic commit · [PASS] 15. placement CORRECT · [PASS] 18. CHANGELOG present

Decision: CHANGES REQUESTED. This PR is blocked on sdk#43 (which must be fixed + merged first), and independently carries an untidy charly/go.sum from the kong bump. Re-validation path (one round): (1) cd sdk && go mod tidy + push; (2) cd charly && go mod tidy + push. Once sdk#43 lands, I re-validate the assembled pair (super head + merged sdk gitlink) end-to-end. The lifecycle deep-body move itself is well-placed and clean.

Assisted-by: Claude (analysed on a live system)

atrawog added 2 commits July 14, 2026 03:58
…K4CHAIN round)

charly/go.mod requires kong v1.15.0 (CLI) but go.sum was missing the kong v1.15.0/go.mod hash — the go.work UNION masked it. SURGICAL fix: GOWORK=off go mod download github.com/alecthomas/kong github.com/fatih/color adds the missing go.mod hash (+1 line) WITHOUT touching go.mod requires.

NOTE: a full 'go mod tidy' is WRONG for charly — it is a WORKSPACE MEMBER whose compiled-in plugins are provided by go.work (main's charly/go.mod has ZERO plugin requires); tidy fetches 40+ plugin pseudo-versions and pollutes go.mod. So the sdk-style 'GOWORK=off go build ./... exit 0' gate does NOT apply to charly (its plugin imports are unresolvable standalone by design); the correct verification is 'GOWORK=off go mod verify' (all modules verified) + the workspace build (go.work). Both pass. sdk (the standalone-consumed contract module) got the full tidy — that gate DOES apply there.

Assisted-by: Claude (fully tested and validated)

Claude-Session: https://claude.ai/code/session_01LEPDwaNUu2J5zk5Doyamqu
@atrawog
atrawog merged commit af4337d into main Jul 14, 2026
@atrawog
atrawog deleted the feat/k4-collection branch July 14, 2026 02:16
@atrawog

atrawog commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅ (supersedes the prior CHANGES-REQUESTED)

Change class: charly core + candy plugins (cross-repo). Re-validated at head 6e31b1a (final commit dee6d72 = the merge-time sdk-gitlink + CalVer finalization).

Both prior blockers resolved:

  • charly/go.sum — the surgical go mod download (+1: kong v1.15.0/go.mod) is present; GOWORK=off go mod verify = all modules verified. Confirmed the correct gate for charly (a workspace-member module) via a control: on main, GOWORK=off go build ./... fails only on candy/plugin-* imports — architectural, pre-existing, not a defect. A full go mod tidy would (correctly) have been wrong here; the surgical fix is right.
  • sdk dependency — sdk#43 merged first (529df36, tag v0.2026195.204); the sdk gitlink (baa6c68 → 529df36) and charly/go.mod require (→ v0.2026195.204) are finalized here (B2).

Gates (fresh worktree, merged sdk gitlink): per-worktree binary built; charly go vet + go test ./... (incl. TestPluginsGenReproducible + reserved-word/bijection gates) + golangci-lint 0 issues + gofmt clean; plugin-box and plugin-deploy-pod (the +130-line lifecycle.go) build/vet/lint clean; charly box validate exit 0; no codegen drift. R5 grep clean; the parseLeaf (done,err) fix is correct + in-scope. Placement: CORRECT — pod-lifecycle bodies moved to deploy:pod over F6, core keeps kind-blind dispatch + the host-process arbiter bracket; advances the K4 plugin-host end-state.

Runtime R10 (corroborated read-only): the concurrent 6-bed disposable roster all ok: true through a fresh charly update — check-sidecar-pod (new K4 steps PASS), check-commands-local, and the VM lanes check-substrate/check-charly-vm/check-local-vm/check-k3s-vm. Tier fully tested and validated justified.

Decision: APPROVED, merged (squash) af4337d, tagged v2026.195.0215.

Assisted-by: Claude (analysed on a live system)

github-actions Bot pushed a commit that referenced this pull request Sep 6, 2026
… validation; pin spec v0.2026249.2231 (offline-fallback latest-tag) (#551)

* fix(check): gate the compiled-in plugin schemas BEFORE authored-input validation

A COMPILED-IN plugin unit registers its PROVIDERS at init() but its SERVED
SCHEMA only through the sync.Once loadBuiltinPluginUnits gate. A box-mode
check run inside a fresh container (charly check live on a deployed bed)
reaches runPluginVerb through an entry path that runs NO project plugin
load, so connectBakedPlugin resolves the init-registered builtin provider
immediately (registry hit, no connect) and validation ran against an EMPTY
input-def registry — every `plugin verb:*` check step failed with "no input
def registered (schema not loaded)" while the deploy phase (whose
loadDeployPlugins path runs the gate) passed. The kind-class dispatch
already gates before validating (runPluginKind); runPluginVerb now runs
the SAME idempotent gate before any resolve/validation, and a broken
builtin schema fails the verb loudly. The TDD repro test fails pre-fix
with the exact production message.

* chore: pin spec v0.2026249.2231 (offline-fallback latest-tag) + forced migration tail

Companion pin set required by spec v0.2026249.2231 (opencharly/spec #108 —
the persisted latest_tags cache is an offline fallback, never fresh data;
the stale-latest-tag RCA fix):

- spec v0.2026249.2030 => v0.2026249.2231 — the staleness fix itself: a
  fresh process now always re-probes the latest tag instead of serving the
  1h-TTL persisted entry (plugin refs resolved STALE v2026.242.0932 minutes
  after v2026.249.2212 was tagged).
- sdk v0.2026249.2036 => v0.2026249.2114 — forced: spec 2231 removed
  Deploy/FleetNode.IsGroup (spec #105); 2114 is the first sdk tag without
  the deleted guard (sdk #224).
- plugin-check v0.2026249.2119, plugin-fleet v0.2026249.2126,
  plugin-preempt v0.2026249.2116, plugin-migrate v0.2026249.2144 — forced:
  the same IsGroup migration in charly's compiled-in plugin candies.

Schema-floor tail (the migrate verb's own 2026.249.2125 stamp output, no
hand edits): charly/charly.yml version stamp + the hardcoded fixture
stamps in six test files the raised floor requires. The broader config
conversion (group-node rewrites) is NOT part of this PR.

* Revert "chore: pin spec v0.2026249.2231 (offline-fallback latest-tag) + forced migration tail"

This reverts commit 39d0bb9.
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