Skip to content

feat(kit): check ENGINE + host seams + exit-code contract (P12 sdk half) - #33

Merged
atrawog merged 4 commits into
mainfrom
feat/p12-check-plugin
Jul 13, 2026
Merged

atrawog merged 4 commits into
mainfrom
feat/p12-check-plugin

Conversation

@atrawog

@atrawog atrawog commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

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 candy
candy/plugin-check. Core becomes a plugin host; this PR ships the sdk surface the
relocated 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

  • P12a — kit/runner.go (the check ENGINE relocated into sdk/kit as a
    constructor-shaped library type; kit.NewRunner(kit.RunnerConfig{…})). Behaviour-neutral:
    charly check box is byte-identical across every --format before vs after.
  • P12b — the transitional check-family host seams + the exit-code contract:
    • schema/seam.cue: #CheckRunRequest (discriminated per-mode) + #CheckBedRequest/
      #CheckBedReply/#CheckBedMember/#CheckBedPrereqSkip (the op-discriminated
      check-bed host SESSION seam — BedDomain feat(kit): check ENGINE + host seams + exit-code contract (P12 sdk half) #33, group Members, 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): CheckRunReply grown — Score, Header, Passthrough.
    • 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.

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:

check-commands-local  ∥  check-sidecar-pod  ∥  check-group  ∥  check-local-vm  ∥  check-structkind
        PASS                  PASS               PASS             PASS               PASS
  • Round 1 caught a real defect in the relocated runner's group-UPDATE arm (a targetless
    group mis-resolved as a default pod on fresh-rebuild); fixed in-tree (the case IsGroup
    member-rebuild + members-down + re-bring-up + check-live-rebuild sequence) and re-verified.
  • Coverage: group-member build + the group REBUILD arm (check-group + the targetless-spec.Deploy
    check-structkind), VM nested-local-children (check-local-vm), the exit-code 2/3 paths
    (every bed), and cli .log combined-capture (all logs).

sdk-local gates (this repo, this branch's final code): gofmt -l clean · go build ./... 0 ·
go test ./... 0 · golangci-lint run ./... 0 issues · TestGenReproducible PASS (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 main via a merge of K1 (b95165f,
the loaderkit relocation) — ced48fe..7b305ed, a fast-forward — and the P12a changelog was
consolidated into the single CHANGELOG/2026.194.1800.md for the squash-merge. The resulting head
tree is byte-identical to the R10-validated tree.

Confidence

Assisted-by: Claude (fully tested and validated) — the full P12 acceptance roster ran GREEN against
the fresh rebuild, exercising the relocated code paths, with the group-update defect caught and fixed.

R0–R10 checklist

  • R0 skills loaded (check / go / git-workflow / cutover-policy / strict-policy)
  • R1 RCA on every failure (the round-1 group-update defect + the unstamped-binary artifact)
  • R2 no deferral — every surfaced issue fixed in-tree (the non-P12 --help fall-through flagged as its own cutover, correctly NOT folded)
  • R3 no duplication (single exit-code contract; bedCliReq refactor)
  • R5 hard cutover — transitional-free before the R10 acceptance run; deleted-identifier grep clean
  • R7/R8 generated artifacts verified (cue:gen reproducible; the compiled-in dispatch verified end-to-end)
  • R10 fresh-rebuild acceptance on disposable: true beds — the 5-bed concurrent roster GREEN

Assisted-by: Claude (fully tested and validated)

… 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
atrawog added a commit that referenced this pull request Jul 13, 2026
pr-validator version stamp for #33 sdk half (per-deploy VM domain identity).

Assisted-by: Claude (fully tested and validated)
atrawog added a commit that referenced this pull request Jul 13, 2026
#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)
atrawog added 2 commits July 13, 2026 17:49
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
@atrawog atrawog changed the title feat(kit): relocate the check ENGINE (Runner) into sdk/kit (P12a, sdk half) feat(kit): check ENGINE + host seams + exit-code contract (P12 sdk half) Jul 13, 2026
@atrawog

atrawog commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

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 7b305ed (7 files, +929/−0, pure additions).

Independent gate re-runs (mine): gofmt -l clean · go build ./... 0 · go vet ./... 0 · go test ./... ok · TestGenReproducible (forced -count=1) PASS · golangci-lint run ./... (v2.12.2) 0 issues · task cue:gen → git status CLEAN (reproducible no-op).

Reconciliation-merge legitimacy: tree diff 9c6e12d (claimed R10-validated linear tree) vs 7b305ed (PR head) = EMPTY → head tree byte-identical to the R10-validated tree. The 3 commits squash to one; main already carries K1 (b95165f), so the squash diff is exactly the 7 files.

SDD (verified positively): all check-family wire types (CheckRunRequest/CheckBed{Request,Reply,Member,PrereqSkip}/CheckConfig{Request,Reply}/CheckRunResults/StepScore/ScoreSummary) are CUE-sourced in schema/seam.cue → generated. CheckRunReply.Score uses CUE-sourced *spec.CheckRunResults (no alias). The hand-written kit/checkrun_seam.go invokes the LEGAL spike-proven exception — kit/checkresult.go:34 DeadlineExceeded bool json:"-" genuinely exists and is inexpressible in gengotypes; the go SKILL on main explicitly documents this exact spike. CliRequest.Combined (plain bool) rides the conversion-in-progress deploy_wire.go migration inventory (non-blocking).

Placement: CORRECT. kit/runner.go is a kind-blind, constructor-shaped M-mechanism (imports only stdlib + sdk/spec, no charly core, 3 injected host seams) consumed by host + candy/plugin-check → the right layer is an sdk kit. CUE wire contracts → spec (E-envelopes). Both check seams marked TRANSITIONAL/K-mortal in CUE comments + CHANGELOG.

R10 corroboration (on-disk, adversarial). The concurrent 5-bed roster on the assembled superproject: round 1 caught a REAL group-UPDATE-arm defect (check-group+check-structkind failed the update step — targetless group mis-resolved as a default pod), fixed in-tree and re-proven under concurrent load at round 2 (update → re-bring-up-members+check-live-rebuild, both green). The round-2 check-local-vm failure was root-caused from the actual error line to an UNSTAMPED guest binary (charly version → unknown, plan:vm:eval-host-vm:3) — a deterministic R9 build-artifact, NOT a concurrency race (all 9 other checks incl. every relocated-code path passed; the bed passed under equal concurrent load in round 1); re-run green 10/10 at 1530 with a stamped binary. Legitimate R1 RCA + re-run, not a "passed-on-idle" dismissal.

Decision: Every applicable rule (R0–R10 + RDD/ADE-N/A/SDD + concurrency + placement + security screen T1–T4) verified compliant against main's rule-set. Proceeding to finalize the merge-time CalVer, post the required status, squash-merge, and tag.

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
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