Skip to content

feat(kit): the check-engine plan walk lands in sdk/kit (P5) - #20

Merged
atrawog merged 2 commits into
mainfrom
feat/p5-check-engine
Jul 10, 2026
Merged

atrawog merged 2 commits into
mainfrom
feat/p5-check-engine

Conversation

@atrawog

@atrawog atrawog commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

P5 (check-engine SDK-ization) — the plan walk lands in sdk/kit. The producer half of one
cross-repo cutover (sdk lands first; the superproject consumer is opencharly/charly#55).

The check engine's plan walk — RunOne (per-op: skip/exclude/context handling, ${VAR}
expansion, venue swap, do-mode routing, the eventually: retry) and RunPlan/runUnit
(flatten by layer, mode-gated step selection, agent-step grading) — moves from charly core into
sdk/kit (planrun.go + planspec.go), so ANY plugin candy that runs a plan drives the SAME
walk the check engine uses.

Three kind-blind host seams (no concrete kind / provider word / ExecContext crosses them):

  • kit.PlanContext — the driver surface (mode, distros, env, venue swap, the per-verb
    EffectiveDo + ContextSkipReason the core VerbCatalog grammar computes). ExecContext
    lives in deploykit, which imports kit — so the grammar that consults it stays core behind
    these two methods; ExecContext never crosses the interface.
  • kit.VerbResolver — the verb-dispatch seam (the plan's ONE named blocker), satisfied by
    the core provider registry: RunVerb (resolve + run, in-proc or out-of-process) +
    RunProvisionAct (a do:act state verb).
  • kit.StepGrader — the agent-step grader.

Also moved (the plain data + pure helpers the walk consumes): LabeledDescription /
LabelDescriptionSet (+ IsEmpty), the DoMode enum, GraderRequest, and KeywordOf /
StepDoMode / StepID / EffectiveStepID / FilterHostVars.

Change class

charly/sdk Go (pure sdk library, additive) — cross-repo, sdk lands first. Order: this sdk PR
→ opencharly/charly#55 (the superproject consumer, which bumps the gitlink to this PR's tag).

How R10-tested — exact gate, commands, and pasted output

  • The gate: the plan walk runs in EVERY bed's plan filtering + dispatch, so this is a
    cross-cutting check-engine change — the gate is the full 18-bed disposable roster fanned out
    CONCURRENTLY
    against the integrated tree (this sdk walk via replace => ../sdk + the
    superproject consumer feat(deploykit)!: K5-Unit-1 Option A — clean kit of R-item, shrink seam to 1-op (#67) #55), PLUS the kit-standalone planrun_test.go.
  • Behaviour-neutral MOVE: the walk logic is relocated verbatim behind the interface; go test ./... is green in BOTH repos and every bed passes.
$ cd sdk && gofmt -l kit/ ; go vet ./kit/ ; golangci-lint run ./kit/
(clean) ; 0 issues.
$ cd sdk && go test ./kit/
ok  	github.com/opencharly/sdk/kit

# kit-standalone walk coverage (planrun_test.go) — each would FAIL without the moved walk:
  TestRunOne_SkipTrue / _ExcludeDistros / _ContextSkip / _UnknownVerbSkips /
  _DispatchPass (result stamped Op+Verb) / _ActDispatch
  TestRunPlan_VerifyOnlySkipsMutating / _AgentStepGraded (read-only agent-check) /
  _AgentStepNoGrader_StrictFails
  --- PASS (9/9)

$ go test ./charly/...    # integrated consumer, against this sdk via replace => ../sdk
ok  	github.com/opencharly/charly/charly

# R10 — full 18-bed disposable roster, CONCURRENT, binary 2026.191.2134:
check-group              0    535      PASS      check-substrate          0    305      PASS
check-charly-vm          0    423      PASS      check-local              0    414      PASS
check-k3s-vm             0    363      PASS      check-builder-local      0    327      PASS
check-k8s-deploy         0    736      PASS      check-udev-local         0    271      PASS
check-sidecar-pod        0    391      PASS      check-migrate-local      0    337      PASS
check-exampledeploy      0    395      PASS      check-feature-local      0    290      PASS
check-structkind         0    433      PASS      check-agent-local        0    405      PASS
check-doctor-local       0    317      PASS      check-commands-local     0    383      PASS
check-preempt-local      0    349      PASS      check-gpu-local          0    361      PASS
### failing beds: 0     ### orphan domains: (none)     ### orphan containers: 0

Attribution tier

fully tested and validated — the walk executed live across the full concurrent 18-bed roster on
a fresh rebuild (every bed runs it); go test green in both repos; the kit-standalone tests prove
the walk in isolation. The commit carries Assisted-by: Claude (fully tested and validated).

CLAUDE.md rule compliance — HOW each is satisfied (or N/A)

  • R0 skills: /charly-internals:go + /charly-internals:plugin (kit surface) + /charly-check:check loaded.
  • R1 RCA + zero warnings: all gates green, roster 18/18, zero warnings. One self-inflicted
    freshness-guard wash (editing .go comment files mid-roster bumped their mtime) was RCA'd —
    rebuilt so the binary post-dates all sources, orphan vm domains destroyed via charly vm destroy, roster re-run clean. No flake framing.
  • R2 no out-of-scope: the loader/harness-coupled check files stay core and move with P6/P12
    (the plan's own ordering) — not a deferral, a different cutover. Nothing parked from THIS scope.
  • R3 no duplication: the walk lives ONCE in kit; core drives it via the adapter.
  • R4 no ad-hoc workaround: the walk relocated behind interfaces; no sleep/magic-number/shim.
  • R5 hard cutover + grep: runOne/runUnit/keywordOf deleted from core (the consumer PR);
    no transitional/dual-mode path. This sdk PR is additive.
  • R6 git safety: branched off merged main; no destructive git action.
  • R7 runtime gate: the full end-to-end bed roster ran, not just go test.
  • R8 artifact invariants: N/A — no Containerfile/OCI-label generation change.
  • R9 binary == source: task build:charly rebuilt (2026.191.2134); no new OS dep.
  • R10 disposable + coverage: proven on disposable: true beds only, fresh rebuild, zero
    warnings; planrun_test.go would FAIL without the moved walk.
  • RDD: the highest-risk assumption (the kit↔deploykit import cycle) was proven empirically
    (go list -deps ./deploykit shows it imports kit) BEFORE designing the seam — which is why the
    grammar stays core behind PlanContext and ExecContext never crosses the interface.
  • SDD: N/A — no .cue/schema/wire/params/generated/proto file touched (sdk gen-repro green).
  • ADE: N/A — not a candy.
  • Kernel/plugin boundary law: moves a generic kind-blind MECHANISM (the plan walk) out of core
    into shared kit; the VerbCatalog grammar + registry dispatch stay core behind the E-seams.
  • Disposable-only autonomy: the roster's destroy/rebuild was on disposable: true beds only.
  • Hard cutover: ONE atomic commit; the whole walk + its test in one PR; no Phase-2/TODO.
  • CHANGELOG: CHANGELOG/2026.191.2100.md staged (placeholder CalVer; the pr-validator finalizes).

Assisted-by: Claude (fully tested and validated)

The check engine's plan walk — RunOne (per-op: skip/exclude/context handling,
variable expansion, venue swap, do-mode routing, the eventually: retry) and
RunPlan/runUnit (flatten by layer, mode-gated step selection, agent-step
grading) — dissolves out of charly core into sdk/kit (planrun.go + planspec.go),
so ANY plugin candy that runs a plan drives the SAME walk the check engine uses.

The walk reaches the host through three kind-blind seams:

 - kit.PlanContext — the driver surface (mode, distros, env, venue swap, the
   per-verb do-mode + context-skip the core VerbCatalog grammar computes). No
   concrete kind, no provider word, no ExecContext crosses it (ExecContext lives
   in deploykit, which imports kit — so the grammar that consults it stays core
   behind ContextSkipReason / EffectiveDo).
 - kit.VerbResolver — the verb-dispatch seam (the plan's ONE named blocker),
   satisfied by the core provider registry: RunVerb resolves + runs a verb (in-proc
   fast path or out-of-process Invoke), RunProvisionAct runs a do:act state verb.
 - kit.StepGrader — the agent-step grader (the host spawns the kind:agent CLI).

Also moved with the walk (the plain data + pure helpers it consumes):
LabeledDescription / LabelDescriptionSet (+ IsEmpty), the DoMode enum,
GraderRequest, and the pure step helpers KeywordOf / StepDoMode / StepID /
EffectiveStepID / FilterHostVars.

The host-serving atoms (endpoint/venue/container resolution, HTTP-do, the
provider registry, the CUE loader) STAY in core behind these seams — only the
vocabulary-independent walk moves. checkspec.go's VerbCatalog grammar +
opActsInBuildDeploy (registry-coupled) and the loader/harness-coupled check
files (readiness_config, check_score_kind, check_members resolution,
check_substitute) stay core — they move with the loader (P6) / harness (P12).

Check-coverage: planrun_test.go drives RunOne + RunPlan through a fake
PlanContext / VerbResolver / StepGrader — skip:/exclude_distros:/context skip,
unknown-verb skip, verb + provision-act dispatch (result stamped with Op+Verb),
verify-only skips mutating, agent-step grading (read-only agent-check, strict
vs lax no-grader) — each would FAIL without the moved walk.

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

atrawog commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Change class: charly/sdk Go — pure additive library move (cross-repo, sdk lands first; consumer is opencharly/charly#55).

Fresh, independent re-derivation (trusted nothing in the body). Every gate re-run by me.

# Rule Verdict
0 security / anti-tampering (T1–T4) PASS — 4 additive files; no secrets/exfil/network/eval; code matches description (the walk move); no security-machinery touched; no injection
1 description complete PASS — org template filled, evidence pasted
2 change-class gate (R7/R10) PASS — cross-cutting check-engine → full 18-bed concurrent roster + go test both repos; no dry-run/rebuild-alone fraud
3 attribution tier PASS — fully tested and validated justified: the walk executed live across the fresh-rebuild roster (binary 2026.191.2134)
4 R0 skills PASS — go/plugin/check honored; walk is a kind-blind MECHANISM
5 R1 zero warnings PASS — golangci 0, gofmt clean, vet clean; freshness-wash RCA'd to root (mtime guard) + fixed, not flake-dismissed
6 R2 no out-of-scope split PASS — P6/P12 are separate forward-motion cutovers; P5's R10 passes without them
7 R3 no duplication PASS — walk lives ONCE in kit; core drives via adapter; core runOne deleted in the consumer
8 R4 no ad-hoc workaround PASS — clean interface move; sendSIGTERM relocated verbatim
9 R5 hard cutover + grep PASS — sdk additive (0 deletions), no transitional/dual-mode; core deletion atomic in #55
10 R6/R8/R9 integrity PASS — no destructive git; R8 N/A (no gen); binary 2134 fresh, replace => ../sdk, no new OS dep
11 R10 disposable + coverage PASS — disposable-only, fresh rebuild, zero warnings, 18/18; planrun_test.go would FAIL on a broken walk
12 RDD / ADE / SDD PASS — RDD cycle proven (deploykit→kit); ADE N/A; SDD N/A (no cue/spec/proto/wire/param; moved structs are kit-model peers of CheckResult)
13 concurrency + anti-cheat PASS — roster fanned out concurrently (~12 min vs ~75 min serial); wash RCA'd to root, not idle/serial/load dismissal
14 hard cutover (one commit) PASS — ONE atomic commit; no Phase-2/TODO in scope
15 kernel/plugin boundary law PASS — ExecContext does NOT enter PlanContext (only 2 comment lines); no concrete-kind switch/map/field-read
16 disposable-only autonomy PASS — roster + my bed run on disposable: true only
17 clean arch + go gates PASS — gofmt/vet/golangci-0/test all green (re-run)
18 CHANGELOG PASS — CHANGELOG/2026.191.2100.md (placeholder; finalized at merge)

Independent evidence I re-ran:

  • go build ./... OK · gofmt -l kit/ clean · go vet ./kit/ OK · golangci-lint run ./kit/ = 0 issues · go test ./... all green · 9 walk tests PASS uncached.
  • go list -deps ./deploykit | grep sdk/kit → cycle is deploykit→kit; kit does NOT import deploykit → ExecContext (a deploykit type) cannot and does not cross the PlanContext seam.
  • Faithful move: kit.RunOne vs main:charly/checkrun.go runOne (the new settle() helper factors the identical Elapsed/Attempts/TotalElapsed early-return tail); RunPlan/runUnit vs main:charly/description_run.go. Every stage preserved: skip / exclude_distros / context-skip / venue-swap / var-expand / host-missing FAIL-vs-SKIP / DeadlineExceeded flag / TotalElapsed / do:act branch / unknown-verb skip / eventually: wrapper. No stage dropped.
  • Roster artifacts: .check/*/2026.191.2138/summary.yml — all 18 ok: true; the disclosed washed run 2133 is cleanly separate (all ok: false, total 0, matching the mtime-freshness RCA). Binary 2026.191.2134 current + fresh; no orphan domains/containers.
  • Live re-confirmation: charly check run check-feature-local → PASS (steps=5) on the integrated tree (consumer branch + this sdk via replace => ../sdk); 0 orphans after.

Decision: The move is behaviour-neutral and faithful, the three seams (PlanContext/VerbResolver/StepGrader) are kind-blind with ExecContext kept in deploykit on the correct side of the import cycle, every Go gate is green at zero warnings, the standalone walk tests are non-tautological, and the cross-cutting R10 gate (18-bed concurrent roster on the fresh 2134 binary) is real and passing — independently re-confirmed by one live bed. APPROVED; finalizing the merge-time CalVer and merging.

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

pr-validator finalized the merge-time CalVer for PR #20 (P5 check-engine
plan walk lands in sdk/kit). Renames the placeholder CHANGELOG entry to the
generated-at-merge version and matches its H1.

Assisted-by: Claude (fully tested and validated)
@atrawog
atrawog merged commit e742dc4 into main Jul 10, 2026
@atrawog
atrawog deleted the feat/p5-check-engine branch July 10, 2026 22:07
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