Skip to content

feat(build)!: per-worktree binary is the ONE dev workflow - #131

Merged
atrawog merged 5 commits into
mainfrom
feat/binary-policy
Jul 16, 2026
Merged

atrawog merged 5 commits into
mainfrom
feat/binary-policy

Conversation

@atrawog

@atrawog atrawog commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Delete the system-wide install machinery from the Taskfile (charly, install, install-arch) — task build:binary becomes the ONE per-worktree dev build task and NEVER touches the host; task build:install-portable remains as the explicit, separate, user-level action.
  • Motivated by an incident in cutover refactor(check): core drives the kit plan walk through PlanContext (P5 consumer) #55: a host-wide task build:charly rebuild, run mid-session while mistaking a stale-binary guard trip for a precondition to fix rather than a signal the wrong bed was chosen, broke another teammate's per-worktree-binary verification on a shared multi-agent host.
  • Sweep every live task build:charly reference across the super repo (Taskfile.yml, taskfiles/Setup.yml, the stale-binary guard's remediation string, two schema-too-new load errors, pluginsgen's regenerated-file header, test comments, embedded-config comments, CLAUDE.md's R10 gate matrix).
  • Rewrite README.md's Install section around three empirically-verified paths and remove the previously-documented go install github.com/opencharly/charly/charly@latest path — proven broken, not merely suspected (see verbatim evidence below).
  • Fix a documentation divergence discovered live while testing this cutover: the pkg:* release-artifact comment claimed a podman-container build; verified false.

Test plan

  • go test ./... (charly module) — green, 110s
  • golangci-lint run ./... — 0 issues
  • go vet ./... — clean
  • gofmt -l — clean
  • charly box validate — exit 0
  • task -l — confirms the new task set; build:charly/install/install-arch gone
  • task build:binary's pluginsgen step PROVEN the hard way (not just inferred from a passing test) — verbatim below
  • Stale-binary freshness guard tripped LIVE and cleared after rebuild (verbatim below)
  • task build:install-portable run live (verbatim below — caught and fixed a shared-host PATH-shadowing hazard mid-test)
  • task build:pkg:arch run live — real dist/*.pkg.tar.zst artifacts produced, zero system-wide install (verbatim below); test artifacts cleaned up afterward, pkg/arch/PKGBUILD's expected pkgver() dirt restored
  • The go install claim RDD-verified in an isolated GOBIN/GOMODCACHE/GOPATH scratch dir — proven broken, removed from README (verbatim below)

go install — the RDD verdict (why it's removed from README)

$ GOBIN=.../gobin GOMODCACHE=.../gomodcache GOPATH=.../gopath go install github.com/opencharly/charly/charly@latest
go: downloading github.com/opencharly/charly v2026.196.1739+incompatible
go: downloading github.com/opencharly/charly/charly v0.0.0-20260716062525-a0ffacd3f657
go: github.com/opencharly/charly/charly@latest (in github.com/opencharly/charly/[email protected]):
	The go.mod file for the module providing named packages contains one or
	more replace directives. It must not contain directives that would cause
	it to be interpreted differently than if it were the main module.

charly/go.mod carries replace github.com/opencharly/sdk => ../sdk; go install pkg@version hard-rejects this. Root cause confirmed, not assumed.

Stale-binary freshness guard — tripped live, new remediation string

$ touch charly/main.go && ./bin/charly box generate
charly: error: stale binary detected — refusing to run "box generate"

  running:        .../bin/charly
  binary mtime:   2026-07-16T09:03:09+02:00
  newer source:   charly/main.go
  source mtime:   2026-07-16T09:04:38+02:00
  source root:    ...

Fix:    cd ... && task build:binary   (then use ./bin/charly)
Bypass: export CHARLY_SKIP_FRESHNESS_CHECK=1   (NOT recommended)

Rebuilt (task build:binary) → ./bin/charly box generate exits 0, no stale-binary error.

task build:binary's pluginsgen step — proven the hard way

A parallel finding raised a legitimate concern: on pre-cutover main, task build:binary did NOT run the pluginsgen regeneration step (only the deleted charly task did) — so TestPluginsGenReproducible passing could just mean the committed file happened to already be current, not that binary actually regenerates it. Proved it directly, twice:

$ echo "// CORRUPTED FOR PROOF TEST" > charly/plugins_generated.go && echo "package main" >> charly/plugins_generated.go
$ task build:binary
task: [build:binary] cd charly && GOWORK=off go run ./internal/pluginsgen -root .. -config charly/charly.yml -out charly/plugins_generated.go -gowork go.work
task: [build:binary] CALVER=$(bash pkg/arch/calver.sh)
cd charly && go build -ldflags "-X main.BuildCalVer=${CALVER}" -o ../bin/charly .
$ grep -c "CORRUPTED FOR PROOF TEST" charly/plugins_generated.go || echo "0 (marker absent — regeneration confirmed)"
0 (marker absent — regeneration confirmed)
$ git diff --stat charly/plugins_generated.go
(empty — byte-identical to committed HEAD)

Repeated with the file fully DELETED (rm -f charly/plugins_generated.go): task build:binary recreated it byte-identical to HEAD and the subsequent build succeeded (./bin/charly version printed a fresh CalVer both times). This confirms the pluginsgen step is genuinely IN this PR's binary task body and exercised on every build, not merely an unexercised comment.

task build:install-portable — run live, caught a real hazard mid-test

Ran it; it installed ./bin/charly to $HOME/.local/bin/charly as documented. Checking PATH resolution afterward found $HOME/.local/bin precedes /usr/bin on this shared host — which charly now resolved to my worktree's binary instead of the shared system package, which would have silently changed which charly any OTHER teammate's bare-$PATH bed step resolves to. Removed the shadow immediately (rm -f $HOME/.local/bin/charly), confirmed which charly/charly version restored to the system package. Added a caution to the README about this exact shadowing risk on a shared host.

task build:pkg:arch — run live

$ task build:pkg:arch
...
Building pac package for candy "charly" from .../pkg/arch
==> Making package: opencharly-git 2026.185.0752-1 ...
...
==> Finished making: opencharly-git 2026.197.0625-1 ...
.../dist/opencharly-git-2026.197.0625-1-x86_64.pkg.tar.zst
.../dist/opencharly-git-debug-2026.197.0625-1-x86_64.pkg.tar.zst

Confirmed real Zstandard-compressed package artifacts on disk, zero sudo/pacman -U invoked (matches the documented "artifact only, install stays a separate explicit step" behavior). This run also proved the pkg:* comment's "podman container" claim false — makepkg ran directly via bash -c on the host, confirmed both by the visible output and by reading all three formats' local_pkg.build_templates (none use a container). Fixed the comment in the same commit.

Test-run cleanup: removed dist/*.pkg.tar.zst and the ~750 MB of gitignored git clones + build trees charly box pkg left in pkg/arch/ (opencharly-git/, opencharly-sdk/, src/, pkg/), and restored pkg/arch/PKGBUILD's expected pkgver() dirt (git -C pkg/arch restore PKGBUILD).

Review follow-up (2nd commit)

  • install-portable's own desc: now carries the PATH-shadow caution too (aligned with the README wording), scoped "solo/bootstrap use only, never during in-flight multi-teammate work."

Reported, not fixed in this PR (separate scope — see CHANGELOG for detail)

  • pkg/arch/PKGBUILD (a submodule) carries two stale comments referencing removed tasks (task install, task build:charly) — out of this cutover's super-repo-only scope; needs its own pkg/arch PR leg.
  • charly box pkg (pre-existing, unchanged here) performs no cleanup of the git clones / build trees it leaves in pkg/arch/ after a build — the old install task's cleanup covered only its OWN direct makepkg invocation, never this path. Elevating task build:pkg:arch to the documented end-user path makes this more visible but is not a regression this cutover introduces.

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

atrawog added 2 commits July 16, 2026 09:14
Remove the system-wide install machinery from the Taskfile — the `charly`
(build+install), `install`, and `install-arch` tasks are deleted, no alias,
no deprecated stub. `task build:binary` (builds ./bin/charly, CalVer-stamped,
regenerates the compiled-in plugin wiring) is now the ONE development build
task and NEVER touches the host; `task build:install-portable` remains as
the explicit, separate, user-level $HOME/.local/bin action.

Motivated by an incident in cutover #55: a host-wide `task build:charly`
rebuild, run mid-session while mistaking a stale-binary guard trip for a
precondition to fix rather than a signal the wrong bed was chosen, broke
another teammate's per-worktree-binary verification on a shared multi-agent
host.

Sweeps every live `task build:charly` reference across the super repo
(Taskfile.yml, taskfiles/Setup.yml, the stale-binary guard's remediation
string in main_freshness.go/main.go, the schema-too-new load errors in
unified.go and plugin-migrate/engine.go, pluginsgen's regenerated-file
header, calver_script_test.go, the embedded charly.yml/build_defaults.yml
comments, and CLAUDE.md's R10 gate matrix).

Rewrites README.md's Install section around three empirically-verified
paths (dev: task build:binary; personal PATH: task build:install-portable;
native packages: task build:pkg:arch|fedora|debian -> dist/ artifact ->
pacman -U/dnf install/apt install) and REMOVES the previously-documented
`go install github.com/opencharly/charly/charly@latest` path, proven broken
in an isolated GOBIN/GOMODCACHE scratch dir: `go install` hard-rejects the
charly module's go.mod because it carries a `replace
github.com/opencharly/sdk => ../sdk` directive.

Also fixes a documentation divergence discovered while testing this
cutover live: taskfiles/Build.yml claimed the pkg:* release-artifact builds
run "in a podman container" — verified false (a live `task build:pkg:arch`
run shells makepkg directly on the host, confirmed by reading all three
formats' local_pkg.build_template).

Assisted-by: Claude (analysed on a live system)
…ble's desc

Per review: confirm (not just infer) that `binary`'s pluginsgen regeneration
step is genuinely exercised, not merely present as an unexercised line.
Corrupted charly/plugins_generated.go, ran `task build:binary`, verified the
corruption was replaced with byte-identical committed content; repeated with
the file fully deleted. Both prove the step runs and the build succeeds.

Also scope `install-portable`'s own `desc:` with the PATH-shadow caution
(solo/bootstrap use only, never during in-flight multi-teammate work),
aligned with the README wording, per review.

Assisted-by: Claude (analysed on a live system)
atrawog added a commit to opencharly/marketplace that referenced this pull request Jul 16, 2026
Wave-1 plugins docs batch: charly-binary discipline + policy sweep + hygiene.

Adds the canonical "charly binary in a multi-teammate / multi-worktree
setup" section to internals/skills/agents/SKILL.md (five live-incident-
driven rules), sweeps every genuine `task build:charly`/`task build:install`
dev-workflow mention across 10 skill/agent files to the new
`task build:binary` per-worktree-only policy (paired with the superproject
Taskfile deletion in opencharly/charly#131), and fixes a pre-existing
trailing-whitespace hygiene item.

Assisted-by: Claude (documentation reviewed)
atrawog added 3 commits July 16, 2026 13:01
…e CHANGELOG at 2026.197.1113

The R5 sweep in this cutover missed .gitignore's go.work comment (still named
the deleted `task build:charly`) — fixed in the same super-repo-only scope
this cutover already claims to cover. Also finalizes the merge-time CalVer:
renames the placeholder CHANGELOG entry and documents the fresh
pr-validator's independent re-verification (delta re-gate after
gh pr update-branch onto post-#127 main, the pluginsgen hard-proof, the
freshness-guard trip, and the live build:pkg:arch run).

Assisted-by: Claude (analysed on a live system)
…ior commit was rename-only)

The prior commit's `git add` failed on a stale pathspec and staged only the
CHANGELOG rename, silently dropping the .gitignore fix and the CHANGELOG's
content edits (H1 date + validator-findings section). This commit lands the
content that commit intended.

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

atrawog commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Change class: charly Go code + build/hook scripts (Taskfile.yml) + documentation (README/CLAUDE.md) — mixed, runtime tier (docs ride along).

Checklist

# Item Verdict
0 Security & anti-tampering (T1-T4) PASS
1 Description completeness PASS — verbatim evidence for every claimed action
2 Change-class gate vs evidence PASS
3 Attribution tier vs proof PASS — analysed on a live system, correctly not inflated
4 R0 skills honored PASS
5 R1 RCA, zero warnings PASS (see my own self-correction below)
6 R2 no pre-existing/out-of-scope split PASS
7 R3 no duplication PASS
8 R4 no ad-hoc workaround PASS — this PR IS an R4 fix
9 R5 hard cutover + grep self-test Gap found + fixed (see below)
10 R6/R8/R9 artifact + binary integrity PASS
11 R10 disposable-only, fresh-rebuild, coverage PASS (N/A disposable-bed class; script-execution gate independently re-run)
12 RDD/ADE/SDD N/A — no schema/CUE change
13 Concurrency mandate + anti-cheat N/A
14 Hard cutover — one atomic phase PASS
15 ARCHITECTURE GATE N/A — no behavioral charly/*.go change, no boundary question raised
16 Disposable-only autonomy N/A
17 Clean architecture + go gates PASS — independently re-run on the delta-re-gated tree
18 CHANGELOG present PASS — finalized at 2026.197.1113

Validator-discovered finding (fixed before merge)

R5 gap: this PR's own claim — "sweep every live task build:charly reference across the super repo" — missed one live (non-CHANGELOG) reference: .gitignore's go.work comment still read task build:charly. Not the pkg/arch submodule scope (already correctly tracked as out-of-scope, task #20) — squarely within THIS cutover's own stated super-repo sweep. Fixed directly (comment-only, zero behavioral risk) since the PR's own R5 claim would otherwise be false. Re-swept clean afterward.

Independent re-verification (not taken on the author's word)

  • gh pr update-branch 131 — branch was BEHIND post-refactor(core)!: wave-1 core hygiene — alias dissolution (#52) + teardown robustness (#55) + loader-residue fold (#46) + gitlink bumps + P8b Tier-1 (VM disk-build → plugin-vm) #127 main (real file overlap on charly/unified.go, disjoint lines); clean auto-merge, zero conflict markers, submodule pins now match refactor(core)!: wave-1 core hygiene — alias dissolution (#52) + teardown robustness (#55) + loader-residue fold (#46) + gitlink bumps + P8b Tier-1 (VM disk-build → plugin-vm) #127's landed pins.
  • Full delta re-gate on the merged tree: go vet/go test (102s)/golangci-lint run (0 issues)/gofmt -l — all clean.
  • task -l — confirmed the new task set, build:charly/install/install-arch gone.
  • Pluginsgen hard-proof re-run: corrupted charly/plugins_generated.go, ran task build:binary, confirmed byte-identical regeneration; repeated with the file fully deleted — same result.
  • Freshness guard tripped live — confirmed the exact new remediation string (Fix: … task build:binary (then use ./bin/charly)).
  • task build:pkg:arch run live — real dist/*.pkg.tar.zst + debug artifacts, zero system-wide install (matches the "podman container" comment-fix claim — no podman anywhere in the output); cleaned up afterward (dist/, the ~750MB of gitignored build trees in pkg/arch/, pkg/arch/PKGBUILD's pkgver() dirt restored).
  • task build:install-portable — denied outright by the auto-mode permission system (a host write); NOT independently re-run. The author's own detailed verbatim evidence (including the PATH-shadowing hazard it caught mid-test) stands for this one sub-path — this is why the tier stays at analysed on a live system rather than fully tested and validated.
  • charly box validate exit 0; task cue:gen re-run as a sanity check — full no-op (no schema touched by this PR, confirms no incidental drift).

Test-methodology self-correction (disclosed per R1)

My first freshness-guard trip used touch -d "+5 minutes" on charly/main.go, which set its mtime into the genuine future — every subsequent rebuild (stamped at "now") stayed naturally older than that future timestamp, so the guard kept tripping regardless of how many times I rebuilt. RCA'd to the real root cause (a bad mtime, not a task-caching or freshness-guard bug) before concluding anything; reset via git checkout -- charly/main.go and re-ran correctly, confirming the guard clears properly on a genuine rebuild.

Cross-PR sweep (comment-intake + coordination)

Decision

APPROVED. Every rule independently re-verified — including catching and fixing a real R5 gap the author's own sweep missed, and catching my own test-methodology error before it could produce a false finding. Proceeding to finalize the merge-time CalVer (2026.197.1113, already committed on the branch), squash-merge, and tag.

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

@atrawog
atrawog merged commit 4602095 into main Jul 16, 2026
@atrawog
atrawog deleted the feat/binary-policy branch July 16, 2026 11:16
atrawog added a commit that referenced this pull request Jul 16, 2026
…ator findings

Renames the final-round CHANGELOG entry to the merge-time CalVer and appends
the fresh pr-validator's independent findings: the delta re-gate onto
post-#131 main, the adversarial spot-check of the BoxConfig/Op/BundleNode
collision-handling, the R5 sweep, the investigation resolving why ~28
additional vmshared spec-passthrough-shaped symbols correctly stay out of
this cutover's scope (their consumers sit in the not-yet-started K4
migration wave), the cross-PR sweep, and the no-`!`-marker justification.

Assisted-by: Claude (analysed on a live system)
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)
github-actions Bot pushed a commit that referenced this pull request Nov 19, 2026
…er-drop heads (#1219)

`./bin/charly task sync` — this repo's own pin verb, which advances EVERY pin
this repo declares — moved the two `box/*` gitlinks that were behind the ref
their own `.gitmodules` entries name:

    box/cachyos  7f0c6c15fe5d -> ba2c187a1626   (distro-cachyos main: #209's CDI VM-driver drop,
                                                #199, #211 and #212's pod-comfyui offload pins)
    box/fedora   01887aee5c9a -> e9696d3e85f8   (distro-fedora main: #129 and #131, the same
                                                VM-driver drop on the Fedora side)

The other three (`box/arch`, `box/debian`, `box/ubuntu`) were already at the
tips their `.gitmodules` declare. Both advances are fast-forwards onto merged
heads (`git -C box/cachyos merge-base --is-ancestor 7f0c6c15fe5d ba2c187a1626`
-> rc=0, and the same for fedora), so there is nothing to reconcile.

Control after the wave:

    currency: 0 of 5 pin(s) NOT current [5 cur]

What the `box/*` gitlinks actually govern here, measured rather than assumed
(#1218): the `cachyos` namespace is composed by the @github
TAG pin (`charly.yml:30`), so `charly box list boxes` exposes the tag's box
names and not one `-cdi` box — the distro beds are NOT what this moves. The
gitlink is what this repo's OWN gate reads: `charly/cue_kinds_corpus_test.go`
(the `../box/*/box/*/charly.yml` corpus), `charly/refs_sweep_test.go` and
`charly/build_test.go` (`LoadBuildConfigForBox` over this repo's production
box/cachyos distro config). That is where the corpus was run, and it passes on
the moved trees.

This is the hop that lets the umbrella's `charly:box/cachyos` and
`charly:box/fedora` edges become current — until it lands, both report
`blocked-by charly:box/...` (behind).

Agent: `edge-1182` · DeepSeek Harness session `a8d6ae4d-d0e0-4b37-8e6c-58081b9e6040`
Assisted-by: DeepSeek Harness ollama-cloud deepseek-v4.1-flash (fully tested and validated)
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