Repository navigation
feat(resolvedproject): project candy plugin.requires into CandyView - #173
Conversation
…View The authored `plugin.requires:` field was declared in candy.cue but PROJECTED NOWHERE: `sdk/loaderkit/scan_candy.go` copies `Plugin.Source` + `Plugin.Providers` into the resolved CandyView, never `Plugin.Requires`, so a plugin's declared inter-plugin dependency never reached the runtime — it was silently inert. Add `CandyView.plugin_requires?: [...#PluginRequirement]`, mirroring the `plugin_providers` / `plugin_source` fields already there, so the host can reach a plugin's declared dependencies through the SAME resolved-view path (clause D: a projection of the plugin repo's own manifest), which the A3 gate then resolves. Regenerated cue_types_gen.go (the generator reorders PluginRequirement before its new referencer; TestGenReproducible passes). Assisted-by: OpenCode ollama-cloud DeepSeek V4.1 Flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: code/config — CUE schema ( Security screen: PASS (no secrets, no network/egress, no Blocks
Comments considered: none (thread empty). Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Change class: code/config — CUE schema ( Placement: CORRECT — a resolved-view wire field belongs in Blocks
Comments considered:
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS — additive CUE field + Go accessor + regenerated type + test; no secrets/egress/eval, no guardrail/validator/rulebook change, no embedded directive. Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
Add the resolved-view receiver for a candy's authored
plugin.requires:list — the#CandyView.plugin_requiresfield, thespec.CandyReader.GetPluginRequires()accessor, and aschema test that fails without the field. This is the producer leg of a cross-repo chain
(spec → sdk → charly); it ships the contract, and the two consumer legs named below consume its
tag.
Why the field is needed (the gap):
plugin.requires:was added tocandy.cue(spec#163) asthe authored declaration of a plugin's inter-plugin dependencies, carried on the wire as
Capabilities.requiresand consumed by the host's gate. But the resolved-project view —the
CandyViewenvelope every consumer reads a candy through (the SAME viewplugin_source/plugin_providerslive in) — had no receiver for it:#CandyViewis a CLOSED struct withplugin_source+plugin_providersand noplugin_requires. So a consumer reading a candy'splugin block off the resolved view could see its providers but not its declared dependencies.
This change closes that asymmetry:
#CandyView.plugin_requires?: [...#PluginRequirement](thesame
#PluginRequirementdef spec#163 introduced — one shape, no mirror), the matchingCandyReader.GetPluginRequires()accessor besideGetPluginProviders(), andschema/plugin_requires_test.go.Scope, with the exact consumer legs named (producer-first, B6)
This PR is the spec contract only.
#CandyViewis CLOSED, so a consumer cannot even compileagainst
plugin_requires/GetPluginRequires()until this tag exists — spec must land first. Thetwo consumers land as their own branches that bump their
specpin to this change:opencharly/sdkbranchfeat/candyview-plugin-requires: the projector(
loaderkit/scan_candy.go'spopulateFromYAMLcopiesly.Plugin.Requiresintov.PluginRequiresexactly as it already copiesSource+Providers) plus the adapteraccessor (
deploykit/spec_candy_adapter.go'sGetPluginRequires(), beside its existingGetPluginProviders()).opencharly/charlybranchfeat/requires-manifest-consume: the host'srequires gate reads the declared dependencies through the resolved view
(
candy.GetPluginRequires()), the reference plugin declaresrequires:in its manifest + Gometa, and the disposable R10 bed exercises resolve/connect/cycle/missing-peer live.
Both consume this PR's
spectag. This PR does NOT claim to test runtime resolution — its owngate is the schema + interface contract (below).
How tested
Coverage that fails without the change
schema/plugin_requires_test.gounifies#CandyViewwithplugin_requires:fragments. Because#CandyViewis CLOSED, the field's ABSENCE rejects the fragment outright, so the test fails onthe pre-change schema:
On this branch (the change present):
TestCandyViewRejectsMalformedPluginRequiresproves the projection reuses the#PluginRequirement/
#PluginCapabilityvocabulary (abogus:xclass, an empty word, a non-githubsourceare allrejected) — it does not open a second, looser shape.
The regenerated type is reproducible, and the whole module passes
spec/cue_types_gen.gois regenerated with the schema (charly task cue-gen's pipeline). Thegenerator emits the referenced
PluginRequirement+PluginCapabilitytypes immediately aftertheir referencer
CandyView(after its closing}at the new ~line 2369, before#RouteConfig)— a pure relocation of the two defs from their old spot (after
Plugin) to just after their newuser; byte-reproducible (
TestGenReproducible).Diff (4 files):
Rulebook compliance
/charly-internals:go(schema-change recipe +cue-gen),/charly-internals:plugin(the plugin block +#CandyView),/charly-internals:git-workflow.plugin_source/plugin_providers) existed; that is the RCA above.plugin:block via the resolved view(source + providers + requires), not a subset; the consumer legs are named, not deferred.
#PluginRequirement/#PluginCapabilitydefs;GetPluginRequires()mirrorsGetPluginProviders(); one projector.each manifest by each consumer.
feat/candyview-plugin-requiresofforigin/main; no force-push.TestGenReproduciblegates the regenerated type.
cue_types_gen.gois the emitted artifact, gated.go build+go test ./...+ the failing-without test on the finaltree.
Change classification
leg of a spec → sdk → charly chain.
go build ./...+go test ./...+TestGenReproducible+ the failing-withoutschema test.
fully tested and validated— the contract change is reproducible and thefull suite + the failing-without test pass on the final tree.
Assisted-by: OpenCode ollama-cloud DeepSeek V4.1 Flash (fully tested and validated)