Repository navigation
fix(deploykit,packagekit): match a pinned package by bare name; parse a real candy charly.yml - #307
Conversation
… a real candy charly.yml Two defects exposed by pinning an exact version in a candy's `distro: <d>. package:` (opencharly/layer-charly#10): 1. deploykit.distroRepoProvidesPackage compared the bare packaging.name against the package list with slices.Contains, so a pinned entry (`charly=2026.268.1917` pac/apt/apk, `charly-<ver>-<rel>` rpm) no longer matched and the localpkg-skip did not fire — emitting a redundant UNPINNED second install that defeats the pin. Match on the bare name via the ONE canonical strip (buildkit.PkgName, R3), the same helper the `{{pkgName .}}` render func uses. 2. packagekit.ParsePackaging decoded the whole document into a typed map, which fails on a real candy charly.yml's top-level `version:` scalar before reaching the candy body — so `charly generate-packages` errored on every real candy (its fixture hid this by nesting version:). Walk a yaml.Node so a top-level scalar is tolerated. Both fix a unit test that fails without the change. Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: contract/library module ( Blocks
Verify (tool-limited, non-blocking)
CommentsNo comments on this PR ( Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…e go 1.26.4) The one-line function literal in TestMergeReverseOps is reflowed by gofmt 1.27 but NOT by the gofmt of the module's declared toolchain (go 1.26.4, which CI uses). It is not part of this change; revert it so the diff carries only the two defects. Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — PASSHead SHA: Security screen: PASS (T1–T4 — no injected/embedded instructions, no secrets or egress, no guardrail/CI/branch-protection weakening, no supply-chain change; the only new import is the in-repo
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
Fix two sdk defects exposed by pinning an exact version in a candy's
distro: <d>. package:list (name=versionon pac/apt/apk,name-<version>-<rel>on rpm) — the mechanism opencharly/layer-charly#10 adds soan upstream package rebuild invalidates exactly the install layer.
1.
deploykit.distroRepoProvidesPackagematched a pinned entry by exact string.It compared the bare
packaging.name(charly) against the package list withslices.Contains. A pinned entry (charly=2026.268.1917) no longer matched, sothe localpkg-skip did not fire and the emitter produced a redundant, UNPINNED
second install — defeating the pin it was meant to enforce. Measured on the
githubrunnerbox: without the pin, ONE install line; with the pin, TWO(
pacman -Syu --needed charly=2026.268.1917+ apacman -U …/charly-${ARCH}.pkg.tar.zstthat pulls the latest). Match on the bare name via the ONE canonical strip
(
buildkit.PkgName, R3) — the same helper the{{pkgName .}}render func uses.2.
packagekit.ParsePackagingcould not parse a real candycharly.yml.It decoded the whole document into a
map[string]struct{…}; a real candy filecarries a top-level
version: <calver>SCALAR, which fails that decode beforeever reaching the
candy:body — socharly generate-packageserrored on everyreal candy. Its own test fixture hid this by nesting
version:insidecandy:.Walk a
yaml.Nodeso a top-level scalar is tolerated.Both changes ship a unit test that FAILS without the fix; no exported API changes
beyond adding
buildkit.PkgName(whoseTemplateFuncs["pkgName"]behavior isbyte-identical). Five files total, all named above.
How tested
Each new test fails with the fix reverted (proof):
Real-file end-to-end (
ParsePackagingagainst the actuallayer-charly/charly.yml):before — the exact
unmarshalerror above; after —OK name=charly.Final module-CI gate on the final tree:
Rulebook compliance
layer-charly#10.buildkit.PkgName), reused by the template func and deploykit.gofmt/vet/test) is the whole gate for a contract module with no bed.Change classification
github.com/opencharly/sdk) — nocharly.yml, no deployable target, nodisposable: trueentity.gofmt -l .+go vet ./...+go test ./...) GREEN on this head; each new test fails without its fix.fully tested and validated— the module suite executed the changed paths and fails without them.Cross-repo ordering
This sdk fix must land before opencharly/layer-charly#10, whose pin triggers the
defect; the consumer boundary is the githubrunner box build (
distro-cachyos),which this unblocks once charly carries the fix.
Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (fully tested and validated)