Repository navigation
feat(spec): one canonical deploy add_candy ref collection - #310
Merged
Merged
Conversation
ScopedAddCandyRefs answers "which add_candy: refs does this deploy contribute, and at what composition scope" ONCE, beside the member-tree accessors it walks and the scope constructor it tags with. Three consumers need exactly this traversal and must agree on it: the host's plugin-LOADING collection (charly/plugin_loader.go's deployNodePluginContext), the pod-overlay build (charly/build_overlay.go's overlayCandies), and the externalized check command's resolved-project widening (opencharly/plugin-check#147's addCandyRefsForEntity). A plugin cannot import core, and neither ResolvedProject nor CheckLoadPluginsReply carries the refs, so the shared home is this module - otherwise each consumer hand-writes the same loop (#309). The traversal boundary is the authored POSITION: an in-substrate member is part of its parent's composition and shares its scope; a deploy-level member is its own composition and is not visited. Scope is the caller's (normally BoxScope of the deploy name) - a constant label is the charly#739 false-conflict bug. No schema change: a hand-written method beside member_tree.go's accessors, with a unit test that fails when the in-substrate recursion or the scope tag is dropped. Agent: fix-112 Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
Review — PASSHead SHA: Security screen: PASS
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
aitrawog
pushed a commit
to opencharly/plugin-check
that referenced
this pull request
Nov 13, 2026
…ies no duplicate traversal Round-2 review was right that a stated duplication is not a cured one: `scopedAddCandyRefs` re-implemented the host's ref-collection half in NEW code this change introduced, which R2 marks blocking regardless of which repo the other copies live in. `opencharly/spec#310` now owns that traversal - spec.DeployNode.ScopedAddCandyRefs(scope), beside the member-tree accessors it walks and the scope constructors it tags with - so this package deletes its copy and calls the shared one. The plugin's own two facts stay here: WHICH node the deploy name denotes (over the plugin-side merged tree, with the host's node-lookup contract) and which composition scope the refs take (spec.BoxScope(name)). The spec pin advances to the tag spec#310 minted, v0.2026317.1828. That tag also carries opencharly/spec#308 (the #1131 connect-seam wire field), which is additive and changes nothing this package consumes; the bump is go.mod + two go.sum lines and `go mod tidy` is clean. Behaviour is unchanged, and that is measured, not assumed: the deleted local collector and the shared method were dumped over the same node (a node with two add_candy refs, an in-substrate member carrying a third, and a deploy-level sibling carrying a fourth that must NOT appear) and the two dumps are byte-identical; the witness bed and both directions of the fixture A/B are re-run on this head. Agent: fix-112 Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system)
github-actions Bot
pushed a commit
to opencharly/plugin-check
that referenced
this pull request
Nov 13, 2026
…st, so the child phase asserts the PINNED coordinate (#147) * fix(check): a deploy's add_candy refs ride the resolved-project request, so the child phase asserts the PINNED coordinate The child `check live` phase composed its plan from `rp.CandyModels[deploykit.BareRef(ref)]` — an identity-keyed lookup — in a resolution that never MATERIALIZED the coordinate the deploy pinned: the envelope's candy scan is reachability-scoped over the project's IMAGE closure, and a deploy's `add_candy:` refs sit outside it (candy/plugin-build's own cache-key comment states the consequence: ExtraCandyRefs "is the ONLY way a host-side plugin candy that no image closure reaches enters rp.Candies at all"). So the phase read whatever OTHER coordinate of that repo the closure reached — an older tag transitively required by a composed layer — and, since #113, refused naming the mismatch. A bed's pin could be read, fetched and still not change what the phase asserted (#112). The fix is at the request, where the mechanism lives: the live and feature-live arms now pass the deploy's own `add_candy:` refs (scoped with spec.ScopedExtraCandyRefs/spec.BoxScope, the same construction the host's deployNodePluginContext uses, and over the same plugin-side merged-tree resolver) as `ResolvedProjectRequest.ExtraCandyRefs`, so the pinned coordinate becomes a CANDIDATE, the arbiter resolves it, and `candyAddSteps` reads the pinned model. Evidence: the new in-repo R10 bed `check-addcandy-pin-honoured` (a disposable kind:local bed driving the child phase of testdata/addcandy-pin-fixture, which pins layer-direnv at the newer of two coordinates that project references) PASSES on this tree and FAILS on the previous binary; unit tests pin the request field and the collection rule, both mutation-proven. Agent: fix-112 Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system) * fix(check): name the bed that actually witnesses #112, and state the collector duplication Round-1 review found the new unit test's header naming two beds that this diff never creates (`check-addcandy-pin-advanced` / `-stale`): draft names, replaced by `check-addcandy-pin-honoured` before the beds were authored and never re-read. The header now names the real witness and describes what it actually does — the fixture pins layer-direnv at the NEWER of the two coordinates the project references, so the phase must compose the PINNED plan rather than refuse on the other one; it does not "advance a pin". No behaviour change: comments only, in the file the finding named. Agent: fix-112 Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system) * refactor(check): consume spec's ScopedAddCandyRefs, so this diff carries no duplicate traversal Round-2 review was right that a stated duplication is not a cured one: `scopedAddCandyRefs` re-implemented the host's ref-collection half in NEW code this change introduced, which R2 marks blocking regardless of which repo the other copies live in. `opencharly/spec#310` now owns that traversal - spec.DeployNode.ScopedAddCandyRefs(scope), beside the member-tree accessors it walks and the scope constructors it tags with - so this package deletes its copy and calls the shared one. The plugin's own two facts stay here: WHICH node the deploy name denotes (over the plugin-side merged tree, with the host's node-lookup contract) and which composition scope the refs take (spec.BoxScope(name)). The spec pin advances to the tag spec#310 minted, v0.2026317.1828. That tag also carries opencharly/spec#308 (the #1131 connect-seam wire field), which is additive and changes nothing this package consumes; the bump is go.mod + two go.sum lines and `go mod tidy` is clean. Behaviour is unchanged, and that is measured, not assumed: the deleted local collector and the shared method were dumped over the same node (a node with two add_candy refs, an in-substrate member carrying a third, and a deploy-level sibling carrying a fourth that must NOT appear) and the two dumps are byte-identical; the witness bed and both directions of the fixture A/B are re-run on this head. Agent: fix-112 Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system) --------- Co-authored-by: charly <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Head
ad1a8e6baa24bfe3a29e47a2477d63075ac14a12— one commit, 2 files, +84/−0 (git rev-parse HEAD), branched fromorigin/mainat83ad4dd.Summary
opencharly/spec#309: the question "whichadd_candy:refs does this deploy contribute, and at what composition scope?" had three hand-written answers. This adds the ONE mechanism —(*Deploy).ScopedAddCandyRefs(scope string) []ExtraCandyRefinspec/deploy_addcandy.go, beside the member-tree accessors it walks (member_tree.go) and the scope constructors it tags with (resolve_opts.go).The three consumers it must serve:
charly/charly/plugin_loader.go:1164(deployNodePluginContext)charly/charly/build_overlay.go:360(overlayCandies)checkcommand's resolved-project wideningopencharly/plugin-check'saddCandyRefsForEntity(opencharly/plugin-check#147)The last one exists because a plugin cannot import core, and neither
ResolvedProjectnorspec.CheckLoadPluginsReplycarries the refs (go doc … ResolvedProject | grep -ci extracandy→ 0; the reply is empty by design), soResolvedProjectRequest.ExtraCandyRefs— a REQUEST field — is the only channel and every caller must supply the input. Without a shared home each caller hand-writes the loop; that is the duplication this removes.The traversal contract (the thing all three must agree on, and what the test pins):
Member.InSubstrate()) is deployed into its parent's venue, is part of its parent's composition, and shares its scope;Member.Alongside()— a sibling of the kind key) is its own composition, addressed by its own name, and is not visited;scopeis the caller's, normallyspec.BoxScope(<deploy name>), because a deploy IS its box — a constant label is thecharly#739false-conflict bug (two independent deploys legitimately pin one candy at different tags).What this does NOT do: it does not migrate the two
charlycall sites. Those are that repo's own write scope in the campaign that found this (charly-pluginsis live incharly), andopencharly/spec#309stays open until they consume this and delete their loops. This PR is the shared home the consumers need, which is the part that must exist first.How tested
The new test is mutation-proven: dropping the in-substrate recursion from the traversal turns it RED (the nested candy's ref disappears and the count drops from 3 to 2), and the restored tree is GREEN.
The test also pins the two shapes a real tree reaches: a node with no
add_candy:collects nothing, and anilreceiver does not panic (a member entry can carry no node body).No schema is touched, so
charly task cue-genstays a no-op — this is hand-written behaviour beside the generated types, the same class asmember_tree.go's accessors. Nocue-genartefact is in the diff:Rulebook compliance
git-workflow,root-cause-analyzer,check; this repo'sAGENTS.mdread first, including its Go gate (build, test, gofmt, lint under the declared toolchain).charlysites — isopencharly/spec#309's own close condition, recorded there rather than claimed here.spec#309.git status --shortbefore staging listed exactly the two new files; one appended commit; no force-push, no bypass;Agent:/Assisted-by:trailers in order.spec.DeployNode.disposable: truetarget is involved: spec ships no image and composes no box (charly.ymlsays so), so there is no bed this change could alter. The live proof of the shared mechanism is its first consumer's bed, which is fix(check): a deploy's add_candy refs ride the resolved-project request, so the child phase asserts the PINNED coordinate plugin-check#147's own R10 run.Change classification
An additive exported method on an existing type (
spec.DeployNode, alias ofDeploy) plus its unit test. No schema, wire, generated file or pin changes. Breaking change + rollback: none — nothing existing is renamed or removed, and no call site changes in this repo; consumers adopt it on their own schedule (spec#309). Rollback is to revert this one commit.Agent: fix-112
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)