Repository navigation
fix(loaderkit): the candy-manifest fallback runs the one desugar step (#323, #315) - #354
Conversation
sdk#323. spec.DocDirectives no longer contains version (retired with the version-stamp cutover), so a project file carrying the legacy top-level version: SCALAR makes ParseDoc fail on that scalar node and ParseCandyManifest takes its FALLBACK branch — which decoded the candy body RAW, with no desugarEntityPlan. The authored <word>: <input> plugin-verb sugar then matched no #Op field and the closed-schema CUE decode silently DROPPED it, so every authored plugin verb in that candy's plan vanished. The fallback is a different SHAPE SCAN, never a different PARSE: it now runs the same desugarEntityPlan the primary branch gets from parseNode, and the canonical candy: kind-keyed branch (reachable only when ParseDoc failed AND no node-form candy node exists, so nothing had desugared it) runs the same idempotent step. DecodeNodeValue consumes a pn.Body parseNode already desugared, so no third bypass remains. sdk#315. The box's EffectiveVersion lost its only writer when sdk#313 removed deploykit.ComputeEffectiveVersions, and nothing reads LocalPkgInstallStep.Version either: downloadLocalPkg obtains the format's stable-latest download_template and the field only round-trips through spec/install_step_view.go. The dead assignment is deleted and CompileLocalPkgStep's doc, which still claimed the step "carries ... the release CalVer (the box's effective version)", is corrected with it. Tests (both fail without their change, measured): - loaderkit TestParseCandyManifest_ProjectFileFallbackDesugarsPlan — before the fix plan[0].Plugin was "" and PluginInput nil. - deploykit TestCompileLocalPkgStep_CarriesNoDeadEffectiveVersion — before the fix the fixture box's version leaked onto the step. Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: Code — Go source + tests in the Security screen (T1–T4): no finding — no secrets/egress, no guardrail weakening, no scope mismatch, no supply-chain change, no security-machinery edit. Comment thread: empty (0 comments) — nothing to disposition. Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review-round fix on the BLOCK of #354: running the repo's OWN committed CI (`.github/workflows/ci.yml`) surfaced loaderkit/parse_candy_manifest.go:54:1: cyclomatic complexity 31 of func `ParseCandyManifest` is high (> 30) (gocyclo) The sdk#323 fix pushed ParseCandyManifest one branch over the repo's configured gocyclo threshold of 30, so the module's own gate was RED. Fixed in the tree, not by raising the threshold: the function is split into three behaviour-identical helpers — candyFromParsedNodes (the node-form scan over a ParseDoc result), candyFromFlatScan (the ParseDoc-FAILURE flat scan, which carries the sdk#323 desugar step and reuses the ONE existing kit.MappingChild rather than a second copy), and candyFromKindKeyedForm (the canonical `candy:` form + the unrecognized-shape error). Re-measured on this head: `go test ./...` exit 0 with zero failing tests, `golangci-lint run ./...` (v2.13.2, the CI pin) reports 0 issues, `gofmt -l .` empty, `go vet ./...` clean, and the CI cross-compile matrix (linux/{amd64,arm64,arm,386}, CGO_ENABLED=0) builds for all four. 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. |
…oes desugar Rule 11 (guidance is part of the fix, claim-keyed not file-pattern-keyed): the fix in this PR makes the candy-manifest FALLBACK branch desugar too, which falsifies "the ONLY branch that desugars authored verb sugar" / "it would fall back to a decoder that does not desugar" — a live claim carried by the liveBedParse fixture comment in loaderkit/scan_live_bed_test.go. The fixture's legacy-`version:` strip STAYS, because it is right for its real reason (it mirrors production's command:migrate reshape of the pristine export before the parse); only the reason text changes, so the fixture no longer leans on which branch desugars. Org-wide sweep of the same claim, excluding the permitted CHANGELOG history: 0 live hits in sdk, charly, spec or marketplace. Assisted-by: DeepSeek Harness DeepSeek V4.1 Flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: Code — Go source + tests in the sdk contract module ( Placement: CORRECT — the change keeps the desugar call inside Security screen (T1–T4): PASS — no secrets/egress, no new endpoints, no guardrail/branch-protection/validator-spec weakening, no dependency or pin change, no security-machinery edit; no instruction-like content in body, commits, or diff. Blocks
Comment intake
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS (T1–T4 — no secrets/egress, no guardrail/validator-spec/branch-protection weakening, no supply-chain or dependency change, no scope mismatch, no instruction-like content). Comment intake:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
…s spec half) (#208) Closes #204. The field has had no writer since opencharly/sdk#354 deleted deploykit/install_build.go's `Version: img.EffectiveVersion` (whose producer, deploykit.ComputeEffectiveVersions, died in sdk#313), and it has no reader anywhere either: downloadLocalPkg obtains the format's stable-latest `download_template`, never a versioned URL, so the in-proc field and its view round-trip are pure residue. Deleted in this cutover: - spec/install_step_vocab.go — the `LocalPkgInstallStep.Version` field AND the doc that claimed a behaviour the code never had ("Version is the release CalVer (e.g. "2026.225.1200") to download") — the R5 half and the guidance half of the same removal. - spec/install_step_view.go — both round-trip assignments (StepToView / StepFromView), so the wire no longer pretends to carry a version. - spec/install_step_vocab_test.go, spec/install_step_view_test.go — the fixtures that set it (the step-IR round-trip test stays green). Not touched, and named rather than silently dropped: the wire view's own `version?: string @go(Version)` in spec/schema/deploy.cue (#InstallStepView) is now written by nothing and read by nothing, but spec/schema/* is another owner's surface in this wave, so it is reported to the Lead rather than edited here. Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
…ained The validator's R1/R5 finding is correct and the divergence was introduced by this hunk: one event — "the field lost its only writer" — was attributed three ways (sdk#315 in the new comment, sdk#313 in the new error string directly beneath it, and sdk#354 in the PR body), and the guard-adding PR was attributed to #354. Measured, rather than picked from the three: - #315 does NOT resolve as a pull request; it is the ISSUE, now CLOSED: "deploykit: install_build.go still assigns the now-unpopulated EffectiveVersion (dead after sdk#313)". - the assertion this change replaces — the retained evidence, itself tagged sdk#315 — said the box's EffectiveVersion "lost its only writer in sdk#313". - opencharly/spec#208 is the spec-side PR of that retirement (the field and its view round-trip), which is what this change adapts to. - #354 is a loaderkit fix ("the candy-manifest fallback runs the one desugar step (#323, #315)"), not the field's retirement, so naming it as the writer's deleter or the guard's author was false. The comment and the error string now both say the same thing: the writer was already lost in sdk#313; the retirement is tracked by ISSUE sdk#315 and landed on the spec side as spec#208. No PR number is invented for the guard: the commit that added it could not be measured from this checkout (`git log -S` on its text finds nothing here), so the text names the issue instead of guessing a number. Refs #315, opencharly/spec#208 Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
…egs) (#358) * chore(deps): adopt spec v0.2026280.2244 (the sdk#315 and sdk#253 consumer legs) Bumps `require github.com/opencharly/spec` v0.2026276.0 -> v0.2026280.2244 via `go get` + `go mod tidy` (the toolchain, never a hand-pin) and adapts the two consumer surfaces the adopted range changes: 1. spec#208 removed `spec.LocalPkgInstallStep.Version` (with its view round-trip) after #354 deleted the field's only writer. The dead-vestige guard added in that PR asserted the field was EMPTY, which no longer typechecks; it now asserts STRUCTURALLY that the type has no `Version` field at all — a reinstated assignment is a compile error, and the reflection check keeps the vestige from creeping back as a field without a writer. 2. spec#202 made a ref's identity its PROJECT identity, not the enclosing repository (the fix for the false import back-edge sdk#253 measured as three namespace failures). `loaderkit.RepoIdentity` is a plain alias of `spec.RepoIdentity`, so the stale expectation in `TestRepoIdentity` is updated to the project identity and the reason is recorded at the assertion: stripping `@github.com/o/r/candy/x:v1.2.3` to `github.com/o/r` is the PRE-#202 behaviour. This closes the residual the sdk#253 dossier named — "sdk's own go.mod still pins spec v0.2026276.0 (a pin bump, not the defect)" — in the same range. Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated) * docs(deploykit): reconcile one retirement's provenance to what is retained The validator's R1/R5 finding is correct and the divergence was introduced by this hunk: one event — "the field lost its only writer" — was attributed three ways (sdk#315 in the new comment, sdk#313 in the new error string directly beneath it, and sdk#354 in the PR body), and the guard-adding PR was attributed to #354. Measured, rather than picked from the three: - #315 does NOT resolve as a pull request; it is the ISSUE, now CLOSED: "deploykit: install_build.go still assigns the now-unpopulated EffectiveVersion (dead after sdk#313)". - the assertion this change replaces — the retained evidence, itself tagged sdk#315 — said the box's EffectiveVersion "lost its only writer in sdk#313". - opencharly/spec#208 is the spec-side PR of that retirement (the field and its view round-trip), which is what this change adapts to. - #354 is a loaderkit fix ("the candy-manifest fallback runs the one desugar step (#323, #315)"), not the field's retirement, so naming it as the writer's deleter or the guard's author was false. The comment and the error string now both say the same thing: the writer was already lost in sdk#313; the retirement is tracked by ISSUE sdk#315 and landed on the spec side as spec#208. No PR number is invented for the guard: the commit that added it could not be measured from this checkout (`git log -S` on its text finds nothing here), so the text names the issue instead of guessing a number. Refs #315, opencharly/spec#208 Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Summary
Fixes #323 and #315 (cluster C3 — the loader's parallel paths must not
bypass the one desugar/validate step).
#323 — the candy-manifest fallback ran no desugar step.
spec.DocDirectivesno longer containsversion(retired with the version-stamp cutover), so a project file carrying the legacy top-levelversion:SCALAR makesParseDocfail on that scalar node andParseCandyManifesttakes itsFALLBACK branch. That branch is a different SHAPE SCAN, but it was also a different PARSE: it decoded
the candy body RAW, with no
desugarEntityPlan. The authored<word>: <input>plugin-verb sugar thenmatched no
#Opfield and the closed-schema CUE decode silently DROPPED it, so every authored pluginverb in that candy's plan vanished. It now runs the same
desugarEntityPlanthe node-form path getsfrom
parseNode; the canonicalcandy:kind-keyed branch (reachable only whenParseDocfailed ANDno node-form candy node exists, so nothing had desugared it) runs the same idempotent step.
DecodeNodeValueconsumes apn.BodythatparseNodealready desugared, so no third bypass remains —one parse-to-desugar path, not two.
#315 — the dead
EffectiveVersionvestige. The box'sEffectiveVersionlost its only writer whensdk#313 removed
deploykit.ComputeEffectiveVersions. The dead assignment is deleted, andCompileLocalPkgStep's doc — which still claimed the step "carries ... the release CalVer (the box'seffective version)" — is corrected in the same commit.
Review-round fix 1 (R1). Running this repo's OWN committed gate (below) found that the #323 change
had pushed
ParseCandyManifestto cyclomatic complexity 31, one over the repo's configuredgocyclothreshold of 30 — the CI was RED. Fixed in the tree, not by raising the threshold: the function is
split into three behaviour-identical helpers (
candyFromParsedNodes,candyFromFlatScan,candyFromKindKeyedForm). The new flat scan reuses the ONE existingkit.MappingChildrather thanadding a second copy of the mapping lookup (R3).
How tested
Change class and gate, from the matrix that owns it (
/charly-check:checkreferences/beds-and-r10.md, "R10 gate by change class", the Contract / library module row, whichnames this module explicitly):
So this class requires no
charly check runbed in this repo (none can exist here). The gate isthis module's own CI, DISCOVERED at
origin/main(not assumed):.github/workflows/ci.ymlrunstest -z "$(gofmt -l .)",go vet ./...,golangci-lint(pinned v2.13.2),go test ./..., and aGOOS=linuxcross-compile matrix overamd64/arm64/arm/386withCGO_ENABLED=0. All of it, executedon this head:
The lint run is not ceremony: it is the gate that FAILED on the first head of this PR, with
and it is 0 issues on the head pushed here (the refactor above). Both changed pieces are EXECUTED
by the suite, not merely compiled, and each new test fails without its change:
Negative controls (the fix reverted in a scratch copy, then restored — the tree pushed is the
restored one), showing each test genuinely exercises the changed path:
The deploykit piece, and the consumer boundary that owns its bed.
CompileLocalPkgStepis calledfrom
BuildDeployPlan(deploykit/candy_steps.go:115), whose live boundary is a CONSUMER deploy thatactually installs a
local_pkg. That bed is not in this repo — per the matrix row it rides theconsumer change — and the consumer bed for a localpkg install is charly's
check-pkg-uninstall, whichopencharly/charly#752 records as RED for an independent, named reason (the inner guest's charly does
not load
/usr/lib/charly/plugins), tracked and owned there. The live loader boundary is exercised insibling PR opencharly/charly#823 (the C3 consumer leg, which also carries the charly-side loader gate
and, once this PR merges and tags, the pin bump that adopts this module), and I have run its
change-class bed against this unreleased sdk via the local-
replacerecipe:The
no disposable targetpremise, proven with executed output rather than asserted:The four hits are
.goldenfixtures ofworkflowkit, not a project; no tracked YAML in this moduledeclares a
disposable: trueentity, so no bed can exist here. (cmd/charly-lib-gen/main.gois acodegen CLI, not a deployable target.)
git diff --statfor this head:Head
e2395eb2ba7baf611923c27439edbae45a9d4ee9Rulebook compliance
R0 — skills loaded before each step:
/charly-internals:pluginand/charly-internals:go(sdk/loaderkit Go + the per-plugin CUE contract),
/charly-internals:git-workflow(before anygit/PR action, plus
references/pre-validator-self-audit.mdbefore the first push),/charly-internals:strict-policy(R1/R2/R3 + RDD),/charly-check:check(loaded before any beddecision, and its
references/beds-and-r10.mdis the matrix quoted above).R1 — three findings were root-caused here, none parked: (a) the issue's premise re-derived on
origin/mainand reproduced as a failing test BEFORE the fix; (b) the CI lint gate red on my ownfirst head (
gocyclo 31 > 30) — fixed by the refactor, and the whole gate re-measured green; (c) thewarning question reconciled by measurement instead of prose — the single
WARNINGline in the liveoutput is on stderr and is the documented R9 dev/worktree-build notice, while
charly box validate's own tally on stdout is exactly one line reporting0 warnings, 0 errors:The dev-build notice is the R9 worktree-binary behaviour the rulebook requires (never install a
shared binary), not a validate finding; the three
plugin ...: served fromlines on stderr areinformational register lines, not warnings.
R2 — no deferral and no unnamed parking. The doc the deletion falsified is corrected in this
commit. The one residue this change cannot fix in-tree — the now-orphaned
spec.LocalPkgInstallStep.Versionand its view round-trip, which live in a DIFFERENT repo — isfiled as its own issue with the exact named scope: spec: LocalPkgInstallStep.Version has no reader — delete the orphaned field, its view round-trip and the doc that claims a versioned download spec#204 (field, view round-trip
lines, and the doc comment that claims a versioned download). That is the named immediate-next batch
this PR advances it to, not "a spec-side residue batch".
R2 / rule 11 (guidance is part of the fix) — the claim this change INVALIDATES is swept in the
same cutover, claim-keyed rather than file-pattern-keyed: the phrase that the candy-manifest fallback
"does not desugar" (and its sibling "the ONLY branch that desugars") is now false, so it is fixed at
its one live surface, the fixture comment in
loaderkit/scan_live_bed_test.go(liveBedParse), whoselegacy-
version:strip stays — but for its real reason, mirroring production'scommand:migratereshape rather than leaning on which branch desugars. The org-wide sweep shows no other live surface
carrying it (the one remaining hit is
CHANGELOG/history, the permitted survivor):No other surface promises a versioned
LocalPkgInstallStepeither — the field's only writer isdeleted here and its only live references are the inert spec-side ones named in
spec: LocalPkgInstallStep.Version has no reader — delete the orphaned field, its view round-trip and the doc that claims a versioned download spec#204, which is the guidance half of the same cutover.
R3 — one desugar step: every branch of
ParseCandyManifestruns the SAMEdesugarEntityPlan,and neither the split nor the flat scan adds a second copy of anything (the flat scan reuses
kit.MappingChild, the ONE mapping lookup). The threeDecodeEntityViaCUEcall sites were swept(run from the sdk worktree root): the third,
loaderkit/node_tree.go:108, decodes apn.BodythatparseNodealready desugared, so it is not a bypass.The dead field claim is likewise backed by executed output, not asserted — the only writer was the
deleted line, and the consumer sweep finds no reader (run from the umbrella root, against a
freshly-fetched
origin/main):line 55 above is
InstallPlan.Version(a different struct); the localpkg execution path reads nostep
Version(downloadLocalPkg,deploykit/localpkg.go:306, uses the format's stable-latestdownload_template), and the field only round-trips throughspec/install_step_view.go:125,263—which is exactly the inert residue spec: LocalPkgInstallStep.Version has no reader — delete the orphaned field, its view round-trip and the doc that claims a versioned download spec#204 now owns.
R4 — no sleep, retry, suppression or environment shim; the fallback keeps its documented role
(the "charly.yml is everything at once" project-file shape) instead of being papered over.
R4a — N/A — this change adds no user-facing command; the doc that contradicted it was corrected
in the same commit rather than routed around.
R5 — the dead assignment and the stale prose describing it are deleted in this commit; the one
remaining live reference to the field is the spec-side round-trip, which is filed as
spec: LocalPkgInstallStep.Version has no reader — delete the orphaned field, its view round-trip and the doc that claims a versioned download spec#204 with its exact lines.
R6 —
git status --shortis empty on both worktrees and the temporary proofreplacewasreverted before this head; no reset, no force-push, no hook bypass, no push to
main.R7 — both new tests fail without their change (negative controls pasted above), and the live
charly box validateexecuted the changed parse path over 609 real candy manifests.R7a — N/A — no boundary crosses a real external service; the parse is pure and in-process (the
live run additionally registered three real out-of-process plugins).
R8 — no emitted artifact changes: the parsed/validated value for every non-colliding input is
unchanged, proven by the module suite (
TestDeployCompileParity-style compile fixtures included) andby the live
box validateresolving the same 609/125/45/7/7 entity counts with 0 warnings, 0 errors.R9 — the live runs used a worktree-local CalVer-stamped binary built by
./scripts/bootstrap-charly.sh(2026.280.2122), invoked through that worktree'sbin/; nothing wasinstalled as a shared binary.
R10 — the class is Contract / library module, whose matrix gate is this module's own committed
CI green on the PR head; that gate is pasted above in full (gofmt, vet, golangci-lint 0 issues,
go test ./...0 failures, four cross-compile targets) together with the executed proof that nodisposable: trueentity — and therefore no bed — can exist in this module. The consumer boundarybed belongs to the consumer change: it rides sibling PR fix(plugin-loader): a plugin-vs-plugin CUE def-name collision is a load ERROR (#770) charly#823 (and the pin bump that
follows this merge), whose bed I ran against this unreleased sdk via the local-
replacerecipe withpasted output.
A1/A3 (attribution) — substantiated, not asserted. The authoring runtime is the DeepSeek Harness
DSH, cross-checked against the managed environment variables the harness exports in this session:
The provider and the model are named by the session's own runtime record — the DSH session
transcript for THIS session (
DSH_SESSION_ID=09394229-4031-4299-9576-ca9af176a3e4), which carries theprovider/model pair the runtime actually used:
So the harness, provider and model are all cross-checked against runtime evidence, and the trailer
names them in that order:
DeepSeek Harness ollama-cloud/deepseek-v4.1-flash.Change classification
Code — Go source plus tests in the
sdkcontract module (loaderkit/,deploykit/). Not adocs-only change, so
documentation reviewedwould be invalid. The class is Contract / librarymodule; its matrix gate is this module's own committed CI, pasted in full above and green on this
head, with both changed paths executed by tests that fail without them and the changed parse path also
run live on 609 real candy manifests through the assembled charly loader.
Agent: loader-paths
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)