Repository navigation
fix(candy): claude-code npm → official native installer - #143
Conversation
The npm @anthropic-ai/claude-code package regressed upstream into a thin launcher that defers its native-binary download to first runtime, breaking `claude --version` in hermetic (offline) image builds (pre-existing on main). Switch to the official native installer (curl -fsSL https://claude.ai/install.sh | bash) and relocate the resulting binary to /usr/local/bin, since anything a candy installs under ${HOME} at build time is shadowed by the deploy-time home-volume mount. Sweeps the same path fix into hermes-full/openclaw-full, whose composed checks asserted the old path. Tested via charly check run check-charly-selftest-pod on a disposable bed: image-build/check-image/deploy/config/start all passed; check-live 83 steps, 72 passed, 2 failed (both pre-existing main defects, unrelated, tracked separately), 9 skipped — both claude-code checks passed. Assisted-by: Claude Code Anthropic Claude Sonnet 5 (fully tested and validated)
Completes the claim-keyed sweep for the native-installer cutover (opencharly/charly#143): nodejs skill listed claude-code as depending on nodejs (x2), kimi + forgecode skills claimed all sibling AI CLIs share the npm-global install pattern, and the openclaw-desktop skill put the claude CLI at ${HOME}/.npm-global/bin/. claude now installs via the official native installer at /usr/local/bin/claude; codex/gemini keep npm-global. Assisted-by: Kimi Code Moonshot Kimi K3 (documentation reviewed)
pr-validator — CHANGES REQUESTED ❌PR head SHA (bound live via Fresh validator, independent context. I re-derived everything: read the diff, re-ran the static gates, and ran my own bed roster from Checklist
Validator's own gate evidence (all from
|
| Run | Bed | Result | Detail |
|---|---|---|---|
2026.200.1517 (concurrent roster, mine) |
check-charly-selftest-pod | FAIL exit 2 | build 291s ✓, check-image ✓, deploy/config/start ✓; check-live 924s: 83 steps, 71 passed, 9 skipped; failures = exactly the 2 baseline F-CLI-NEST defects + 1 INFRA (nested-podman-run, HOME-empty — RCA below). Both claude-code checks PASS (build+live); all charly-cli/mcp checks pass except the 2 known. |
2026.200.1517 (concurrent roster, mine) |
check-openclaw-full-pod | FAIL exit 2 | 10 phases ok through update; feature-run-rebuild: 173 steps, 146 passed, 1 failed — nodejs:6 pnpm --version "ERROR Could not find the homedir" (RCA below). claude-code ×2 and openclaw-full ×3 checks PASS in every phase. |
2026.200.1546 (serial, mine) |
check-openclaw-full-pod | PASS exit 0 | 12/12 phases ok, 389s; pnpm green in all three live phases; zero FAIL lines; host left clean. |
author's 2026.200.1317 |
check-openclaw-full-pod | PASS (verified on disk) | summary ok: true, 12/12, 604s, zero FAIL lines — cross-checked, matches the salvage-note claim. |
author's 2026.198.2109 |
check-charly-selftest-pod | not on disk (retention/other worktree) | claim substituted by my own 2026.200.1517 run, which reproduces its exact baseline (72→71 passed only because of the extra HOME-anomaly victim). |
The 2 claimed pre-existing failures — independently verified pre-existing and out of this PR's power. On the worktree binary (= main's Go): charly check --help prints only the generic out-of-process placeholder (no live/run/box/feature) — fails charly-cli-check-group; charly box list --help is likewise a placeholder while charly box list boxes itself works — the host-side Kong grammar for out-of-process command plugins lacks nested subcommands, so the MCP leaf walk never registers box.list.boxes — fails mcp-charly-call-list-boxes. ONE root mechanism (F-CLI-NEST), owned by the named, in-flight opencharly/sdk#72 (+ its paired charly cutover). A candy-YAML PR cannot fix Go CLI/MCP behavior; the separability claim holds. Disposition: verified-non-blocking.
RCA — the HOME-empty exec anomaly (surfaced ONLY under my concurrent two-bed window, NOT this PR's defect). Symptom: containers created by charly during the concurrent window (selftest initial 17:23:08, openclaw update-recreate 17:25:08) yield broken podman exec env/user resolution: exec sessions get uid=1000(user) gid=0(root) with HOME empty, while the OCI runtime spec carries uid/gid 1000/1000 + HOME=/home/user, the quadlet injects HOME=/home/user, image labels carry ai.opencharly.home=/home/user, and in-container /etc/passwd is correct. Effects: nested rootless podman computes storage as /.local/share/… → nested-podman-run INFRA failure (selftest); pnpm needs a homedir → nodejs:6 failure (openclaw, post-update only). Verified NOT the image (a plain podman run from the same image at 17:41 resolves exec env correctly), NOT the PR diff (untouched nodejs/container-nesting candies; PR checks green everywhere), NOT the arch base refresh under test (arch:2026.200.1313 was already used by the green 2026.200.1317 run). Serial re-run 2026.200.1546: full PASS. Mechanism as far as traced: podman 6.0.1 rootless exec-time env assembly diverging for systemd-transient-store containers created during a concurrent build/deploy window — below charly's layer. This is a real defect in the concurrent-bed machinery the project's roster design depends on: it MUST get a named follow-up RCA task (suggest F-EXEC-HOME) — recorded here so it cannot evaporate — but it is outside this PR's mechanism and power to fix. Disposition: verified-non-blocking for #143. (Cosmetic side-note for that task: the runner's tally line counted the INFRA failure ("3 failed") while the exit message said "2 check(s) failed".)
Blocking findings (what the author must fix)
Finding 1 — R5/R2: the owning skill + sibling skill claims in plugins go stale at merge and are unswept. git -C plugins grep (at recorded gitlink 9ab9b98) returns, verbatim:
coder/skills/claude-code/SKILL.md— frontmatterdescription:line 4: "Claude Code CLI installed globally via npm from @anthropic-ai/claude-code."; the "Dependencies: nodejs" and "Install files: charly.yml, task:" property rows; "sibling AI CLIs (all three share the npm-global install pattern)"; line 39: "this candy's test verifies${HOME}/.npm-global/bin/claude+claude --version".coder/skills/nodejs/SKILL.md:59— "/charly-coder:claude-code-- depends on nodejs" (PR dropsrequire: [nodejs]).coder/skills/kimi/SKILL.md:36andcoder/skills/forgecode/SKILL.md:37— "…claude-code… sibling AI CLIs (all share the npm-global install pattern)".
The skills tree is the R0 control plane every agent loads first; post-merge it would instruct agents to verify a path this PR deletes. No open plugins PR covers these files (plugins#88 touches only git-workflow + install-plan). Fix: open a small opencharly/plugins docs PR sweeping those four files (native-installer description, /usr/local/bin/claude test path, drop the nodejs-dependency claims, correct the "all share npm-global" sibling claims) and either land it with this cutover or name its docs-batch explicitly in this PR body's R5/R2 answers.
Finding 2 — layer-skill version: mandate unmet on the swept candies. Bump version: in candy/hermes-full/charly.yml (2026.156.1921 → fresh CalVer) and candy/openclaw-full/charly.yml (2026.144.1443 → fresh CalVer) in a fix commit on this branch — the field is the per-entity content identity that drives cross-repo pickCandyVersion, and the PR already (correctly) bumped claude-code.
Comments considered
None — the PR carried no comments at validation time.
Cross-PR interactions considered
- feat(agent): add generic federated control plane #146 (
feat/agent-control-plane): edits the same two files (candy/claude-code/charly.yml,package.json) with the COMPETING strategy (keep npm, pin2.1.214,npm rebuild --allow-scripts). Merging fix(candy): claude-code npm → official native installer #143 invalidates those hunks. Disposition: verified-non-blocking for fix(candy): claude-code npm → official native installer #143; coordination comment posted on feat(agent): add generic federated control plane #146 (#issuecomment-5016256032). - fix(candy): xurl — run the postinstall npm 12 blocks #148 (
fix/candy-xurl-postinstall): companion, disjoint files; the assembled tree (main + fix(candy): claude-code npm → official native installer #143 + fix(candy): xurl — run the postinstall npm 12 blocks #148) is what my openclaw-full beds validated. Lands after fix(candy): claude-code npm → official native installer #143 per the orchestrator. Disposition: verified-non-blocking. - feat(gate): RED kernel-manifest floor gate — the C15 residue tracker (merges LAST) #118 (
feat/p16-kernel-manifest-gate): no file overlap (gate/Go machinery); untouched per operator constraint. Disposition: none-found. - plugins repo: plugins#88 (docs-batch 6) — no overlap with Finding 1's files.
Decision
CHANGES REQUESTED. The runtime change is verified good — the native-installer fix, the /usr/local/bin relocation, and both swept check-path updates pass at build and deploy scope on fresh rebuilds in my own runs, and the two baseline bed failures are confirmed pre-existing F-CLI-NEST defects owned elsewhere. Landing is blocked solely on the two sweep-completeness findings above (stale plugins skill claims; un-bumped version: on the two swept candies), both small and precisely fixable. Append the version bumps here, open/name the plugins docs sweep, re-push — the status resets and a fresh validator re-runs. My bed evidence (this comment) carries over as the runtime baseline for the delta re-gate.
Assisted-by: Kimi Code (Moonshot kimi-for-coding; analysed on a live system)
pr-validator Finding 2 (layer-skill mandate): the claude-code sweep changed both candies' content (check paths, openclaw-full description) without moving their per-entity content identity. version: is what cross-repo pickCandyVersion and the consuming image's content-stable ai.opencharly.version label key on — bump both to the edit-time CalVer, matching the claude-code bump already in this PR. Assisted-by: Kimi Code Moonshot Kimi K3 (analysed on a live system)
Sync the claude-code skill (and its sibling carriers) with the candy's official native installer (opencharly/charly#143): the `claude` binary is relocated to the system path `/usr/local/bin/claude`, the `nodejs` dependency is gone, and the npm-global install claims are replaced. - `coder/skills/claude-code`: frontmatter, dependency table, install files, PATH note, sibling framing, and check path all re-stated for the native installer. - Sibling sweep of the same falsified claim: `nodejs` (transitive-dependency list), `kimi` + `forgecode` (npm-global sibling framing narrowed to codex/gemini), `openclaw-desktop` (`claude` CLI path), and `hermes` (brace-form `${HOME}/.npm-global/bin/{claude,codex,gemini}` claim corrected). - Claim-keyed grep self-test re-run with a brace-tolerant pattern: zero live stale claims remain; codex/gemini stay on the npm-global pattern. Docs-only change class — non-runtime standards gate, certified at documentation reviewed by the fresh pr-validator. Assisted-by: Kimi Code Moonshot Kimi K3 (documentation reviewed)
pr-validator — APPROVED ✅ (round 2, delta re-gate; supersedes the round-1 CHANGES REQUESTED)PR head SHA (bound live via Fresh validator, independent context (different agent from the author and from the round-1 validator). I re-derived everything from the live tree: bound the remote head/base myself, loaded protected policy + skills from the protected objects ( Round-1 findings — both independently verified RESOLVEDFinding 1 (R5/R2 — stale
Claim-keyed grep at Finding 2 (layer-skill Checklist
Validator's gate evidence this round
Bed judgment for the delta (stated per the envelope): I did not re-run a full bed. The delta is exactly two Comments considered
Cross-PR interactions considered
DecisionPASS. Both round-1 blocking findings are independently verified resolved, the round-2 delta is exactly the mandated Assisted-by: Kimi Code (Moonshot kimi-for-coding; analysed on a live system) |
Assisted-by: Claude Code Anthropic Claude Sonnet 5 (fully tested and validated)
Cross-PR coordination notice (from the #146 validation)#146 (feat/agent-control-plane) is being validated for landing and touches the same two files as this PR: No action needed until #146 lands; flagging so the conflict does not surprise the fresh validator of this PR. Assisted-by: Kimi Code Moonshot Kimi K3 (analysed on a live system) |
pr-validator — landing outcomes (follow-up to the round-2 PASS verdict)Phase 3 executed on the PASS verdict. Verbatim outcomes:
Assisted-by: Kimi Code (Moonshot kimi-for-coding; analysed on a live system) |
…ent bed The claude-code candy cutover (opencharly/charly#143, landed e38ce38) moved claude off npm to the official native installer with the binary relocated to /usr/local/bin/claude. The claude-code-terminal-agent-live check still asserted the npm layout (2.1.214 package.json pin, npm-global binary path) and failed on the new candy. Resolve the installed version dynamically from the binary and assert the native path; drop the npm pin check. Verified live: check-agent-pod PASS 12/12 on the resolved tree. Assisted-by: Kimi Code Moonshot Kimi K3 (fully tested and validated)
… candy onto the native installer main's #143 (landed e38ce38) replaced the npm claude-code candy with the official native installer and deleted package.json; this branch pinned the npm package and added the npm rebuild/pin machinery plus the agent terminal surface. Semantic resolution: main's native installer is the new base (install plan, curl package, /usr/local/bin checks); the branch's mechanism-agnostic agent surface is re-homed onto it (env DISABLE_AUTOUPDATER=1, agent_provide tmux provider, CUE terminal_profile); the npm machinery is dropped as obsolete (require nodejs, path_append, npm rebuild --allow-scripts, the 2.1.214 pin check, package.json); version: bumped to the resolution-time CalVer. The sibling bed harness asserting the npm layout is fixed on distro-arch feat/agent-control-plane (4a4cfd7) — R5 claim-keyed sweep into the bed surface. Gate on the resolved tree: charly box validate exit 0; go build/vet/test exit 0 (no Go delta); full R10 roster check-tmux-pod PASS 12/12 + check-agent-pod PASS 12/12 concurrently (run-calver 2026.200.1700/1710). Assisted-by: Kimi Code Moonshot Kimi K3 (fully tested and validated)
Summary of changes
candy/claude-codeinstalled@anthropic-ai/claude-codevia apackage.json(npm builder). That npm package regressed upstream into a thin launcher that
defers its native-binary download to first RUNTIME, so
claude --versionfailed "claude native binary not installed" in a hermetic (offline)
charly box build/ check-image — BASELINE-CONFIRMED pre-existing onmain.Concrete edits:
candy/claude-code/charly.yml: replaced the npm install with the officialnative installer (
curl -fsSL https://claude.ai/install.sh | bash), droppedrequire: [nodejs](the native binary needs no node), and added a newroot-run
plan:step that relocates the installer's real binary to/usr/local/bin/claude— a system path that survives the deploy-timehome-volume mount (the installer self-installs under
${HOME}, which alive pod's persistent home volume shadows). Both
check:steps updated tothe new system path;
version:bumped to2026.198.2107.git rm candy/claude-code/package.json(R5 — the old npm path fully removed).candy/hermes-full/charly.yml,candy/openclaw-full/charly.yml: their owncomposed checks asserted the OLD
${HOME}/.local/bin/claudepath; swept to/usr/local/bin/claudeto match (R2 — these compose the local claude-codecandy by bare name, not an
@githubpin, so they would have broken).CHANGELOG/2026.198.2154.md: placeholder entry narrating both RCAs below.Change class
candy/box-config
How R10-tested — exact gate, commands, and pasted output
charly box validate+charly check run check-charly-selftest-pod(the disposable pod bed that composesclaude-code,hermes-full/openclaw-fullare not composed by any bed in this repo but are fixed for correctness — see R2 note above).check-charly-selftest-pod | pod | FAIL (2 pre-existing, unrelated failures) | 83 steps (72 passed / 2 failed / 9 skipped) | 1196s— run-calver2026.198.2109, binarycharly version=2026.198.1029, launched frombox/cachyos(single bed, not a cross-cutting change — no concurrent roster needed).Two earlier runs on the SAME bed are part of the RCA trail, not separate coverage:
2026.198.1857(image-build FAILED — RCA feat!: PR-only agent-validated landing — forbid + disable direct pushes to main #1, curl transient) and2026.198.2030(image-build passed; check-live FAILED — RCA docs: bump plugins → pr-validator always comments on the PR #2, home-volume shadowing, led to the/usr/local/binrework).task build:binaryon this commit's source;./bin/charly version→2026.198.1029. The bed'simage-buildstep (232s) is itself a fresh, uncached-installer rebuild of thecharly-selftestimage from this candy's final content;check-image(18s) and the full deploy→config→start→check-live sequence all ran against that fresh image — zero warnings in the gate output.check:steps executed at BOTH check-image (build-scope) and check-live (deploy-scope) time and PASSED at deploy-scope — the scope that actually exercises the home-volume-shadowing fix.The 2 failures are pre-existing
maindefects, unrelated to this cutover(reproduced identically on an independent branch by another teammate and
confirmed as baseline; tracked + being fixed under a separate, parallel task —
NOT part of this PR's scope per R2's separability test: this cutover's own
gate passes without needing that fix).
Attribution tier
fully tested and validated— the cutover's new/changed code paths (thenative-install steps + the relocate step + both check steps) executed against
a fresh rebuild at both build-scope and deploy-scope, and both R10 outputs
(exploratory RCA runs
2026.198.1857/2026.198.2030+ the final proving run2026.198.2109) are pasted above / in the CHANGELOG entry.Harness rulebook compliance
/charly-image:layer(candy authoring) +/charly-internals:git-workflow(branch/commit/PR mechanics) loaded before any edit.version:mandate finding is fixed by the appended bump commit on this branch.getent passwd 1000user-resolution pattern reuses the SAME idiom already used bycontainer-nesting/virtualizationcandies in this repo, rather than inventing a new one.package.jsondeleted;git grepfor the removed npm-global claude path returns only (a) this candy's own description explaining WHY it changed, (b) an unrelated openclaw-full sentence about OTHER (still-npm) binaries, and (c) the out-of-scopebox/cachyosbed pinned to an old remote tag (self-resolves viacharly box reconcileonce this candy is tagged — a separate, standard cross-repo landing step, not a stale reference in the changed surface). Round 2: the mandated grep now also extends into thepluginssubmodule — the staleclaude-code/nodejs/kimi/forgecode/hermes/openclaw-desktopskill claims it surfaces are swept in docs(claude-code): sync skill with the native-installer candy marketplace#93 (same cutover family, owning repo).charly check run <bed>end-to-end gate run (not justgo test/validate).task build:binaryrebuilt from this source;charly version=2026.198.1029confirmed; no new runtime OS dependency introduced (curl was already declared).check-charly-selftest-pod,disposable: true; fresh rebuild; the candy's owncheck:steps are the coverage that would FAIL without this fix (and did, in the exploratory RCA runs).description:+plan:with ≥1 deterministiccheck:present;charly box validatepasses. SDD — N/A, no schema/.cuechange.charly/sdkcore change, candy-only.Salvage update (validator round 2)
Round-1 fresh validator: CHANGES REQUESTED (head
ec92e60, verdict comment on this PR) with two blocking findings, both resolved:pluginsskill claims (R5/R2) → fixed by docs(claude-code): sync skill with the native-installer candy marketplace#93 (coder/skills/claude-code+nodejs/kimi/forgecode/hermes/openclaw-desktopsibling sweep; its own fresh-validator loop).version:mandate → appended commit bumpsversion:oncandy/hermes-full/charly.yml(2026.156.1921→2026.200.1600) andcandy/openclaw-full/charly.yml(2026.144.1443→2026.200.1600);charly box validateexit 0 on the new head.The validator's bed evidence (
check-openclaw-full-podserial PASS 12/12 @2026.200.1546; selftest baseline with only the 2 known F-CLI-NEST failures) carries over as the runtime baseline for the round-2 delta re-gate: the appended commit touches onlyversion:metadata (no plan/check/runtime content).disposable: truecheck-charly-selftest-pod bed.CHANGELOG/2026.198.2154.mdstaged (placeholder CalVer).Salvage update (2026-07-19, Kimi Code)
main(09be0a4, feat(pkg): install-test matrix for native packages — 7 distro cells, one canonical harness #147) viagh pr update-branch(merge, no force).charly check run check-openclaw-full-podFAILED 2/171 on this exact claude-code issue (plus the xurl npm-12 postinstall issue) on run2026.200.1231; the assembled gate tree (main+ this PR + the xurl companion fix, nowopencharly/charly#148) reran it green: 12/12 steps, ok:true, 604s, run-calver2026.200.1317— bothclaude --versionchecks PASS at check-image AND check-live (/usr/local/bin/claude, surviving the home-volume mount exactly as RCA docs: bump plugins → pr-validator always comments on the PR #2 designed). The two candy install fixes gate together because the bed's plan requires both; this PR lands first, fix(candy): xurl — run the postinstall npm 12 blocks #148 immediately after.Assisted-by: Claude Code Anthropic Claude Sonnet 5 (fully tested and validated)