Repository navigation
feat(deploy,bundle)!: FLOOR-SLIM-proper Unit-8 — arbiter-bracket K4-exit + builder pre-pass + clause-D leak fixes - #177
Conversation
…xit + builder pre-pass + clause-D leak fixes Moves the Q1 resource-arbiter bracket (charly/arbiter_bracket.go, deleted) and the deploy-time builder pre-pass (charly/builder_preresolve.go's Invoke half) into candy/plugin-bundle, via two new HostBuild seams (arbiter-bracket-acquire/-release) and exec.InvokeProvider (spike-proven live against a real out-of-process ClassBuilder plugin) respectively. Fixes two clause-D leaked kind-word switches in node_bundle.go/ node_normalize.go, replacing them with the existing P9 plugin-declared #DeployTraits fact (deployTraitsFor) — zero new schema. Resolves R-FS17's overturned arbiter_bracket.go permanence claim. Four originally-scoped items (oci_step_emit.go, arbiter_host.go+preempt.go, vm_lifecycle_preresolve.go+ephemeral_dispatch.go, service_render.go+ install_build_services.go) deferred with concrete new design notes after implementation surfaced genuine architectural blockers beyond the initial scoping estimate; one (plugin_grpc.go's relayNestedTarget, ~155 LOC) is a spike-REFUTED floor-shrink hypothesis, not a deferral. See CHANGELOG for the full per-item breakdown. Landed under the pre-authorized sizing carve-out given the confirmed-safe pool (~1,300 LOC once implementation depth was accounted for). Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
# Conflicts: # sdk
pr-validator — APPROVED ✅Change class: cross-repo charly-or-sdk Go (consumer leg of the sdk#89 wire-contract cutover, now merged) Head SHA validated: sdk#89 ancestry cross-check
Checklist
Live verification performed (not taken on the author's word)Post-merge delta re-gate — I watched this run to completion myself (it was still in-flight when I first checked, This is the SAME binary ( Comments consideredNone — the PR carries no comments. Cross-PR interactions considered
DecisionPASS. This is a clean, well-scoped consumer leg: the sdk#89 wire contract it depends on is correctly pinned (ancestry independently verified), the two capability moves (arbiter bracket, builder pre-pass RPC half) faithfully preserve behavior (call-order semantics ported and independently re-tested, the host-side env-mutation property preserved via the same HostBuild idiom as an existing precedent), the two clause-D fixes strictly improve boundary-law compliance (kind-word switches removed, not added), axis-A does not increase, no new alias, and the previously-vacuous parity test now genuinely exercises real builder-context data. Zero warnings across every gate I re-ran myself, including a full go test run I personally timed and a post-merge bed re-gate I personally waited for and read off disk. The 4 deferred items are corroborated as genuine follow-on work (not silent parking) by independently-observed live evidence (a sibling worktree + a stash already mid-flight on the next unit). Proceeding to finalize the merge-time CalVer, merge, and tag. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated) |
pr-validator: rename the placeholder CHANGELOG to the merge-time CalVer and rewrite its H1 heading to match (filename<->H1 byte-parity). Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
pr-validator — outcome: MERGED ✅
This closes the Unit-8 chain: sdk#89 ( Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated) |
Second and last of the sources this leg carries. Adds the content-scoped execution rule, the PROVENANCE clause, the symptom table and the rerunnable merge-tree fixture to git-workflow-skill. This one was load-bearing beyond its own additions. Before it, regenerating evidence-and-freshness.md at this tree removed 152 lines: plugins carried those four sections as a PROJECTION introduced at ab1f93d9, while their candy source existed in no superproject tree at all — not origin/main, not this branch, not the merge-base. Landing the projection's pin without this source would have reverted another leg's work as ordinary generator output. Verified as a gate rather than an expectation: after applying, all four previously source-less sections are present, patch 1's additions are intact, and all six lines #285 contributed are still present. Applied as a patch on top of patch 1, measured in between, so an unattributable artifact would have been caught against one source rather than two. The 7 trailing-whitespace warnings are pre-existing blank lines inside a YAML block scalar; --whitespace=fix is deliberately NOT used, since stripping that indentation would change the rendered page. Claude-Session: https://claude.ai/code/session_01Rt9KMZF6v3x1iL24M74dN2
…s cover Two pins move together, because they are one mirror state: docs@69f97926 is the whole-site projection at plugins@853e72a9, and pinning either alone re-splits it. Both DERIVED rather than confirmed. The pin must reach the newest projection any source in this tree covers, not merely this leg's own producer merge — the tree now carries three producers' sources. [email protected]/main is exactly one commit, #177's merge, whose source is in this tree; docs@620839538.. origin/main is two, #59 (patch 1's projection) and #58 (patch 2's), both now sourced here. DOCS_REF follows the docs gitlink at BOTH occurrence sites. It had drifted three merges behind on this branch: five commits moved the gitlink — four docs projections and the four-pin re-pin — and none carried the pin that names it. A projection commit must carry the page AND the pin; carrying only the page leaves check-docs cloning a pre-projection commit and asserting that same commit, so it passes while proving stale content. task docs:pin is the gate, and it binds on nothing automatic — not CI, not a hook, not a bed. Verified: marketplace drift is clean at 400 artifacts with both sources and this pin, which was the stated target and is measurable only on the clean path. Claude-Session: https://claude.ai/code/session_01Rt9KMZF6v3x1iL24M74dN2
…uilt (#278) `charly check box <box>` could run against an image that was not the one you had just built, report every step green, and give no sign. A gate that certifies the wrong artifact is the highest-severity defect this system has, because a false pass is indistinguishable from a real one. Two independent causes compounded, both traced against the real image store. The render labelled an imported box's image with the namespace-qualified Generator key while tagging the ref with the leaf name, so a fresh build was invisible to a resolve of its own image name. And the election's primary key is the content-derived version label, so an image built from a differently-versioned source tree outranked a newer build regardless of when either was produced. The three build-scope verdict verbs — `charly check box`, `charly box feature run` and `charly box labels` — now resolve through the guarded `kit.ResolveBuiltImageRef`, which refuses a short name whose election is not the newest local build and names both refs plus the pinned re-invocation. Build recency keys on the image's CREATION TIME, the only key total over the tags charly mints (`--tag` REPLACES the CalVer tag, so every bed build reads as no CalVer at all). All three verbs print their `Image:` provenance FIRST on every path, including the no-plan path that previously bailed before printing one; for `box labels` it goes to stderr so `--format`'s single raw stdout value stays byte-unchanged. `candy/plugin-clean`'s retention sort shared the same blind spot and is folded in rather than named separately, because it is the one surface here that DESTROYS an artifact instead of mis-answering: a group of bed-tagged images had no usable ordering key, so `keep_images: N` kept an arbitrary N and could delete the newest build. This commit carries FOUR cutovers' candy sources, and the union was forced rather than chosen. The docs mirror had been regenerated at a projection no reachable superproject state reproduced, so the first leg through the gate had to carry all of them: the build-scope verdict resolver, the git-workflow landing-mechanics leg (#176), the merge-tree guard (#177, source `c144ad11`), and the R4a task-target sweep (#285). Named so a squash does not bury other authors' provenance. Advancing the `sdk` gitlink forces a spec-floor sweep across 90 `candy/*/go.mod` files: under MVS every module depending on `sdk` and requiring `spec` directly must match, and `go.work` masks the defect in-tree while these plugins ship out-of-workspace. The standing gate this adds is a `GOWORK=off` per-module build; it reports 91 modules with one failure, `candy/plugin-dsh`, which fails identically on `main` for an unrelated `go`-directive cause and joins a named module-hygiene batch with a measured scope. Gates, re-derived independently at merge: `check-agent-pod` run 2026.227.1451 (13 steps, 365s) against a byte-identical final resolver; `check-docs` run 2026.227.1835 (13 steps, 492s) on the final tree at zero warnings, with the build log showing it cloned the `DOCS_REF` commit it then asserts. `marketplace drift` clean at 400 artifacts and `task docs:drift` a no-op over 6 repo roots and 891 pages — the first of those perturbation-tested to confirm it can actually fail. Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
…systemd (#419) B1's last item, and the half that had to wait for sdk#176. systemd's candy_file: listed only *.service, and its assembly_template hardcoded that same extension TWICE: cp /systemd/*.service /usr/lib/systemd/user/ && \ for svc in /systemd/*.service; do systemctl --global enable ...; done The pair agreed only because both were frozen. A candy could not ship a .socket, .target or .slice at all - and widening either side alone would have been worse than leaving it: widening candy_file: would stage units the copy never installs, widening the copy would install units nothing collected. Both move together now. candy_file: claims .service/.socket/.target/.timer/.path/ .slice, and the assembly copies EVERY staged unit, then enables only the types systemd can enable. .slice is claimed but deliberately NOT enabled: a slice is a resource container referenced by other units' Slice=, and `systemctl enable` on one is an error, not a no-op. That distinction is asserted, not just commented. The enable loop carries an existence guard because an unmatched glob stays literal in sh - without it, a candy shipping only services would fail the build on `systemctl enable '/systemd/*.socket'`. This is inert without sdk#176, which made candy_file: honoured at all (the scan is init-agnostic, so the patterns are globbed at the point of use). The sdk pin moves to v0.2026240.1542, which also carries #177's fix for the depends_candy false positive that #176 introduced. TestEmbeddedVocab_SystemdClaimsEveryUnitTypeItInstalls guards the pair that has to stay consistent - what candy_file: claims versus what the assembly copies and enables - so neither side can drift again. Verified to fail on the pre-change vocabulary rather than assumed. Assisted-by: Claude Code Anthropic Opus 5 (analysed on a live system) Claude-Session: https://claude.ai/code/session_01Gf42A3bau77JigFYLALrnq Co-authored-by: atrawog <[email protected]>
Summary of changes
FLOOR-SLIM-proper Unit-8 of the core-minimization program (depends on sdk#89 — the wire-contract leg — merging first; the gitlink here points at that PR's branch tip pending merge).
charly/arbiter_bracket.go, DELETED, 90 LOC). OWNERSHIP of the acquire-before-Start/release-on-failure/release-after-Stop bracket call moves tocandy/plugin-bundle'shandleLifecycleSimple(deploy_target.go), via two new HostBuild seams (charly/host_build_arbiter_bracket.go: "arbiter-bracket-acquire"/"arbiter-bracket-release") so theCHARLY_PREEMPT_LEASEenv mutation still executes host-side.unified_targets.go'sStart/Stopnow thread a newHasPlanwire field instead of bracketing inline. The decision logic is a purerunLifecycleBracketfunction; 9 new unit tests (candy/plugin-bundle/deploy_target_bracket_test.go) port the deletedarbiter_bracket_test.go's exact call-order assertions. Resolves R-FS17's overturned "stays core" permanence claim onarbiter_bracket.go.invokeBuilderCollect/invokeBuilderReverse/preresolveBuilderContextsmoved out ofcharly/builder_preresolve.go, 190 LOC net). Moves tocandy/plugin-bundle/builder_preresolve.go(new), dispatched viaexec.InvokeProvider(ClassBuilder, word, OpCollectContext/OpReverse, …)— spike-proven live against a real out-of-processClassBuilderplugin before landing.candy/plugin-bundle/compile.go'scompileDeployPlansnow runs this pre-pass itself before itsdeploykit.BuildDeployPlanloop, using the existingspec.ResolvedProject.ExternalizedBuildersword set (already on the wire — no duplicated data, R3).charly/builder_preresolve.gokeeps ONLY the host-only CONNECT half (loadProjectPlugins/ScanAllCandyWithConfigOptsare core-private).bundle_add_cmd.go'spreresolveBuildersIntoupdated to match.node_bundle.go'sbundleTargetForDisc/setBundleCrossRefandnode_normalize.go'sisStandaloneResourceKindreplace hand-keptswitch disc {case "pod"/"vm"/…}statements with the EXISTING P9 plugin-declared#DeployTraitsfact (deployTraitsFor) — zero new schema, reused infra already present in the same files.isStandaloneResourceKind's own prior comment noted it "reincarnates the R5-deletedbuildStandaloneResourceswitch" — this closes that regrowth.What did NOT land (registered as FINAL/K5 IOU items with concrete design notes — see
CHANGELOG/2026.203.1200.mdfor the full per-item write-up):oci_step_emit.go(StepContract-introspection gap),arbiter_host.go+preempt.go(~500 LOC, gated-not-refuted — Unit B, starting immediately, same session),vm_lifecycle_preresolve.go+ephemeral_dispatch.go(caller-side restructuring needed; half ofvm_lifecycle_preresolve.gois already-adjudicated STAY),service_render.go+install_build_services.go(found DURING implementation: the compile-seam func vars only work becauseplugin-bundleis compiled-in same-process; moving the bodies would nil-panicBuildDeployPlan— needs a ctx/exec-threading signature cascade, its own cutover).plugin_grpc.go'srelayNestedTargetcluster (~155 LOC) is SPIKE-REFUTED (traced to charly-core's own two reentry-only call sites — no plugin could ever host it), not deferred. The k8s-gen subsystem (~290 LOC) is now OWNED with a design note, deliberately not folded in to keep this wave's R10 story coherent.Also fixes two REAL bugs surfaced by this change's own test suite (R1/R2 — fixed in-tree, never deferred):
TestBundleCompileParity_PluginRoundTriphad a silently-vacuous comparison on the exact builder-context path this cutover touches (both OLD and NEW sides constructed an artificially-emptyHostContext, so the pixi-builderreverse_opsdivergence this cutover introduced went uncaught until a realtestPreresolveBuilderContexttest helper was added to populate REAL builder-context data on both sides); and the worktree was missing thebox/fedorasubmodule init (confirmed genuinely environmental via direct inspection, not assumed — fixed, re-verified green).Change class
charly-or-sdk Go (cross-repo: sdk#89 → this PR; sdk lands first)
How R10-tested — exact gate, commands, and pasted output
charly check run <bed>—unified_targets.go's Start/Stop threading change touches all-substrate dispatch, and the loader-level clause-D fixes (node_bundle.go/node_normalize.go) are cross-cutting, so the full approved roster ran CONCURRENTLY (not just the minimal composing bed).charly version=2026.203.0742), same run-calver.check/<bed>/2026.203.0744/:check-group| vm+group(targetless) | ok | 7 steps | 675scheck-sidecar-pod| pod+vm-member | ok | 17 steps | 1178scheck-substrate| vm (all 5 substrate kinds byte-equivalence) | ok | 10 steps | 456scheck-exampledeploy| pod | ok | 6 steps | 110scheck-k3s-vm| vm | ok | 8 steps | 546stask build:binary(charly version→2026.203.0742); content-marker verified (strings bin/charly | grep arbiter-bracket-acquire→ 2 hits). Each bed's OWN[update]/[check-live-rebuild]step (part of the bed's standard sequence) IS the fresh-rebuild R10 pass — e.g. check-substrate's[update] PASS after 3m13.302s, check-sidecar-pod's TWO full rebuild cycles (update+redeploy+check-live-rebuild), check-k3s-vm's[update] PASS after 3m46.232s. Zero warnings across all 5 runs.deploy-add/start/configstep dispatches throughunified_targets.go's modifiedStart(threadingHasPlan), andcheck-sidecar-pod'sconfig+startstep directly exercises the arbiter-bracket Start path for itspodsubstrate (the only substrate that registers a Start plan hook today); every bed'sdeploy-add/updatestep compiles throughcandy/plugin-bundle's modifiedcompileDeployPlans(the builder pre-pass runs on every compile, whether or not the specific candy needs a builder —DetectExternalizedBuildersno-ops cleanly when none do);check-substrate's 10-step run directly exercisesisStandaloneResourceKind/bundleTargetForDisc/setBundleCrossRefacross all 5 substrate kinds (its own byte-equivalence assertions passed).2026.203.0744above), host ceiling not hit, zero store-lock/race findings.Attribution tier
fully tested and validated — all 10 Testing Standards met: every changed code path executed live across 5 concurrent disposable beds, each including its own fresh-rebuild re-verification, zero warnings, host left healthy.
Harness rulebook compliance
/charly-internals:go,/charly-internals:plugin,/charly-internals:strict-policy,/charly-internals:git-workflow,/charly-internals:cutover-policy,/charly-internals:install-plan,/charly-core:deploy,/charly-internals:disposable,/charly-check:check— all loaded before any code was touched (Phase 1 re-derivation + Phase 2 cutover).box/fedorasubmodule-init failure (confirmed genuinely environmental via direct inspection —git submodule statusshowed-uninitialized — fixed, re-verified green); the R6/B7 staging bug where a multi-pathgit addsilently aborted on one bad pathspec, caught via mandatory post-commitgit status/git show --statverification and fixed via amend (branch never pushed). Zero warnings in the final gate output.host_build_deploy_config_save_state.gopattern verbatim; the builder pre-pass reuses the EXISTINGspec.ResolvedProject.ExternalizedBuilderswire field instead of adding a duplicate data source; the clause-D fixes reuse the EXISTINGdeployTraitsFormechanism already used elsewhere in the same files.charly bundle del/charly vm destroyvia the bed runner.charly/arbiter_bracket.go+ its test fully deleted;git grep 'arbiterBracketedStart\|arbiterBracketedStop\|acquireForBracket\|releaseForBracket'returns zero hits outside this PR's own CHANGELOG/commit-message historical context. No transitional/dual-mode path —preresolveBuilderContexts's Invoke half is fully gone fromcharly/builder_preresolve.go(kept only the connect step, renamed).git status/git worktree listchecked before every destructive action; the R6/B7 staging-verification catch above is itself evidence of this discipline in practice.go test) — see above.charly versionmatches, content-marker verified; no new runtime OS deps introduced.disposable: true; fresh rebuild proven (each bed's own update/rebuild step); new check/test coverage that would FAIL without this change: 9 newrunLifecycleBracketunit tests + thetestPreresolveBuilderContext-augmented parity test (which DID fail before the fix, proving it's real signal).ClassBuilderplugin, PASS, then deleted per RDD discipline;relayNestedTarget: a feasibility trace that REFUTED the floor-shrink hypothesis, saving a future wave from re-attempting it). ADE: no candy authoring surface touched. SDD: thehas_planfield + 2 new CUE defs were authored schema-first in sdk#89,task cue:genregenerated,TestGenReproduciblePASS.unified_targets.go(floor) gained only a genericHasPlanbool passthrough — no kind-word logic added; the two clause-D fixes REMOVE kind-word switches, strictly improving boundary-law compliance; the moved logic (arbiter bracket, builder pre-pass) is now correctly incandy/plugin-bundle, a plugin, not core.disposable: true; autonomous destroy+rebuild was authorized for all of them.gofmt -l .empty;golangci-lint run0 issues (charly/, candy/plugin-bundle/, sdk/deploykit/);go vetclean;go test ./...green (charly + sdk).CHANGELOG/2026.203.1200.mdstaged (placeholder CalVer) with the full per-item breakdown including the 6 deferred items' design notes.Assisted-by: Claude Code Anthropic Claude Sonnet 5 (fully tested and validated)