Repository navigation
feat(builders)!: one mechanism for every build-time manager — aur behaves exactly like npm - #613
Conversation
…aves exactly like npm 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)
|
HOLDING HOLDING — #613 (head
All of those are committed locally and gated against the dev chain. #613 closes this issue and #610. Next STATUS: on #613's verdict, or by 2026-11-22 12:00 UTC. Agent: |
Review — PASSHead SHA: Security screen: PASS — no secrets/egress, no guardrail weakening (the change makes silent skips loud), Comment considered: @aitrawog's Checklist: All applicable rules PASS or NA. Notable cross-checks: A1 body complete with AI-form Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
…421) Completes opencharly/sdk#608's plugin-owned install contract in the schema. opencharly/sdk#613 made what a builder copies into the target the builder plugin's own knowledge: its payload and tool binary come back in its #BuilderResolveReply (copy_artifacts, copy_binary). Nothing reads the authored copy_artifact or copy_binary on a builder node any more. Both fields still loaded and were then silently ignored, the same defect class this chain deleted #AUR.replace for. A grep of the org finds no config that authors them, so no `charly migrate` step is needed. - #Builder loses copy_artifact and copy_binary, and #Copy, which only they used, is deleted. The reply's copy_artifacts and copy_binary strings stay; they are what the plugin produces. - The comment above copy_artifact, which this chain itself wrote in #420, said it was "the ONE install contract every builder shares", read by the image render and the apply path. That was false once sdk#613 landed and is gone with the field. - #BuilderPackage's comment and the unified test's comment cite #BuilderAlt under D-PLUG-2. They cited D-IR-7, a different requirement. - spec/cue_types_gen.go is regenerated (charly task cue-gen). Test: TestBuilderPackageOutputIsDeclaredByThePlugin now refuses an authored copy_artifact and copy_binary on #Builder. It fails at builder_manager_unified_test.go:102, for both, when the fields are restored. 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
The sdk half of the unified builder mechanism (#608, Unit 1). Before, aur, npm, pixi, cargo and mise did one job spread over five surfaces, and aur took a different road on every one. Each road had a silent skip.
kdotool, declared underaur:in layer-kde-shell, never reached any image while the build stayed green (opencharly/layer-kde-shell#7). Now every builder goes through one trigger, one fail-loud pre-pass, one install contract and one IR. aur behaves exactly like npm.Closes #608. Closes #610: the #609 regression is superseded, because the tag-scoped trigger below keeps an arch-tagged declaration off non-arch boxes.
Consumes opencharly/spec#420, merged and tagged
v0.2026326.323, whichgo.modnow requires.One trigger.
NeedsBuilder(candy, image, builder)fires on a detect file, or on a manager declaration the image's tag chain selects.ResolveManagerPackagesreads it over the sameCascadeTagChainthe OS packages resolve over.distro.<tag>.auron its own tag section. It used to merge every tag into one image-independent section, so an arch-tagged declaration no longer reaches a fedora image.build:opt-in.DetectExternalizedBuilders) and the apply compile all call this one function.One fail-loud pre-pass.
requireBuildersruns first inEmitBuilderStages, over the builder vocabulary, not 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'srequireDeclaredBuilders.One install contract, owned by the builder plugin (DESIGN.cue
#BuilderAltunder D-PLUG-2, D-IR-7, P3; the operator chose plugin-owned on #608). What a builder installs is the plugin's own knowledge, never the authored builder node.kitdefines every stage builder's payload (builderPayloadCopies): pixi, npm and mise copy the stage home, and aur copies its extracted package tree. A stage word with no payload is an error.BuilderResolveReply.Package,BuilderCollectReply.Package, viakit.BuilderPackageOutput).local_pkg, pacman installs the candy's packages from the candy's own directory (/tmp/aur-pkgs/<candy>). There is no shared directory, so no double install.One IR for both modes (D-IR-1).
compileBuilderStepsuses the same trigger and carries the plugin-declared package output ontoBuilderStep.Package, neverbName == "aur".find /backstop is deleted.RunVenueBuilderStep). An image build copies the payload instead, so the shared compile no longer fails a fedora pod overlay.RenderBuilderPackageInstall).NeededBuilderImageslists exactly the builder images the stages name, so the overlay ensures them first.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. Before, nothing filled npm's or cargo's teardown set. An unknown builder word or an unparseable manifest is an error.
No swallowed errors, one dispatch (R2).
manylinux_fixrender error, a missing cached stage reply, and anexternal_builderstage that copies nothing now fail.HasInstallFilescounts mise manifests and manager declarations.BuilderCollectInputForis the one constructor of the collect input.sdk.InvokeBuilderis the one Invoke dispatch every builder plugin serves. The four byte-identical plugin-builder-* copies and plugin-mise's three helpers become one call each.Cache. The materialized-tree cache key's doc names the embedded-defaults digest among its inputs (spec#420 carries the field, charly's walk stamps it).
TestLoadedProjectCacheKeyCoversTheEmbeddedDefaultsfails if the key narrows to the documents.Also:
build: [pac, aur], a box the schema now refuses. It now models a schema-valid box, and its new tag half covers the aur case, since manager declarations are tag-scoped.generate-sourceskill, thekitcomments and the npm stage template's comment stop naming the retiredcopy_artifact/detect_config.The chain (producer-first). spec#420 (merged) → this PR → plugin-builder, plugin-fleet, plugin-box, plugin-installstep, plugin-loader, plugin-deploy-pod, the builder plugins (aur, npm, pixi, cargo, mise) → charly → distro-arch, plugin-migrate, distro-cachyos, pod-kde-vnc → layer-kde-shell. Each is its own PR, opened when its producer has tagged.
How tested
This is a contract / library module (
/charly-check:check, "R10 gate by change class"). Its gate is its own committed CI (.github/workflows/ci.yml: gofmt, vet, golangci-lint v2.13.2,go test ./..., the four-arch cross-compile), green on the PR head.Every job, on the pushed head
bee074910ae368de15bd5f3af3fa43f6a7595a6d, withGOWORK=off(the spec require resolves from the module proxy atv0.2026326.323). Verbatim:Each rule's test fails with the rule reverted. All twelve mutations ran on
bee074910ae368de15bd5f3af3fa43f6a7595a6d. Each one was applied, the named test run, and the file restored; the runner checksgit statusat the end. Verbatim:No disposable target exists here, so no bed can. The class requires proof of that, executed on the head:
sdk-skill-shelfis a skill-carrier candy, not a box, deploy or check node.The consumer boundary. This module's behaviour is observable live only through a charly binary built over it. That bed rides the charly PR of this chain, the consumer, in producer→consumer order. Dev-build evidence from earlier in the cutover, with a worktree-local charly built from these branches (it supports the design, but it is not this PR's gate):
arch-test(aur on arch):charly check box,41 steps: 39 passed, 0 failed, 2 skipped.4 steps: 4 passed, 0 failed, 0 skipped. That includeskdotool resolves every shared library on Fedora (ldd reports none not found)andkdotool runs on Fedora.builders-arch: the npm and pixi payloads land (cowsayin the image home,jqin the default pixi env),5 steps: 5 passed, 0 failed, 0 skipped.add_candy:) adding an npm candy: the payload landed (/home/user/.npm-global/bin/cowsay -> ../lib/node_modules/cowsay/cli.js). Running it exits 127 withenv: 'node': No such file or directory. The throwaway probe declares no Node runtime (real npm candies requirenodejs), so that run proves the copy, not a runnable package.Rulebook compliance
/charly-internals:git-workflow,/charly-internals:go,/charly-internals:plugin,/charly-internals:install-plan(sdk's ownAGENTS.mdR0 list is plugin, go and install-plan), and/charly-internals:strict-policy./charly-internals:designwas read by path from the corpus (marketplace/internals/skills/design/SKILL.md), because this harness's installed plugin cache predates it. That's a stale install, not a skipped skill. The change-class gate table was read from/charly-check:check'sreferences/beds-and-r10.md.writestringwarnings in two untouchedkitfiles, which CI's lint does not report. Filed as kit/profile.go and kit/grader.go: gopls writestring warnings (string concatenation inside WriteString) that CI's lint does not report #612.NeedsBuilder), one pre-pass (requireBuilders), one collect-input constructor, one package-install render, and one builder Invoke dispatch (InvokeBuilder), replacing four byte-identical plugin copies.build:format gate, the secondary-format loop, the shared/tmp/aur-pkgs, thefind /backstop and every silentcontinueon these paths are deleted, not routed around.bee074910ae368de15bd5f3af3fa43f6a7595a6d:Both hits are intended.
:63is the corrected text: "pixi/npm/cargo/aur/mise" matches the old pattern at the\bbefore/mise, and the sentence states thatcopy_artifact/copy_binaryare gone.TestComputeIntermediates_UnionChildBuildFormatsis the rewritten union test's name.R6:
git statuswas clean before the push. This is afeat/branch off freshorigin/main(e52cf22), rebased before its first push. Nothing else was touched.R7: every rule has a test that fails with it reverted (above), across all five builders where the rule applies.
R8: nothing live is mocked. The module suite is unit-level by class, and the live boundary runs on the consumer PR.
R9: the dev-build evidence used a worktree-local, CalVer-stamped charly built from these sources, never a shared install.
R10: the class gate (the module CI) passed on the exact pushed head
bee074910ae368de15bd5f3af3fa43f6a7595a6d.R11: conforms to:
buildernode. aur is one like npm, with no box opt-in, and a declaration is scoped by its tag.#BuilderAlt: the authored builder row is a manager map, so the payload and package output are the plugin's, never authored.Nothing moves further from DESIGN. The umbrella ledger
design/dulling.tsv(thekind:builderrow) still listsdetect_configamong the builder fields; it is corrected in the umbrella PR at the end of this chain.Change classification
fully tested and validated. The class gate passed on the final tree, and no bed can exist in this module.requireDeclaredBuilderspath, the secondary-format install road and the authoredcopy_artifact/copy_binaryreading are gone. Builder replies now carryPackage, andcompileBuilderStepsreads the plugin's declaration. Every consumer moves to this tag only in its own PR of the chain, so nothing that pins an older sdk changes behaviour. Rollback: revert this squash commit and re-tag. Consumers still pinned to the previous sdk tag (v0.2026325.921) are unaffected throughout.Filed issues
writestringwarnings inkit/profile.goandkit/grader.go, untouched by this change, that CI's lint does not report.build: [pac, aur]as#CandyValue.base: field not allowed. The source is traced to charly'svalidateKindValueCUE, with a kind-blind fix direction.charly migratereformats untouched YAML in every file a step rewrites.resolved_imageon a freshadd_candypod; it predates this change and exists on main.https://claude.ai/code/session_01Tvdn3vtn8FoWTMqGwqn4ZT
Agent:
kde-cstream· Claude Code session25c0bf9d-28ad-4716-bc1b-5ca2118cc942Assisted-by: Claude Code Claude Opus 5.5 (fully tested and validated)