Repository navigation
feat(validate)!: move the charly box validate ENGINE out of core into candy/plugin-box (K3-D+) - #107
Conversation
… 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
pr-validator — APPROVED ✅Change class: charly Go (workspace-member) — the superproject leg of #60 (K3-D+): the Coordinates (real head Independently re-ran (final tree):
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 ( 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; Assisted-by: Claude (fully tested and validated) |
…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)
superproject leg of #60 (K3-D+) — move the
charly box validateENGINE out of core into candy/plugin-boxThe 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-incandy/plugin-boxplugin, which reads the resolved-project envelope (spec.ResolvedProject) instead of the runtime*Candy/*Configgraph. 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→ structuredOpValidate→spec.Diagnostics). ~2054 net LOC leave core. Consumes merged sdk7e9aafe(envelope growth, sdk#45) + merged pluginsd94a53b(docs leg, plugins#52).Deliberate consistency fix —
charly box validateerror 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 + returningExitCodeError(which had made validate the lone box subcommand without thecharly: 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-validatereentry; replicating a dead path's accident is worse than sibling-consistency.Two hidden side-channels the cutover exposed (both RCA'd + fixed here)
validateBoxDAGsilently continued past; the tolerant branch now silent-skips, matching the old verdict.intent_do(golden-labels-caught, charly-only fix) — the old in-coreValidate()stamped each step'sOp.IntentDoas a SIDE EFFECT of mutating the shared structs, and theai.opencharly.descriptionbake serialized them. The plugin engine validates an envelope COPY, so the side channel died and the label bakedintent_do-less steps.bakeableStepsnow applies the stamp DELIBERATELY on its own baked copy (stampStepIntentDo, over the sharedkit.StepDoModederivation); verb-less agent-check steps keep an emptyintent_do, matching the pre-cutover bake. Regression guard:TestBakeableSteps_StampsIntentDo(fails without the stamp); empirically proven — the generated label carriesintent_do":"assert"on every check step.Scope dispositions (on the record, never silent)
rca-loc-variance.md. So docs(submodules): bump plugins to the pr-validator bed-coverage strengthening #60 lands as A/B/C + P2B + chore(box/cachyos): bump gitlink — charly-cachyos is no longer a check bed #46, NO Unit D.envVarNameToPodmanSecretSlugnow exists in bothcharly/validate.go(host-natural keep-set) andcandy/plugin-box(the plugin can't import core) — accepted register row (fix(retention): make liveBuildFloor injectable so the prune tests are hermetic #73) with a convergence exit: it collapses when the host-natural validate set moves K-wave.plugins/image/skills/image/SKILL.mdcites deletedcharly/graph.go— K3-A graph-fold residue, documented in the plugins CHANGELOG, left untouched.Verification (change class: charly Go code)
go build -o bin/charly ./charly0 ·go test ./...PASS (charly + plugin-box, 0 FAIL) ·golangci-lint run0 issues (charly + plugin-box) ·gofmtclean ·task cue:genreproducible. 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-validateonly in CHANGELOG). The 57 bakedvalidate_fixture_test.gofixtures 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 fullfully tested and validatedR10 — this PR isanalysed on a live systempending that roster + the freshpr-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/collectionKindsgrep-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)