Repository navigation
feat(kit): check ENGINE + host seams + exit-code contract (P12 sdk half) - #33
Conversation
… half)
The sdk half of the P12 check-plugin cutover, landing FIRST (cross-repo producer order). The check-engine Runner — the host context the plan walk drives (RunOne/RunPlan consume it) — relocates from charly core into sdk/kit as an importable, constructor-shaped library type, so any plugin candy that runs a plan drives the SAME loop the in-core check engine uses.
kit/runner.go (new): Runner implements PlanContext and carries the shared engine state; CONSTRUCTOR-SHAPED (unexported state + accessor methods that ARE the interface — the same-named method/field collision is why the former core runnerPlanContext/runnerCheckContext were wrappers), built via kit.NewRunner(kit.RunnerConfig{}). Three injected host seams keep the host-coupled surfaces in charly core: PlanGrammar (VerbCatalog do-mode/context grammar), VenueResolver (the on: per-step venue swap), and the exported accessors read by charly's thin hostCheckContext wrapper (which keeps the 12-method kit.CheckContext, its 6 host-coupled legs staying core). runnerProbeNeverHangFallback is kit-local (R3, kit stays standalone). var _ PlanContext = (*Runner)(nil) locks the contract.
Behaviour-neutral (R10 = the parity gate): charly check box is BYTE-IDENTICAL across every --format (text/json/tap/junit) before(old-Runner)-vs-after, including the context-skip grammar seam. Verification post-rebase onto sdk origin/main (f0f37fa): go build/vet/test (kit 3.47s) green, golangci-lint 0, gofmt clean, TestGenReproducible green. The seam (#CheckRunRequest + kit.CheckRunReply) is DEFERRED to P12b and is not in this PR.
R10 fresh-rebuild live+box roster is the orchestrator's and PENDING; tier lifts to 'fully tested and validated' on the green roster.
Assisted-by: Claude (analysed on a live system)
Claude-Session: https://claude.ai/code/session_01P9yTC9hgMxbZVoL7W7EjrB
pr-validator version stamp for #33 sdk half (per-deploy VM domain identity). Assisted-by: Claude (fully tested and validated)
#33 sdk half) The sdk half of #33 — the libvirt domain is keyed by the DEPLOY, not the shared kind:vm entity, so sibling beds referencing one entity via from: get distinct charly-<deploy> domains, collision-free by construction. - vmshared.VmDomainIdentity(deployName): the per-deploy VM DOMAIN identity (strip vm:, flatten / and . to -) keying the libvirt domain / per-domain state / ssh alias / ssh-port. Pinned by vmshared/vm_domain_identity_test.go. - deploykit.VmChildExecutor + AppendHopForFlatPath: the nested-child SSH hop now derives SSHParamsForVm(VmDomainIdentity(<deploy path>)) instead of node.From (the shared entity), fixing the concurrent-VM-bed R10 defect where sibling beds collided on charly-eval-vm. VmChildExecutor drops its unused *BundleNode param (BREAKING; the sole in-tree caller is updated in the superproject PR). Pinned by deploykit/deploy_tree_test.go. - spec/deploy_wire.go: LifecyclePrepareInput field comments clarified per-deploy (comment-only). BREAKING CHANGE: deploykit.VmChildExecutor signature drops the *BundleNode param. R10: the consuming superproject VM-bed pair (check-builder-vm ok:true 9/192s ∥ check-substrate ok:true 9/178s), launched CONCURRENTLY on one binary, distinct domains + independent overlays + distinct cloud-init identities, fresh update, clean teardown. Round-1 failed at exactly the nested-child seam (Could not resolve hostname charly-eval-vm); round-2 passes with the fix. Go gates re-run by the validator: gofmt clean, go vet, go test green, golangci-lint 0 issues. Assisted-by: Claude (fully tested and validated)
Brings the merged K1 loaderkit relocation under the P12 sdk branch so the check-family relocation lands on current main. Clean merge (disjoint files: K1 = loaderkit; P12a = kit/runner.go).
…(P12 sdk half) The sdk-contract half of P12 (relocating the `charly check` / AI-harness command family into the compiled-in `candy/plugin-check`). Folds the P12a `kit/runner.go` ENGINE relocation (0ed24c5) into ONE sdk changelog (2026.194.1800) and adds the transitional check-family host seams + the exit-code contract the plugin resolves. - schema/seam.cue: `#CheckRunRequest` (discriminated per-mode envelope) + `#CheckBedRequest`/`#CheckBedReply`/`#CheckBedMember`/`#CheckBedPrereqSkip` (the op-discriminated check-bed host SESSION seam — `BedDomain` #33, group `Members`, `LocalChildKeys`) + `#CheckConfigRequest`/`#CheckConfigReply` (the check-project projection). Both check seams are TRANSITIONAL (K1/K5-mortal). Regenerated via `task cue:gen` (spec/cue_types_gen.go). - kit/checkrun_seam.go (new): `CheckRunReply` grown — `Score *spec.CheckRunResults`, `Header`, `Passthrough *StepPass` (nested-pod-in-VM guest delegation). - spec/deploy_wire.go: `CliRequest.Combined` — merges stderr into the captured stream so a check-bed step's per-step `.log` matches the pre-relocation capture. - exitcode.go (new): `sdk.ExitCodeError{Code,Err}` + `CheckFailExitCode` (2) / `CheckSkippedExitCode` (3) — the cross-module exit-code contract `main()` classifies. - kit/runner.go: `VmName` doc = the caller-set per-deploy DOMAIN identity (#33). sdk gates: gofmt clean · go build 0 · go test 0 · golangci-lint 0 issues · TestGenReproducible PASS (real run, cue:gen reproducible). R10: the full P12 acceptance ran on the assembled superproject — the 5-bed CONCURRENT roster (check-commands-local ∥ check-sidecar-pod ∥ check-group ∥ check-local-vm ∥ check-structkind) GREEN; round 1 caught + fixed the group-update arm in the relocated runner. Full narrative in the superproject CHANGELOG. Assisted-by: Claude (fully tested and validated) Claude-Session: https://claude.ai/code/session_01Bn3YTe8GTaPt9ccPqQ4m4t
pr-validator — APPROVED ✅Change class: code (sdk contract — CUE schema + generated Go + wire types + Go engine). Runtime tier. Fresh, independent re-derivation at PR head Independent gate re-runs (mine): Reconciliation-merge legitimacy: tree diff SDD (verified positively): all check-family wire types ( Placement: CORRECT. R10 corroboration (on-disk, adversarial). The concurrent 5-bed roster on the assembled superproject: round 1 caught a REAL group-UPDATE-arm defect ( Decision: Every applicable rule (R0–R10 + RDD/ADE-N/A/SDD + concurrency + placement + security screen T1–T4) verified compliant against Assisted-by: Claude (analysed on a live system) |
Merge-time version stamp applied by the fresh pr-validator (V-P12chain). Renames the placeholder CHANGELOG to the finalized CalVer + rewrites its H1. Assisted-by: Claude (fully tested and validated) Claude-Session: https://claude.ai/code/session_01CevG1zEmzDfCpXA3GKt8Wz
Summary
The sdk-contract half of cutover P12 — relocating the entire
charly check/AI-harness command family out of
charly/core into the compiled-in plugin candycandy/plugin-check. Core becomes a plugin host; this PR ships the sdk surface therelocated plugin resolves against.
This is leg 1 of a 3-PR B2 chain (dependency order): sdk (this) → plugins → superproject.
The consumer PRs (plugins skill-sweep, superproject gitlink bump + the full P12 core
relocation) land after this merges.
What this PR contains
kit/runner.go(the check ENGINE relocated intosdk/kitas aconstructor-shaped library type;
kit.NewRunner(kit.RunnerConfig{…})). Behaviour-neutral:charly check boxis byte-identical across every--formatbefore vs after.schema/seam.cue:#CheckRunRequest(discriminated per-mode) +#CheckBedRequest/#CheckBedReply/#CheckBedMember/#CheckBedPrereqSkip(the op-discriminatedcheck-bed host SESSION seam —
BedDomainfeat(kit): check ENGINE + host seams + exit-code contract (P12 sdk half) #33, groupMembers,LocalChildKeys) +#CheckConfigRequest/#CheckConfigReply. Both check seams are TRANSITIONAL (K1/K5-mortal).Regenerated via
task cue:gen(→spec/cue_types_gen.go).kit/checkrun_seam.go(new):CheckRunReplygrown —Score,Header,Passthrough.spec/deploy_wire.go:CliRequest.Combined— merges stderr into the captured streamso a check-bed step's per-step
.logmatches the pre-relocation capture.exitcode.go(new):sdk.ExitCodeError{Code,Err}+CheckFailExitCode(2)/CheckSkippedExitCode(3) —the cross-module exit-code contract
main()classifies.Change class
Code (sdk contract — CUE schema + generated Go + wire types + Go engine). Runtime tier.
R10 evidence — the full P12 acceptance (run on the assembled superproject)
Because the relocated bed RUNNER is the cross-cutting shared-state path, acceptance was the
CONCURRENT 5-bed roster (serial-green proves nothing), driven through the plugin runner on
the final transitional-free tree:
group mis-resolved as a default pod on fresh-rebuild); fixed in-tree (the
case IsGroupmember-rebuild + members-down + re-bring-up + check-live-rebuild sequence) and re-verified.
check-group+ the targetless-spec.Deploycheck-structkind), VM nested-local-children (check-local-vm), the exit-code 2/3 paths(every bed), and cli
.logcombined-capture (all logs).sdk-local gates (this repo, this branch's final code):
gofmt -lclean ·go build ./...0 ·go test ./...0 ·golangci-lint run ./...0 issues ·TestGenReproduciblePASS (real run — cue:gen reproducible).Landing-mechanics note (transparency)
This PR was updated in place (never closed/recreated, never force-pushed). The branch's original
pre-K1 P12a commit was brought up to date with current
mainvia a merge of K1 (b95165f,the loaderkit relocation) —
ced48fe..7b305ed, a fast-forward — and the P12a changelog wasconsolidated into the single
CHANGELOG/2026.194.1800.mdfor the squash-merge. The resulting headtree is byte-identical to the R10-validated tree.
Confidence
Assisted-by: Claude (fully tested and validated)— the full P12 acceptance roster ran GREEN againstthe fresh rebuild, exercising the relocated code paths, with the group-update defect caught and fixed.
R0–R10 checklist
--helpfall-through flagged as its own cutover, correctly NOT folded)bedCliReqrefactor)disposable: truebeds — the 5-bed concurrent roster GREENAssisted-by: Claude (fully tested and validated)