Repository navigation
fix(bundle,envelope)!: --add-candy ref not threaded into the resolved-project envelope - #101
Conversation
…olved-project envelope BLOCKING regression (charly superproject task #13): candy/plugin-bundle's OpCompile handler re-fetches the resolved-project envelope independently via HostBuild("resolved-project"), using only the project directory — never the add_candy/--add-candy ref the host's own scanCandiesForRef already widened its scan with (a synthetic-augmented ScanAllCandyWithConfig call, for a REMOTE ref never reachable from any box's image closure). So a remote add-candy resolved host-side (used to compute the compile order) was completely absent from the plugin's own envelope, and BuildDeployPlan's per-name lookup failed "candy not in resolved-project envelope". Adds extra_candy_refs?: [...string] @go(ExtraCandyRefs) to BOTH #ResolvedProjectRequest and #DeployCompileRequest, mirroring the existing ResolveOpts.ExtraCandyRefs contract (already used elsewhere for a check bed's own add_candy:) so a compile caller can widen the plugin's envelope re-fetch the same way. go build/vet/test green. task cue:gen reproducibility gate clean.
… envelope BLOCKING regression (task #13): check-addcandy-pod and check-stepkind-emit-pod both failed `charly bundle add` with "bundle compile: candy ... not in resolved-project envelope" — --add-candy on a REMOTE candy ref (never reachable from any box's own image closure, e.g. @github.com/opencharly/charly/candy/pod-addcandy-marker:vTAG). Root cause: candy/plugin-bundle's OpCompile handler (compileDeployPlans) re-fetches the resolved-project envelope independently via HostBuild("resolved-project"), using only the project dir. The host's own pre-compile scan (bundle_add_cmd.go's scanCandiesForRef) already widens ITS candy map for a remote add-candy ref via a synthetic-augmented ScanAllCandyWithConfig call — but that widening was never threaded into the plugin's separate envelope re-fetch, so a remote add-candy resolved host-side (used to compute the compile `order`) was completely absent from rp.Candies/rp.CandyModels, and BuildDeployPlan's per-name lookup failed. Fix: threads the add-candy ref through as a NEW CUE-sourced ExtraCandyRefs field (opencharly/sdk#101 -- #ResolvedProjectRequest + #DeployCompileRequest both gain extra_candy_refs?: [...string], mirroring the existing ResolveOpts.ExtraCandyRefs contract already used for a check bed's own add_candy:): - hostBuildResolvedProject threads req.ExtraCandyRefs into ResolveOpts. - candy/plugin-bundle's compileDeployPlans threads r.ExtraCandyRefs into its own resolved-project envelope re-fetch. - charly's compileSelectionViaPlugin gains an extraCandyRefs parameter; compileCandySelection (the add_candy / standalone-candy compile path) passes []string{ref.Raw}; compileBoxSelection (the primary image compile, unaffected) passes nil. sdk gitlink repoints to 0612a9c (sdk#101, unmerged pending review — will repoint to the merged/tagged commit once it lands, same drill as sdk#98/99/ 100). go build/vet/test green on charly + candy/plugin-bundle + sdk. 01af617 (vm-Raw fix) confirmed intact.
pr-validator — CHANGES REQUESTED ❌Change class: charly-or-sdk Go (cross-repo producer leg — sdk schema/generated-code half of K1-α task #13; the charly consumer leg lands separately per B6, sdk-first) Head SHA validated: Checklist
Blocking findings1. PR body fails the mandatory template (item 1). Fetched the org-wide template
Per the pr-validator mandate: "a body that leaves any APPLICABLE section blank … FAILS," 2. The commit carries no
I did not invent or backfill a trailer on the author's behalf — the validator What the author must fixAppend a fix commit (do not amend — the branch is pushed) that:
Everything I independently re-verified (build/vet/test/lint/gofmt delta/cue:gen Comments consideredNone — the PR carries no comments. Cross-PR interactions considered
DecisionFAIL. Every technical check I could independently re-derive (build, vet, test, Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system) |
…sing from plugin-installstep's own envelope Follow-up to this branch's first commit (0612a9c): fixed the STANDARD --add-candy compile path, but the add_candy-ON-POD-OVERLAY deploy path (deploy-key != image-name, e.g. check-addcandy-pod) has a THIRD independent "resolved-project" envelope fetch site that also needed the fix - candy/plugin-installstep's getGenerator, used to render HOST-COUPLED build-emit words (system-packages/builder/op) during an overlay build. hostBuildOverlay (charly/build_overlay.go) already correctly widens its OWN overlay Generator with ResolveOpts.ExtraCandyRefs = the deploy's add_candy refs - but that widened candy set was never threaded into plugin-installstep's SEPARATE envelope fetch, so an add_candy candy (never reachable from any box's image closure) was present in the host's overlay Generator.Candies but absent from the plugin's own re-fetch, and candyByName's remote-candy fallback still missed ("candy not found" from OCITarget.Emit). Adds extra_candy_refs?: [...string] @go(ExtraCandyRefs) to #BuildEnv (schema/buildwire.cue) - the wire struct the host already puts in op.Env for an OpEmit Invoke - so charly's dispatchOCIStep (oci_step_emit.go) can thread the host's own already-widened build.Generator.Candies key set through, and plugin-installstep's getGenerator can use it to widen its own resolved-project re-fetch identically. go build/vet/test green; task cue:gen reproducibility gate clean.
…sing from plugin-installstep's own envelope Completes task #13's fix: the STANDARD --add-candy compile path (compile.go) was already fixed, but check-addcandy-pod's add_candy-ON-POD-OVERLAY deploy path (deploy-key != image-name) hit a THIRD independent "resolved-project" envelope fetch site — candy/plugin-installstep's getGenerator, used to render HOST-COUPLED build-emit words (system-packages/builder/op) during an overlay build — that also needed the fix. hostBuildOverlay already correctly widens its OWN overlay Generator with ResolveOpts.ExtraCandyRefs = the deploy's add_candy refs, but that widened candy set was never threaded into plugin-installstep's SEPARATE envelope fetch, so an add_candy candy was present in the host's overlay Generator.Candies but absent from the plugin's own re-fetch — candyByName's remote-candy fallback still missed, surfacing as "OCITarget.Emit(<candy>): candy not found". Fix (opencharly/sdk#101, follow-up commit 2092236): #BuildEnv gains extra_candy_refs?: [...string] @go(ExtraCandyRefs). charly's dispatchOCIStep (oci_step_emit.go) threads build.Generator.Candies' key set (the host's own already-widened candy set) onto env.ExtraCandyRefs; plugin-installstep's getGenerator threads env.ExtraCandyRefs into its own resolved-project re-fetch the same way compile.go's fix already does for the standard path. sdk gitlink repoints to 2092236 (sdk#101 follow-up, unmerged pending review — will repoint to the merged/tagged commit once it lands). go build/vet/test green on charly + candy/plugin-installstep + candy/plugin-deploy-pod + sdk. 01af617 (vm-Raw fix) confirmed intact.
…fixes + pasted verification Rewrites the placeholder CHANGELOG/2026.205.2010.md to cover BOTH commits on this branch (0612a9c: the standard --add-candy compile path; 2092236: the add_candy-on-pod-overlay path) with pasted fresh go build/vet/test output, per the full PR review. Also backfills the missing AI-attribution trailer this branch's first two commits omitted. Assisted-by: Claude Code (Anthropic Claude Opus 4.5; analysed on a live system)
pr-validator: rename CHANGELOG/2026.205.2010.md placeholder to the merge-time CalVer and rewrite its H1 heading to match. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
pr-validator — APPROVED ✅ (re-derivation on updated head)Change class: charly-or-sdk Go (cross-repo producer leg — sdk wire-shape half of K1-α task #13) Head SHA validated (pre-finalize): This is a fresh, independent re-derivation on the updated branch — not a rubber-stamp
Full checklist (re-run live on
|
| # | Item | Verdict |
|---|---|---|
| 0 | Security & anti-tampering | PASS — diff is 3 CUE field additions (resolvedproject.cue, seam.cue, buildwire.cue) + regenerated cue_types_gen.go + CHANGELOG; matches the description exactly, no scope mismatch, no secrets, no weakened guardrail |
| 1 | Description complete | PASS (cured) — see above |
| 2 | Change-class gate matches evidence | PASS — standalone battery is the correct/only gate for an sdk-only wire-shape leg; explicitly and honestly scoped in the body |
| 3 | Attribution tier justified | PASS (cured) — see above; tier analysed on a live system matches the actual proof (standalone battery ran, no sdk-side behavioral execution exists to run) |
| 4 | R0 skills honored | PASS — /charly-internals:go SDD + /charly-internals:plugin (per-plugin/host-coupled CUE contract) + /charly-internals:git-workflow (cross-repo landing order) all correctly applied |
| 5 | R1 zero warnings | PASS — go build/go vet/go test ./... all green on my own live re-run of 31ba1119; golangci-lint run ./... = 0 issues (isolated cache); the one gofmt -l . hit (vmshared/cloud_init_iso.go) reconfirmed pre-existing on origin/main, untouched by this diff |
| 6 | R2 no split | PASS — the third envelope-fetch site found mid-review was fixed in THIS SAME cutover (commit 2092236), not deferred — textbook R2 compliance |
| 7 | R3 no duplication | PASS — all three new fields (resolvedproject.cue, seam.cue, buildwire.cue) reuse the identical extra_candy_refs?: [...string] @go(ExtraCandyRefs) shape/name, mirroring the pre-existing charly/config.go ResolveOpts.ExtraCandyRefs |
| 8 | R4 no workaround | PASS |
| 9 | R5 grep/hard-cutover | N/A — pure additive optional fields |
| 10 | R6/R8/R9 | N/A — no destructive git action, no OCI/Containerfile surface, no binary in this repo |
| 11 | R10 disposable+coverage | PASS for the sdk leg — standalone battery is the whole gate here; real coverage is the consumer leg's job (honestly stated, not claimed here) |
| 12 | RDD/ADE/SDD | PASS — task cue:gen re-run live on 31ba1119: zero diff; TestGenReproducible + TestGeneratedProtocolReproducible both re-run live, both PASS; plain []string fields, no wire-type violation, no unjustified @go(-) |
| 13 | Concurrency | N/A |
| 14 | Hard cutover | PASS — will land as exactly ONE commit on main via squash regardless of the branch's own commit count |
| 15 | Architecture gate | PASS — placement: CORRECT, generic (E)-envelope request/env-carrier fields, no charly/*.go in this diff (sdk-only PR), no provider-word leak (F11) |
| 16 | Disposable-only autonomy | N/A |
| 17 | Clean architecture + Go gates | PASS — go build/go vet/go test/golangci-lint(0 issues)/gofmt-delta/go mod tidy+verify all re-run live by me, all clean |
| 18 | CHANGELOG | PASS — placeholder CHANGELOG/2026.205.2010.md staged with full pasted verification; no collision with any existing tag/CHANGELOG on main (re-verified fresh) |
Comments considered
My own two prior verdict comments (the FAIL round and this PASS round) — not
external input, not weighted either way. No other comments on the PR.
Cross-PR interactions considered
Re-swept fresh: opencharly/sdk has no other open PRs; opencharly/charly#185
(docs) and #118 (P16 gate) — none-found, no overlap; opencharly/plugins#110
(docs) — none-found. The charly consumer leg (feat/k1-unblock-wave1, commits
a9dc2c7c + 067940bd per the PR body) still has no open PR — expected, B6
producer-first order.
Post-validation actions (Phase 3)
- Finalized the merge-time CalVer:
2026.205.1841(UTC at merge). Renamed
CHANGELOG/2026.205.2010.md→CHANGELOG/2026.205.1841.mdand rewrote its H1 to
match — verifiedgit show :CHANGELOG/2026.205.1841.md | head -1byte-matches
# 2026.205.1841 — ...before committing (caught and corrected the classic
git mv-stale-pathspec footgun mid-flight: my firstgit addre-staged the OLD
content because it named the now-gone old path alongside the new one — re-ran
git addwith only the valid path and re-verified). - Pushed the finalize commit (
5dcc43e), a normal non-force push adding to the
branch. - Re-posted
charly/pr-validator = successon the new head5dcc43e46940223842421e1efdca34d4be1ab3dd. - Proceeding to
gh pr merge --squash --delete-branch, then tagging
v0.2026205.1841(sdk's Go-module scheme).
Decision
PASS. Merging.
Assisted-by: Claude Code (Anthropic Claude Sonnet 5; analysed on a live system)
…26205.1841) The prior gitlink bump (d654a20) pinned the pre-merge feat/k1-alpha-addcandy-envelope branch head (31ba111), which is orphaned once opencharly/sdk#101 merged (squash) as 0eb86a1, tagged v0.2026205.1841. Repoint to the actual merged, tagged commit. Forward-verified: `git diff 31ba111 0eb86a1` shows only the CHANGELOG filename/title rewrite to the merge-time CalVer (evaluator's standard squash-merge bookkeeping) — zero content delta, so this is a pure descendant-wins gitlink advance, not a behavior change. charly/go.mod's sdk require bumped v0.2026205.1618 -> v0.2026205.1841 to match (the in-tree `replace github.com/opencharly/sdk => ../sdk` directive means this string is non-load-bearing for local resolution, but kept in lockstep for out-of-tree consumers). Verified (analysed on a live system, this worktree): $ go build ./charly/... ./candy/plugin-installstep/... ./sdk/... (clean) $ go vet ./charly/... ./candy/plugin-installstep/... ./sdk/... (clean) $ go test ./charly/... ./candy/plugin-installstep/... ./candy/plugin-bundle/... ./sdk/... ok github.com/opencharly/charly/charly 135.828s ok github.com/opencharly/charly/candy/plugin-bundle (cached) ok github.com/opencharly/sdk (+ every subpackage) (candy/plugin-deploy-pod, outside go.work, re-verified standalone with GOWORK=off: build + vet clean) This is the FINAL sdk gitlink target for the K1-alpha wave — no further sdk-side change is expected for the add-candy overlay path (4b3d94e already reuses the merged #BuildEnv.extra_candy_refs field with no new sdk schema needed). Assisted-by: Claude Code (Anthropic Claude Opus 4.5; analysed on a live system)
Summary of changes
Fixes a K1-alpha blocking regression (charly superproject task #13):
--add-candy <remote-ref>/ a deploy'sadd_candy: [<remote-ref>]failed atTWO independent resolved-project envelope fetch sites for a candy never
reachable from any box's own image closure (e.g.
@github.com/opencharly/charly/candy/pod-addcandy-marker:vTAG):--add-candycompile path:candy/plugin-bundle's compilehandler re-fetches the resolved-project envelope independently via
HostBuild("resolved-project"), using only the project directory — neverthe add-candy ref the host's own
scanCandiesForRefalready widened itsown scan with. Error:
bundle compile: candy "<name>" not in resolved-project envelope.check-addcandy-pod):candy/plugin-installstep'sgetGenerator(used torender HOST-COUPLED build-emit words during an overlay build) makes its
OWN separate resolved-project re-fetch, again without the add-candy ref
the host's overlay
Generatoralready widened with. Error:OCITarget.Emit(<name>): candy "<name>" not found.Concrete edits:
#ResolvedProjectRequest(schema/resolvedproject.cue) gainsextra_candy_refs?: [...string] @go(ExtraCandyRefs).#DeployCompileRequest(schema/seam.cue) gains the sameextra_candy_refs?: [...string] @go(ExtraCandyRefs)field.#BuildEnv(schema/buildwire.cue) gains the same field, for theoverlay-build's host-coupled step-emit dispatch.
spec/cue_types_gen.goregenerated viatask cue:gen(three intendedfields only).
CHANGELOG/2026.205.2010.md(placeholder CalVer) covers both fixes withpasted verification.
All three new fields mirror the EXISTING
ResolveOpts.ExtraCandyRefscontract (already used elsewhere, e.g. a check bed's own
add_candy:) — nonew mechanism invented, R3.
Change class
Cross-repo. This is the sdk (producer) leg — a pure wire-shape addition
(three new optional CUE-sourced fields, no behavior of its own). The
consumer leg is the
charlysuperproject (feat/k1-unblock-wave1, commitsa9dc2c7c+067940bd), which threads these fields throughhostBuildResolvedProject/compileDeployPlans/compileSelectionViaPlugin(standard path) and
dispatchOCIStep/plugin-installstep'sgetGenerator(overlay path), and is the one that actually proves the fix via the
check-addcandy-pod/check-stepkind-emit-poddisposable beds. Landingorder: this sdk PR merges first; the charly consumer's sdk gitlink then
repoints from the unmerged commit to the merged/tagged one.
How R10-tested — exact gate, commands, and pasted output
runtime bed of its own (per
/charly-internals:git-workflowB6 "New candy" /cross-repo landing note: a producer's gate is the standalone battery; the
REAL gate is the consuming image/build, which for a cross-repo wire-shape
change is the charly-side consumer leg's own bed run). The gate actually
run HERE is the sdk standalone battery:
GOWORK=off go build/vet/test ./...task cue:genreproducibility check.N/Afor this sdk-only leg — no sdk package has its owndisposable bed; the two beds this fix targets (
check-addcandy-pod,check-stepkind-emit-pod) live in the charly superproject /box/fedorasubmodule and are run against the CONSUMER leg (
feat/k1-unblock-wave1),owned by the K1-alpha orchestrator (team-lead), not this sdk PR. That
consumer-leg bed proof is the actual R10 evidence for the fix's runtime
correctness; this PR's own gate is the standalone battery below.
charly version/ binary-freshness applies only to the charly consumer leg.
Go code that ONLY exists in the CONSUMER (charly) repo — this sdk repo's
own code has no reader of
ExtraCandyRefson these three structs (theyare pure data-carrier additions). So "live execution of the changed path"
is, by construction, entirely the consumer leg's proof. This PR's own
verification is limited to: the fields marshal/unmarshal correctly
(implicit in
go build/go testpassing with the regenerated types) andthe schema is reproducible.
Attribution tier
analysed on a live system— the standalone battery actually ran and itsoutput is pasted above; this is an sdk-only wire-shape addition with the
runtime bed proof deliberately deferred to the charly consumer leg (see "How
R10-tested" — there is no sdk-side reader of these fields to execute live).
Not
fully tested and validatedbecause the changed code PATH (the actualenvelope-widening behavior) only executes in the consumer repo.
Harness rulebook compliance
/charly-internals:go(Schema Driven Design / CUE-sourced wire types),/charly-internals:git-workflow(cross-repo landing order).HostBuild("resolved-project")call sites lacking the host's ownExtraCandyRefswidening); gate output above has zero warnings.compileDeployPlansAND plugin-installstep'sgetGenerator) fixed in this SAME cutover, not deferred — a second one was found mid-review and folded in immediately (commit 2092236).ResolveOpts.ExtraCandyRefsnaming/contract rather than inventing a parallel mechanism.check-addcandy-pod,check-stepkind-emit-pod) is proven on the charly consumer leg, owned by the K1-alpha orchestrator — not re-run here since this sdk-only diff has no independently-executable behavior.task cue:genregeneratedcue_types_gen.goand re-running it is a no-op (git status clean), confirmed above. RDD — the root cause was found via a live reproduction (not a doc read) in the consumer worktree before this fix was written. ADE: N/A, no candy touched.main; no Phase-2/deferred work left in this PR's scope.go vetclean (pasted above);go build/go testgreen;GOWORK=off golangci-lint run ./...→0 issues..CHANGELOG/2026.205.2010.mdstaged (placeholder CalVer2026.205.2010; the fresh pr-validator finalizes the real merge-time CalVer).Assisted-by: Claude Code (Anthropic Claude Opus 4.5; analysed on a live system)