Repository navigation
feat(kit): the plan-execution helpers land in sdk/kit (P5-unit-3) - #18
Conversation
Third unit of P5 (check-engine SDK-ization). Three self-contained plan-execution
helpers move from charly core into sdk/kit, so a plugin candy that runs a plan
shares them with the check engine instead of re-implementing them:
- kit.RunWithEventually (eventually.go): the eventually: retry loop + the
killed-probe bounded re-attempt (a probe SIGKILLed by a transient host-load
spike is re-run; a probe that ran and failed is not). Uses the already-shared
kit.SignalKillErrMarker.
- kit.ScenarioContext (scenario.go): the per-plan-run mutable state - the
capture: store, the ${STEP_ID} thread, the background-PID reaper. Self-contained
(sync only).
- the acceptance-depth ladder (checklevel.go): CheckLevel{None,Build,NoAgent,Agent},
DefaultCheckLevel, ResolveCheckLevel, IsValidCheckLevel, CheckLevelReaches,
CheckLevels.
plan_validate.go and check_substitute.go deliberately STAY in core: the former is
invoked by both charly box validate and the charly feature HostBuild seam (its own
header documents this); the latter is bound to the core CUE loader
(decodeEntityViaCUE).
Tests move with the code: eventually_test.go (the killed-probe retry semantics -
killed-on-every-attempt fails loudly after the cap; a ran-and-failed probe is not
retried) and checklevel_test.go (the ladder ordering + default + validity,
load-bearing for how deep every bed runs). The core ExtractMetadata label
round-trip stayed in core (it exercises the OCI label surface, not the ladder).
Also (R2, in-repo): CHANGELOG/2026.191.1732.md (the P5-unit-2 entry) carried an H1
of "# 2026.191.1530" - the merge-time CalVer stamp renamed the file to 1732 but
left the placeholder H1. Corrected to match its filename and tag.
Assisted-by: Claude (fully tested and validated)
pr-validator — CHANGES REQUESTED ❌Change class: charly/sdk Go — pure library, purely additive (core deletions land in the superproject consumer PR) I re-derived everything independently from the diff, the repo, and superproject history — I did not take the body's word for anything. The code and behaviour are compliant — the single blocker is the PR bodyItem 1 — description completeness: FAIL (sole blocker). The body does not follow the mandatory org PR template (
The burden is on the PR to supply this evidence in the template; I had to reconstruct all of it myself. Please fill both sections and re-push (append a fix commit in place — do not close/recreate). When you write the "How R10-tested" block, base the Everything else PASSES (independently verified)
Behaviour preservation (the core of the review): Decision: CHANGES REQUESTED. The change itself is a clean, behaviour-preserving, security-clean move and all substantive gates are green — the only thing blocking merge is the incomplete PR body. Fill the mandatory "How R10-tested" (with pasted Assisted-by: Claude (analysed on a live system) |
pr-validator — APPROVED ✅ (re-validation after body-fill)Supersedes the prior CHANGES-REQUESTED verdict. The two previously-missing org-template sections (How R10-tested with pasted gate output, and the CLAUDE.md rule compliance R0–R10 block) are now filled with real evidence, and I independently re-ran every substantive check. Change class: charly/sdk Go — pure Checklist
Byte-equivalence (my code-only normalized diff vs
Decision: Genuine PASS. The move is provably behavior-neutral, all sdk gates are green, the moved tests are real and non-tautological, the consumer integrates live-green against this tree, and the body honestly discloses that the live bed roster is the consumer PR's gate. Finalizing the merge-time CalVer and merging. Assisted-by: Claude (analysed on a live system) |
The pr-validator stamps the merge-time version: CHANGELOG/2026.191.1600.md (author placeholder) -> CHANGELOG/2026.191.1837.md, H1 aligned to the filename and the release tag v0.2026191.1837. Assisted-by: Claude (fully tested and validated) Claude-Session: https://claude.ai/code/session_01W8GPhuyWWs5XwJyJYtCaxE
Summary of changes
Third unit of P5 (check-engine SDK-ization). Three self-contained plan-execution helpers
move from charly core into
sdk/kit, so a plugin candy that runs a plan shares them with thecheck engine instead of re-implementing them.
kit/eventually.go—RunWithEventually(theeventually:retry loop) +probeWasKilledkilledProbeRetries/killedProbeRetryInterval. Uses the already-sharedkit.SignalKillErrMarker.kit/scenario.go—ScenarioContext+NewScenarioContext+AddBackground/SnapshotBackgrounds/ApplyToEnv(the per-plan-run capture store +${STEP_ID}thread +background-PID reaper).
kit/checklevel.go— the acceptance-depth ladder:CheckLevel{None,Build,NoAgent,Agent},DefaultCheckLevel,ResolveCheckLevel,IsValidCheckLevel,CheckLevelReaches,CheckLevels.kit/eventually_test.go,kit/checklevel_test.go.CHANGELOG/2026.191.1732.md(the P5-unit-2 entry): its H1 read# 2026.191.1530after the merge-time stamp renamed the file but not the header. One line.plan_validate.goandcheck_substitute.gostay in core (dual-invoked by box-validate +the feature HostBuild seam; and bound to the core CUE loader, respectively) — only what compiles
standalone in kit moved.
Change class
charly-or-sdk Go — pure
sdklibrary, purely additive. Cross-repo: sdk producer → thesuperproject consumer (core alias rewire + the 3-file deletions + gitlink bump); sdk lands
first, the consumer PR follows and carries the full bed roster + golden parity.
How R10-tested — exact gate, commands, and pasted output
sdklibrary →go test ./...+golangci-lint+go vet+gofmt, plus the integration build/test of the consuming superproject against thissdk tree (
replace => ../sdk). The full concurrent 18-bed roster + 21-file goldencheck-liveparity is the consumer PR's gate (it exercises the moved code live); it already passed on this
work in progress and re-runs there against the final code.
N/A (pure sdk library)for THIS PR — the disposable-bed rosterbelongs to the superproject consumer PR. No bed can fail on a library-internal move that the
consumer has not yet wired.
N/A (R9)— no binary is produced by an sdk-library change. The consumer PRrebuilds
charly(task build:charly) and runs the roster on the fresh binary.moved tests exercise
RunWithEventually's killed-probe/deadline paths and theCheckLevelladder directly, and the consumer's roster runs the retry loop + ladder live. The move is proven
byte-equivalent to the originals (
main:charly/description_eventually.go,description_capture.go,check_level.go) modulo the package/name renames.N/A— no shared-state path is touched;ScenarioContext'smutex guarding is preserved verbatim. (The consumer roster nonetheless runs all beds concurrently.)
Attribution tier
fully tested and validated— the moved code is byte-equivalent to the originals (proven bydiff), the moved tests pass, and the consuming superproject builds + tests green against this
tree; the consumer PR carries the live 18-bed roster + golden parity that exercises the retry
loop and ladder end-to-end. The commit carries
Assisted-by: Claude (fully tested and validated).CLAUDE.md rule compliance — state HOW each is satisfied (or
N/A — <reason>)/charly-internals:go(sdk/kit source structure) +/charly-internals:plugin(kit is the importable host-engine surface a plugin candy shares) were loaded before the move.
unusedfindingsthe move produced in the consumer (dead
plural/signalKillErrMarkeraliases) were root-caused(their sole caller moved to kit) and removed, not suppressed.
fixed here (one line, same repo) rather than parked; the consumer deletions are the sanctioned
cross-repo next step, not a "follow-up".
aliases. No
-host/-podsiblings.(a signal-killed probe that produced no result), never a retry-on-flake — a probe that ran and
failed is not retried. No sleep/magic-number added; the const/interval are moved verbatim.
git grepself-test are in the consumer PR; no transitional/dual-mode path exists.N/A— no destructive git action (a stray CHANGELOG diff was inspected beforekeeping it as the R2 fix).
gate is
go test+ integration build, which is the correct gate for its change class.N/A— no Containerfile/OCI-label generation touched.N/Ahere — no binary; the consumer rebuilds + version-checks.ordering + the killed-probe semantics are asserted); the live disposable-bed proof is the
consumer PR.
N/A— no.cue/schema/wire/params/generated file touched (ScenarioContextis process-local state, not a wire type); no candy.
CUE-coupled and dual-invoked ones stay, documented).
library — it strengthens the boundary; no concrete-kind schema/switch/per-kind map added.
N/A— no destroy/rebuild in this PR.gofmt -lempty,golangci-lint0 issues,go vetclean,go test ./...green (pasted above); deprecated core copies are deleted in the consumer.CHANGELOG/2026.191.1600.mdstaged (placeholder CalVer; the pr-validator finalizes).Assisted-by: Claude (fully tested and validated)