Skip to content

fix(build,pkg): repair task build:pkg:arch go.sum + buildPluginBinary VCS-stamp test race - #180

Merged
atrawog merged 3 commits into
mainfrom
feat/buildpkg-batch
Jul 22, 2026
Merged

atrawog merged 3 commits into
mainfrom
feat/buildpkg-batch

Conversation

@atrawog

@atrawog atrawog commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary of changes

Build/packaging thematic batch (near-urgent: unblocks the operator's pending
host-resync — the installed opencharly-git on the host panics on every
invocation 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 -U the fix).

  1. task build:pkg:arch FAILED — the arch native-package build
    (bin/charly box pkg pac → makepkg → pkg/arch/PKGBUILD's build())
    builds every candy in pkg/host-command-plugins.txt STANDALONE
    (GOWORK=off go build), so each candy's own go.sum must cover its full
    transitive graph — the shared repo go.work.sum does 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 (via secret_probe.go) +
    sdk/buildkit/sdk/enginekit — none ever added to
    candy/plugin-preempt/go.sum, invisible in every workspace-mode dev
    verification (go test ./..., task build:binary). A full sweep of all
    83 candy/plugin-* modules (GOWORK=off go build each) found the SAME
    root 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 via GOWORK=off go mod tidy
    (go.mod/go.sum only, zero source changes).
  2. pkg/fedora + pkg/debian build the SAME pkg/host-command-plugins.txt
    set from the SAME candy/<name> source tree via the identical
    GOWORK=off go build invocation (opencharly.spec / debian/rules
    local_pkg build_templates) — no per-format duplicate exists to mirror;
    this fix covers all three packagers.
  3. Test-harness VCS-stamping fragility — buildPluginBinary
    (charly/plugin_loader.go) hardcodes -buildvcs=auto for any
    git-backed source (essentially every candy here). Go's -buildvcs=auto
    walks git status on the source dir; under this project's many linked
    worktrees, 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 test
    failures in a busy-worktree context, reproduced 3x independently by the
    PR validator on charly#178's thread). GOFLAGS cannot override it — it's
    an explicit argv flag, which always wins. Fix: buildPluginBinary now
    goes through pluginBuildVCSFlag → pluginBuildVCSFlagForContext, which
    skips the git-status walk unconditionally inside a go test binary
    (testing.Testing(), Go stdlib — true only in a test binary) while
    leaving 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 anywhere
    in this tree reads the embedded VCS stamp back out of a plugin binary
    (grep -rn "ReadBuildInfo\|vcs\.revision\|vcs\.modified" across the whole
    tree, 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:arch run (the literal R10 gate
    for item 1 — the pkg build IS the exercising surface for the go.sum fix)

    • a full 83-module standalone-build sweep (the systemic-check instrument
      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 root charly.yml,
    where two of the counter-examples live), and it searched for
    plugin-example-external (a different, compiled-in example plugin — a
    red herring) and source:.*github (not this codebase's actual
    out-of-tree composition syntax, add_candy: [<plugin-candy-name>, ...]).
    The root charly.yml carries check-exampledeploy and
    check-structkind (both disposable: true), and box/fedora/charly.yml
    carries check-stepkind-emit-pod — all three genuinely compose an
    out-of-process plugin (plugin-example-deploy / plugin-example-structkind
    / plugin-example-stepkind, none in compiled_plugins:) through exactly
    the buildPluginBinary path this PR modifies. Retracted; both this PR
    body and CHANGELOG/2026.203.1400.md now carry the correction.

  • Why no disposable check-bed run is STRICTLY REQUIRED (the correct
    argument):
    buildPluginBinary's VCS-flag change is observable ONLY
    inside a go test binary by construction — pluginBuildVCSFlag defers to
    testing.Testing(), which is provably false in every live charly
    invocation (a compiled charly binary is never a go test binary,
    regardless of what it deploys). So even running one of the three beds
    named above only re-exercises the UNCHANGED isTestBinary=false
    production branch — byte-identical to main — proving nothing about this
    diff that go test ./... doesn't already prove (R10's own "a gate that
    cannot 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 to
    remove any residual doubt — it drives plugin-example-deploy (an
    out-of-process candy, NOT in compiled_plugins:) through the exact
    loadPluginUnit → buildPluginBinary path this PR touches, via
    charly bundle add → charly check live → charly update →
    charly bundle del:

    $ ./bin/charly check run check-exampledeploy
    charly check run check-exampledeploy: [deploy-add] START (charly bundle add; log: .check/check-exampledeploy/2026.203.1227/deploy-add.log)
    charly check run check-exampledeploy: [deploy-add] PASS after 55.96s
    charly check run check-exampledeploy: [bring-up-members] START
    charly check run check-exampledeploy: [bring-up-members] PASS after 0s
    charly check run check-exampledeploy: [check-live] START (charly check live; log: .check/check-exampledeploy/2026.203.1227/check-live.log)
    charly check run check-exampledeploy: [check-live] PASS after 8.391s
    charly check run check-exampledeploy: [update] START (charly update; log: .check/check-exampledeploy/2026.203.1227/update.log)
    charly check run check-exampledeploy: [update] PASS after 24.096s
    charly check run check-exampledeploy: [cleanup] START (charly bundle del; log: .check/check-exampledeploy/2026.203.1227/cleanup.log)
    charly check run check-exampledeploy: [cleanup] PASS after 22.978s
    charly check run check-exampledeploy: [cleanup-members] START
    charly check run check-exampledeploy: [cleanup-members] PASS after 0s
    charly check run check-exampledeploy: PASS (steps=6)
    

    Exit code 0, 6/6 steps PASS (~111s total), post-run state clean
    (git status --short unchanged; the disposable deploy was fully torn
    down by charly bundle del). This confirms the out-of-process
    plugin-example-deploy connect + charly update re-deploy (which
    rebuilds the plugin binary again) both still work unchanged — the exact
    production branch this fix leaves untouched.

  • Fresh rebuild: charly version → 2026.203.1143 on this commit
    (6521f275 + this cutover), git log -1 --format=%H → 3fc579b8.
    Fresh-from-clean pkg build below removed dist/, bin/, the makepkg
    src//pkg/ staging dirs, and the installed candy/charly/bin/charly
    copy before rebuilding, at ZERO warnings.

  • Did the CHANGED code path execute live? Yes for both items:

    • Item 1: task build:pkg:arch's build() actually invokes
      GOWORK=off go build … candy/plugin-preempt (among the other 8 listed
      candies) — this is the literal broken line the fix repairs, and the
      fresh run below shows it succeeding end-to-end through
      rpmbuild-equivalent makepkg packaging.
    • Item 2: TestBuildPluginBinary_DifferentPluginsConcurrent (pre-existing)
      calls buildPluginBinary directly, building two real plugin binaries
      (plugin-record, plugin-wl) concurrently — this now resolves
      -buildvcs=false via the new code path (proven by the two new tests
      below) instead of the racing -buildvcs=auto, and still passes.
$ cd charly && go build ./... && echo BUILD_OK
BUILD_OK

$ golangci-lint run --timeout 120s ./...
0 issues.

$ go test -run 'TestPluginBuildVCSFlag|TestPluginBuildEnv|TestBuildPluginBinary_DifferentPluginsConcurrent|TestPluginSourceTag' -v ./...
=== RUN   TestPluginBuildEnvKeepsVCSStampingReadOnly
--- PASS: TestPluginBuildEnvKeepsVCSStampingReadOnly (0.10s)
=== RUN   TestPluginBuildEnvNoGitSourceDoesNotInheritGitIdentity
--- PASS: TestPluginBuildEnvNoGitSourceDoesNotInheritGitIdentity (0.00s)
=== RUN   TestPluginBuildVCSFlag_TestBinaryAlwaysSkipsAutoDetect
--- PASS: TestPluginBuildVCSFlag_TestBinaryAlwaysSkipsAutoDetect (0.26s)
=== RUN   TestPluginBuildVCSFlag_NoGitSourceStaysFalseRegardless
--- PASS: TestPluginBuildVCSFlag_NoGitSourceStaysFalseRegardless (0.00s)
=== RUN   TestBuildPluginBinary_DifferentPluginsConcurrent
--- PASS: TestBuildPluginBinary_DifferentPluginsConcurrent (15.10s)
=== RUN   TestPluginSourceTag_DistinctSrcDirs
--- PASS: TestPluginSourceTag_DistinctSrcDirs (0.00s)
=== RUN   TestPluginSourceTag_SameSrcDirStable
--- PASS: TestPluginSourceTag_SameSrcDirStable (0.00s)
PASS
ok  	github.com/opencharly/charly/charly	15.936s

$ go test ./...   # full suite, box/fedora + sdk + pkg/* submodules initialized
ok  	github.com/opencharly/charly/charly	152.897s
ok  	github.com/opencharly/charly/charly/internal/pluginsgen	(cached)

# Full 83-candy standalone-build sweep (GOWORK=off go build -buildvcs=false),
# proving the go.sum fix is complete across every candy/plugin-* module —
# BEFORE fix: 3 failures (plugin-preempt, plugin-loader, plugin-status);
# AFTER fix (shown): 0 failures.
$ while read -r d; do
    [ -f "$d/go.mod" ] || continue
    target="."; [ -d "$d/cmd/serve" ] && target="./cmd/serve"
    out=$(cd "$d" && GOWORK=off go build -buildvcs=false -o /tmp/plugincheck "$target" 2>&1)
    [ -n "$out" ] && { echo "=== FAIL: $d ==="; echo "$out"; fail=1; }
  done < <(find candy -maxdepth 1 -name "plugin-*" -type d | sort)
  echo "done fail=${fail:-0}"
done fail=0

# The literal R10 gate for item 1 — fresh-from-clean task build:pkg:arch:
$ rm -rf dist pkg/arch/src pkg/arch/pkg pkg/arch/*.pkg.tar.zst bin candy/charly/bin/charly
$ git checkout -- pkg/arch/PKGBUILD
$ task build:pkg:arch
task: [build:binary] ... (regenerates bin/charly)
task: [build:pkg:arch] bin/charly box pkg pac
Building pac package for candy "charly" from .../pkg/arch
==> Making package: opencharly-git 2026.198.1029-1 (...)
==> Retrieving sources... (git+file:// clone of the superproject + sdk submodule)
==> Starting prepare()... (sdk submodule wired from the second source)
==> Starting pkgver()... ==> Updated version: opencharly-git 2026.203.1143-1
==> Starting build()...
==> Entering fakeroot environment...
==> Starting package()...
==> Creating package "opencharly-git"...
==> Creating package "opencharly-git-debug"...
==> Leaving fakeroot environment.
==> Finished making: opencharly-git 2026.203.1143-1 (Wed 22 Jul 2026 02:05:49 PM CEST)
/home/atrawog/Atrapub/o/charly-wt-buildpkg/dist/opencharly-git-2026.203.1143-1-x86_64.pkg.tar.zst
/home/atrawog/Atrapub/o/charly-wt-buildpkg/dist/opencharly-git-debug-2026.203.1143-1-x86_64.pkg.tar.zst
  • Concurrency (shared-state changes only): N/A — no loader/ledger/store/
    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 the
real buildPluginBinary call path in TestBuildPluginBinary_DifferentPluginsConcurrent
plus 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

  • R0 (skills first): Loaded /charly-internals:go, /charly-internals:strict-policy,
    /charly-internals:git-workflow, /charly-internals:cutover-policy,
    /charly-build:build before any tool call.
  • R1 (RCA on every failure): Root-caused both findings from the ACTUAL
    error text before touching anything — reproduced task build:pkg:arch's
    real 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 confirmed
    via 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.
  • RDD: The high-risk assumption ("is this genuinely systemic, or a
    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.
  • R2 (no deferral): Both registered batch items are fixed HERE, in the
    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."
  • R3 (no duplication, generic fix): The go.sum fix applies to every
    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) both
    the production wrapper and the tests exercise, not an inline ad-hoc
    branch.
  • R4 (no workarounds): No sleep/retry — the fix removes the racing
    operation (the git-status walk) from the context that races it, rather
    than retrying past the race.
  • R5 (hard cutover / stale refs): No identifiers renamed or removed;
    git grep self-test N/A for this class. Comment describing the old
    buildVCS inline logic was replaced (not left stale) alongside the
    refactor into pluginBuildVCSFlagForContext.
  • R6: git status/git stash list checked before every destructive
    step (the rm -rf dist ... bin ... fresh-rebuild step was run against a
    clean, fully-committed tree).
  • R9: charly version (2026.203.1143) matches the fresh
    task build:binary rebuild baked into the pkg build; no new runtime OS
    dependency introduced (pure Go dependency-graph fix).
  • R10: See "How R10-tested" above — the literal exercising gates for
    both items ran against the final, committed code.

… 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)
@atrawog

atrawog commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — CHANGES REQUESTED ❌

Change class: charly Go code (+ 3 sdk-consuming plugin candy go.mod/go.sum files)

Checklist

# Item Verdict
0 Security & anti-tampering (T1–T4) PASS — no exfiltration, no scope mismatch (code matches description exactly), no weakened guardrail, no supply-chain surprise (pure dependency-graph additions, no version bumps), no instruction-injection attempt in the diff/body
1 Description complete PASS — template fully filled, evidence pasted
2 Change-class gate matches evidence (R7/R10) FAIL — see Decision below
3 Attribution tier justified PASS (see Decision)
4 R0 skills honored PASS — /charly-internals:go, /charly-internals:strict-policy, /charly-internals:git-workflow, /charly-internals:cutover-policy, /charly-build:build named + spot-checked
5 R1 RCA / zero warnings / no flake framing FAIL — a false factual claim ships uncorrected in the cutover's own new prose (CHANGELOG + PR body)
6 R2 no pre-existing/out-of-scope split PASS — nothing deferred
7 R3 no duplication PASS — one shared pluginBuildVCSFlagForContext, one root-cause fix applied to all 3 affected candies
8 R4 no ad-hoc workaround PASS — removes the racing operation from the context that races it; no sleep/retry
9 R5 hard cutover + grep self-test N/A — no identifier renamed/removed
10 R6/R8/R9 artifact + binary integrity PASS — R6: git status/stash checked before destructive steps (verified in my own re-run too); R8: N/A (no OCI labels/Containerfile touched); R9: no new runtime OS dep (pure Go build-graph fix); charly version matched the fresh rebuild
11 R10 disposable-only, fresh-rebuild, zero-warning, coverage FAIL — see Decision; the packaging half is solid, the "no bed needed" claim is not
12 RDD/ADE/SDD N/A — no CUE schema, no candy plan touched
13 Concurrency mandate + anti-cheat FAIL — 13(d): the sweep/verification claim backing "no bed run" was actually executed but against the wrong file and the wrong pattern, producing a false negative that supports a false claim
14 Hard cutover — one atomic commit PASS
15 Architecture gate PASS — placement: CORRECT. charly/plugin_loader.go is core plugin-LOADING mechanism (one of the four in-core M's); no new/grown charly/*_aliases.go; no new charly/ import of an sdk kit; no per-kind word leaked into core. Per-item trace: plugin_loader.go — new funcs pluginBuildVCSFlag/pluginBuildVCSFlagForContext are plain helpers inside the existing plugin-build mechanism, no kind-word, no alias, no kit import. plugin_build_cache_test.go — test-only, N/A.
16 Disposable-only autonomy PASS — nothing destroyed in the evidence beyond my own disposable-worktree re-runs
17 Clean architecture + go gates PASS — re-ran myself: gofmt -l . empty, golangci-lint run → 0 issues, go vet ./... clean, go test ./... green (154.7s)
18 CHANGELOG present PASS — CHANGELOG/2026.203.1400.md, filename/H1 CalVer match, placeholder collides with nothing on main

What I independently re-verified (fresh worktree, PR head 3fc579b8)

Item 1 (go.sum fix) — genuinely solid, re-proven independently, not rubber-stamped:

  • Reverted candy/plugin-preempt/{go.mod,go.sum} to the pre-fix (6521f275) content and re-ran GOWORK=off go build ./... — reproduced the EXACT failure the PR claims (missing go.sum entry for module providing package golang.org/x/term (imported by github.com/opencharly/sdk/deploykit)), then restored and confirmed git diff --stat was clean again.
  • Ran the full 83-candy standalone sweep myself (not a sample): 0 failures, matching the PR's claim exactly.
  • Verified all three go.sum diffs are pure additive tidy output (golang.org/x/term, golang.org/x/crypto — new hashes only, zero version churn of any pre-existing dependency).
  • Verified the plugin-preempt/go.mod grpc // indirect → direct promotion is legitimate: google.golang.org/grpc is directly imported by holder_dispatch_test.go (pre-existing test file), so go mod tidy correctly reclassified it — not a smuggled dependency.
  • Ran the literal R10 gate myself, fresh-from-clean: removed dist/, bin/, candy/charly/bin/charly, re-initialized submodules, ran task build:pkg:arch end-to-end — produced fresh dist/opencharly-git-2026.203.1206-1-x86_64.pkg.tar.zst (confirmed file reports valid zstd package). The PKGBUILD sources from git+file:// at the working tree's own HEAD, so this build genuinely exercised the fix on the PR's exact code.
  • go vet ./... clean, golangci-lint run → 0 issues, gofmt -l . empty, full go test ./... green (154.7s, ran as a background task and inspected the tail), and the two new regression tests + the pre-existing concurrent-build test all pass on my own re-run.

Item 1 and the mechanical code quality of item 2 are genuinely well-executed. This is not why the PR fails.

Decision — the blocking finding

The PR's stated justification for skipping a live disposable-bed run is:

"This repo's beds also never load an out-of-process external plugin candy (the only case that would exercise buildPluginBinary in a live bed) — confirmed via grep -n "plugin-example-external\|source:.*github" box/fedora/charly.yml (no hits)."

This claim is false, and I disproved it independently with three concrete counter-examples:

  1. check-exampledeploy (root charly.yml) — disposable: true. Its own comment: "candy/plugin-example-deploy (recognized at parse time via the plugin-declaration pre-scan, connected at deploy time via loadDeployPlugins)... Invokes the plugin out-of-process." plugin-example-deploy is not in charly/charly.yml's compiled_plugins: list — it is a genuine out-of-process plugin, connected via exactly loadPluginUnit → resolvePluginBinary → buildPluginBinary (the function this PR modifies).
  2. check-structkind (root charly.yml) — disposable: true. Its own comment: "the top node is the external STRUCTURAL plugin kind examplestructkind (out-of-process, candy/plugin-example-structkind)." Also absent from compiled_plugins:.
  3. check-stepkind-emit-pod (box/fedora/charly.yml:178-190) — disposable: true. Composes plugin-example-stepkind via add_candy, which self-describes (candy/plugin-example-stepkind/charly.yml) as "Reference OUT-OF-TREE charly class:step plugin." Also absent from compiled_plugins:.

The grep the PR ran to "confirm" its claim (a) only searched one file (box/fedora/charly.yml), never the root charly.yml where two of the three counter-examples live, and (b) searched for the literal string plugin-example-external (which is a different, compiled-in example plugin — a red herring) and the pattern source:.*github (which does not match this codebase's actual out-of-tree composition syntax, add_candy: - '@github...' or a bare local candy name). The grep was executed and pasted honestly, but it tested the wrong thing and produced a false negative supporting a false claim.

Why this is blocking, not a nitpick: this false claim is committed to the cutover's own new prose — both the PR body and the immutable CHANGELOG/2026.203.1400.md entry — which R1 treats as an incident regardless of it being newly authored ("being newly authored — never pre-existing — is not an exemption"). Per R10's own anti-cheat clause (13(d)), a verification claim that was executed but against the wrong surface, propping up a conclusion, is treated exactly like an unexecuted claim: it fails until corrected.

Note for the author — my own analysis suggests the ultimate conclusion (no live bed run required) is likely still correct, but for a different and stronger reason than the one given: testing.Testing() is provably false in every live charly invocation, including one of the three beds above connecting an out-of-process plugin — so even running check-exampledeploy would only re-exercise the unchanged isTestBinary=false branch (byte-identical to pre-PR behavior), proving nothing new about this diff. That is a valid R10 "gate that cannot fail on the change proves nothing" argument — but it is not the argument the PR made, and the argument it did make is false. Fix required: correct the false claim in the PR body and the CHANGELOG entry (restate the justification on the testing.Testing()-is-always-false-in-live-invocations grounds, which is verifiably true and does not require running a bed), or alternatively actually run one of the three beds named above as additional evidence. Either path is acceptable; shipping the current false claim is not.

Comments considered: none — the PR carries no comments.

Cross-PR interactions considered: two other open PRs in this repo — #179 (dead-code radical-removal, feat/deadcode-radical-sweep) and #118 (RED kernel-manifest gate, feat/p16-kernel-manifest-gate, merges last by design). Compared file lists against this PR's touched files: zero overlap with either (confirmed via comm -12 over sorted path lists). No coordination comment needed; disposition: none-found.

What must change: correct the false "beds never load an out-of-process plugin" claim in both the PR body's "Why no disposable check-bed run" section and CHANGELOG/2026.203.1400.md, restating the justification on grounds that actually hold (or run one of the three named beds as evidence instead). Everything else in this PR — the go.sum fix, the VCS-flag fix, its tests, lint/vet/build cleanliness, the architecture placement — is sound and does not need to change.

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

…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)
@atrawog

atrawog commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Fix round pushed (7c0cc42, fast-forward on feat/buildpkg-batch): both items addressed.

  1. Retracted the false claim in both the PR body's "Why no disposable check-bed run" section and CHANGELOG/2026.203.1400.md — the "beds never load an out-of-process plugin" claim + its mis-targeted grep are explicitly named and retracted in both places.
  2. Restated the justification on the correct grounds: pluginBuildVCSFlag defers to testing.Testing(), which is provably false in every live charly invocation, so a bed run only re-exercises the unchanged isTestBinary=false production branch.
  3. Ran check-exampledeploy anyway (belt-and-braces) on the final tree: PASS, 6/6 steps, ~111s, exit 0 — drives plugin-example-deploy (out-of-process, not in compiled_plugins:) through the exact loadPluginUnit → buildPluginBinary path this PR touches, via charly bundle add → charly check live → charly update → charly bundle del. Full output pasted in the PR body. Post-run state verified clean.

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)
@atrawog

atrawog commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅ (round 2)

Change class: charly Go code (+ 3 sdk-consuming plugin candy go.mod/go.sum files)

What changed since round 1

Commit 7c0cc428 touched only CHANGELOG/2026.203.1400.md (git diff 3fc579b8..7c0cc428 --name-only — one file). No charly/*.go, no go.mod/go.sum changed, so all of round 1's code-level verification (go.sum fix, VCS-flag fix, lint/vet/test/build) remains valid unchanged — I did not need to re-run it.

Round-1 blocking finding — verified resolved

The false claim ("this repo's beds never load an out-of-process external plugin candy") is explicitly retracted in both the PR body and CHANGELOG/2026.203.1400.md (now renamed, see below), naming exactly what my round-1 review found (the two-file/wrong-pattern grep miss, the three counter-example beds). The restated justification — pluginBuildVCSFlag defers to testing.Testing(), which is provably false in every live charly invocation, so a bed run only re-exercises the unchanged isTestBinary=false production branch — is correct and matches my own round-1 analysis exactly.

I independently re-ran the belt-and-braces evidence myself, not just trusted the paste:

$ ./bin/charly check run check-exampledeploy
charly check run check-exampledeploy: [deploy-add] PASS after 39.31s
charly check run check-exampledeploy: [bring-up-members] PASS after 0s
charly check run check-exampledeploy: [check-live] PASS after 6.173s
charly check run check-exampledeploy: [update] PASS after 18.891s
charly check run check-exampledeploy: [cleanup] PASS after 18.939s
charly check run check-exampledeploy: [cleanup-members] PASS after 0s
charly check run check-exampledeploy: PASS (steps=6)

Exit 0, 6/6, matching .check/check-exampledeploy/2026.203.1234/summary.yml on disk. Post-run: git status --short clean, charly status --all shows no exampledeploy residue, ~/.config/opencharly/installed/ carries no exampledeploy entry — full teardown confirmed. This drives plugin-example-deploy (out-of-process, not in compiled_plugins:) through the exact loadPluginUnit → buildPluginBinary path this PR modifies, on the binary built from this PR's exact source (only the CHANGELOG differs between heads, so the Go source is byte-identical to round 1's verified build — confirmed charly version → 2026.203.1206, matching my round-1 fresh-rebuild).

Full checklist (updated)

# Item Verdict
0 Security & anti-tampering PASS
1 Description complete PASS
2 Change-class gate matches evidence PASS — go.sum fix proven on the real task build:pkg:arch gate (round 1); VCS-flag fix proven by go test ./... + the correctly-justified no-bed-needed argument + belt-and-braces check-exampledeploy PASS (independently re-run by me)
3 Attribution tier justified PASS — fully tested and validated is earned: real artifact built, full test suite green, AND a live bed now exercises the out-of-process connect path
4 R0 skills honored PASS
5 R1 RCA / zero warnings / no flake framing PASS — the divergence is corrected with a full RCA-quality retraction naming the exact defect in the original grep
6 R2 no pre-existing/out-of-scope split PASS
7 R3 no duplication PASS
8 R4 no ad-hoc workaround PASS
9 R5 N/A
10 R6/R8/R9 PASS
11 R10 disposable-only/fresh-rebuild/coverage PASS
12 RDD/ADE/SDD N/A
13 Concurrency mandate + anti-cheat PASS — the corrected claim is now backed by both a sound argument AND executed, pasted, independently-reproduced evidence
14 Hard cutover — one atomic commit PASS (the CHANGELOG-only fix commit rides the same PR; squash folds it)
15 Architecture gate PASS — placement: CORRECT (unchanged from round 1; no code touched in this round)
16 Disposable-only autonomy PASS
17 Clean architecture + go gates PASS (unchanged code from round 1 — gofmt/vet/lint/test all still valid)
18 CHANGELOG present PASS — finalized to CHANGELOG/2026.203.1237.md (merge-time CalVer, see below)

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 — #179 and #118 still zero file overlap (this round's only file, CHANGELOG/2026.203.1400.md→renamed, doesn't intersect either). none-found.

Decision: PASS. Finalizing the merge-time CalVer, merging, and tagging now.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)

@atrawog
atrawog merged commit 64305c2 into main Jul 22, 2026
@atrawog
atrawog deleted the feat/buildpkg-batch branch July 22, 2026 12:39
@atrawog

atrawog commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Merged ✅

  • Merge commit: 64305c249a3982335ee6299cfd9990a0c085207b (squash, main advanced 6521f27 → 64305c2)
  • Tag: v2026.203.1237 (annotated, pushed, verified via git ls-remote --tags)
  • CHANGELOG finalized: CHANGELOG/2026.203.1237.md
  • Branch feat/buildpkg-batch deleted (via --delete-branch)

Fresh post-merge package built from main for the operator's host-resync:
dist/opencharly-git-2026.203.1239-1-x86_64.pkg.tar.zst (charly version → 2026.203.1239, matches this merge's HEAD-commit-derived CalVer). Install with pacman -U dist/opencharly-git-2026.203.1239-1-x86_64.pkg.tar.zst.

Assisted-by: Claude Code (Anthropic Claude Sonnet 5; fully tested and validated)

github-actions Bot pushed a commit that referenced this pull request Aug 29, 2026
…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]>
github-actions Bot pushed a commit that referenced this pull request Aug 29, 2026
…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]>
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