Skip to content

feat(sdk): in-proc CLI dispatch primitive (#52) + pod-lifecycle wire carriers (K4) - #43

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 sdk contract half of the K4 deploy-lifecycle deep-body move (superproject PR lands second, bumping the sdk pointer). Two purely-additive additions:

  1. clidispatch.go (+ clidispatch_test.go) — the feat(deploy): K4-B — OpCompile + PlanFromView + the deploy-compile seam types #52 fix at the shared root. RunInProcCLI / ParseInProcCLI wrap kong's in-process dispatch with a panic-sentinel (kong.Exit → recoverable panic → *ExitCodeError), so a subcommand --help returns 0 (was exit 80) and a real exit code propagates — fixed once, uniformly, for every command plugin (R3). 8 regression tests that FAIL without the fix.
  2. schema/seam.cue — two CUE-sourced pod-lifecycle wire carriers (SDD). #PodLifecyclePlan (host-resolved start/stop plan) + #PodExecReply {output, exit_code} (the captured-exec reply for the charly service move, exit-code-faithful). Regenerated into spec/cue_types_gen.go via task cue:gen (purely additive; no @go(-), no disjunction).

Change class

Code (sdk contract) — runtime tier via the superproject's K4 bed roster.

R10 evidence (exercised by the superproject half)

  • charly check run check-sidecar-pod: PASS (steps=11) — the pod plugin's podStart/podStop/podExec decode #PodLifecyclePlan/#PodExecReply against a fresh charly update rebuild.
  • charly check run check-commands-local: PASS (steps=5) — the #52 --help paths across command plugins.
  • Direct live proof: charly service status (reprinted keepalive RUNNING, exit 0), charly stop/start/post-restart — all exit 0 on the real pod.

Static gates

task cue:gen reproducible (TestGenReproducible); go build + go test ./... + golangci-lint run (0 issues) + gofmt clean. Rebased onto origin/main (3968a3b); cue:gen reproducible post-rebase.

R0–R10

Tier: fully tested and validated.

Assisted-by: Claude (fully tested and validated)

https://claude.ai/code/session_01LEPDwaNUu2J5zk5Doyamqu

…carriers (K4)

The sdk contract half of the K4 deploy-lifecycle deep-body move (superproject half separately).

clidispatch.go: RunInProcCLI / ParseInProcCLI — a kong panic-sentinel primitive converting kong's os.Exit into a recoverable *ExitCodeError, fixing the #52 subcommand --help fall-through (exit 80 -> 0) uniformly across every command plugin. clidispatch_test.go ships 8 regression tests that FAIL without the fix.

schema/seam.cue: #PodLifecyclePlan (the host-resolved pod start/stop plan the plugin's OpStart/OpStop execute) + #PodExecReply {output, exit_code} (the captured-exec reply for the 'charly service' move, exit-code-faithful). Regenerated into spec/cue_types_gen.go via task cue:gen, purely additive.

Verified: task cue:gen reproducible (TestGenReproducible); sdk go build + go test + golangci-lint (0 issues) + gofmt clean. Exercised end-to-end by the superproject K4 bed roster (check-sidecar-pod PASS steps=11, check-commands-local PASS steps=5).

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 (sdk contract — Go + CUE/SDD)

Fresh independent re-validation (new context, author claims not trusted). One blocking finding; the rest of the PR is otherwise sound.

🔴 BLOCKING — the committed go.sum is incomplete; the sdk module does not build/vet/test/lint standalone

clidispatch.go adds github.com/alecthomas/kong as a new direct dependency, but the committed go.sum at baa6c68 is missing the /go.mod hash lines for the modules the bump pulls in:

github.com/alecthomas/kong    v1.15.0/go.mod
github.com/fatih/color        v1.15.0/go.mod
github.com/mattn/go-colorable v0.1.13/go.mod
github.com/stretchr/testify   v1.11.1/go.mod

Reproduced in a fresh detached worktree at baa6c68, standalone (GOWORK empty):

go build ./...          → exit 1: github.com/alecthomas/[email protected]: missing go.sum entry for go.mod file
go vet ./...            → exit 1  (same)
go test ./...           → FAIL github.com/opencharly/sdk [setup failed]
                          the ROOT package (clidispatch.go + clidispatch_test.go) does not compile,
                          so the 8 #52 regression tests — the fix's OWN check-coverage — never run.
golangci-lint run ./... → exit 1  (typecheck: could not import kong / go-plugin→go-hclog→fatih/color)

RCA (root cause, not dismissed): the static gates were evidently run through the superproject go.work workspace, whose member modules' go.sums (the command-plugin modules — all correctly tidied, kong v1.15.0/go.mod present) supply the missing hash in the workspace union, masking the incomplete standalone sdk go.sum. But the sdk is the tagged contract module consumed standalone by out-of-tree plugin modules (require github.com/opencharly/sdk @tag) and by CI — standalone it does not build. So the PR body's claim "go build ./... + go test ./... + golangci-lint (0 issues) + gofmt clean on the sdk module" is false for the committed standalone tree.

Bounded fix: cd sdk && go mod tidy, commit the completed go.sum (+10 lines, go.sum only), re-push feat/k4-collection in place (never force-push; the status resets and I re-run). Verified in a throwaway worktree: after go mod tidy the code is sound — build/vet/test all exit 0, all 8 clidispatch #52 regression tests PASS, gofmt clean, and go mod tidy touched go.sum only.

✅ Otherwise sound (will re-validate fully after the fix)

  • SDD: #PodLifecyclePlan + #PodExecReply are CUE-sourced in schema/seam.cue, regenerated into spec/cue_types_gen.go — no disjunction, no @go(-), no hand-written wire struct. (The TunnelConfig/TunnelPort reorder in the generated file is a gengotypes artifact of #PodLifecyclePlan referencing #TunnelConfig; I'll confirm task cue:gen reproducibility once the module builds.)
  • R3: #52 fixed once at the shared clidispatch root (the kong.Exit panic-sentinel), not per-plugin.
  • R5: purely additive — no deleted identifiers. gofmt clean.
  • Security (T3): the kong/fatih-color/testify version bumps are legitimate (kong is a real dep of the new dispatch code); hashes resolve via proxy.golang.org. No exfiltration / scope-mismatch / weakened-gate finding.

Checklist

  • [PASS] 0. security & anti-tampering
  • [PASS] 1. description complete
  • [FAIL] 2. change-class gate ↔ pasted evidence (claimed static gates do not pass on the committed standalone tree)
  • [PASS] 3. attribution tier would be justified once buildable
  • [PASS] 4. R0 skills honored
  • [PASS] 5. R1 (I RCA'd the build failure; no flake framing)
  • [PASS] 6. R2 · [PASS] 7. R3 · [N/A] 8. R4 · [PASS] 9. R5
  • [FAIL] 11. build integrity — module does not build standalone
  • [PASS] 12. SDD (CUE-sourced carriers) — pending the reproducibility re-run
  • [PASS] 14. one atomic commit
  • [FAIL] 17. go gates — go build/vet/test/golangci-lint all fail standalone
  • [PASS] 18. CHANGELOG present (placeholder)

Decision: CHANGES REQUESTED. The sdk contract module must build standalone (it is tagged and consumed out-of-tree). Run go mod tidy in the sdk module, commit the completed go.sum, and re-push in place. Everything else in this PR is sound and will pass on re-validation.

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

atrawog added 2 commits July 14, 2026 03:52
…HAIN round)

The kong 1.14->1.15 bump (via clidispatch.go) was tidied on the command-plugin modules but not on sdk itself; the go.work UNION masked the gap, so the committed standalone tree failed 'GOWORK=off go build/test' with 'missing go.sum entry for [email protected] / fatih/color'. GOWORK=off go mod tidy completes the standalone go.sum (+10). sdk is the tagged contract module consumed standalone by out-of-tree plugins, so standalone-clean is mandatory. Verified: GOWORK=off go build ./... + go test ./... (all 8 clidispatch tests RAN + PASSED standalone, no cache) + golangci-lint (0).

Assisted-by: Claude (fully tested and validated)

Claude-Session: https://claude.ai/code/session_01LEPDwaNUu2J5zk5Doyamqu
@atrawog
atrawog merged commit 529df36 into main Jul 14, 2026
@atrawog
atrawog deleted the feat/k4-collection branch July 14, 2026 02:08
atrawog added a commit to opencharly/charly that referenced this pull request Jul 14, 2026
… pod plugin over F6 (+ #52)

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
(pod_lifecycle_{dispatch,resolve,verb}.go host-resolve `spec.PodLifecyclePlan`) + the host-process
arbiter BRACKET (acquire before OpStart / release after OpStop / release on failure). Inline
runDirect / runQuadlet / stopUnmountIfRequested bodies DELETED (R5 grep clean). Folds in the shared
command-plugin `--help` fix (#52) at the sdk clidispatch root, wired across
alias/box/bundle/check/migrate/status/vm; the parseLeaf (done,err) integration also extends the
#52 discipline to `charly box inspect` (R2, an interaction with #102 already on main).

shell / logs-follow / cmd stay M-core rows (F12/#62 — can't ride Invoke-and-reply); restart is
thin-core (K5) — named exits, not incomplete seams.

Depends on sdk v0.2026195.204 (opencharly/sdk#43, merged 529df36) — the clidispatch primitive +
#PodLifecyclePlan/#PodExecReply carriers; the sdk gitlink + charly/go.mod require are finalized to
that merged commit here (B2). go.sum completed for the kong v1.15.0 bump (validator fix round).

Validated (fresh worktree, merged sdk gitlink): workspace go build/vet/test + golangci-lint 0 +
gofmt clean; charly module GOWORK=off go mod verify = all modules verified; `charly box validate`
clean; pluginsgen + cue:gen reproducible. Runtime: the concurrent 6-bed disposable roster all
green through a fresh `charly update` (check-sidecar-pod ok:true with the new K4 check steps
service-status-output-present + sidecar-pod-restarted PASS; check-commands-local; the VM lanes
check-substrate/check-charly-vm/check-local-vm/check-k3s-vm all EXIT 0).

Assisted-by: Claude (fully tested and validated)
@atrawog

atrawog commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

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

Change class: sdk contract Go + CUE/SDD. Re-validated at head 78cf465 after the fix round.

The fix baa6c68..78cf465 is go.sum-only, +10 lines (the missing /go.mod transitive hashes for the kong bump) — the reviewed code is unchanged. Standalone re-validation (fresh detached worktree, GOWORK empty):

Runtime: the #PodLifecyclePlan/#PodExecReply carriers are exercised by the superproject K4 bed roster — check-sidecar-pod ok: true through a fresh charly update, with the new service-status-output-present + sidecar-pod-restarted check steps PASS. Tier fully tested and validated justified.

Decision: APPROVED, merged (squash) 529df36, tagged v0.2026195.204.

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

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