Repository navigation
fix(plugin): resolve a kind's value def the way the gate does, so a moved body stays judged - #1126
Conversation
…oved body stays judged The consumer half of unit 1's leg 4 (tracker opencharly/spec#304). opencharly/spec#305 deleted the #Pipeline* body defs (they are plugin-pipeline's CUE since opencharly/plugin-pipeline#63) and opencharly/sdk#502 deleted the kind-aware workflowkit machinery; this PR pins both merges and teaches the corpus sweep's selection to resolve a kind's value def the way the production gate does. THE TRAP. charly/kind_value_corpus_sweep_test.go selected bodies with spec.KindValueDefs[pn.Disc]. With #PipelineValue gone from the base, that predicate judges ZERO pipeline bodies and still PASSES: on the fresh-origin/main corpus the witness drops 431 -> 418 with 13 pipeline bodies -> 0, and the full-corpus arm drops 2,004 -> 1,992. THE FIX. Selection now goes through kindValueDefPath(prov, disc) - the gate's own resolver: the provider's declared InputDef first, spec.KindValueDefs as the compatibility fallback - and the provider is resolved by gatedKindProvider, which asks the registry and, on a miss, the loader's on-demand connect (connectPluginByWord) for a kind whose body lives in a plugin. That is what makes plugin-pipeline's `InputDef: "#PipelineValue"` visible to the witness. The connect is bounded: cached per word, attempted once, and OFF for the default-suite corpus test (a plain `go test ./...` must never build a plugin or hit the network). The `base` arm stays the pre-change oracle and now skips, visibly and counted, a def the base no longer declares. MEASURED. 2,004 bodies / 12 pipeline bodies on the full-corpus arm and 431 / 13 on the fresh-origin/main arm, with the full arm's verdict list byte-identical to the pre-change run (sha256 c99e948b...). (The campaign's "2,004" and "13 pipeline bodies" come from two different corpus roots - the full checkout is one fixture behind origin/main - so both arms are reported rather than one fitted to the other.) PINS. sdk -> v0.2026316.1848, spec -> v0.2026316.1928, in charly/go.mod and every lockstep tools/* module (charly task mods-tidy); tools/gomod-canonical's TestContractPinsMatchShared is green. Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: The evidence is unusually strong and internally consistent (arm A 2,004 bodies / pipeline 12; arm B 431 / pipeline 13; silent-loss 519−101=418 with 0 pipeline — all reconcile). The blocks below are about body/comment truthfulness against the current diff and R10 coverage, not about the pins. Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Round-1 review findings on #1126, all three fixed here. 1. `TestSweepLoopJudgesAPluginDeclaredGateDef` drives `runCorpusSweep` (the loop itself, now extracted from the test body) over a fixture corpus that authors one body of a kind whose `#<Kind>Value` def exists only in a served unit, and asserts the body is JUDGED. Reverting the loop's selection to `spec.KindValueDefs[pn.Disc]` is red on assertions; the previous witness exercised only the helper and passed with the loop reverted. 2. The `gatedKindProvider` doc comment named the wrong `connect=false` caller: it is the default-suite witness, not "the default-suite corpus test". Corrected. 3. The `base` arm's "skips visibly, counted" claim now has an executed run in the PR body: `gate=base: judged 1992 entity bodies (…, 12 bodies the base arm cannot judge)` on the full corpus. No production code changed: `charly/provider_kind_invoke.go` is untouched. Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
|
STATUS — round 1's three blocks are fixed in a new commit; the body is re-finalized for the new head. Agent: dsh-unit1-legs34 (DeepSeek Harness, ollama-cloud/deepseek-v4.1-flash) RCA — the missed controlsBlock 2 (no test guards the LOOP). Mechanism: my witness drove Block 1 (Summary quoted stale code). Mechanism: the Summary was written before the Block 3 (comment divergence + unexecuted claim). Mechanism: the No production code changed — Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated) |
Review — PASSHead SHA: Security screen: PASS — pins point at the org's own Checklist: All applicable rules PASS or NA. Diff↔body reconcile: Summary quotes Comments:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
The consumer half of unit 1's leg 4 (
TODO.md2.1, trackeropencharly/spec#304).opencharly/spec#305deleted the#Pipeline*body defs andopencharly/sdk#502deleted the kind-awareworkflowkitmachinery; this PR movescharlyonto those releases, and teaches the corpus sweep to resolve a kind's value def through the SAME route the production gate uses — so the 13 pipeline bodies the corpus authors stay in the witness after their def leaves the base schema.1. The sweep's selection follows the production resolver
charly/kind_value_corpus_sweep_test.goselected bodies withspec.KindValueDefs[pn.Disc]. With#PipelineValuegone fromspec, that predicate silently drops every pipeline body: the witness shrinks and nothing fails. The selection now asks the route the loader asks:gatedKindProvider(disc, connect)isproviderRegistry.ResolveKindand, whenconnectis true and the word is unregistered,connectPluginByWord(ClassKind, disc)— the function the loader uses to connect a referenced plugin kind (it host-builds and registers the unit, which is what makesplugin-pipeline'skindcapability'sInputDef: "#PipelineValue"visible). The provider is cached per word, so a failed connect is attempted once, not once per body.Two callers, deliberately different: the sweep's loop (
runCorpusSweep) passestrue;TestSweepSelectionResolvesAPluginDeclaredGateDefpassesfalseand registers its provider directly, so a plaingo test ./...never builds a plugin or touches the network. A miss is cached only when a connect was actually attempted, so the false caller cannot poison the loop's resolution.The
basearm — the pre-change oracle — still resolves in the base alone and SKIPS, visibly and counted, a def the base no longer declares:gate=base: judged 1992 entity bodies (1646 files unparsable, 12 bodies the base arm cannot judge)on the full corpus (all 12 are the pipeline bodies), against the composed arm's 2,004.2. The pins
github.com/opencharly/sdkandgithub.com/opencharly/specmove to the merge-time tags of legs 3 and 4 incharly/go.modand in every locksteptools/*module (charly task mods-tidy), andtools/gomod-canonical'sTestContractPinsMatchSharedis the gate that keeps them lockstep.How tested
The sweep — before and after, on two corpus roots, verdicts byte-identical
Arm A — the full corpus (the session umbrella checkout, 2,828 YAML files, every submodule materialized):
2,004 bodies in, 2,004 out; every one of the 12 pipeline bodies still judged (3 OK / 9 FAIL, unchanged). The deletion of the base def moved nothing because the def is resolved from
plugin-pipeline's served unit now — and the verdict list is byte-identical, not merely equal in count.Arm B — a fresh umbrella worktree at
origin/main(139898d, the tree leg 2 used; three submodules materialized, 431 bodies) carries one more pipeline fixture than arm A (design/negative/ask-no-answer.yaml), so it has 13 pipeline bodies — the campaign's figure:The two numbers the campaign quoted — "2,004 bodies" and "13 pipeline bodies" — come from two different corpus roots, not from one: the full checkout is one fixture behind
origin/main(ask-no-answer.yamlis newer than its umbrella commit), so it carries 12 pipeline bodies at 2,004 total. Both arms are reported above rather than one being manufactured to fit the other.The plant — red on ASSERTIONS, restored byte-identical
Two witnesses, one per layer, and each is red on assertions when its layer regresses.
The LOOP —
TestSweepLoopJudgesAPluginDeclaredGateDefdrivesrunCorpusSweepover a fixture corpus authoring onegateprobe:body whose def only a served unit declares, and asserts the body is JUDGED. Reverting the loop's selection to the pre-change predicate (spec.KindValueDefs[pn.Disc]) is red on assertions:The RESOLVER —
TestSweepSelectionResolvesAPluginDeclaredGateDefregisters a served unit whose#GateprobeValuethe base does not declare, puts its provider in the real registry, and asserts the resolver both SELECTS the kind and names the declared def. Disabling the declared-def branch ofkindValueDefPathis red on assertions:The loss the change prevents — MEASURED, not described
The same corpus, the same tree, with the SELECTION reverted to the pre-change predicate (
spec.KindValueDefs[pn.Disc]) and everything else identical. This is the silent 13-body loss in numbers — note the test still PASSES:519 lines − 101 unparsable files = 418 bodies judged, 0 pipeline bodies — against 431 bodies with all 13 judged under the taught selection. The pre-change predicate reports success over a witness that lost its subject.
The repo gate and the pin gate
The R10 bed
check-loader-flat-import-localon this tree (the pins point at the merged tags, so the driver contains both legs):go version -mcannot prove the binary's commit (-buildvcs=false); the identity ischarly versionagainstscripts/calver.shplus the bed'sdriver_version.Rulebook compliance
/charly-internals:go,/charly-internals:plugin,/charly-internals:cue,/charly-internals:cutover-policy,/charly-internals:strict-policyand/charly-internals:git-workflowbefore any repo action, plus this repo'sAGENTS.md.spec.KindValueDefswould have dropped 12–13 bodies silently. Root cause: the sweep's selection was frozen to the pre-change schema source while the gate's resolution moved. Fix: both now resolve throughkindValueDefPath, and the plant proves the difference. No gate above warns.kindValueDefPath/validateKindValueCUErather than re-implementing a second predicate.spec.KindValueDefsuse is accounted for, by role, not by hope:_test.go:113is thebasearm, the pre-change ORACLE that must resolve in the base alone;:145is the new witness's discrimination guard (the base must NOT carry the probe def);composed_test.goasserts the fallback still answers for a kind the base keeps. No selection site resolves a moved def through the base any more.git statuswas empty in this worktree before the first edit; no force-push, no bypass.Change classification
Change class: loader/gate consumer change — the corpus sweep's selection plus the contract-module pins that carry legs 3–4 into this tree.
Breaking change + rollback: none for consumers of
charly's CLI or schema. The pins advance to merged tags, so nothing in this diff introduces a surface change of its own; the breaking surface was declared and reviewed insdk#502(!) andspec#305(!). Rollback is a revert of this squash commit, which returns the pins to the pre-leg tags.Filed issues
Closes
opencharly/charly#1125— the consumer half this PR lands (the sweep's selection + this tag's pins).opencharly/sdk#500was closed bysdk#502this PR pins; the stalesdk/workflowkit.Lower/sdk/workflowkit.ValidatePipelineprose in two consumer repos is filed asplugin-lobster#14andplugin-migrate#29, and the relocated graph renderers' caller question asplugin-pipeline#65. None of those is this PR's finding.Files
charly/kind_value_corpus_sweep_test.gokindValueDefPathwith the loader's own connect (gatedKindProvider), thebasearm counts what it cannot judge, andTestSweepSelectionResolvesAPluginDeclaredGateDefpins the routecharly/go.modv0.2026316.1848, spec →v0.2026316.1928charly/go.sumtools/generate-packages/go.modtools/generate-packages/go.sumtools/golden-cloudinit/go.modtools/golden-cloudinit/go.sumtools/golden-compile/go.modtools/golden-compile/go.sumAssisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)