Skip to content

feat(spec): P14a — #SubstrateStatusRequest/Reply collector wire types + StatusFromState mapper - #53

Merged
atrawog merged 2 commits into
mainfrom
feat/p14a-opstatus-wire
Jul 15, 2026
Merged

atrawog merged 2 commits into
mainfrom
feat/p14a-opstatus-wire

Conversation

@atrawog

@atrawog atrawog commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

P14a sdk half — #SubstrateStatusRequest/Reply collector wire types + StatusFromState mapper

Leg 0 of the consolidated P14-remainder 3-leg B2 landing (sdk → plugins → super). This is the
sdk contract leg: two CUE-sourced wire carriers for the status-collector host↔plugin seam,
plus the shared pure state-vocabulary mapper. All additive, zero break. The collector MOVE
itself (the plugin side + the core deletion) lands in the super leg (leg 2), which composes
this merged sdk via the gitlink bump. Merging this sdk PR first is the B2 producer→consumer
order: the super gitlink must point at a commit on sdk main.

What this lands (3 sdk files + CHANGELOG)

  • schema/status.cue — two new self-contained wire defs:
    • #SubstrateStatusRequest — the per-substrate COLLECTOR request the host sends to the
      substrate plugin's OpStatusCollect: scalar inputs a sdk-only candy cannot derive
      (engine_bin, run_mode, quadlet_dir, include_all, single-path box+instance).
      NO deploy-cone (BundleConfig/UnifiedFile) crosses this seam — deploy enrichment stays
      host-side until K5, applied to the live rows the reply returns. vm/k8s/android deferred to K5
      (deploy-cone-coupled); the plugin returns no rows for those words until then.
    • #SubstrateStatusReply — the per-substrate COLLECTOR result: the LIVE rows the substrate
      plugin produced (pod: snapshot-derived + live mounts + tool probes; local: install-ledger
      rows); single carries the one pod detail row.
  • spec/cue_types_gen.go — regenerated via task cue:gen (cue exp gengotypes): the two Go
    structs SubstrateStatusRequest / SubstrateStatusReply (json+yaml tags via schemagen -mode=retag).
  • spec/status_types.go — StatusFromState(state string) string: the shared pure
    state-vocabulary mapper (normalises engine/container states to charly's
    DeploymentStatus.Status vocabulary). R3 single-source for the plugin pod-live collector
    (P14a) AND the host-side vm collector (charly/status_collect_vm.go, deploy-cone-coupled →
    stays core until K5). Pure over its input (no core reentry). This is a pure non-wire
    helper function — the legal non-wire category; the wire carriers above are CUE-generated.

SDD compliance

Wire types are CUE-sourced and task cue:gen-generated (no hand-written wire struct — the #SubstrateStatus*
defs → cue_types_gen.go). StatusFromState is a pure non-wire mapper function, the legal
non-wire category (a function, not a wire/data-carrier struct). task cue:gen reproducible: run
twice, tree clean (no drift).

Verification — sdk standalone battery (B2 per-module, GOWORK=off)

go mod tidy      → no-op (no go.mod/go.sum drift)
go mod verify    → all modules verified
go build ./...   → exit 0
go test ./...    → ok (sdk 0.159s, deploykit, enginekit, kit 4.483s, loaderkit, spec 0.322s, vmshared)
golangci-lint run → 0 issues
gofmt -l .      → empty
go vet ./...    → clean
task cue:gen (run 1) → regenerated, no drift
task cue:gen (run 2) → regenerated, no drift (reproducible)

The new wire types are exercised live by the composition (super-leg tree):

candy/plugin-substrate go test  → ok 0.006s   (the plugin imports SubstrateStatusRequest/Reply)
charly go test -run 'Status|Substrate|Cdp' → ok 1.191s

The fresh-rebuild disposable bed (charly check run check-commands-local) runs on the super
leg
(leg 2) — that is the consolidated R10 gate for the whole P14-remainder cutover. This sdk
leg's gate is the standalone contract-module battery above.

R0–R10 checklist

  • R0 skills loaded (git-workflow, plugin, agents) before any action
  • R1 no failure/anomaly surfaced (all gates green)
  • R2 every surfaced issue fixed in-cutover (none outstanding)
  • R3 generic + single-source: StatusFromState is the ONE mapper shared by plugin + host vm collector
  • R4 no workarounds (pure function, CUE-sourced wire)
  • R5 no deprecated path deleted here (additive only — the core deletion is the super leg)
  • R6 no destructive working-tree action (preserved p13r; new sdk branch off origin/main)
  • R7/R10 sdk contract-module battery passed (build/test/lint/cue:gen/vet/fmt); live composition tests pass; disposable bed is the super leg's gate
  • R8 generated artifact (cue_types_gen.go) verified reproducible (cue:gen run twice, no drift)
  • R9 module battery ran on the sdk source tree
  • SDD: wire types CUE-sourced + generated; non-wire mapper is the legal category

Tier

Assisted-by: Claude (analysed on a live system) — the sdk module battery ran live
(go test ./... pasted) AND the new wire types are exercised live by the composition tests
(plugin-substrate + charly Status tests, pasted). The fresh-rebuild disposable bed (which would
earn fully tested and validated) runs on the super leg.

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

… + StatusFromState mapper

The sdk half of the P14a status-COLLECTOR move (consolidated P14-remainder, B2 leg 0). The
cleanly-movable status collectors (pod live + local + the probes) relocate from charly/ core
into candy/plugin-substrate (super leg), served on the substrate kind provider's Invoke by
word. This sdk leg adds the TWO CUE-sourced wire carriers the host<->plugin seam needs, plus
the shared state-normalising mapper — all additive, zero break.

- schema/status.cue: #SubstrateStatusRequest (the collector request — engine_bin/run_mode/
  quadlet_dir/include_all/single/box/instance; NO deploy-cone crosses the seam) +
  #SubstrateStatusReply (the LIVE rows the plugin produced; host applies deploy enrichment
  after). vm/k8s/android deferred to K5 (deploy-cone-coupled).
- spec/cue_types_gen.go: regenerated via task cue:gen (cue exp gengotypes) — the two Go structs.
- spec/status_types.go: StatusFromState — the shared pure state-vocabulary mapper (R3
  single-source for the plugin pod-live collector + the host vm collector that stays core
  until K5). Pure non-wire helper; the wire carriers are CUE-generated.

SDD: wire types CUE-sourced + generated; StatusFromState is the legal non-wire pure-mapper
category. cue:gen reproducible (run twice, tree clean).

Verification (sdk standalone battery, B2): GOWORK=off go mod tidy (no-op) + go mod verify +
go build ./... + go test ./... (all ok) + golangci-lint run (0 issues) + gofmt -l (empty) +
go vet (clean). New wire types exercised live by the composition: candy/plugin-substrate go
test ok + charly go test -run 'Status|Substrate|Cdp' ok. Fresh-rebuild disposable bed runs on
the super leg.

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

atrawog commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Change class: charly/sdk Go (runtime class — sdk standalone contract module)

Fresh, independent re-validation of opencharly/sdk #53. I re-derived every check from the diff + my own re-runs; no author claim was inherited.

Security & anti-tampering (T1–T4)

  • No exfiltration / scope-mismatch / weakened-gate / supply-chain finding. The PR does not touch the validator spec, CLAUDE.md, hooks, or branch protection. No embedded directives aimed at the validator. Scope matches the description exactly (two CUE wire types + a pure mapper, additive, zero break).

Checklist (R0–R10 + pillars)

  • [PASS] 0. security screen — no findings
  • [PASS] 1. description complete — full template with summary, SDD compliance, pasted module-battery output, R0–R10 checklist answered with HOW, tier justification
  • [PASS] 2. change-class gate — sdk is a standalone-consumed contract module (B2 per-module); the standalone battery is the correct gate; disposable bed is the super leg's gate (B2 producer→consumer)
  • [PASS] 3. attribution tier — analysed on a live system is justified and NOT inflated: the module battery ran live AND the composition tests exercise the new types live (I re-ran both independently); no disposable bed on this leg (the bed is the super leg's gate)
  • [PASS] 4. R0 skills — git-workflow, plugin, agents loaded by path; SDD/wire-type law from plugin skill
  • [PASS] 5. R1 — zero failures/warnings/anomalies in my re-run
  • [PASS] 6. R2 — no pre-existing/out-of-scope split; all additive
  • [PASS] 7. R3 — StatusFromState is the ONE single-sourced mapper (plugin pod-live + host vm collector)
  • [PASS] 8. R4 — no workarounds; pure function, CUE-sourced wire
  • [PASS] 9. R5 — no deprecated path deleted (additive; core deletion is the super leg)
  • [PASS] 10. R6/R8/R9 — cue_types_gen.go reproducible (run twice, no drift); module battery on sdk source tree
  • [PASS] 11. R10 — sdk contract-module battery is the gate for this leg; super leg owns the disposable bed
  • [PASS] 12. SDD — wire types CUE-sourced + generated (no hand-written wire struct); StatusFromState is the legal non-wire category (a pure function); cue:gen no-op reproducible
  • [N/A] 13. concurrency — no shared-state path touched (additive wire types + pure function)
  • [PASS] 14. hard cutover — ONE commit on the feat branch; no Phase-2/TODO
  • [PASS] 15. ARCHITECTURE GATE — placement: CORRECT. Wire types (E-envelope carriers — wire replies plugins resolve into) belong in sdk/spec (CUE-first, the contract layer). StatusFromState is a kind-blind reusable helper consumed by ≥2 consumers (plugin + host vm collector) → sdk/spec. No new alias, no new charly kit import. Goal-fit: externalizes status collectors toward the plugin-host end-state.
  • [N/A] 16. disposable-only autonomy — no autonomous destroy/rebuild on this leg
  • [PASS] 17. clean architecture + go gates — gofmt empty, golangci-lint 0 issues, vet clean, test green
  • [PASS] 18. CHANGELOG present — placeholder CalVer (finalized at merge)

Independent re-verification (my own runs)

  • File set: schema/status.cue (+29), spec/cue_types_gen.go (+36), spec/status_types.go (+29), CHANGELOG/2026.196.9999.md (new). 4 files, 141+/0-. Matches the claim.
  • task cue:gen run 1 → tree clean; run 2 → tree clean (reproducible, no drift).
  • GOWORK=off go mod verify → all modules verified; go build ./... → exit 0; go test ./... → all ok (spec 0.304s); golangci-lint run → 0 issues; gofmt -l . → empty; go vet ./... → clean.
  • Composition (super-leg worktree, sdk on feat branch): candy/plugin-substrate go test → ok; charly go test -run 'Status|Substrate|Cdp' → ok — the new wire types ARE exercised live.
  • Generated banner present (Code generated by cue exp gengotypes; DO NOT EDIT.).

Decision: APPROVED. The sdk leg is additive, CUE-sourced, reproducible, and the composition exercises the new types live. The analysed on a live system tier is honest (module battery + composition live; disposable bed is the super leg's gate). Proceeding to finalize the merge-time CalVer, merge, and tag.

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

@atrawog
atrawog merged commit 5303941 into main Jul 15, 2026
@atrawog
atrawog deleted the feat/p14a-opstatus-wire branch July 15, 2026 04:55
atrawog added a commit to opencharly/charly 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)
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