Skip to content

refactor(deploy): single-source preempt consts to spec + kill 3 test-only aliases (K4 Bucket D) - #91

Merged
atrawog merged 2 commits into
mainfrom
feat/k4-deploy-resolution
Jul 13, 2026
Merged

atrawog merged 2 commits into
mainfrom
feat/k4-deploy-resolution

Conversation

@atrawog

@atrawog atrawog commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

K4 Bucket D — the small, host-type-FREE residue of the deploy-resolution wave. The K4 survey established that the bulk of the deploy-resolution surface is envelope-gated (consumes *BoxMetadata → §4.2 WAITS for the S-K5 #ResolvedProject envelope), KEEP-FABRIC (the wire-broker / substrate-lifecycle proxy / registry dispatch), or reassigned to other owners. This lands the host-type-free residue now; the resolution-body relocation is next-wave.

Change class

Code (Go refactor + dead-code/comment removal), behavior-preserving. Tier: fully tested and validated.

What changed

  • Preempt consts → spec single-source (R3 dedup). Deleted the package-main PreemptStopShutdown/PreemptRestoreAlways/PreemptRestoreSuccess consts in deploy.go that duplicated spec.Preempt* (sdk/spec/arbiter_wire.go); validate_preempt.go + preempt_schema_test.go reference spec.* directly. Identical string values.
  • 3 test-only deploykit aliases converted + deleted. bundleWalkPostOrder / preemptEffectiveStop / encryptedPlainDir → deploykit.X in their tests; alias entries removed (preemptEffectiveRestore stays — non-test caller in arbiter_host.go).
  • R1: removed the dangling occupiedHostPorts doc-comment in deploy.go (the func relocated to sdk/deploykit).

R10 evidence

charly check run check-preempt-local: PASS (steps=5)  exit=0  calver 2026.194.1220
  deploy-add 15s · bring-up-members 0s · check-live 7s · update 26s · cleanup 9s — all ok, total 57s

check-preempt-local composes check-preempt-app = the validate_preempt surface the const-dedup touches — the matched gate, exercised on the frozen final code through the fresh-charly update cycle.

Gates (all green)

  • go build charly + sdk + full per-worktree binary → EXIT 0
  • go test ./... charly → ok 60s; sdk kit + sdk spec (cue:gen repro) → ok
  • golangci-lint charly → 0 issues; gofmt clean
  • R5 grep self-test: bundleWalkPostOrder / preemptEffectiveStop / encryptedPlainDir / occupiedHostPorts / bare PreemptStop* → all 0
  • cue:gen → no-op (no schema touched)
  • Net charly/ non-test delta: −13 LOC

Deferred to K5 (registered, not neglect)

  • The broad FREE-alias-death is throwaway (config_image/enc/start/shell/secrets/data move wholesale to their substrate plugins at K5, deleting any core conversion).
  • InjectSecretsIntoPlans → deploykit + the generateRandomSecretToken R3-dedup (duplicate in candy/plugin-secrets) ride the K5 consumer move.
  • The config-resolution BODY move (config_image runConfig → deploykit) is §4.2-gated on the now-PROVEN #ResolvedProject envelope; next-wave as its first consumer.
  • The sibling sdk/kit/deploy_types.go stale-comment fix is committed + pushed on the sdk feat branch (durable), riding the next-wave sdk PR.

R0–R10

R0 skills loaded before any action · R1 both divergences fixed/registered · R3 const dedup · R5 grep self-test all-0 · R7/R10 check-preempt-local PASS on a fresh charly update · behavior-preserving refactor with the matched deploy bed as the acceptance gate.

https://claude.ai/code/session_01XSv38sdYqre3yzzDTENzgG

Assisted-by: Claude (fully tested and validated)

…only aliases (K4 Bucket D)

R3 dedup: delete the package-main PreemptStop/Restore consts (deploy.go) that
duplicated spec.Preempt* (sdk/spec/arbiter_wire.go); validate_preempt.go +
preempt_schema_test.go reference spec.* directly (identical values,
behavior-preserving). Convert 3 test-only deploykit aliases
(bundleWalkPostOrder/preemptEffectiveStop/encryptedPlainDir) to deploykit.X in
their tests and delete the alias entries. R1: remove the dangling
occupiedHostPorts doc-comment (the func relocated to sdk/deploykit).

The host-type-free K4 residue; the resolution-body relocation is section 4.2-gated
on the S-K5 #ResolvedProject envelope (next-wave). Net charly/ non-test -13.

Gated: charly check run check-preempt-local PASS 5/5 exit=0 on the frozen final
code through the fresh-charly-update cycle (the validate_preempt surface the
const-dedup touches).

Assisted-by: Claude (fully tested and validated)
Claude-Session: https://claude.ai/code/session_01XSv38sdYqre3yzzDTENzgG
@atrawog

atrawog commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Change class: charly Go (runtime) — behavior-preserving const-single-source refactor (K4 Bucket D)

Independently re-derived from the PR + repo + CLAUDE.md + the git-workflow/go/plugin skills (loaded by path). Head 1624e41, base cf31ff9, +69/−27, 7 files. sdk gitlink unchanged at 2977d5c (verified base==head).

Checklist (every rule; [N/A] where the class excludes it):

  • [PASS] 0. security/anti-tampering (T1–T4) — no exfiltration / scope-mismatch / weakened-gate / supply-chain; diff exactly matches the description; no spec / CLAUDE.md / hook / branch-protection edits; body is clean prose, no validator manipulation.
  • [PASS] 1. description complete — full template with pasted evidence.
  • [PASS] 2. change-class gate matches evidence (R7/R10) — matched bed check-preempt-local (composes check-preempt-app = the validate_preempt/preempt surface); no dry-run / rebuild-alone fraud. Note: the body pastes the 1220 run (which ran 14:20, before the 14:28 source freeze — an exploratory run) and labels it "final code"; the genuine final-code run is 1242 (14:42, on the 14:32 fresh per-worktree binary). Both ok:true, 5/5, identical outcome (behavior-preserving). I corroborated 1242 on disk independently — R10 substance satisfied.
  • [PASS] 3. attribution tier justified — fully tested and validated holds: fresh-rebuild bed PASS on the matched surface + the changed value-references executed live (preempt_schema_test.go asserts deploykit.PreemptEffectiveStop == spec.PreemptStopShutdown, which ran in my go test -count=1).
  • [PASS] 4. R0 skills honored.
  • [PASS] 5. R1 RCA / ZERO warnings — no warnings in any gate; the dangling occupiedHostPorts comment removed; the sibling sdk/kit/deploy_types.go fix is registered on the next-wave sdk PR.
  • [PASS] 6. R2 no pre-existing/out-of-scope split — K5 deferrals are registered next-wave cutovers (envelope-gated on the PROVEN #ResolvedProject), the host-type-free residue lands now.
  • [PASS] 7. R3 no duplication — this REMOVES a duplication (package-main Preempt* consts duplicated spec.Preempt*).
  • [PASS] 8. R4 no ad-hoc workaround.
  • [PASS] 9. R5 hard cutover + grep — git grep (charly): bundleWalkPostOrder/preemptEffectiveStop/encryptedPlainDir/occupiedHostPorts = 0; all Preempt* refs now spec.-qualified; no transitional/dual-mode path survives.
  • [PASS] 10. R6/R8/R9 integrity — R9: per-worktree bin/charly built 14:32 from the 14:28 frozen source; the bed ran 14:42 on it (version-matched). R8 N/A (no Containerfile/label surface). R6 N/A.
  • [PASS] 11. R10 disposable-only / fresh-rebuild / zero-warning / coverage — check-preempt-local disposable:true, fresh charly update cycle, 5/5 ok. Coverage: the converted refs are asserted by preempt_schema_test.go/enc_test.go/deploy_node_test.go (would FAIL if spec values diverged). Cross-checked both on-disk summaries (1220 & 1242): exist, ok:true, correct bed, right binary, coherent window — no re-run needed.
  • [PASS] 12. RDD/ADE/SDD — SDD sub-checks N/A: no .cue/_gen.go/.proto/.pb.go/*_wire.go touched → cue:gen a genuine no-op; no hand-edited generated file; no new @go(-)/hand-written wire type. ADE N/A (no candy changed).
  • [PASS] 13. concurrency mandate + anti-cheat — no shared-state LOGIC changed (compile-time const re-pointing); no idle/serial-as-proof, no flake/pre-existing dodge; single matched bed is correct for a localized behavior-preserving refactor.
  • [PASS] 14. hard cutover — one atomic commit; no Phase-2/TODO — exactly ONE commit; K5 items are next-wave cutovers.
  • [PASS] 15. ARCHITECTURE GATE — placement: CORRECT. Consts single-sourced INTO sdk/spec (the wire contract); deploykit_state_aliases.go SHRINKS 3 entries (advances ZERO-ALIASES); net charly/ −13 LOC; nothing new INTO core. Mechanical: no new/grown *_aliases.go; the only new non-test core import is sdk/spec (allowed by P16 gate (b), advances import-purity); test-file deploykit imports are not the core import gate. validate_preempt body stays core = tracked K5 migration inventory (named exit, registered).
  • [PASS] 16. disposable-only autonomy — bed is disposable:true.
  • [PASS] 17. clean architecture + go gates — my re-run on the head: go build 0, go vet 0, go test -count=1 ok (59.4s REAL, not cached), golangci-lint 0 issues, gofmt clean.
  • [PASS] 18. CHANGELOG present — CHANGELOG/2026.194.1240.md (placeholder; finalized to the merge-time CalVer), H1 matches filename; K5 register items present.

Decision: All rules satisfied on my independent re-derivation. The change is a clean R3 dedup (preempt consts → spec single source) + ZERO-ALIASES-advancing test-alias death + an R1 comment fix — behavior-preserving, every Go gate green on my own re-run, the matched disposable bed passing on a fresh rebuild (final-code run 1242 corroborated on disk), and correct architectural placement. Finalizing the merge-time CalVer and merging --squash.

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

Evaluator merge-time version stamp: rename the placeholder CHANGELOG to the
finalized 2026.194.1254 and rewrite its H1 to match.

Assisted-by: Claude (fully tested and validated)
Claude-Session: https://claude.ai/code/session_01H4fhMBpXvVTpgcpVPnUmpV
@atrawog
atrawog merged commit 0d7472d into main Jul 13, 2026
@atrawog
atrawog deleted the feat/k4-deploy-resolution branch July 13, 2026 12:56
atrawog added a commit that referenced this pull request Jul 15, 2026
… + box-authoring → command:authoring (P14b)

feat(p14)!: consolidate status collectors → substrate OpStatus + box-authoring → command:authoring

The consolidated P14-remainder cutover — TWO disjoint, already-implemented cutovers
landed as ONE atomic superproject cutover via a 3-leg B2 multi-repo landing
(sdk → plugins → super). Net core LOC negative (1301 insertions / 1486 deletions
on the super leg; the plugin grows, core shrinks).

Leg 0 (sdk, merged 5303941, tag v0.2026196.449, PR opencharly/sdk#53):
  CUE-sourced wire carriers for the status-collector host↔plugin seam —
  #SubstrateStatusRequest / #SubstrateStatusReply + StatusFromState (R3 single-source).

Leg 1 (plugins, merged 93b3010, tag v2026.196.0456, PR opencharly/marketplace#64):
  skill-doc R5 sweep for both halves (documentation reviewed).

Leg 2 (super, this merge):
  P14a — status COLLECTORS clean subset → substrate OpStatus (HOW A):
    charly/{cdp_preresolve,status_collect_local,status_collect_pod,status_probes,
    status_golden_test,status_live_mounts_test,status_quadlet_test}.go + their tests
    DELETED from core; the LIVE collection half + the probes + the cdp devToolsTab
    decode MOVED to candy/plugin-substrate over the new OpStatus wire seam;
    enginekit shed from charly/ core imports. The 7 deploy-cone-coupled status files
    STAY host until K5 (PR #91). Deleted host tests faithfully relocated to
    candy/plugin-substrate/status_test.go (26 tests, no coverage dropped).
  P14b — box-authoring command family → command:authoring plugin:
    charly/scaffold_cmds.go + scaffold_project.go (399 LOC) DELETED; the 5 pure verbs
    run on sdk/kit (zero core reentry); box fetch/refresh reenter core over the new
    hidden __box-fetch/__box-refresh reentry via HostBuild("cli").
  R5 sweep: cdp_preresolve.go → check_endpoint_resolve.go (candy/plugin-cdp/methods.go);
    status_golden_test.go → relocated plugin golden (candy/plugin-status/charly.yml).
  Gitlink bumps: sdk → 5303941; plugins → 93b3010; charly/go.mod require → v0.2026196.449.

Verification (worktree binary, task build:binary, NOT installed):
  go test ./... (charly): ok 80.709s
  candy/plugin-{substrate,authoring,status,cdp}: go test/build ok
  golangci-lint run (charly): 0 issues
  gofmt -l (charly): empty
  go vet ./... (charly): clean
  task cue:gen (super): reproducible (no drift)
  R5 grep self-test: deleted identifiers only in CHANGELOG/ + "moved from" help-text

R10 bed — charly check run check-commands-local (disposable: true):
  summary.yml ok: true, 5/5 steps (deploy-add 70s, bring-up 0s, check-live 27s,
  update 89s [fresh charly update], cleanup 19s), total 205s.
  check-live 7/7 passed incl. status-runs (P14a charly status via status-substrate
  seam → substrate OpStatusCollect) + box-authoring-dispatches (P14b authoring verbs).
  ZERO warnings. Moved code executed LIVE on the worktree binary.

Architecture gate: placement CORRECT.
  Status collectors → R (substrate plugin OpStatusCollect).
  Host fan-out/enrichment → M (kind-blind dispatch by word, stays core).
  vm/k8s/android collectors stay host-side (deploy-cone-coupled, K5-gated, named exit).
  enginekit shed from core. command:authoring → R (command class plugin).
  box_fetch_reentry → K5-doomed hidden reentry (tracked residue, named K5 exit).
  No new charly/*_aliases.go; no new charly sdk-kit import. Net charly/*.go LOC −2128.

Assisted-by: Claude (fully tested and validated)
atrawog added a commit that referenced this pull request Jul 19, 2026
plugins#91 landed as squash 9caed76 (tag v2026.200.1455); its fresh
validator proved tree-equality with the validated head 680188f. The
superproject gitlink moves from the feat candidate commit 5917a23 to the
merged protected-main commit (B2: the pointer references a commit on the
submodule's real main). Verified via git diff --cached --submodule=short
(exactly 5917a23..9caed76) and post-commit git ls-tree HEAD plugins.

Assisted-by: Kimi Code Moonshot Kimi K3 (analysed on a live system)
atrawog added a commit that referenced this pull request Jul 19, 2026
…cendant-wins

main advanced with the #152/#153 plugins-submodule bumps (now at plugins
main a58da76 = post-#95); the branch recorded 9caed76 (post-#91). The
gitlink conflict resolves descendant-wins to a58da76 (a descendant of
9caed76: #93/#94/#95 are docs-only skill accuracy fixes), so the branch
cannot regress main's pointer. Delta gate: charly box validate re-run.

Assisted-by: Kimi Code Moonshot Kimi K3 (analysed on a live system)
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