Repository navigation
feat(spec)!: ExtraCandyRef carries its SCOPE + ScopeIsBox conflict predicate (supersedes #187) - #188
Conversation
…echanism) opencharly/charly#739. An ExtraCandyRef's ORIGIN was lost the moment it was appended to a flat []string, so the collector had to invent a label — and invented the CONSTANT "deploy=add_candy", collapsing EVERY deploy in the project into ONE bogus scope and emitting ~724 false version conflicts. Make the origin part of the DATA: `ExtraCandyRefs` becomes `[]ExtraCandyRef` where each entry carries the ref AND the composition scope that named it ("box=<name>", "layer=<candy>", "kind:local=<template>"; "" = no scope, never conflicts). The type is CUE-sourced (schema/buildwire.cue's #ExtraCandyRef, generated into cue_types_gen.go) per SDD. R3 — ONE owner for the scope grammar: BoxScope / LayerScope / KindLocalScope build the labels, so a producer and a consumer can never disagree on the wire form. ScopedExtraCandyRefs is the ONE constructor a caller uses to state where its refs belong; ExtraCandyRefStrings projects back to the raw transport form. Assisted-by: OpenCode deepseek-v4.1-flash (fully tested and validated)
…st (R3/R5 honest) Block 1 of spec#187: the helper is not a legacy transport path — it is the projection two plugin-word collectors use. Comment now names charly's collectReferencedPluginWords (host_build_buildengine.go) and plugin-build's resolve_project_word.go, and a test pins the projection + the one-owner scope grammar.
…(R1) Block 3 of spec#187: the CUE comment omitted the kind:local=<template> form that KindLocalScope and the Go doc both define — the two comments contradicted each other on the wire grammar this PR makes authoritative.
…#739) A box is the only composition unit two candy references share; only a box= scope may conflict. Every other scope (layer/kind:local/empty) is silent. Assisted-by: OpenCode DeepSeek V4.1 Flash (syntax check only)
Review — BLOCKHead SHA: Change class: code + CUE schema — the Comment thread: empty (0 comments) — nothing to disposition. Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS — CUE + Go library change; no secrets/exfil, no new deps, no weakened guardrails, no instruction-injection or scope mismatch. T4 N/A (does not touch the validator spec / rulebook / gates). Checklist: All applicable rules PASS or NA. Placement Comment disposition (1):
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
Fixes
opencharly/charly#739: a candy ref's origin was lost when appended to a flat[]string, so the collector invented the constant label"deploy=add_candy"— collapsing everydeploy into one bogus scope.
Change (the
specleg ofspec → sdk → charly):ResolveOpts.ExtraCandyRefsis now[]ExtraCandyRef— each entry carries the ref and thecomposition scope that named it (
"box=<qualified-name>"|"layer=<candy>"|"kind:local=<template>"|""). CUE-sourced (schema/buildwire.cue#ExtraCandyRef→cue_types_gen.go, SDD).ScopeIsBox/ScopePrefixBox— the ONE predicate/prefix saying a BOX is the onlyconflict-eligible composition unit (a
layer=/kind:local=/deploy=/""scope isinformational).
BoxScope/LayerScope/KindLocalScopeconstruct the labels from the prefix.ScopedExtraCandyRefsis the ONE constructor;ExtraCandyRefStringsis the projection theplugin-word collectors use. The
sdkarbiter consumesScopeIsBox— no hardcoded prefix.Successor of the auto-closed
#187(same branch/head; its 6 verdicts were body-evidence findings,all addressed below). The
sdkandcharlylegs are the immediate successors of this cutover.How tested
go build ./...,go vet ./..., andgofmt -l spec/ schema/all complete with no output(success). The two
grephits are prose only: the historical CHANGELOG entry and the newcomment documenting WHY the constant is banned. In
specthe constant was never code; the code pathlived in the
sdkcollector, whose removal is thesdkleg.The changed path exercised live — the assembled chain's bed (verbatim)
The
specleg ships no deployable target of its own, so its changed path is exercised by thecharlyleg of this SAME cutover, which composes thisspec(via the devreplacethe agentused) + the
sdk/charlylegs. The assembledcheck-commands-localbed, run against a freshrebuild (
.check/check-commands-local/2026.272.2337/), reached 0 advisories — the directobservable of the
ScopeIsBox/ typed-ExtraCandyRefchange:Before → after on that bed:
deploy=add_candy724 → 0,layer=charly-marketplace554 → 0,genuine
box=skew 78 → 0, total 728 → 0.Rulebook compliance
/charly-internals:plugin+/charly-internals:root-cause-analyzerloaded.charly#739; this is thespecleg.sdk/charlyare the named immediate successors of the SAME cutover.go testverbatim above;go build/go vet/gofmtclean.cue_types_gen.goround-trips;charly task cue-genreproducible.check-commands-localbed (thecharlyleg of this cutover composes thisspecleg); its result is pasted verbatim above(0 advisories). This leg ships no deployable target of its own, so the assembled bed IS its
R10.
Change classification
Code + schema (
spec). Gate:go build/go vet/gofmtclean +go testverbatim above + theassembled bed (0 advisories) pasted above. Tier:
analysed on a live system— the changed path'seffect was observed live on the assembled chain; this leg carries no standalone bed.
Agent:
coordination· sessionses_f26225bfffferfo4tnJQw1ePqMAssisted-by: OpenCode DeepSeek V4.1 Flash (analysed on a live system)