Repository navigation
feat(checkstep)!: the candy owns its step kind + materialization (C7) - #177
Conversation
Widen spec/checkstep's StepProvider so the CANDY owns BOTH halves of its typed
install-step lowering, and delete the now-dead descriptor/kind-name machinery:
type StepProvider interface {
StepKind() spec.StepKind
MaterializeStep(op *spec.Op, runAsUser, candyName, pkgFormat string, distroTags []string) spec.InstallStep
}
StepKind() returns the internal InstallPlan IR spec.StepKind directly (no candy-local
StepKindName string for core to map). MaterializeStep builds the real spec.InstallStep
from the op's plugin_input + the four host-resolved ctx scalars (run-as user, candy name,
package format, distro tags). Deleted: StepKindName +
StepKindNameServicePackaged/StepKindNameSystemPackages, StepDescriptor,
ServicePackagedDesc, SystemPackagesDesc.
RCA: charly/check_kit_adapter.go held a per-kind switch (kitStepKindToCharly) + a
per-kind materializer (materializeStep) in CORE. A core kind switch is an incomplete seam
by the kernel/plugin boundary law; it existed only because StepProvider returned a candy
-local kind string + a neutral descriptor, forcing core to map and rebuild. Widening the
interface removes the need for any core switch. Consumer legs (sdk/kit, plugin-service,
plugin-package, charly) follow producer-first.
checkstep_test.go locks the exact method set at compile time (fails against the old
interface) and covers ResolvePackageName.
Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: Go library contract widening + dead-type deletion ( Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review block 2: the package doc still asserted sdk/kit re-exports the cluster "so every candy call site compiles UNCHANGED". That is false after this PR: the C7 re-signature changes StepProvider's method set, so every implementer (plugin-service / plugin-package) moves in the producer-first chain. Reword to say the re-export keeps the IDENTIFIER resolving for a candy that NAMES the roles, and name the hard cutover explicitly. Comment-only; no code change. Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — PASSHead SHA: Security screen: PASS — T1–T4 clean. The diff is a contract interface widening + dead-type deletion ( Checklist: All applicable rules PASS or NA. Diff matches the body's accounting ( Comments considered:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
|
Cross-leg sequencing flag from the schema-versioning-removal chain ( The
Proposed sequencing (no action needed from me if you prefer another order): land the C7 sdk adoption first (it bumps Flagging so we don't both bump |
Summary
C7 crutch-sweep, producer-first leg 1/5. Widen
spec/checkstep'sStepProviderso thecandy owns BOTH halves of its typed install-step lowering, and delete the now-dead
descriptor / kind-name machinery.
StepProviderbecomes:StepKind()returns the internal InstallPlan IRspec.StepKinddirectly — no candy-localStepKindNamestring enum for core to map.MaterializeStepbuilds the realspec.InstallStepfrom the op'splugin_inputplus thefour host-resolved ctx scalars.
StepKindName+StepKindNameServicePackaged/StepKindNameSystemPackages,StepDescriptor,ServicePackagedDesc,SystemPackagesDesc.RCA.
charly/check_kit_adapter.goheld a per-kindswitch(kitStepKindToCharly) plus aper-kind materializer (
materializeStep) in CORE. A core kind switch is an incomplete seam bythe kernel/plugin boundary law, and it existed only because
StepProviderreturned acandy-local kind string plus a neutral descriptor, forcing core to map and rebuild. Widening
the interface removes the need for any core switch; the consumer legs (
sdk/kit,candy/plugin-service,candy/plugin-package,charly) follow producer-first.Review round 1 addressed both BLOCKs: the stale consumer-leg "compiles UNCHANGED" claim
corrected (comment-only commit
354bc88), and the attribution tier is now backed by a liveend-to-end run (below).
How tested
Spec's own gate — final committed tree
checkstep_test.gois the coverage that fails without the change: aStepProviderstubwith the exact new method set, so the old interface cannot compile against it. It also proves
MaterializeStepreturns a real*spec.SystemPackagesStepand coversResolvePackageName.Live proof of the widened path — real
charly check runon the compositeA pure library leg cannot deploy alone, so the changed path was exercised live via the
sanctioned local-composite recipe (the spec branch + the in-development sdk /
plugin-service / plugin-package / charly wired by
go.mod replace, then a fresh binarybuilt from that tree). A disposable
kind:localbed whose candy authors apackage:deploy-context run step drives the install-timeline compile — the exact paththat reaches
hostBuildConstructStep→ the kit adapter → the candy'sStepProvider:An RDD spike instrumented the core seam with a one-line stderr print, ran that same real
deploy, and captured the widened path executing — then removed the instrumentation before
commit (the print is NOT in the final tree):
The permanent, reproducible guarantee of the same path is the charly-side unit test
TestCompileOpSteps_FoldsBuildContextRunStepNotCheck, which drives the REALhostBuildConstructStepthrough the REAL compiled-in candy and asserts a*spec.SystemPackagesStepis produced (it fails without the widened interface). Theno-regression R10 bed
charly check run check-commands-localis run on the composite at thecharly leg.
Rulebook compliance
core to map a candy-local kind and rebuild a neutral descriptor.
four consumer legs are named and follow producer-first, not deferred.
ResolvePackageNamestays the one sharedcross-resolver, now consumed by the candy's own
MaterializeStep.replacewiring is the sanctioned unreleased-plugin RDD recipe, not a shipped shim.StepKindName, its two consts, and the three descriptor types aredeleted in the same PR; no shim/dual path survives.
feat/c7-step-provider-materializeoff freshorigin/main; noforce-push.
checkstep_test.gofails to compile against the old interface; thechanged path ran live (above).
go test ./...+go vet+ the fails-without test on the finalcommitted tree, plus the live composite deploy of the widened path.
Change classification
spec → sdk → plugin-service/plugin-package → charly chain).
gofmt+go vet ./checkstep/...+go test ./...+ the fails-without contracttest + the live composite
charly check runof the widened path.fully tested and validated— the full Go suite and thefails-without-the-change contract test pass on the final committed tree, and the changed
path was executed live in a real disposable deploy.
Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)