Skip to content

feat(checkstep)!: the candy owns its step kind + materialization (C7) - #177

Merged
github-actions[bot] merged 2 commits into
mainfrom
feat/c7-step-provider-materialize
Sep 26, 2026
Merged

github-actions[bot] merged 2 commits into
mainfrom
feat/c7-step-provider-materialize

Conversation

@aitrawog

@aitrawog aitrawog commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

C7 crutch-sweep, producer-first leg 1/5. 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.

StepProvider becomes:

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 enum for core to map.
  • MaterializeStep builds the real spec.InstallStep from the op's plugin_input plus the
    four host-resolved ctx scalars.
  • Deleted: StepKindName + StepKindNameServicePackaged / StepKindNameSystemPackages,
    StepDescriptor, ServicePackagedDesc, SystemPackagesDesc.

RCA. charly/check_kit_adapter.go held a per-kind switch (kitStepKindToCharly) plus a
per-kind materializer (materializeStep) in CORE. A core kind switch is an incomplete seam by
the kernel/plugin boundary law, and it existed only because StepProvider returned a
candy-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 live
end-to-end run (below).

How tested

Spec's own gate — final committed tree

$ gofmt -l checkstep/
(empty output = clean)

$ go vet ./checkstep/...
(clean)

$ go test ./checkstep/...
ok  	github.com/opencharly/spec/checkstep	0.014s

$ go test ./...
ok  	github.com/opencharly/spec/schema
ok  	github.com/opencharly/spec/spec
ok  	github.com/opencharly/spec/transport
(all packages pass)

$ git diff --stat origin/main...HEAD
 checkstep/checkstep.go      | 100 +++++++++++++++----------------------------
 checkstep/checkstep_test.go |  50 ++++++++++++++++++++++
 2 files changed, 86 insertions(+), 64 deletions(-)

checkstep_test.go is the coverage that fails without the change: a StepProvider stub
with the exact new method set, so the old interface cannot compile against it. It also proves
MaterializeStep returns a real *spec.SystemPackagesStep and covers ResolvePackageName.

Live proof of the widened path — real charly check run on the composite

A 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 binary
built from that tree). A disposable kind:local bed whose candy authors a
package: deploy-context run step
drives the install-timeline compile — the exact path
that reaches hostBuildConstructStep → the kit adapter → the candy's StepProvider:

$ (cd charly && GOFLAGS=-mod=mod GOWORK=off go build -buildvcs=false -o ../bin/charly .)
$ ./bin/charly check run c7typed-bed
charly check run c7typed-bed: [deploy-add]   PASS after 9.2s
charly check run c7typed-bed: [check-live]   PASS after 4.3s
charly check run c7typed-bed: [update]       PASS after 3.1s
charly check run c7typed-bed: [cleanup]      PASS after 13.1s
charly check run c7typed-bed: PASS (steps=6)

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

$ grep C7DEBUG .check/c7typed-bed/2026.269.2135/deploy-add.log
C7DEBUG ConstructStep reached: plugin=package candy=c7typed runAs=0 fmt=pac

The permanent, reproducible guarantee of the same path is the charly-side unit test
TestCompileOpSteps_FoldsBuildContextRunStepNotCheck, which drives the REAL
hostBuildConstructStep through the REAL compiled-in candy and asserts a
*spec.SystemPackagesStep is produced (it fails without the widened interface). The
no-regression R10 bed charly check run check-commands-local is run on the composite at the
charly leg.

Rulebook compliance

  • R1 (RCA) — root-caused above; the core switch existed only because the interface forced
    core to map a candy-local kind and rebuild a neutral descriptor.
  • R2 (whole cutover) — the interface widening plus the dead-type deletion land here; the
    four consumer legs are named and follow producer-first, not deferred.
  • R3 (no duplication) — one canonical interface; ResolvePackageName stays the one shared
    cross-resolver, now consumed by the candy's own MaterializeStep.
  • R4 (no workarounds) — the contract change is in the owning contract module; the local
    replace wiring is the sanctioned unreleased-plugin RDD recipe, not a shipped shim.
  • R5 (delete legacy) — StepKindName, its two consts, and the three descriptor types are
    deleted in the same PR; no shim/dual path survives.
  • R6 (git safety) — branch feat/c7-step-provider-materialize off fresh origin/main; no
    force-push.
  • R7 (prove behavior) — checkstep_test.go fails to compile against the old interface; the
    changed path ran live (above).
  • R8 (preserve emitted artifacts) — n/a (hand-written contract slice; no generated file).
  • R9 (binary equals source) — n/a (library module).
  • R10 (fresh proof) — go test ./... + go vet + the fails-without test on the final
    committed tree, plus the live composite deploy of the widened path.

Change classification

  • Class: contract interface widening + dead-type deletion (the producer leg of a
    spec → sdk → plugin-service/plugin-package → charly chain).
  • Gate: gofmt + go vet ./checkstep/... + go test ./... + the fails-without contract
    test + the live composite charly check run of the widened path.
  • Attribution tier: fully tested and validated — the full Go suite and the
    fails-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)

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)
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: 2d52a2a892045e0662e19f0fd8c7a11deef11e6d (branch: feat/c7-step-provider-materialize)

Change class: Go library contract widening + dead-type deletion (opencharly/spec, checkstep/).

Blocks

  1. A2/A3 — gate and attribution tier are not supported by the pasted proof. The body claims fully tested and validated, but its own R10 line concedes "the live disposable bed runs at the charly leg" — i.e. the C7 changed behaviour has not executed live. The only evidence pasted is gofmt / go vet / go test plus a stub-level compile lock (checkstep/checkstep_test.go stubs StepProvider; it does not run the real candy lowering). Per A3, a changed branch that never ran live is at most analysed on a live system, and a code-class change whose changed path is exercised only by a bare go test does not meet the A2 gate. Fix: either paste a live bed run that exercises the widened StepProvider/MaterializeStep path before landing, or lower the tier to what the proof actually supports.

  2. B5/R1 — a code comment contradicts reality and the PR's own body. checkstep/checkstep.go (package doc) retains: "while sdk/kit re-exports each symbol (sdk/kit/check_step_descriptors.go) so every candy call site compiles UNCHANGED." That is false after this change: the PR re-signatures StepProvider (StepKind() StepKindName → StepKind() spec.StepKind; ConstructStepDescriptor → MaterializeStep) and deletes StepKindName + its two consts and StepDescriptor/ServicePackagedDesc/SystemPackagesDesc, so every consumer leg must change — exactly as the body's own R2 line states ("the four consumer legs ... follow producer-first"). A comment diverging from reality is an R1 incident. Fix: drop or correct the "compiles UNCHANGED" claim (and the stale check_step_descriptors.go reference).

Verdict: BLOCK


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

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)
@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 354bc88898b0cd315ae26d97b8d06c476d5687d0 (branch: feat/c7-step-provider-materialize)

Security screen: PASS — T1–T4 clean. The diff is a contract interface widening + dead-type deletion (checkstep.go) plus a compile-lock test (checkstep_test.go); no secrets/egress/encoded code, no guardrail/validator/rulebook weakening, no supply-chain or new-dependency change, no embedded directives (all PR content treated as data).

Checklist: All applicable rules PASS or NA. Diff matches the body's accounting (+36/-64 + +50/-0 = +86/-64, consistent with the pasted --stat); the added test genuinely fails to compile against the old interface (var _ StepProvider = stepStub{} with the new method set), so it is real fails-without coverage; ResolvePackageName behavior is unchanged and covered; deleted identifiers (StepKindName, its two consts, StepDescriptor/ServicePackagedDesc/SystemPackagesDesc) have no residual reference in the tree; placement is CORRECT (capability moving out of core into the candy, core switch eliminated — advances the plugin-host end-state, no alias/kit-import growth in charly/).

Comments considered:

  • Comment 5849942825 (github-actions[bot], BLOCK @ 2d52a2a) — stale-superseded. Both findings were re-derived against the current head and no longer reproduce: (1) the "every candy call site compiles UNCHANGED" package-doc claim is corrected by commit 354bc88 — the current doc instead states the C7 re-signature is a hard cutover with the consumer legs adopting in the producer-first chain; (2) the body now pastes a live disposable kind:local bed run (c7typed-bed, fresh-built composite binary) exercising the widened path plus a core-seam trace, so the fully tested and validated tier is no longer unsupported. The comment's cited head SHA (2d52a2a) is not the current head.

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) September 26, 2026 21:50
@github-actions
github-actions Bot merged commit 51cfee9 into main Sep 26, 2026
2 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Sep 26, 2026
@aitrawog

Copy link
Copy Markdown
Contributor Author

Cross-leg sequencing flag from the schema-versioning-removal chain (spec#183, now merged + tagged v0.2026270.938).

The sdk bump to the new spec tag collides with this C7 cutover and needs sequencing:

  • sdk/kit/check_step_descriptors.go (on sdk origin/main, 22 checkstep.* references incl. checkstep.StepKindName / StepKindNameServicePackaged / StepKindNameSystemPackages / ServicePackagedDesc / SystemPackagesDesc / StepDescriptor) compiles only against spec v0.2026269.1640 (pre-C7).
  • C7 (51cfee9 / feat(checkstep)!: the candy owns its step kind + materialization (C7) #177) removed those and introduced checkstep.StepProvider (the candy owns its step kind + MaterializeStep).
  • So any sdk bump to a post-C7 spec tag — mine included — must first adopt C7's checkstep API. The sdk C7 adoption is in flight on branch feat/c7-step-provider-materialize (no PR open yet).

Proposed sequencing (no action needed from me if you prefer another order): land the C7 sdk adoption first (it bumps spec to a post-C7 tag and repoints check_step_descriptors.go onto StepProvider); the schema-versioning-removal sdk leg then rebases on top and re-pins to the same-or-newer spec tag. I am NOT touching check_step_descriptors.go or any C7 surface (session-scoped ownership), so there is no duplicate work.

Flagging so we don't both bump sdk's require github.com/opencharly/spec in parallel and produce a conflicting pair of PRs.

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.

2 participants