Repository navigation
fix(build,pkg): repair task build:pkg:arch go.sum + buildPluginBinary VCS-stamp test race - #180
Conversation
… VCS-stamp test race Three compiled-in-only candies (plugin-preempt, plugin-loader, plugin-status) had stale per-module go.sum files missing golang.org/x/term (and its sdk/deploykit transitive chain) — invisible in workspace-mode dev builds but fatal to the standalone GOWORK=off build the native package (task build:pkg:arch) and the rpm/deb packagers all perform. `go mod tidy` per module fixes all three; verified via a full 83-candy standalone-build sweep plus a real task build:pkg:arch run producing a .pkg.tar.zst. Also fixes buildPluginBinary's hardcoded -buildvcs=auto racing concurrent git-status walks across this project's many linked worktrees (18 reproducible spurious test failures, confirmed 3x by the PR validator on charly#178). pluginBuildVCSFlag/pluginBuildVCSFlagForContext skip the walk inside a `go test` binary (testing.Testing()) while leaving production behavior (real plugin connect, bake_plugin: embedding) unchanged — no consumer anywhere reads the embedded VCS stamp back out. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
pr-validator — CHANGES REQUESTED ❌Change class: Checklist
What I independently re-verified (fresh worktree, PR head
|
…HANGELOG Round-1 pr-validator finding: the CHANGELOG's evidence for skipping a disposable-bed run asserted "this repo's beds never load an out-of-process external plugin candy," backed by a grep that only searched box/fedora/charly.yml for the wrong pattern. False — check-exampledeploy + check-structkind (root charly.yml) and check-stepkind-emit-pod (box/fedora) all compose a genuine out-of-process plugin through the exact buildPluginBinary path this cutover touches. Retract the claim; restate the justification on the correct grounds (testing.Testing() is provably false in every live charly invocation, so a bed run only re-exercises the unchanged production branch), and record the check-exampledeploy bed run (PASS, 6/6 steps, ~111s) executed as belt-and-braces evidence anyway. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
|
Fix round pushed (7c0cc42, fast-forward on feat/buildpkg-batch): both items addressed.
Nothing else changed — item 1 (go.sum fix) and the mechanical shape of item 2 were already confirmed sound by your independent re-verification. |
Rename CHANGELOG/2026.203.1400.md -> CHANGELOG/2026.203.1237.md and rewrite its H1 to match, per the pr-validator's merge-time CalVer stamp. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)
pr-validator — APPROVED ✅ (round 2)Change class: What changed since round 1Commit Round-1 blocking finding — verified resolvedThe false claim ("this repo's beds never load an out-of-process external plugin candy") is explicitly retracted in both the PR body and I independently re-ran the belt-and-braces evidence myself, not just trusted the paste: Exit 0, 6/6, matching Full checklist (updated)
Comments considered: the author's round-2 comment describing the fix — verified-non-blocking (accurately summarizes the retraction + evidence; matches my own independent findings, nothing new to investigate). Cross-PR interactions considered: unchanged from round 1 — Decision: PASS. Finalizing the merge-time CalVer, merging, and tagging now. Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated) |
Merged ✅
Fresh post-merge package built from Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated) |
…Client; cache in the per-host charly.yml (#446) * feat(git): route every host git operation through the centralized GitClient; cache in the per-host charly.yml The per-host charly.yml (~/.config/charly/charly.yml) is the SINGLE home for local system state — deployments, install records, local system info, and cache status. The git metadata cache the loader resolves @github refs with lives in its `cache:` section (spec#66), NOT in ad-hoc JSON files. - charly/git_client.go: the charly-core process-wide GitClient singleton (spec/refs.GitClient); the host seams share it instead of calling the raw git primitives directly (R3) - host_build_remote_image_resolve.go: refs.GitLatestTag → gitClient().LatestTag - host_build_box_fetch_resolve.go: refs.GitDefaultBranch → gitClient().DefaultBranch - plugin_prescan.go: builtinOnlyInvocation() skips the remote prescan fetch for version/help/settings/ssh — the 13s `charly version` hang (issue #423) - charly.yml: schema migration 2026.232.0520 → 2026.240.1943 (required by the new spec) - go.mod: spec v0.2026241.931, sdk v0.2026241.933 (git-layer wiring), plugin-vm v0.2026240.2034, plugin-check v0.2026241.920 (dev-worktree allowance) - host_build_retention_defaults.go: the retention-defaults seam reads charly.yml defaults directly (no walk, no refs) — the #423 clean-hang fix * test(charly): migrate test fixtures to schema 2026.240.1943 + document the new kernel files - charly/charly.yml: schema migration 2026.232.0520 → 2026.240.1943 (the embedded default config, required by the new spec) - testdata + test fixtures: version bump to 2026.240.1943 - build_target_oci_test.go: the cargo builder (sdk PR #180) copies the crate to /tmp/charly-cargo-src before installing — the test now expects the new rendering - reverse_channel_three_legs_test.go: whitelist the retention-defaults host builder kind - KERNEL_MANIFEST.md: rows for host_build_retention_defaults.go + git_client.go * test(charly): migrate testdata/charly.yml to schema 2026.240.1943 * chore: re-apply the charly.yml schema migration after the main merge * chore: advance the box/fedora gitlink to the migrated distro-fedora TestMaterializeSeam_RealFixtureDeterministic loads box/fedora as its fixture and failed on this branch with: box/fedora/charly.yml: schema 2026.240.1943 is required (found "2026.232.0520"). Run: charly migrate The spec this branch pins requires schema 2026.240.1943; distro-fedora carried the old stamp. That migration is now merged (opencharly/distro-fedora#43), so advance the gitlink to it. Only the gitlink changes here -- no edit inside the submodule. box/fedora: f267d3fb -> fbc10ba4 Claude-Session: https://claude.ai/code/session_01Gf42A3bau77JigFYLALrnq * chore(box): advance the distro submodule pointers to the schema-2026.240.1943 migrations The five box submodules (arch/cachyos/debian/fedora/ubuntu) migrated their charly.yml to schema 2026.240.1943 (version-bump-only PRs). Advance the pointers so the charly project loads them under the new spec. * style: gofmt host_build_retention_defaults.go and plugin_prescan.go The `go` job's gofmt gate fails the build: gofmt would rewrite these files: charly/host_build_retention_defaults.go charly/plugin_prescan.go Both are cosmetic -- one struct-tag field alignment, one stray double blank line. No behaviour change. Claude-Session: https://claude.ai/code/session_01Gf42A3bau77JigFYLALrnq * test: cover the three new git-layer behaviors (B12) The kernel-manifest row and the reverse-channel whitelist entry are registration gates -- neither fails if the new code computes the wrong answer. Add a test per new behavior, each verified to fail without it: builtinOnlyInvocation break the builtin case list -> 6 subtests FAIL hostBuildRetentionDefaults drop the keep_images read -> ReadsBothFields FAIL gitClient return a new client per call -> IsSingleton FAIL The discriminating halves matter more than the happy paths: builtinOnlyInvocation is table-driven over commands that must NOT skip (build/check/config/start), since a mis-firing skip silently loses external command words; the retention seam is pinned to degrade to 0/0 with a NIL error on an absent or unparseable project, which is its documented best-effort contract; and the gitClient singleton is what keeps the cache alive across calls -- a per-call client would silently restore the timing this cutover exists to fix. Claude-Session: https://claude.ai/code/session_01Gf42A3bau77JigFYLALrnq --------- Co-authored-by: atrawog <[email protected]>
…to the ledger tags (#447) * feat(git): route every host git operation through the centralized GitClient; cache in the per-host charly.yml The per-host charly.yml (~/.config/charly/charly.yml) is the SINGLE home for local system state — deployments, install records, local system info, and cache status. The git metadata cache the loader resolves @github refs with lives in its `cache:` section (spec#66), NOT in ad-hoc JSON files. - charly/git_client.go: the charly-core process-wide GitClient singleton (spec/refs.GitClient); the host seams share it instead of calling the raw git primitives directly (R3) - host_build_remote_image_resolve.go: refs.GitLatestTag → gitClient().LatestTag - host_build_box_fetch_resolve.go: refs.GitDefaultBranch → gitClient().DefaultBranch - plugin_prescan.go: builtinOnlyInvocation() skips the remote prescan fetch for version/help/settings/ssh — the 13s `charly version` hang (issue #423) - charly.yml: schema migration 2026.232.0520 → 2026.240.1943 (required by the new spec) - go.mod: spec v0.2026241.931, sdk v0.2026241.933 (git-layer wiring), plugin-vm v0.2026240.2034, plugin-check v0.2026241.920 (dev-worktree allowance) - host_build_retention_defaults.go: the retention-defaults seam reads charly.yml defaults directly (no walk, no refs) — the #423 clean-hang fix * test(charly): migrate test fixtures to schema 2026.240.1943 + document the new kernel files - charly/charly.yml: schema migration 2026.232.0520 → 2026.240.1943 (the embedded default config, required by the new spec) - testdata + test fixtures: version bump to 2026.240.1943 - build_target_oci_test.go: the cargo builder (sdk PR #180) copies the crate to /tmp/charly-cargo-src before installing — the test now expects the new rendering - reverse_channel_three_legs_test.go: whitelist the retention-defaults host builder kind - KERNEL_MANIFEST.md: rows for host_build_retention_defaults.go + git_client.go * test(charly): migrate testdata/charly.yml to schema 2026.240.1943 * chore: re-apply the charly.yml schema migration after the main merge * chore: advance the box/fedora gitlink to the migrated distro-fedora TestMaterializeSeam_RealFixtureDeterministic loads box/fedora as its fixture and failed on this branch with: box/fedora/charly.yml: schema 2026.240.1943 is required (found "2026.232.0520"). Run: charly migrate The spec this branch pins requires schema 2026.240.1943; distro-fedora carried the old stamp. That migration is now merged (opencharly/distro-fedora#43), so advance the gitlink to it. Only the gitlink changes here -- no edit inside the submodule. box/fedora: f267d3fb -> fbc10ba4 Claude-Session: https://claude.ai/code/session_01Gf42A3bau77JigFYLALrnq * chore(box): advance the distro submodule pointers to the schema-2026.240.1943 migrations The five box submodules (arch/cachyos/debian/fedora/ubuntu) migrated their charly.yml to schema 2026.240.1943 (version-bump-only PRs). Advance the pointers so the charly project loads them under the new spec. * style: gofmt host_build_retention_defaults.go and plugin_prescan.go The `go` job's gofmt gate fails the build: gofmt would rewrite these files: charly/host_build_retention_defaults.go charly/plugin_prescan.go Both are cosmetic -- one struct-tag field alignment, one stray double blank line. No behaviour change. Claude-Session: https://claude.ai/code/session_01Gf42A3bau77JigFYLALrnq * test: cover the three new git-layer behaviors (B12) The kernel-manifest row and the reverse-channel whitelist entry are registration gates -- neither fails if the new code computes the wrong answer. Add a test per new behavior, each verified to fail without it: builtinOnlyInvocation break the builtin case list -> 6 subtests FAIL hostBuildRetentionDefaults drop the keep_images read -> ReadsBothFields FAIL gitClient return a new client per call -> IsSingleton FAIL The discriminating halves matter more than the happy paths: builtinOnlyInvocation is table-driven over commands that must NOT skip (build/check/config/start), since a mis-firing skip silently loses external command words; the retention seam is pinned to degrade to 0/0 with a NIL error on an absent or unparseable project, which is its documented best-effort contract; and the gitClient singleton is what keeps the cache alive across calls -- a per-call client would silently restore the timing this cutover exists to fix. Claude-Session: https://claude.ai/code/session_01Gf42A3bau77JigFYLALrnq * test(charly): B12 coverage for the git layer, retention seam, and prescan skip - TestBuiltinOnlyInvocation: the prescan remote fetch is skipped for builtin-only invocations (version/help/settings/ssh) — the #423 13s `charly version` hang; non-builtin commands are NOT skipped - TestHostBuildRetentionDefaults: the retention seam reads defaults.keep_images/keep_check_runs from charly.yml WITHOUT walking the project or resolving @github refs; absent config degrades to 0/0 - TestGitClientSingleton: the charly-core process-wide GitClient singleton constructs a spec/refs.GitClient and is process-wide (same instance) * test(charly): drop the duplicate B12 tests (the merged git_layer_behaviors_test.go covers them) * chore(pins): advance sdk to v0.2026241.1032 + plugin-fleet/substrate to the ledger tags The install ledger moved to the `ledger:` section of the per-host charly.yml (sdk#183). Pin the merged tags: sdk v0.2026241.1032, plugin-fleet v0.2026241.1037, plugin-substrate v0.2026241.1038. The reverse-channel e2e test reads the ledger from the charly.yml `ledger:` section (the per-run XDG_CONFIG_HOME override redirects the plugin's default resolution). --------- Co-authored-by: atrawog <[email protected]>
Summary of changes
Build/packaging thematic batch (near-urgent: unblocks the operator's pending
host-resync — the installed
opencharly-giton the host panics on everyinvocation because it was built from a stale worktree carrying a
since-fixed dual-registration bug; this PR is what makes the fresh package
build so the operator can
pacman -Uthe fix).task build:pkg:archFAILED — the arch native-package build(
bin/charly box pkg pac→makepkg→pkg/arch/PKGBUILD'sbuild())builds every candy in
pkg/host-command-plugins.txtSTANDALONE(
GOWORK=off go build), so each candy's owngo.summust cover its fulltransitive graph — the shared repo
go.work.sumdoes not apply.candy/plugin-preempt/holder_dispatch.go(landed in Unit-8B,6521f275)added the candy's first direct import of
github.com/opencharly/sdk/deploykit,which transitively pulls
golang.org/x/term(viasecret_probe.go) +sdk/buildkit/sdk/enginekit— none ever added tocandy/plugin-preempt/go.sum, invisible in every workspace-mode devverification (
go test ./...,task build:binary). A full sweep of all83
candy/plugin-*modules (GOWORK=off go buildeach) found the SAMEroot cause in two more compiled-in-only candies that would fail
identically if ever built standalone:
candy/plugin-loader,candy/plugin-status. Fixed all three viaGOWORK=off go mod tidy(go.mod/go.sum only, zero source changes).
pkg/host-command-plugins.txtset from the SAME
candy/<name>source tree via the identicalGOWORK=off go buildinvocation (opencharly.spec/debian/ruleslocal_pkg build_templates) — no per-format duplicate exists to mirror;
this fix covers all three packagers.
buildPluginBinary(
charly/plugin_loader.go) hardcodes-buildvcs=autofor anygit-backed source (essentially every candy here). Go's
-buildvcs=autowalks
git statuson the source dir; under this project's many linkedworktrees, concurrent test/bed runs racing that walk against sibling
worktrees' git operations produced reproducible spurious
"error obtaining VCS status: exit status 128"failures (18 unrelated testfailures in a busy-worktree context, reproduced 3x independently by the
PR validator on charly#178's thread).
GOFLAGScannot override it — it'san explicit argv flag, which always wins. Fix:
buildPluginBinarynowgoes through
pluginBuildVCSFlag→pluginBuildVCSFlagForContext, whichskips the git-status walk unconditionally inside a
go testbinary(
testing.Testing(), Go stdlib — true only in a test binary) whileleaving the existing auto-detect-from-git-revision behavior unchanged
for every production caller (a project's real out-of-process plugin
connect, and
bake_plugin:image embedding). Verified: no code anywherein this tree reads the embedded VCS stamp back out of a plugin binary
(
grep -rn "ReadBuildInfo\|vcs\.revision\|vcs\.modified"across the wholetree, sdk included, finds zero non-test hits), so a test binary never
producing one is not observable.
Change class
charly Go code (+ 3 sdk-consuming plugin candy go.mod/go.sum files).
How R10-tested — exact gate, commands, and pasted output
The gate for this change class:
go test ./...(charly module,workspace mode) + a real
task build:pkg:archrun (the literal R10 gatefor item 1 — the pkg build IS the exercising surface for the go.sum fix)
that found the 2 additional broken candies) +
golangci-lint run+go vet ./....CORRECTION (round 1 validator finding, addressed): an earlier draft of
this section claimed "this repo's beds never load an out-of-process
external plugin candy," backed by
grep -n "plugin-example-external\|source:.*github" box/fedora/charly.yml(no hits). That claim was FALSE, and the grep was wrong on two counts:
it searched only
box/fedora/charly.yml(never the rootcharly.yml,where two of the counter-examples live), and it searched for
plugin-example-external(a different, compiled-in example plugin — ared herring) and
source:.*github(not this codebase's actualout-of-tree composition syntax,
add_candy: [<plugin-candy-name>, ...]).The root
charly.ymlcarriescheck-exampledeployandcheck-structkind(bothdisposable: true), andbox/fedora/charly.ymlcarries
check-stepkind-emit-pod— all three genuinely compose anout-of-process plugin (
plugin-example-deploy/plugin-example-structkind/
plugin-example-stepkind, none incompiled_plugins:) through exactlythe
buildPluginBinarypath this PR modifies. Retracted; both this PRbody and
CHANGELOG/2026.203.1400.mdnow carry the correction.Why no disposable check-bed run is STRICTLY REQUIRED (the correct
argument):
buildPluginBinary's VCS-flag change is observable ONLYinside a
go testbinary by construction —pluginBuildVCSFlagdefers totesting.Testing(), which is provablyfalsein every livecharlyinvocation (a compiled
charlybinary is never ago testbinary,regardless of what it deploys). So even running one of the three beds
named above only re-exercises the UNCHANGED
isTestBinary=falseproduction branch — byte-identical to
main— proving nothing about thisdiff that
go test ./...doesn't already prove (R10's own "a gate thatcannot fail on the change proves nothing" principle — see
/charly-check:check"R10 gate by change class"). The go.sum fix (item 1)IS proven on the real packaging path below, which is the only "live"
surface that actually builds these 3 candies standalone.
Eval beds run — belt-and-braces, run anyway:
check-exampledeploy(root
charly.yml,disposable: true) was run live on the final tree toremove any residual doubt — it drives
plugin-example-deploy(anout-of-process candy, NOT in
compiled_plugins:) through the exactloadPluginUnit → buildPluginBinarypath this PR touches, viacharly bundle add→charly check live→charly update→charly bundle del:Exit code 0, 6/6 steps PASS (~111s total), post-run state clean
(
git status --shortunchanged; the disposable deploy was fully torndown by
charly bundle del). This confirms the out-of-processplugin-example-deployconnect +charly updatere-deploy (whichrebuilds the plugin binary again) both still work unchanged — the exact
production branch this fix leaves untouched.
Fresh rebuild:
charly version→2026.203.1143on this commit(
6521f275+ this cutover),git log -1 --format=%H→3fc579b8.Fresh-from-clean pkg build below removed
dist/,bin/, the makepkgsrc//pkg/staging dirs, and the installedcandy/charly/bin/charlycopy before rebuilding, at ZERO warnings.
Did the CHANGED code path execute live? Yes for both items:
task build:pkg:arch'sbuild()actually invokesGOWORK=off go build … candy/plugin-preempt(among the other 8 listedcandies) — this is the literal broken line the fix repairs, and the
fresh run below shows it succeeding end-to-end through
rpmbuild-equivalentmakepkgpackaging.TestBuildPluginBinary_DifferentPluginsConcurrent(pre-existing)calls
buildPluginBinarydirectly, building two real plugin binaries(
plugin-record,plugin-wl) concurrently — this now resolves-buildvcs=falsevia the new code path (proven by the two new testsbelow) instead of the racing
-buildvcs=auto, and still passes.arbiter/VM/pod-lifecycle path touched; a go.mod/go.sum dependency fix and a
pure test-context flag decision carry no concurrency surface of their own
(the pre-existing
TestBuildPluginBinary_DifferentPluginsConcurrent,which DOES exercise concurrent plugin builds, continues to pass above).
Attribution tier
fully tested and validated— the cutover's changed code paths(the go.sum fix via a real
task build:pkg:arch; the VCS-flag fix via thereal
buildPluginBinarycall path inTestBuildPluginBinary_DifferentPluginsConcurrentplus the two new dedicated regression tests) all executed against the fresh
rebuild, pasted above, at zero warnings.
Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)CLAUDE.md rule compliance — state HOW each is satisfied
/charly-internals:go,/charly-internals:strict-policy,/charly-internals:git-workflow,/charly-internals:cutover-policy,/charly-build:buildbefore any tool call.error text before touching anything — reproduced
task build:pkg:arch'sreal failure line (
missing go.sum entry for module providing package golang.org/x/term), traced it to the specific new import(
holder_dispatch.go→sdk/deploykit) added in Unit-8B, and confirmedvia a standalone build loop across ALL 83 candies (not just the one that
failed first) rather than assuming scope. For item 2, verified the
test-harness fix mechanism directly (
testing.Testing()semantics,confirmed via
go doc) rather than assuming an env-var/GOFLAGS shape.one-off?") was proven empirically via the full 83-candy sweep BEFORE
declaring the fix complete — found 2 more broken candies beyond the one
reported, both fixed in this same cutover.
same working tree, same commit; the additional 2 broken candies found
mid-investigation are BLOCKING by the same root cause and fixed in this
same cutover rather than deferred to a "next batch."
affected module the sweep found (3, not just 1); confirmed rpm/deb
packagers share the identical source tree + build invocation so there is
no separate PKGBUILD-equivalent to duplicate the fix into. The VCS-flag
fix is ONE shared decision function (
pluginBuildVCSFlagForContext) boththe production wrapper and the tests exercise, not an inline ad-hoc
branch.
operation (the git-status walk) from the context that races it, rather
than retrying past the race.
git grepself-test N/A for this class. Comment describing the oldbuildVCS inline logic was replaced (not left stale) alongside the
refactor into
pluginBuildVCSFlagForContext.git status/git stash listchecked before every destructivestep (the
rm -rf dist ... bin ...fresh-rebuild step was run against aclean, fully-committed tree).
charly version(2026.203.1143) matches the freshtask build:binaryrebuild baked into the pkg build; no new runtime OSdependency introduced (pure Go dependency-graph fix).
both items ran against the final, committed code.