Skip to content

feat(core): K3 wire-to-spec Path 1 — pure import repoint (5 files) - #140

Merged
atrawog merged 2 commits into
mainfrom
feat/wire-to-spec-path1
Jul 17, 2026
Merged

atrawog merged 2 commits into
mainfrom
feat/wire-to-spec-path1

Conversation

@atrawog

@atrawog atrawog commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

Five charly/*.go files were importing sdk/deploykit/sdk/kit for ONLY
symbols that a prior wave ("SDK envelope relocation", task #13) already moved
to sdk/spec as literal Go type aliases (sdk/deploykit/steps.go:
InstallPlan/EmitOpts/DeployExecutor = spec.X; sdk/kit/planrun.go:
LabelDescriptionSet/LabeledDescription = spec.X). This is Path 1 of a
K1/wire-to-spec classification spike of the 25 remaining "projection-only"
(type-only) files off charly/*.go's kit-import list: these 5 needed no new
CUE schema work — just an import repoint, since the underlying spec type
already exists.

  • charly/deploy_preresolve.go — deploykit.InstallPlan → spec.InstallPlan; drop the deploykit import.
  • charly/deploy_substrate_lifecycle.go — deploykit.InstallPlan/EmitOpts/DeployExecutor → spec.* (the substrateLifecycle interface); drop the deploykit import.
  • charly/layer_artifacts.go — deploykit.DeployExecutor/EmitOpts → spec.*; drop deploykit, add spec.
  • charly/plugin_grpc.go — deploykit.DeployExecutor → spec.DeployExecutor; drop deploykit, add spec (kept the pb alias on the proto import unchanged).
  • charly/description_collect.go — kit.LabelDescriptionSet/LabeledDescription → spec.*; drop the kit import (one accurate historical comment mentioning kit.MergeDeployDescriptions — a genuinely different function that stays in kit — is left as-is).
  • CHANGELOG/2026.198.0311.md — new entry (placeholder CalVer).

Metric: charly/*.go kit-importing files 150 → 145.

Change class

charly Go (core-minimization import repoint; zero behavior change).

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

  • The gate for this change class: these are same-type repoints — deploykit.X/kit.X were literal Go type ALIASES of spec.X (type InstallPlan = spec.InstallPlan, etc., in sdk/deploykit/steps.go + sdk/kit/planrun.go), so no runtime code path can behave differently before/after this change — a disposable-bed gate cannot fail on it (R10's own "run only the gate that exercises the change" principle; a gate that can't fail proves nothing). The exhaustive, correct gate for this class is go build/go vet/go test ./... + golangci-lint run ./..., proving the identical-type swap compiles and every existing test (which exercises real production code, not mocks) still passes. This was the orchestrator's (team-lead, this multi-agent session) explicit ruling for this exact change class, reached independently and cross-checked against the R10 gate-by-change-class principle before I executed.
  • Eval beds run: N/A for this class per the ruling above — no bed's outcome depends on which import path (deploykit/kit vs spec) a symbol is read through, since both names resolve to the identical Go type. (The prior K3 cutover this Path-1 spike grew out of, PR feat(core)!: K3 build-engine core-minimization — reentry-class + render-seam + feature-command #139, DID run charly check run check-pod — 12/12 steps, 217s, fresh-rebuild gate included — for its own behavior-changing content; this PR carries none.)
  • Fresh rebuild: binary rebuilt from this branch's source (go build ./... below); charly version unaffected (no version-relevant code touched).
  • Did the CHANGED code path execute live? The changed files' functions (CollectDescriptions, deployPreresolver/wireDeployPreresolver, the substrateLifecycle interface plumbing, RetrieveCandyArtifacts/retrieveOne/waitForArtifactPath, grpcProvider.InvokeWithExecutor) are exercised by the existing go test ./... suite (88s, full pass, real production code paths — not --dry-run, not a bare compile). No CLI/bed-level invocation ran, since none would exercise a difference (see gate justification above).
  • Concurrency: N/A — no shared-state path touched; a pure identifier/import rename.
$ go build ./...
(clean, no output)

$ go vet ./...
(clean, no output)

$ go test ./...
ok  	github.com/opencharly/charly/charly	88.653s
ok  	github.com/opencharly/charly/charly/internal/pluginsgen	0.008s

$ golangci-lint run ./...
0 issues.

$ grep -lE '"github.com/opencharly/sdk/(kit|deploykit|buildkit)"' charly/*.go | grep -v _test.go | wc -l
145

Attribution tier

analysed on a live system — the real go test ./... suite ran and its output is pasted above; no dry-run, no bed/CLI invocation (none would exercise a difference for this change class per the gate justification above).

Harness rulebook compliance

  • R0 skills: /charly-internals:go + /charly-internals:strict-policy loaded before touching charly/*.go source (already loaded earlier in this multi-turn session for the K3 cutover this spike grew out of).
  • R1 RCA + zero warnings: no failure/warning surfaced by any tool in this cutover (build/vet/test/lint all clean on first run); zero warnings in the pasted gate output.
  • R2 no out-of-scope: scope is exactly the 5 files the orchestrator authorized for Path 1; the remaining 20 files (Path 2 real-migration candidates, Path 3 structurally-blocked interface/hook files) are explicitly tracked as the next cutover(s) — not silently dropped.
  • R3 no duplication: pure repoint, no new pattern introduced.
  • R4 no workaround: none — mechanical import/identifier swap only.
  • R5 hard cutover + grep: git grep -n "deploykit\.\|kit\." charly/deploy_preresolve.go charly/deploy_substrate_lifecycle.go charly/layer_artifacts.go charly/plugin_grpc.go charly/description_collect.go returns only the one accurate historical comment in description_collect.go (kit.MergeDeployDescriptions, a genuinely different function that stays in kit) — verified before committing.
  • R6 git safety: git status/git diff --submodule checked before switching worktree branches; no destructive action taken.
  • R7 runtime gate: N/A for this class — see gate justification above (no runtime path can differ).
  • R8 artifact invariants: N/A — no generation/label code touched.
  • R9 binary == source + deps: N/A — no new runtime OS dependency; go build ./... confirms the binary builds from this source.
  • R10 disposable + coverage: N/A bed — see gate justification; existing test suite (88s, full pass) is the coverage that would catch any actual behavior change, and by construction (type alias) none exists.
  • RDD / ADE / SDD: RDD — the "no bed needed" claim itself was validated, not assumed: the underlying = spec.X aliases were confirmed live in sdk/deploykit/steps.go/sdk/kit/planrun.go before any file was touched, and the orchestrator independently spot-checked this claim. ADE/SDD: N/A — no candy/schema touched.
  • Hard cutover: ONE atomic commit, no deferred/partial state; no transitional/dual-mode path (the swap is unconditional).
  • Kernel/plugin boundary law: N/A — no core/sdk boundary change; a pure identifier repoint within already-core files.
  • Disposable-only autonomy: N/A — no destroy/rebuild performed.
  • Clean architecture + Go gates: golangci-lint run ./... = 0 issues; go vet ./... clean; go test ./... green (pasted above).
  • CHANGELOG: CHANGELOG/2026.198.0311.md staged (placeholder CalVer).

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

atrawog added 2 commits July 17, 2026 05:13
Five charly/*.go files used ONLY deploykit/kit types that a prior wave
(SDK envelope relocation, task #13) already moved to sdk/spec as Go type
aliases (deploykit.InstallPlan/EmitOpts/DeployExecutor = spec.X in
sdk/deploykit/steps.go; kit.LabelDescriptionSet/LabeledDescription = spec.X
in sdk/kit/planrun.go). Repoint each to import spec directly instead of
deploykit/kit — a same-type swap with byte-identical runtime behavior
(these were literal Go type aliases, not distinct types), so no bed
re-run is needed for this change class.

- deploy_preresolve.go: deploykit.InstallPlan -> spec.InstallPlan
- deploy_substrate_lifecycle.go: InstallPlan/EmitOpts/DeployExecutor -> spec.*
- layer_artifacts.go: DeployExecutor/EmitOpts -> spec.*
- plugin_grpc.go: DeployExecutor -> spec.DeployExecutor
- description_collect.go: kit.LabelDescriptionSet/LabeledDescription -> spec.*

Identified via a K1/wire-to-spec classification spike of the remaining 25
type-only files off charly/*.go's kit-import list: these 5 retire for free
(Path 1); ~11-12 need real coordinated type migrations (Path 2, next);
~7-8 hold Go interfaces/function-value hooks structurally excluded from
CUE generation, tracked separately (Path 3, task #21).

Metric: charly/*.go kit-importing files 150 -> 145.

R10 gate for this change class (orchestrator-ruled, per R10's own "run only
the gate that exercises the change" principle): deploykit.X/kit.X here were
literal Go type ALIASES of spec.X, so no runtime path can differ — a bed
gate cannot fail on this change. go build/go vet/go test ./... (88s, full
pass) + golangci-lint (0 issues) is the exhaustive, non-wasteful gate.

Assisted-by: Claude Sonnet 5 (analysed on a live system)
Renamed placeholder CHANGELOG/2026.198.0311.md to the actual merge-time
CalVer (evaluator step, computed via `date -u` per the #47 lesson — never
`git show --date=format` in the commit's local TZ).

Assisted-by: Claude Sonnet 5 (analysed on a live system)
@atrawog

atrawog commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Independent PR validation — PASS

Fresh worktree, trusting no author/orchestrator claims. Confirmed:

  • Diff is exactly what's claimed: 5 files, pure deploykit.X/kit.X → spec.X identifier repoint, zero logic change (reviewed the full diff line-by-line).
  • The safety-critical alias claim independently verified: sdk/deploykit/steps.go has EmitOpts = spec.EmitOpts, DeployExecutor = spec.DeployExecutor, InstallPlan = spec.InstallPlan (literal Go type aliases, not distinct types); sdk/kit/planrun.go has LabeledDescription = spec.LabeledDescription, LabelDescriptionSet = spec.LabelDescriptionSet. Confirms the change-class ruling: no runtime path can differ, so a check bed is out-of-spec waste for this change (R10's own "don't run a gate that can't fail" principle).
  • Change-class gate confirmed correct: go build/go vet/go test ./.../golangci-lint re-run independently, all clean (test suite 95s full pass). Also ran gofmt -l — flagged 11 pre-existing files, NONE of which intersect this PR's 5 touched files (confirmed via diff); non-blocking pre-existing debt, not introduced here.
  • R5 grep self-test: no stale deploykit/kit imports remain in the 5 touched files; the 2 remaining textual hits (kit.WalkPlans in a comment, kit.MergeDeployDescriptions in a comment) are both accurate references to genuinely different functions that stay in kit — not stale remainders.
  • Metric independently re-walked file-by-file: main = 150, branch = 145. Confirmed, not trusted.
  • Single-repo landing confirmed correct: sdk/plugins gitlinks unchanged (verified against current main), no producer leg needed since deploykit/kit already carried the aliases before this PR.
  • Renamed the placeholder CHANGELOG/2026.198.0311.md → CHANGELOG/2026.198.0326.md (the true merge-time CalVer, computed via date -u, not git show --date=format — the fix(workflows): a sub-agent runs only what it can own — defer long beds, refuse host-local #47 lesson) before merging.

Tier: analysed on a live system (matches the PR's own claim — no bed invocation needed or possible for this change class). Merging.

@atrawog
atrawog merged commit bba89d8 into main Jul 17, 2026
@atrawog
atrawog deleted the feat/wire-to-spec-path1 branch July 17, 2026 03:27
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