Skip to content

feat(resolvedproject): project candy plugin.requires into CandyView - #173

Merged
github-actions[bot] merged 5 commits into
mainfrom
feat/candyview-plugin-requires
Sep 26, 2026
Merged

github-actions[bot] merged 5 commits into
mainfrom
feat/candyview-plugin-requires

Conversation

@aitrawog

@aitrawog aitrawog commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add the resolved-view receiver for a candy's authored plugin.requires: list — the
#CandyView.plugin_requires field, the spec.CandyReader.GetPluginRequires() accessor, and a
schema 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 to candy.cue (spec#163) as
the authored declaration of a plugin's inter-plugin dependencies, carried on the wire as
Capabilities.requires and consumed by the host's gate. But the resolved-project view —
the CandyView envelope every consumer reads a candy through (the SAME view plugin_source /
plugin_providers live in) — had no receiver for it: #CandyView is a CLOSED struct with
plugin_source + plugin_providers and no plugin_requires. So a consumer reading a candy's
plugin block off the resolved view could see its providers but not its declared dependencies.

This change closes that asymmetry: #CandyView.plugin_requires?: [...#PluginRequirement] (the
same #PluginRequirement def spec#163 introduced — one shape, no mirror), the matching
CandyReader.GetPluginRequires() accessor beside GetPluginProviders(), and
schema/plugin_requires_test.go.

Scope, with the exact consumer legs named (producer-first, B6)

This PR is the spec contract only. #CandyView is CLOSED, so a consumer cannot even compile
against plugin_requires/GetPluginRequires() until this tag exists — spec must land first. The
two consumers land as their own branches that bump their spec pin to this change:

  • sdk — opencharly/sdk branch feat/candyview-plugin-requires: the projector
    (loaderkit/scan_candy.go's populateFromYAML copies ly.Plugin.Requires into
    v.PluginRequires exactly as it already copies Source + Providers) plus the adapter
    accessor (deploykit/spec_candy_adapter.go's GetPluginRequires(), beside its existing
    GetPluginProviders()).
  • charly — opencharly/charly branch feat/requires-manifest-consume: the host's
    requires gate reads the declared dependencies through the resolved view
    (candy.GetPluginRequires()), the reference plugin declares requires: in its manifest + Go
    meta, and the disposable R10 bed exercises resolve/connect/cycle/missing-peer live.

Both consume this PR's spec tag. This PR does NOT claim to test runtime resolution — its own
gate is the schema + interface contract (below).

How tested

Coverage that fails without the change

schema/plugin_requires_test.go unifies #CandyView with plugin_requires: fragments. Because
#CandyView is CLOSED, the field's ABSENCE rejects the fragment outright, so the test fails on
the pre-change schema:

$ git checkout origin/main -- schema/resolvedproject.cue   # pre-change schema
$ go test ./schema/ -run "TestCandyViewCarries|TestCandyViewRejects" -count=1
--- FAIL: TestCandyViewCarriesPluginRequires (0.11s)
    plugin_requires_test.go:44: plugin_requires rejected on #CandyView: #CandyView.plugin_requires: field not allowed
FAIL
FAIL	github.com/opencharly/spec/schema	0.453s
FAIL
$ git checkout HEAD -- schema/resolvedproject.cue   # restore the change

On this branch (the change present):

$ go test ./schema/ -run 'CandyView' -count=1 -v
=== RUN   TestCandyViewCarriesPluginRequires
--- PASS: TestCandyViewCarriesPluginRequires (0.23s)
=== RUN   TestCandyViewRejectsMalformedPluginRequires
--- PASS: TestCandyViewRejectsMalformedPluginRequires (0.34s)
PASS
ok  	github.com/opencharly/spec/schema	0.594s

TestCandyViewRejectsMalformedPluginRequires proves the projection reuses the #PluginRequirement
/ #PluginCapability vocabulary (a bogus:x class, an empty word, a non-github source are all
rejected) — it does not open a second, looser shape.

The regenerated type is reproducible, and the whole module passes

$ go build ./...
$ echo $?
0

$ go test ./spec/ -run TestGenReproducible -count=1
ok  	github.com/opencharly/spec/spec	2.079s

$ go test ./... -count=1
ok  	github.com/opencharly/spec/cache	0.604s
ok  	github.com/opencharly/spec/calver	0.008s
...
ok  	github.com/opencharly/spec/container	14.789s
ok  	github.com/opencharly/spec/deploy	0.014s
ok  	github.com/opencharly/spec/exec	14.038s
...
ok  	github.com/opencharly/spec/schema	19.122s
ok  	github.com/opencharly/spec/spec	2.770s
ok  	github.com/opencharly/spec/transport	0.256s
$ echo $?
0

spec/cue_types_gen.go is regenerated with the schema (charly task cue-gen's pipeline). The
generator emits the referenced PluginRequirement + PluginCapability types immediately after
their 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 new
user; byte-reproducible (TestGenReproducible).

Diff (4 files):

$ git diff --stat origin/main...HEAD
 schema/plugin_requires_test.go | 64 ++++++++++++++++++++++++++++++++++++++++++
 schema/resolvedproject.cue     |  5 ++++
 spec/candy_reader.go           |  6 ++++
 spec/cue_types_gen.go          | 44 ++++++++++++++++-------------
 4 files changed, 100 insertions(+), 19 deletions(-)

Rulebook compliance

  • R0 (skills) — /charly-internals:go (schema-change recipe + cue-gen),
    /charly-internals:plugin (the plugin block + #CandyView), /charly-internals:git-workflow.
  • R1 (RCA) — the resolved-view receiver was missing while its siblings (plugin_source /
    plugin_providers) existed; that is the RCA above.
  • R2 (whole cutover) — the projection covers the whole plugin: block via the resolved view
    (source + providers + requires), not a subset; the consumer legs are named, not deferred.
  • R3 (no duplication) — reuses the existing #PluginRequirement / #PluginCapability defs;
    GetPluginRequires() mirrors GetPluginProviders(); one projector.
  • R4 (no workarounds) — the field is projected on the resolved view, not re-read ad-hoc from
    each manifest by each consumer.
  • R5 (delete legacy) — n/a (additive field + accessor).
  • R6 (git safety) — branch feat/candyview-plugin-requires off origin/main; no force-push.
  • R7 (prove behavior) — the new schema test fails without the field; TestGenReproducible
    gates the regenerated type.
  • R8 (preserve emitted artifacts) — cue_types_gen.go is the emitted artifact, gated.
  • R9 (binary equals source) — n/a (a library module).
  • R10 (fresh proof) — go build + go test ./... + the failing-without test on the final
    tree.

Change classification

  • Class: schema + regenerated type + interface accessor (resolved-project view) — the producer
    leg of a spec → sdk → charly chain.
  • Gate: go build ./... + go test ./... + TestGenReproducible + the failing-without
    schema test.
  • Attribution tier: fully tested and validated — the contract change is reproducible and the
    full suite + the failing-without test pass on the final tree.

Assisted-by: OpenCode ollama-cloud DeepSeek V4.1 Flash (fully tested and validated)

…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)
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: d0dbd9c0d1208cba7a3e47d4c0d7dac1fa60276a (branch: feat/candyview-plugin-requires)

Change class: code/config — CUE schema (schema/resolvedproject.cue) + its regenerated Go type (spec/cue_types_gen.go) in the spec module.

Security screen: PASS (no secrets, no network/egress, no eval-style code, no guardrail/validator/rulebook change, no embedded directive).

Blocks

  1. A2 / B6 — the defect the body claims to close is not closed by this diff. The body states the defect is that the projector sdk/loaderkit/scan_candy.go "copies Plugin.Source + Plugin.Providers into CandyView and never Plugin.Requires." That projector file is not among the changed files (only schema/resolvedproject.cue and spec/cue_types_gen.go changed). Adding the receiving field alone leaves plugin.requires: exactly as inert as the body says it was, so the "defect this closes" claim is unsupported. Fix: either include the scan_candy.go projection change in this cutover, or explicitly name the companion PR/batch (a named target, not a vague "the consumer then resolves them"). As written the fully tested and validated tier is also unsupported — no changed code path that populates the new field executes here.

  2. A1 — "How tested" does not paste real output. ok (all packages) (and the # ok annotation on go build) are author paraphrases, not the actual go test ./... / go build ./... output, which lists each package and its duration. The rule requires pasted output, not a summary. Paste the verbatim command output (and state the fresh-tree confirmation).

  3. A1 / B10 — the body contradicts its own diff. The body says "the generator reorders PluginRequirement before its new referencer CandyView". The diff emits PluginRequirement + PluginCapability immediately after CandyView (after its closing brace at ~new line 2369, before #RouteConfig). Correct the description to match the emitted order (or fix the generated output if the description is the intended truth), so the body accounts for the diff it ships.

  4. A3 — verify the attribution identity. The footer names DeepSeek V4.1 Flash; "Flash" is a Gemini tier and no such DeepSeek model is evidenced anywhere in the body. Since a guessed/config-read model name is a defect, either correct it to the true authoring model (with matching runtime evidence) or, if a fixed model-free generator emitted the body, use the <Harness> <Runtime> form.

Comments considered: none (thread empty).

Verdict: BLOCK


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: 9d6c6ad7ee472db69e963f39596fff50970d1e01 (branch: feat/candyview-plugin-requires)

Change class: code/config — CUE schema (schema/resolvedproject.cue) + regenerated Go type (spec/cue_types_gen.go) in the spec module.

Placement: CORRECT — a resolved-view wire field belongs in spec (CUE-first); nothing moved into core.

Blocks

  1. A1 / A2 / B6 / B12 — the "defect this closes" is not closed; the projector is absent from the diff. The body states the defect is that sdk/loaderkit/scan_candy.go "copies Plugin.Source + Plugin.Providers into CandyView and never Plugin.Requires", yet the diff changes only schema/resolvedproject.cue and spec/cue_types_gen.go. Adding the receiving field does not populate it — plugin_requires stays exactly as inert as the body says it was, and no test in the diff fails without the field being populated (TestGenReproducible only checks regeneration reproducibility, not projection). Fix: land the scan_candy.go projection (plus a test that fails without it) in this cutover, or name the exact companion PR/batch; and drop the "defect this closes" wording and the fully tested and validated tier until the populating code path actually executes.

  2. A1 / B10 — the body contradicts its own diff on emission order. The body says "the generator reorders PluginRequirement before its new referencer CandyView". The diff emits PluginRequirement/PluginCapability after CandyView (immediately after its closing } at ~new line 2369, before #RouteConfig). Correct the body to match the emitted order (or fix the generated output if "before" is intended).

  3. A1 — "How tested" paraphrases rather than pastes output. go test ./... prints one ok <package> <duration> line per package; the body collapses it to ok (all packages) and annotates go build ./... with # ok. Paste the verbatim command output and state the fresh-tree confirmation.

Comments considered:

  • github-actions[bot] @ d0dbd9c0d120 (BLOCK): findings 1–3 verified-blocking — they reproduce against the current head (the head advanced to 9d6c6ad7 via an origin/main merge, but the 2-file diff is unchanged). Finding 4 (attribution model name) verified-non-blocking — DeepSeek V4.1 Flash matches the runtime identity deepseek-v4.1-flash shown in the review action footer; no basis to call it guessed.

Verdict: BLOCK


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: b7862f6b60ba9f70e3dc377daff0cabae377387e (branch: feat/candyview-plugin-requires)

Security screen: PASS — additive CUE field + Go accessor + regenerated type + test; no secrets/egress/eval, no guardrail/validator/rulebook change, no embedded directive.
Placement: CORRECT — #CandyView.plugin_requires + CandyReader.GetPluginRequires() are resolved-view wire shapes belonging in spec (CUE-first, reusing the existing #PluginRequirement def); nothing moves capability into core, no alias/kit import.
Checklist: All applicable rules PASS or NA (schema/interface change class; R9/R5 n/a for a library module).
Comments considered: #5847772468 (head d0dbd9c0) and #5847849193 (head 9d6c6ad7) — all findings stale-superseded: the head advanced to b7862f6 with a re-frozen body (commit b7862f6). The "projector absent / defect not closed" claim is resolved — the body now scopes this explicitly as the producer leg ("spec contract only"), states the projector lives in the named sdk consumer branch feat/candyview-plugin-requires (+ charly feat/requires-manifest-consume), and does not claim to populate the field. The "emission order" contradiction is fixed (body now says the generator emits PluginRequirement/PluginCapability immediately after CandyView, matching the diff). The "paraphrased output" finding is fixed (per-package ok <pkg> <dur> lines + the failing-without FAIL output are now pasted). Attribution model name (DeepSeek V4.1 Flash) matches the runtime identity deepseek-v4.1-flash in the action footer — non-blocking.

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) September 26, 2026 16:40
@github-actions
github-actions Bot merged commit 5d0e57c into main Sep 26, 2026
2 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Sep 26, 2026
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.

2 participants