Repository navigation
refactor(sdk)!: #55 import-purity — spec re-exports, engine test suites, cloud-init provisioning fixes - #118
Conversation
…hAll from spec (import-purity) - schema.go: ProvidedCapability + StepContract → type aliases re-exporting from spec/capability (the 92 plugin candy call sites compile UNCHANGED); spec/spec import dropped (no longer used here), spec/capability added. CLISubcommand alias (climodel.CLISubcommand) kept — resolves through spec/climodel's re-export to capability.CLISubcommand. BuildCapabilities compiles UNCHANGED (alias = same type). - matchers.go: MatchAll + MatchValueString + MatchValueStrings → var re-exports from spec/spec (mirrors the clireflect var-BuildCLIModel precedent); private matchOne/matchNumeric dropped (moved to spec/spec, exercised by its own matchers_test.go). type Matcher = spec.Matcher kept. - matchers_test.go: TestMatchers kept (exercises the re-exports); 2 private-matchOne tests (TestMatcher_AllowlistRunnerSync, TestMatcher_AllOperators) moved to spec/spec/matchers_test.go. - go.mod carries NO local replace (workspace resolution provides local spec; terminus sets the real tag). GATE: go build ./... ok (local workspace resolving spec); go test ./... ok (sdk + 7 kits); gofmt clean. Assisted-by: Claude Code Claude Sonnet 5 (analysed on a live system)
…OnlyVar Relocated from charly/check_members_test.go (the #55 decoupling cone, Batch D): TestFilterHostVars and TestEffectiveEnv_HostVarsOverlay/ _NoHostVarsReturnsBase assert kit's own behavior directly with zero charly coupling, so they belong in kit's own test suite rather than charly/. The HOST:web:8080 compound-key case is folded into the existing TestIsRuntimeOnlyVar table (R3 — extends coverage instead of duplicating it).
Relocated from charly/*_test.go (the #55 decoupling cone, Batch D): empty-op no-verb failure, variable expansion (resolved + unresolved skip), unresolved-${HOST:...}-fails-vs-other-unresolved-skips, SkipDeterministicRun skipping a deterministic run: install step while agent-run: is not swept up as one, and per-step Origin re-stamping from the owning LabeledDescription. All assert kit.RunOne/kit.RunPlan's own wrapper semantics, driven through the existing fakePlanContext/fakeVerbResolver fixtures (planrun_test.go) rather than a directly-constructed charly hostVerbResolver — the construction path production no longer uses (the plan-walk engine moved plugin-side in the #55 CHECK-ENGINE cone). fakeVerbResolver now also captures the full *spec.Op it last saw, for asserting post-expansion/post-stamping field values.
…overage Relocated from charly/poll_probe_neverhang_test.go (#55 decoupling cone, Batch D): Runner.ProbeNeverHang's floor-vs-author-timeout calculation, and the load-robustness regression guard proving a single wedged probe is cancelled INDIVIDUALLY at ProbeTimeout while the pass continues to the next probe. Driven via r.Run against a real Runner with a tight ProbeTimeout and a commandVerbResolver dispatching to Exec().RunCapture (mirroring the real compiled-in command verb), so RunOne's own per-probe ctx-shadow — not test-only plumbing — is what cancels the wedge.
…onfig/ledger records/CloudInitRuntimeParams onto spec Second leg of the 3-repo B2 (spec -> sdk -> super): every call site that used to reference the sdk-native struct definitions now reads through a zero-churn type alias onto the spec.* types the previous spec-leg commit added, so every existing composite-literal / field-selector call site compiles unchanged. - buildkit.ResolvedBox = spec.BuildResolvedBox - deploykit.BundleConfig = spec.BundleConfig (Lookup/LookupKey moved with the type as spec methods) - kit.DeployRecord/CandyRecord/StepRecord = spec.DeployRecord/CandyRecord/StepRecord - kit.LedgerSchemaVersion = spec.LedgerSchemaVersion - vmshared.CloudInitRuntimeParams = spec.CloudInitRuntimeParams BREAKING (method-set cut): BundleConfig.DeployedContainerNames/ OccupiedHostPorts/GlobalEnvForImage were METHODS that reach sdk/kit (ContainerNameInstance/IsAutoPort/ParseHostPort) — spec can never import sdk/kit, so they demote to deploykit FREE FUNCTIONS taking *BundleConfig as the first parameter (deploykit.DeployedContainerNames(dc), etc). A whole-tree grep (charly/ + every candy incl. out-of-work + sdk itself) found exactly 8 call sites, all in candy/plugin-deploy-pod — fixed in the matching candy-leg commit. Verified: sdk builds + full test suite green against the new spec commit (via a local, uncommitted go.work override — go.mod's require stays on the last published spec tag until that tag is cut), gofmt/vet clean. Assisted-by: Claude Code claude-sonnet-5 (analysed on a live system)
…overage Neither compiler sub-function had isolated test coverage anywhere in the repo before this (confirmed by a repo-wide grep): CompileOpSteps was only ever exercised transitively via BuildDeployPlan or charly's own narrow verb-routing tests; CompileServiceSteps had exactly one direct caller, scoped to distro filtering alone. Adds 12 tests covering run-step filtering, runtime-only-context skipping, non-plugin-verb purity (zero HostBuild calls), the construct-step HostBuild round trip both ways (empty-reply fallback and typed-step-reply decode with reversals intact), error propagation, and the full service-lowering matrix (packaged vs custom, machine-venue gating, mixed-pair polymorphism, per-distro filtering, the render-service HostBuild round trip). Assisted-by: Claude Code Claude Sonnet 5 (analysed on a live system) Claude-Session: https://claude.ai/code/session_015CXB8CkzwZeXPzbqKjsuYj
…rly (#55 K4 cone3) charly/enc_test.go's remaining 6 tests (TestQuadletWithBindMounts + TestQuadletWithEncryptedBindMountsKeyring/NonKeyring + TestQuadletWithoutEncryptedMounts + TestCryptoPasswdRequiresUnmount + TestCryptoPasswdPasswordMismatch) were pure GenerateQuadlet/ QuadletConfig/ResolvedBindMount/IsEncryptedMounted/AskPassword/EncryptedPlainDir assertions with zero charly dependency. Diffed against the existing quadlet_test.go (has plain-Volumes coverage but no encrypted-bind-mount/keyring-backend/crypto-service paths) and enc_probe_test.go (covers the probe helpers but not the mock-driven CryptoPasswd flows) — confirmed non-duplicate, so relocated same-package-unqualified rather than deleted. Assisted-by: Claude Code Sonnet 5 (analysed on a live system)
Relocate the deploykit/loaderkit-testing portions of 6 charly test files (apk_format_test.go, refs_test.go, effective_version_test.go, ephemeral_classification_test.go, preempt_schema_test.go, checkspec_test.go) into their owning sdk kits, using literal spec fixtures instead of the charly loader: - sdk/kit: new TestExpandOpVars (checkvars_expand_test.go); 2 charly-side tests deleted as duplicates of existing TestTestVarRefs/TestIsRuntimeOnlyVar. - sdk/deploykit: new effective_version_test.go (TestComputeEffectiveVersions), preempt_effective_test.go (PreemptEffectiveStop/Restore), apk_format_test.go (TestCompileApkStep). - sdk/loaderkit: new validate_ephemeral_test.go (TestValidateVmNamingGuard), bakeplugin_effective_version_test.go (the bake_plugin->require implication cross-kit integration test, loaderkit already imports deploykit in prod so no cycle); scan_candy_test.go gains TestPopulateCandyApk. Assisted-by: Claude Code Sonnet 5 (analysed on a live system)
Each was a charly/*_test.go test asserting an sdk function directly with zero charly-core coupling — moved verbatim (with literal fixtures replacing any charly-testdata dependency) to the owning package's own test suite: - sdk/buildkit/render_test.go: the 3 RenderTemplate tests (rpm/pac/aur), with literal *spec.Format fixtures carrying the install_template TEXT the original charly/testdata/build.yml declared. - sdk/deploykit/bootstrap_test.go: TestRenderDnfConfWrite, using spec.Dnf directly instead of the vmshared.DnfConfig alias. - sdk/deploykit/init_def_label_test.go: the WriteLabels->ExtractMetadata round-trip half of charly's former TestInitDefLabel_RoundTrip, with a literal *spec.CapabilityInitDef fixture replacing the charly-embedded vocabulary (charly kept a slimmer sibling test for the embedded-vocab concern itself). - sdk/kit/planvalidate_test.go: TestValidatePlanSteps_Diagnostics. Each relocation was verified for duplicates against the destination package's existing test suite first; sdk/buildkit and sdk/deploykit already carried stronger coverage for TestHostPlatform/TestRenderPacstrapExtraConf/ TestGenerateRelayInitFragments/TestOCITarget_EmitElidesVenueSkipAndEmptyFragments, so charly's duplicate copies were deleted instead of moved (tracked in the sibling charly-core commit). Assisted-by: Claude Code Claude Sonnet 5 (analysed on a live system)
…ism unit tests Adds two literal-fixture unit tests that isolate mechanism-level claims a charly-side integration test used to prove only indirectly through a real LoadUnified/LoadBuildConfigForBox read: - TestMergedDeployTree_PerHostWinsOverCommittedNode: a per-host preemptible override wins over a committed project node, with committed fields preserved -- the merge itself needs no loader at all. - TestRunVenueBuilderStepRoutesHomeBuilders_LiteralFixture: a builder def shaped like npm/pixi/cargo (no LocalPkg, a phase.install.host cell) routes to the cross-host home-artifact builder by output shape, proven with a literal *spec.Builder instead of the real build.yml. Both are complementary to (not replacements for) the charly-side tests that still verify the real project/build config actually produces these shapes. Assisted-by: Claude Code claude-sonnet-5 (analysed on a live system)
…e db 404s the whole transaction check-local-vm's R10 check-live FAILED on a genuinely fresh eval-host-vm disk: cloud-init's pacman runcmd (bare -S) hit mirror 404s (go-2:1.26.4 rotated out of the mirrors while the cloud image's baked pacman db still referenced it), so rsync/go/git all failed to install and the bed's rsync delivery step broke. R1 RCA from the guest's cloud-init-output.log. Fix: -Syu (full refresh+upgrade before install; bare -Sy is the documented Arch partial-upgrade hazard). Non-pacman distros unaffected. Assisted-by: Claude Code Claude Fable 5 (analysed on a live system)
…the upgrade's new openssh otherwise wedges every connection The -Syu fix (e61725c) exposed the next layer: the full upgrade replaces openssh (10.4 adds a 4th default host key), and the live sshd then execs a NEWER sshd-session than its parent — 'internal error: hostkeys confused (config 4 recvd 3)' in the guest journal, EVERY connection reset against an otherwise-healthy guest, wait-for-sshd exhausting its 30m cap (observed live on both check-local-vm and check-k3s-vm). Fix: a systemctl try-restart of sshd/ssh.socket runs immediately after the pacman command (a no-op when sshd isn't started yet — the common path where composeRunCmd enables it later). Render tests updated for the 6-entry runcmd. Assisted-by: Claude Code Claude Fable 5 (analysed on a live system)
…ovision kernel upgrade breaks every modprobe Third layer of the same R10 finding chain: the -Syu (73ba131) upgraded linux 7.0.14→7.1.5 on the booted guest, deleting /lib/modules/7.0.14-arch1-1/ — modprobe overlay then FATALs, k3s's containerd cannot enable the overlayfs snapshotter, the server never becomes ready, and the kubeconfig wait exhausts even the raised 300s cap (guest journal evidence, check-k3s-vm). A cloud-init guest is provisioned on the kernel it booted and never needs a newer one mid-provision: --ignore linux/-lts/-zen/-hardened added. Render tests updated. Assisted-by: Claude Code Claude Fable 5 (analysed on a live system)
…all) — the full -Syu destabilized live guests three ways Final form of the R10-driven cloud-init chain. Run-4 guest evidence: with kernel exclusion the modules survived (uname 7.0.14, overlay loaded, k3s healthy) but the full -Syu still upgraded ~60 packages (systemd/glibc/openssh) taking ~5min — the k3s unit started at 16:10:13 and k3s.yaml landed 16:10:19, seconds past the 300s artifact wait that began ~16:05. The upgrade itself is the delay AND the destabilizer (kernel: modprobe dead; openssh: hostkeys-confused; systemd/glibc churn under live services). -Sy --needed installs ONLY the named packages + their dep closure against a fresh db: the 404 class stays fixed, the provisioning-time bloat and live-guest churn go away. The documented -Sy partial-upgrade hazard is ACCEPTED by design for a disposable minutes-lived provisioning guest (rationale in the code comment). sshd try-restart kept (guards a dep-closure openssh ride-along). Assisted-by: Claude Code Claude Fable 5 (analysed on a live system)
…rites at merge) Assisted-by: Claude Code Claude Fable 5 (documentation reviewed)
…#13 → 04c2754b) The B2 producer landed; the local-resolution note in the PR body is superseded — the module now builds against the published tag (full suite green, output in the PR body update). Assisted-by: Claude Code Claude Fable 5 (analysed on a live system)
…al title (the recurring round-2 finding class, fixed proactively) Assisted-by: Claude Code Claude Fable 5 (documentation reviewed)
pr-validator — CHANGES REQUESTED ❌Change class: charly/sdk Go (cross-repo consumer leg of #55) Head validated: Environment: validated via a linked Checklist
Comments considered: none — the PR carries zero comments. Cross-PR interactions considered: siblings DecisionFAIL. Fix required: either drop the unused Everything else reviewed (security screen, description completeness, R2–R5, R9/R10 chain consistency, SDD alias legitimacy, architecture placement, CHANGELOG) is compliant — this is a single, narrow, mechanically-fixable finding. Assisted-by: Claude Code Claude Sonnet 5 (analysed on a live system) |
… (unparam, round-1 validator finding)
Every call site passed a literal spec.CandyView{}; the helper now builds the bare named view itself. Fresh-cache golangci-lint: 0 issues; deploykit suite green.
Assisted-by: Claude Code Claude Fable 5 (analysed on a live system)
pr-validator — APPROVED ✅ (round 2)Change class: charly/sdk Go (cross-repo consumer leg of #55) Head validated: Environment: a fresh, independent clone of What changed since round 1Only two files, confirming the round-1 finding's fix and nothing else: Commit Checklist (full re-derivation, not a rubber-stamp of round 1)
Full live gate output (fresh independent clone, Comments considered: one — the round-1 Cross-PR interactions considered: DecisionPASS. The round-1 blocking finding (a real Assisted-by: Claude Code Claude Fable 5 (analysed on a live system) |
…rity leg CHANGELOG placeholder renamed + H1 rewritten to the merge-time stamp (sdk Go-module tag v0.2026215.1806). Assisted-by: Claude Code Claude Fable 5 (analysed on a live system)
Summary of changes
The sdk consumer/re-export leg of #55 (fe0e1d2→442cd6e). Full commit narrative in CHANGELOG/2026.215.1930.md (placeholder CalVer, H1 filename-matched). Concretely:
-Sy --needed(scoped refresh+install; the -Syu experiments' three failure layers documented in the chain's messages) + the sshd try-restart guard.442cd6ebuild(deps): spec pinned to the MERGED tag v0.2026215.1748 (spec#13 → 04c2754b) — the earlier local-resolution note is superseded.Change class
charly-or-sdk Go (cross-repo consumer leg). Chain: spec#13 (MERGED v0.2026215.1748) → sdk (this) → plugins#123 (MERGED v2026.215.1738) / pkg-arch#6 (MERGED v2026.215.1737) → charly#204.
How R10-tested — exact gate, commands, and pasted output
task build:binarycompiled charly against this sdk content (R9); the module gate below runs on the published spec tag.Attribution tier
analysed on a live system — module suites live against the merged tag + the roster's live provisioning; charly#204 owns the fresh-rebuild bed evidence.
Harness rulebook compliance
Assisted-by: Claude Code Claude Fable 5 (analysed on a live system)
https://claude.ai/code/session_015CXB8CkzwZeXPzbqKjsuYj