Skip to content

fix(generate): hard-error on a localpkg render failure (R8 masked failure) - #13

Merged
atrawog merged 2 commits into
mainfrom
feat/generate-localpkg-hard-error
Jul 8, 2026
Merged

atrawog merged 2 commits into
mainfrom
feat/generate-localpkg-hard-error

Conversation

@atrawog

@atrawog atrawog commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

writeCandySteps demoted a renderLocalPkgImageInstall error to a Containerfile comment (# localpkg render error: …) and kept building — masking the failure. A --dev-local-pkg build whose charly-toolchain makepkg failed therefore shipped an image with no /usr/bin/charly, only surfacing downstream as failing charly checks (the check-charly-selftest-pod defect the RCA found: 5 checks failed because the binary was absent). This contradicted renderLocalPkgImageInstall's own contract ("must fail loudly, never silently fall back"). The render error is now returned (hard-fails generate/build) instead of a swallowed comment.

Change class + gate (R10, code)

  • go build ./... + go test ./... green; golangci-lint 0 issues; task build:charly R9 (charly version 2026.189.0400). R5: git grep 'localpkg render error' → only CHANGELOG (the masked-comment path is deleted).
  • Live (pasted): a fresh charly box build charly-selftest --dev-local-pkg — where the render SUCCEEDS — builds EXIT 0 with the charly localpkg installed and zero masked comments in the emitted Containerfile:
installing opencharly-git...
Successfully tagged ghcr.io/opencharly/charly-selftest:2026.189.0405   # BUILD EXIT 0
$ grep -c 'localpkg render error' .build/charly-selftest/Containerfile → 0

Single-repo (no submodule change).

Tier

analysed on a live system — the changed generate runner executed live (the --dev-local-pkg build ran the localpkg render on its success path, proving no regression), and output is pasted. The changed error branch itself is not exercised by a successful build (a live makepkg failure is not safely reproducible without an R4-forbidden hack); it is a direct return err matching the documented contract, and the old masked-comment path is grep-verified removed. Not claiming "fully tested and validated" since the error branch didn't execute live.

Assisted-by: Claude (analysed on a live system)

…lure)

writeCandySteps demoted a renderLocalPkgImageInstall error to a Containerfile
COMMENT and kept building, so a --dev-local-pkg build whose charly makepkg failed
shipped an image with NO /usr/bin/charly (the check-charly-selftest-pod defect) —
contradicting the renderer's own fail-loudly contract. Return the error instead.
Verified: charly box build charly-selftest --dev-local-pkg builds EXIT 0 with
opencharly-git installed + zero "localpkg render error" comments (success path,
no regression); the error branch is a direct return, masked path R5-gone.

Assisted-by: Claude (analysed on a live system)
@atrawog

atrawog commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Change class: code (charly/generate.go)

Independent re-derivation (fresh context, trusted none of the author's claims):

  • [PASS] security & anti-tampering (T1–T4): diff is a 6-line error-branch swap in writeCandySteps + a CHANGELOG — no secrets/exfiltration, no supply-chain, no scope mismatch (code matches the description exactly), and it strengthens the error path (fail-loud, not weaken). No manipulation directives in the PR body.
  • [PASS] description complete: Summary, R10 code change-class + gate with pasted evidence, and an honest Tier rationale.
  • [PASS] change-class gate matches evidence: go build ./... ✓, go test ./... ✓ (ok, 51.6s), golangci-lint run ./... → 0 issues, gofmt -l empty, task build:charly (R9) → charly version 2026.189.0409. I then ran a fresh charly box build charly-selftest --dev-local-pkg with the feat-branch binary → BUILD EXIT 0, Successfully tagged ghcr.io/opencharly/charly-selftest:2026.189.0416; the emitted Containerfile has 0 localpkg render error comments and renders the charly install (COPY .build/.../\_localpkg/charly/ + pacman -U .../*.pkg.tar.zst), and /usr/bin/charly IS present in the image (28 MB, reports 2026.189.0409) — directly proving the render succeeded and was not masked.
  • [PASS] attribution tier justified: analysed on a live system — the changed generate runner ran live on the render success path with pasted output; the changed error branch (return asUser, fmt.Errorf(...)) is not exercised by a valid build and a live makepkg failure is not safely reproducible without an R4-forbidden hack, so fully tested and validated is correctly not claimed. Ceiling confirmed, not upgraded.
  • [PASS] R5 grep self-test: git grep 'localpkg render error' -- 'charly/*.go' → empty (exit 1); the masked-comment string survives only in CHANGELOG/.
  • [PASS] R1–R4 / clean architecture: removes a masked-failure anti-pattern for a loud return matching renderLocalPkgImageInstall's documented fail-loudly contract; asUser in scope (init false), error wraps candy+image+dev flag. No warnings carried.
  • [PASS] CHANGELOG present: placeholder staged (I finalize the merge-time CalVer).
  • [PASS] skills honored: /charly-build:generate — an unresolvable/failed render must fail LOUDLY, never a silently-dropped step.

No submodule change (single-repo, confirmed).

Decision: APPROVED — the fix converts a silently-swallowed localpkg render error into a hard failure; the success path is provably a no-op vs the old code (identical WriteString), independently re-verified live end-to-end (fresh image build with the charly binary present). Finalizing the merge-time CalVer, merging --rebase, and tagging.

Assisted-by: Claude (analysed on a live system)

@atrawog
atrawog merged commit 4aeb9e4 into main Jul 8, 2026
@atrawog
atrawog deleted the feat/generate-localpkg-hard-error branch July 8, 2026 04:23
atrawog added a commit that referenced this pull request Jul 16, 2026
…bustness, VM disk-build engine → plugin-vm, loader-residue fold

Consolidated wave-1 landing: alias dissolution + teardown robustness + VM
disk-build engine relocation + loader-residue fold + gitlink bumps.

Members: #52 (alias dissolution), #55 (bed teardown robustness), P8b Tier-1
(VM disk-build engine → candy/plugin-vm), #46 (loader-residue fold), plugins/
pkg-fedora gitlink bumps, and a roster-surfaced R9 fix (rsync in
eval-host-vm's cloud_init packages).

Deleted (fully superseded, public-surface removal):
- charly/loader_driver.go (whole file — the sole charly-core sdk/loaderkit
  importer; the WALK now reaches sdk/loaderkit exclusively through
  candy/plugin-loader's typed spec.ProjectWalker seam)
- charly/vm_build.go, vm_bootstrap.go, vm_cloud_image.go, vm_disk_builder.go,
  vm_bootc_install.go (the VM disk-build ENGINE, relocated to
  candy/plugin-vm as vm_build.go/vm_bootc_engine.go/vm_bootstrap_engine.go/
  vm_cloud_image.go/vm_disk_layout.go/vm_privileged_runner.go)
- charly/filelock.go's acquireVmBuildLock (sole caller moved plugin-side)
- charly/debootstrap_test.go's TestBaseBootstrapPackages_{DebootstrapDispatch,
  PacstrapStillWorks,NilDistro} + baseBootstrapPackages (moved to
  candy/plugin-vm/vm_bootstrap_engine_test.go with the function they test)
- 51 dead + 55 test-only-rewired alias bindings across 14
  charly/*_aliases.go files (full 106-symbol list: CHANGELOG/2026.197.0615.md)

R10: 7/7 disposable-bed roster PASS (check-commands-local, check-sidecar-pod,
check-charly-vm, check-local-vm, check-group, check-structkind,
check-substrate — the last 3 run by the fresh pr-validator to close a
cross-cutting-loader bed-coverage gap the original 4-bed roster missed).
Architecture gate: placement CORRECT: charly/*.go non-test net -1000 LOC,
candy/plugin-vm net +1059 LOC; the 2 new charly-core sdk-kit imports both
qualify as tracked residual-call-site inventory (task #13's wave).

Full narrative + evidence: CHANGELOG/2026.196.1800.md, 2026.197.0601.md,
2026.197.0615.md, 2026.197.0700.md, 2026.197.1051.md.

Assisted-by: Claude (fully tested and validated)
atrawog added a commit that referenced this pull request Jul 16, 2026
…hrough symbols (task #16)

vmshared→spec envelope-route repoint (task #16): all 23 spec-passthrough
symbols in `charly/vmshared_aliases.go` repointed to reference `sdk/spec`
directly instead of routing through `sdk/vmshared` (a forbidden
mechanism-kit hop for core). These are E-envelope types the kernel/plugin
boundary law says core should reference directly; the defect fixed was the
route, never the reference. Zero behavior change.

Symbols repointed, one commit per group (see CHANGELOG for the full
per-commit collision-class breakdown): LibvirtDomain, LibvirtGraphicsListeners,
MCPServerYAML, PackageItem, PortScope, PreemptibleConfig, TunnelYAML,
ShellConfig, EnvDependency, ServiceEntry, InstallContext, BuildStageContext,
CandyPluginDecl, DistroDef, VmDeployState, Matcher, MatcherList, PortSpec,
CandyYAML, BoxConfig, Step, BundleNode, Op.

Remaining in `vmshared_aliases.go` (correctly out of scope): 6 genuine
`vmshared` mechanism functions with no `spec` equivalent, plus the
deploykit-defined E-envelope symbols tracked separately as task #13, plus
~28 further spec-passthrough-shaped types whose charly-side consumers sit
inside the not-yet-started K4 migration wave (deploy + config resolution) —
their aliases dissolve naturally when K4 moves those call sites.

R10: confirmation bed `check-sidecar-pod` PASS (12/12 steps, 382s).
Independently re-verified by the fresh pr-validator: go build/vet/test/lint
clean across charly + 5 touched plugin modules, on the delta-re-gated tree
after `gh pr update-branch` onto post-#127-and-post-#131 main; adversarial
spot-check of the BoxConfig/Op/BundleNode collision handling; R5 grep sweep
clean (zero live bare-type stragglers).

Assisted-by: Claude (analysed on a live system)
atrawog added a commit that referenced this pull request Jul 17, 2026
)

* feat(core): K3 wire-to-spec Path 1 — pure import repoint (5 files)

Five charly/*.go files used ONLY deploykit/kit types that a prior wave
(SDK envelope relocation, task #13) already moved to sdk/spec as Go type
aliases (deploykit.InstallPlan/EmitOpts/DeployExecutor = spec.X in
sdk/deploykit/steps.go; kit.LabelDescriptionSet/LabeledDescription = spec.X
in sdk/kit/planrun.go). Repoint each to import spec directly instead of
deploykit/kit — a same-type swap with byte-identical runtime behavior
(these were literal Go type aliases, not distinct types), so no bed
re-run is needed for this change class.

- deploy_preresolve.go: deploykit.InstallPlan -> spec.InstallPlan
- deploy_substrate_lifecycle.go: InstallPlan/EmitOpts/DeployExecutor -> spec.*
- layer_artifacts.go: DeployExecutor/EmitOpts -> spec.*
- plugin_grpc.go: DeployExecutor -> spec.DeployExecutor
- description_collect.go: kit.LabelDescriptionSet/LabeledDescription -> spec.*

Identified via a K1/wire-to-spec classification spike of the remaining 25
type-only files off charly/*.go's kit-import list: these 5 retire for free
(Path 1); ~11-12 need real coordinated type migrations (Path 2, next);
~7-8 hold Go interfaces/function-value hooks structurally excluded from
CUE generation, tracked separately (Path 3, task #21).

Metric: charly/*.go kit-importing files 150 -> 145.

R10 gate for this change class (orchestrator-ruled, per R10's own "run only
the gate that exercises the change" principle): deploykit.X/kit.X here were
literal Go type ALIASES of spec.X, so no runtime path can differ — a bed
gate cannot fail on this change. go build/go vet/go test ./... (88s, full
pass) + golangci-lint (0 issues) is the exhaustive, non-wasteful gate.

Assisted-by: Claude Sonnet 5 (analysed on a live system)

* chore(changelog): finalize merge-time CalVer 2026.198.0326

Renamed placeholder CHANGELOG/2026.198.0311.md to the actual merge-time
CalVer (evaluator step, computed via `date -u` per the #47 lesson — never
`git show --date=format` in the commit's local TZ).

Assisted-by: Claude Sonnet 5 (analysed on a live system)
atrawog added a commit that referenced this pull request Jul 24, 2026
…lugin-side, core arm deleted

Wires candy/plugin-check's Mode:"live" dispatch to a new plugin-resident
pluginCheckRunLive (live_gather.go), the port of charly/check_cmd.go's
checkLiveGather + checkLivePod/VM/Local/Group — the full four-kind live
check-run gather, using the already-portable venue/members/cmd_helpers
library (Unit A) plus the plugin verb dispatcher (Unit B). The one genuine
core-only gap — connecting an out-of-process plugin candy a live plan's
verb words reference — got a thin new "check-load-plugins" HostBuild seam
(host_build_check_load_plugins.go) that triggers the UNCHANGED core engine
(resolveCheckRunnerContext) as a side effect; every other dependency was
already sdk-portable or resolvable off the resolved-project envelope's
existing fields (rp.Templates.VM/.Local decode 1:1 into vmshared.VmSpec /
spec.Local — the same shape a fresh core decode would produce).

Deletes the corresponding core bodies in the same commit (delete-as-you-
wire): host_build_check_run.go's hostCheckRunLive/hostCheckLive, and
charly/check_cmd.go's CheckLiveCmd + all its checkLive* methods (~715
lines net off check_cmd.go). Ports the RCA #13/#14 regression tests
(leaf-vm-under-non-vm-parent tree-walk, guest nested check-cmd quoting,
VM_HOSTDEV_COUNT nil-safety) to the plugin package verbatim in substance.

R5 grep self-test clean; go build/vet/test green in both charly and
candy/plugin-check. Live-proven on the check-exampledeploy disposable bed
(local-venue class): full R10 sequence PASS, check-live PASS 5/5 steps,
header confirms the new plugin-side dispatch executed. The VM-venue path
(pluginCheckLiveVM) is unit-tested (ported RCA regressions) but blocked
from a live bed proof by an unrelated PRE-EXISTING bug in charly vm create
(applyCueDefaults vm: unify with #vm: raw: field not allowed — traced to
candy/plugin-substrate's Raw echo field never being declared in schema/vm.cue;
confirmed zero overlap with this cutover's diff) — flagged to the wave lead
for triage; live VM-path proof follows once that lands.

Assisted-by: Claude Code (Anthropic Claude Opus 4.6; analysed on a live system)
atrawog added a commit that referenced this pull request Jul 24, 2026
… envelope

BLOCKING regression (task #13): check-addcandy-pod and check-stepkind-emit-pod
both failed `charly bundle add` with "bundle compile: candy ... not in
resolved-project envelope" — --add-candy on a REMOTE candy ref (never
reachable from any box's own image closure, e.g.
@github.com/opencharly/charly/candy/pod-addcandy-marker:vTAG).

Root cause: candy/plugin-bundle's OpCompile handler (compileDeployPlans)
re-fetches the resolved-project envelope independently via
HostBuild("resolved-project"), using only the project dir. The host's own
pre-compile scan (bundle_add_cmd.go's scanCandiesForRef) already widens ITS
candy map for a remote add-candy ref via a synthetic-augmented
ScanAllCandyWithConfig call — but that widening was never threaded into the
plugin's separate envelope re-fetch, so a remote add-candy resolved
host-side (used to compute the compile `order`) was completely absent from
rp.Candies/rp.CandyModels, and BuildDeployPlan's per-name lookup failed.

Fix: threads the add-candy ref through as a NEW CUE-sourced
ExtraCandyRefs field (opencharly/sdk#101 -- #ResolvedProjectRequest +
#DeployCompileRequest both gain extra_candy_refs?: [...string], mirroring
the existing ResolveOpts.ExtraCandyRefs contract already used for a check
bed's own add_candy:):
- hostBuildResolvedProject threads req.ExtraCandyRefs into ResolveOpts.
- candy/plugin-bundle's compileDeployPlans threads r.ExtraCandyRefs into its
  own resolved-project envelope re-fetch.
- charly's compileSelectionViaPlugin gains an extraCandyRefs parameter;
  compileCandySelection (the add_candy / standalone-candy compile path)
  passes []string{ref.Raw}; compileBoxSelection (the primary image compile,
  unaffected) passes nil.

sdk gitlink repoints to 0612a9c (sdk#101, unmerged pending review — will
repoint to the merged/tagged commit once it lands, same drill as sdk#98/99/
100).

go build/vet/test green on charly + candy/plugin-bundle + sdk. 01af617
(vm-Raw fix) confirmed intact.
atrawog added a commit that referenced this pull request Jul 24, 2026
…sing from plugin-installstep's own envelope

Completes task #13's fix: the STANDARD --add-candy compile path (compile.go)
was already fixed, but check-addcandy-pod's add_candy-ON-POD-OVERLAY deploy
path (deploy-key != image-name) hit a THIRD independent "resolved-project"
envelope fetch site — candy/plugin-installstep's getGenerator, used to
render HOST-COUPLED build-emit words (system-packages/builder/op) during an
overlay build — that also needed the fix.

hostBuildOverlay already correctly widens its OWN overlay Generator with
ResolveOpts.ExtraCandyRefs = the deploy's add_candy refs, but that widened
candy set was never threaded into plugin-installstep's SEPARATE envelope
fetch, so an add_candy candy was present in the host's overlay
Generator.Candies but absent from the plugin's own re-fetch —
candyByName's remote-candy fallback still missed, surfacing as
"OCITarget.Emit(<candy>): candy not found".

Fix (opencharly/sdk#101, follow-up commit 2092236): #BuildEnv gains
extra_candy_refs?: [...string] @go(ExtraCandyRefs). charly's dispatchOCIStep
(oci_step_emit.go) threads build.Generator.Candies' key set (the host's own
already-widened candy set) onto env.ExtraCandyRefs; plugin-installstep's
getGenerator threads env.ExtraCandyRefs into its own resolved-project
re-fetch the same way compile.go's fix already does for the standard path.

sdk gitlink repoints to 2092236 (sdk#101 follow-up, unmerged pending
review — will repoint to the merged/tagged commit once it lands).

go build/vet/test green on charly + candy/plugin-installstep +
candy/plugin-deploy-pod + sdk. 01af617 (vm-Raw fix) confirmed intact.
github-actions Bot pushed a commit that referenced this pull request Nov 21, 2026
…hain's pins (#1230)

* feat(plugins): publish the content kinds, and adopt the owned-skill chain's pins

The host half of ops.OpContent (opencharly/sdk#598), and the five pins
of the chain that installs a composed candy's owned skills.

- buildCapMeta records ProvidedCapability.contents for a class:kind
  capability (capMeta.IsContentKind implements
  spec.ContentKindCarrier). The validate-word-sets leg publishes the
  declaring kind words, sorted, as content_kinds. They are read off each
  provider's own capability, never a per-kind branch. That set is what
  plugin-build's render-prep and plugin-box's validate ask.
- The charly-skill-shelf's validate-satisfying no-op run: step is
  deleted: an owned skill node is install content now.
- Pins, all merged and tagged: spec v0.2026325.913 (#415), sdk
  v0.2026325.921 (#607), plugin-box v0.2026325.928 (#92), plugin-build
  v0.2026325.959 (#62, #63), plugin-harness-kind v0.2026325.1012 (#13).
  They move together: the old plugin-box pin calls
  deploykit.CollectSkillBodies, which the new sdk deletes.

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 (analysed on a live system)

* fix(deps): adopt the shared sdk/spec pins in the tools modules

The required go check failed TestContractPinsMatchShared: the
tools/generate-packages, tools/golden-cloudinit and tools/golden-compile
modules still required sdk v0.2026324.1928 / spec v0.2026324.1914 while
charly/go.mod moved to sdk v0.2026325.921 / spec v0.2026325.913. The
previous commit moved the pins with go get inside charly/ only.

charly task mods-tidy adopts the shared pins in every lockstep module
and tidies them. The whole ci.yml go job passes locally: go test
./charly/..., every tools/* module (GOWORK=off -count=1), gofmt over
charly and tools, and golangci-lint over both.

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 (analysed on a live system)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant