Skip to content

feat(validate)!: move the charly box validate ENGINE out of core into candy/plugin-box (K3-D+) - #107

Merged
atrawog merged 4 commits into
mainfrom
feat/k3d-resolve-domain
Jul 14, 2026
Merged

atrawog merged 4 commits into
mainfrom
feat/k3d-resolve-domain

Conversation

@atrawog

@atrawog atrawog commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

superproject leg of #60 (K3-D+) — move the charly box validate ENGINE out of core into candy/plugin-box

The final leg of task #60 (Units A/B/C + P2B + #46). The ~900-line per-kind/op validate rule ENGINE + the ~527-line candy/box graph re-run move OUT of charly/ core INTO the compiled-in candy/plugin-box plugin, which reads the resolved-project envelope (spec.ResolvedProject) instead of the runtime *Candy/*Config graph. Core keeps only the tolerant projector, the host-natural checks (CUE-conformance + build/distro/merge/tunables/builder-refs/remote-candies), and the build-gate dispatch (command:validate → structured OpValidate → spec.Diagnostics). ~2054 net LOC leave core. Consumes merged sdk 7e9aafe (envelope growth, sdk#45) + merged plugins d94a53b (docs leg, plugins#52).

Deliberate consistency fix — charly box validate error output (decoration ruling B)

Validate now surfaces a failed validation IDENTICALLY to its sibling box subcommands box generate/box pkg — through the standard command-error path (charly: error: command "validate": N validation errors: …, exit 1) — instead of printing directly + returning ExitCodeError (which had made validate the lone box subcommand without the charly: error: decoration). The VALIDATION VERDICT (which rules fire + their messages + the exit code) is byte-identical to the pre-cutover engine (golden corpus). OLD's two-line decoration was an accidental artifact of the deleted __box-validate reentry; replicating a dead path's accident is worse than sibling-consistency.

Two hidden side-channels the cutover exposed (both RCA'd + fixed here)

  1. Tolerant-projector over-report — the resolved-project projector filled a "resolving box" diagnostic for a resolve failure the pre-cutover validateBoxDAG silently continued past; the tolerant branch now silent-skips, matching the old verdict.
  2. Baked-label intent_do (golden-labels-caught, charly-only fix) — the old in-core Validate() stamped each step's Op.IntentDo as a SIDE EFFECT of mutating the shared structs, and the ai.opencharly.description bake serialized them. The plugin engine validates an envelope COPY, so the side channel died and the label baked intent_do-less steps. bakeableSteps now applies the stamp DELIBERATELY on its own baked copy (stampStepIntentDo, over the shared kit.StepDoMode derivation); verb-less agent-check steps keep an empty intent_do, matching the pre-cutover bake. Regression guard: TestBakeableSteps_StampsIntentDo (fails without the stamp); empirically proven — the generated label carries intent_do":"assert" on every check step.

Scope dispositions (on the record, never silent)

Verification (change class: charly Go code)

go build -o bin/charly ./charly 0 · go test ./... PASS (charly + plugin-box, 0 FAIL) · golangci-lint run 0 issues (charly + plugin-box) · gofmt clean · task cue:gen reproducible. Golden corpus = verdict-PARITY (5 real fixtures — good exit0 + missing-candy/typo/dup-volume/dup-alias exit1 — old-in-core-engine 000705e vs this tree, identical rule messages + exit codes). R5 grep clean (__box-validate only in CHANGELOG). The 57 baked validate_fixture_test.go fixtures exercise the real loader→plugin pipeline. The bed roster (check-commands-local / check-sidecar-pod / rich-box build+labels golden) is the orchestrator's lane for the full fully tested and validated R10 — this PR is analysed on a live system pending that roster + the fresh pr-validator's independent golden re-run.

R0–R10

R1 — every failure/warning RCA'd (the vacuous-corpus catch, the two side-channels, the QF1008 lints). R2 — no deferred issues (Unit D ruled; the two side-channels fixed in-tree; #73 registered). R3 — one forced cross-module dup registered with a convergence exit. R5 — deleted __box-validate/validate_check.go/collectionKinds grep-clean; validate.go kind-blind. R7/R8 — the intent_do fix verified on the emitted Containerfile label (R8). R10 — corpus + generate ran live; bed roster pending (orchestrator).

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

atrawog added 2 commits July 14, 2026 08:18
… candy/plugin-box (K3-D+)

Task #60 Units B+C: the ~900-line per-kind/op validate rule engine + the ~527-line
candy/box dependency-graph re-run move OUT of charly/ core INTO the compiled-in
candy/plugin-box plugin, which reads the resolved-project envelope (spec.ResolvedProject)
instead of the runtime *Candy/*Config graph. Core keeps only the host-natural checks
(CUE-conformance + build-tunable/merge), the tolerant resolved-project projector, and the
build-gate dispatch (command:validate → structured OpValidate → spec.Diagnostics).

Deletes the __box-validate core reentry (main.go ValidateCmd) and validate_check.go;
slims validate.go 2129 -> ~410 to the host-natural keep-set; deletes the dead legacy
collectionKinds arm (validate.go is now kind-blind) + the dead-code cascade. ~2054 net
LOC leave core. The ~65 synthetic validate tests convert to on-disk fixtures over the real
loader->plugin pipeline (no-net-loss, 67-scenario mapping). P2B: BoxMetadata -> spec.
charly box validate behaviour unchanged (golden parity corpus, byte-identical errors).

Assisted-by: Claude (analysed on a live system)
Claude-Session: https://claude.ai/code/session_017tVLzcTYLXKebGNmMv25fX
…merged K3-D+ sdk gitlink)

The super leg's sdk gitlink is 7e9aafe (tag v0.2026195.604, the merged envelope-growth leg);
align charly/go.mod's require version so an out-of-tree consumer resolves the same sdk. In-tree
builds ride `replace => ../sdk`, so this is version-pin hygiene, not a build change.

Assisted-by: Claude (analysed on a live system)
Claude-Session: https://claude.ai/code/session_017tVLzcTYLXKebGNmMv25fX
@atrawog

atrawog commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Change class: charly Go (workspace-member) — the superproject leg of #60 (K3-D+): the charly box validate rule ENGINE moves out of core into candy/plugin-box, reading the resolved-project envelope.

Coordinates (real head b038f3f; gh pr view lagged at e0763b7): sdk gitlink 7e9aafe ✓ · plugins gitlink d94a53b ✓ · charly/go.mod require v0.2026195.604 ✓ (author's bump commit b038f3f).

Independently re-ran (final tree):

  • GOWORK=off go mod verify ✓ · gofmt clean (charly+plugin-box) · go build ./... 0 · go vet 0 · golangci-lint run ./... 0 issues (charly AND plugin-box) · go test: charly validate suite PASS + plugin-box PASS + TestBakeableSteps_StampsIntentDo PASS + TestPluginsGenReproducible PASS.
  • Parity corpus (5 fixtures, non-vacuous): OLD /usr/bin/charly 2026.195.0522 (validate-in-core) vs NEW stamped 2026.195.0618 (validate-in-plugin) → all 5 match (good exit0 + missing-candy/typo/dup-volume/dup-alias exit1).
  • R10 beds corroborated from disk (fresh calver 2026.195.0622, 2026.195.0618 binary): check-commands-local 5 steps/122s ok · check-sidecar-pod 11 steps/316s ok (image-build, check-live, update=fresh-rebuild, feature-run+feature-run-rebuild).
  • intent_do fix INDEPENDENTLY PROVEN: podman inspect check-sidecar-pod:2026.195.0626 → ai.opencharly.description carries "intent_do":"assert" ×17 (every check step); label non-empty (R8).

Checklist: [PASS] 0 security · [PASS] 1 desc · [PASS] 2 gate (workspace-member re-run + beds + corpus) · [PASS] 3 tier fully tested and validated (fresh-rebuild R10 beds + changed validate/intent_do paths executed live + independent corpus + independent label proof) · [PASS] 4 R0 · [PASS] 5 R1 · [PASS] 6 R2 (Unit D=D1 RCA'd → K4 IOU; side-channels fixed in-tree) · [PASS] 7 R3 (envVarNameToPodmanSecretSlug forced cross-module dup, tracked #73 with a concrete host-natural-K-wave convergence — a clean share needs an sdk/kit round-trip that self-resolves at that wave) · [PASS] 8 R4 · [PASS] 9 R5 (__box-validate/validate_check.go/collectionKinds grep-clean; kept validate.go kind-blind; bed check-description swept) · [PASS] 10 R6/R8/R9 · [PASS] 11 R10 (57 fixtures + corpus + regression) · [PASS] 12 SDD (no new wire struct; plugin-box input-less; pluginsgen reproducible) · [N/A] 13 concurrency (validate = read-only config gate) · [PASS] 14 hard cutover · [PASS] 15 placement: CORRECT (engine+rules→plugin-box R; build-gate dispatch→M registry K3-exit; tolerant projector + kind-blind host-natural checks in core) · [N/A] 16 · [PASS] 17 go gates · [PASS] 18 CHANGELOG.

Decision: APPROVED, tier fully tested and validated. The boundary law is honored (capability engine → plugin, kind-blind dispatch → core M-mechanism with a named K3 exit; kit_aliases.go SHRANK). Verdict-parity is byte-proven old-vs-new by my independent corpus; the intent_do side-channel fix is honest (deliberate stampStepIntentDo on the bake's own copy over the deterministic kit.StepDoMode; verb-less→empty matching OLD) and independently confirmed on a fresh-rebuild label (×17). Test migration is no-net-loss (67 rows, 0 drops). Finalizing the merge-time CalVer + tag; #60 completes.

Assisted-by: Claude (fully tested and validated)

atrawog added 2 commits July 14, 2026 08:46
…erproject leg)

Merge-time version stamp by the fresh pr-validator: CHANGELOG placeholder renamed to the merge CalVer + H1 rewritten (staged). No code change.

Assisted-by: Claude (fully tested and validated)
#108 gitlink-ancestor recovery)

Brings in #108 (Cutover Sizing Law docs/hook + plugins pointer 2f37adb, a descendant of this branch's d94a53b). sdk stays 7e9aafe. No code change to the validate cutover.

Assisted-by: Claude (fully tested and validated)
@atrawog
atrawog merged commit c9befd8 into main Jul 14, 2026
@atrawog
atrawog deleted the feat/k3d-resolve-domain branch July 14, 2026 06:50
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