Skip to content

fix(candy): xurl — run the postinstall npm 12 blocks - #148

Merged
atrawog merged 4 commits into
mainfrom
fix/candy-xurl-postinstall
Jul 19, 2026
Merged

atrawog merged 4 commits into
mainfrom
fix/candy-xurl-postinstall

Conversation

@atrawog

@atrawog atrawog commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

candy/xurl's npm-installed CLI broke on npm ≥12: the builder image carries npm 12.0.1, which blocks package install scripts unless explicitly allowed, and @xdevplatform/xurl's postinstall (install.js) is what downloads the real platform binary. The global install completed, but xurl --help failed xurl binary not found — surfaced as 2/171 failures on check-openclaw-full-pod and 2/355 on check-openclaw-desktop-pod (first-ever runs of those beds).

Concrete edits (candy/xurl/charly.yml only):

  • new build-time run: step executes the package's own download script explicitly after the npm install: node "${HOME}/.npm-global/lib/node_modules/@xdevplatform/xurl/install.js" — one audited script, no global allow-scripts policy change, no suppression;
  • description updated to document the npm ≥12 behavior and why the step exists;
  • candy version: bumped 2026.144.1443 → 2026.200.1305;
  • CHANGELOG/2026.200.1305.md placeholder, incl. the sibling note (gemini's optional postinstalls still pass; the shared builder-template policy for the class belongs to the named bed-image-hygiene batch).

Change class

candy/box-config (single candy install path).

How R10-tested — exact gate, commands, and pasted output

  • The gate for this change class: charly box validate + the bed that composes xurl: charly check run check-openclaw-full-pod.
  • Eval beds run: check-openclaw-full-pod | pod (cachyos) | ok | 12 steps | 604s — run-calver 2026.200.1317, on the assembled gate tree (main + this fix + the claude-code native-installer fix from fix(candy): claude-code npm → official native installer #143 — the two candy install fixes gate together because the bed's plan requires both; fix(candy): claude-code npm → official native installer #143 lands first, this PR immediately after, each re-gated on the evolving main by the fresh validator).
  • Fresh rebuild: full R10 sequence incl. fresh charly update; image rebuilt from the assembled tree.
  • Did the CHANGED code path execute live? Yes — the new run: step executed at build time and both xurl checks PASS at check-image AND check-live (pasted). Also spike-proven in isolation on npm 12.0.1 (the builder's exact version): plain install reproduces the bed's byte-identical failure; node .../install.js then fetches the binary and xurl --help succeeds.
  • Concurrency: N/A — single-candy install step. (The gate bed ran concurrently with unrelated work; per-run isolation.)
$ podman run --rm node:22-alpine sh -c 'npm i -g npm@12 …; npm i -g @xdevplatform/[email protected]; xurl --help'
npm warn install-scripts 1 package had install scripts blocked because they are not covered by allowScripts
xurl binary not found. Try reinstalling: npm install -g @xdevplatform/xurl        ← the bed failure, reproduced
$ node /usr/local/lib/node_modules/@xdevplatform/xurl/install.js && xurl --help
Downloading xurl v1.2.3 for Linux/x86_64...
xurl v1.2.3 installed to …/binary/xurl
A command-line tool for making authenticated requests to the X API.               ← the fix, proven

$ ./bin/charly box validate            # exit 0
$ grep -h 'xurl CLI' .check/check-openclaw-full-pod/2026.200.1317/check-{image,live}.log
  PASS  check the xurl CLI is installed in the npm global bin  […xurl:1]  ok
  PASS  check the xurl CLI runs and prints its usage           […xurl:2]  exit=0   (both scopes)
$ tail -2 .check/check-openclaw-full-pod/2026.200.1317/summary.yml
total_seconds: 604
ok: true

Residual raw warnings in the bed's image-build log are the cachyos base-image class (pacman local is newer than repo notices from the freshly repinned base, ldconfig network-isolation notice in rootless buildah, reinstall notices) — emissions of base-image content, RCA'd in the same class as pkg-arch#5's documented set; the named bed-image-hygiene batch owns them.

Attribution tier

analysed on a live system at push (spike + validate + assembled-gate ran live); the attached fresh-rebuild roster earns fully tested and validated for the squash.

Harness rulebook compliance

  • R0 skills: check, image:layer, git-workflow loaded before edits.
  • R1 RCA + zero warnings: bed failures RCA'd to npm 12's allowScripts policy (spike-reproduced byte-identically), root-fixed; no "transient" hand-wave.
  • R2 no out-of-scope: the sibling npm-postinstall class documented; the template-level policy deferred to the NAMED bed-image-hygiene batch (immediate next).
  • R3 no duplication: the package's OWN download script is reused, not reimplemented.
  • R4 no workaround: explicit execution of one audited script — no suppression, retry, or env shim.
  • R5 hard cutover + grep: no stale path; the check expectations unchanged (they now pass).
  • R6 git safety: clean branch off origin/main; status/show --stat verified.
  • R7 runtime gate: composing bed end-to-end, not just validate.
  • R8 artifact invariants: the baked plan carries the new run step; the bed asserts the result.
  • R9 binary == source + deps: N/A to the charly binary; no host runtime dep added.
  • R10 disposable + coverage: bed is disposable: true, fresh rebuild; the xurl checks fail without this fix (they did).
  • RDD / ADE / SDD: RDD — the npm-12 mechanism was spike-proven before authoring the step. ADE — description + deterministic checks; validate exit 0. SDD — N/A.
  • Hard cutover: one squash commit; no TODO.
  • Kernel/plugin boundary law: N/A (candy config).
  • Disposable-only autonomy: all targets disposable.
  • Clean architecture + Go gates: N/A (no Go).
  • CHANGELOG: CHANGELOG/2026.200.1305.md placeholder staged.

Assisted-by: Kimi Code Moonshot Kimi K3 (analysed on a live system)

npm >=12 (the builder image carries 12.0.1) blocks install scripts unless
explicitly allowed; @xdevplatform/xurl's postinstall fetches the real
platform binary, so xurl --help failed 'xurl binary not found' on the
check-openclaw-full-pod / check-openclaw-desktop-pod beds. Run the
package's own download script explicitly in the plan — one audited script,
no global allow-scripts policy change. Proven live on npm 12.0.1:
install.js fetches the binary and xurl --help succeeds.

Assisted-by: Kimi Code Moonshot Kimi K3 (analysed on a live system)
@atrawog

atrawog commented Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Bound identities (verified read-only, live):

  • PR head (remote git ls-remote origin refs/heads/fix/candy-xurl-postinstall): 0d662d9d7887ef905d06dd1efdb8f660d3bdbfcb
  • Protected base at validation time: origin/main = f01e9dd2abeb3ec16ae9f3f10b41ab9ab2c90ccb (advanced e38ce38 → fc40cc5 feat: configure Reasonix for OpenCharly #150 → f01e9dd fix: remove hardcoded system paths from reasonix.toml #151 during validation; both harness-config-only merges, zero overlap with this diff — see Cross-PR)
  • Policy/skills loaded from protected main objects: AGENTS.md, plugins/internals/agents/pr-validator.md, skills git-workflow, check, layer, strict-policy, validate, xurl

Change class: candy/box-config (single candy install path — candy/xurl/charly.yml + CHANGELOG placeholder; 2 files, +28/−3)

Validator's own gate (re-derived, never inherited):

$ git ls-remote origin refs/heads/fix/candy-xurl-postinstall
0d662d9d7887ef905d06dd1efdb8f660d3bdbfcb        ← bound head (matches the envelope, unchanged through validation)

$ ./bin/charly box validate                     # exit 0, zero errors/warnings (worktree binary 2026.200.0144)

$ ./bin/charly -C box/cachyos check run check-openclaw-full-pod   # SERIAL roster — the composing bed
charly check run check-openclaw-full-pod: testing LOCAL candies (CHARLY_REPO_OVERRIDE += github.com/opencharly/charly=/home/atrawog/Atrapub/charly/codex/o/charly)
charly check run check-openclaw-full-pod: PASS (steps=12)
BED EXIT=0

$ cat box/cachyos/.check/check-openclaw-full-pod/2026.200.1654/summary.yml
steps: image-build 155s, check-image 36s, deploy-add 36s, config 4s, start 9s, bring-up-members 0s,
       check-live 32s, feature-run 31s, update 69s, feature-run-rebuild 40s, cleanup 9s, cleanup-members 0s — all ok: true
total_seconds: 422
ok: true

$ grep -h xurl .check/check-openclaw-full-pod/2026.200.1654/check-{image,live}.log
  PASS  check the xurl CLI is installed in the npm global bin   […xurl:1]  ok      (both scopes)
  PASS  check the xurl CLI runs and prints its usage            […xurl:2]  exit=0  (both scopes)

$ grep -c "FAIL\|WARN" .check/check-openclaw-full-pod/2026.200.1654/*.log
0 in every log except image-build.log:1 — that single match is prose inside the baked
ai.opencharly.description LABEL ("…they FAIL if any of the three tools is missing"), not a build warning.

The full R10 sequence ran on the final PR tree with the fix's local candy tree (CHARLY_REPO_OVERRIDE → this worktree), including the fresh-rebuild update step and cleanup; host left clean. R8 verified in MY run's emitted image: the ai.opencharly.description OCI label carries the new xurl run: step + both checks. The changed code path executed live: the image build ran the new step (node …/install.js), and both xurl checks pass at check-image AND check-live.

Checklist (every rule):

  • [PASS] 0. security & anti-tampering (T1–T4): 2-file candy/CHANGELOG diff; no secrets, no egress, no guardrail change, no supply-chain surface change — the new step executes the npm package's OWN audited install.js (same trust boundary as the package the candy already installs); no embedded directives aimed at the validator; description ↔ code match exact.
  • [PASS] 1. description complete: filled template — summary accounting for both files, change class, exact gate + pasted evidence, attribution tier, per-rule compliance with HOW answers.
  • [PASS] 2. change-class gate matches: candy/box-config → charly box validate + the composing bed. Bed-coverage check: check-openclaw-full-pod composes xurl via the openclaw-full metalayer (verified vs /charly-tools:xurl "Used In Boxes" and the bed's baked plan plan:candy:…/xurl:0..2 in-run). The bed can and did fail on this defect (author's 2026.200.1231 2/171; class matrix requires the one composing bed — run, PASS). No dry-run/rebuild-alone fraud.
  • [PASS] 3. attribution tier justified: commit b200ddd + body carry Kimi Code Moonshot Kimi K3 (analysed on a live system) — honest at push. My own fresh-rebuild roster on the final tree now earns fully tested and validated for the squash (I set the ceiling independently; the merge commit will carry the upgraded trailer).
  • [PASS] 4. R0 skills honored: check / layer / git-workflow named; the step uses the canonical command: + run_as: ${USER} form per /charly-image:layer; ADE plan-shape per /charly-check:check.
  • [PASS] 5. R1 RCA + zero warnings: the defect was RCA'd to npm ≥12's allowScripts policy with a pasted byte-identical spike reproduction on npm 12.0.1. MY run: zero warnings (the one grep hit is LABEL prose, above). The unclaimed on-disk 2026.200.1517 bed FAILURE was independently RCA'd by me: its log shows the exact nodejs:6 pnpm — ERROR Could not find the homedir signature of the documented F-EXEC-HOME anomaly (F-EXEC-HOME: podman exec HOME/user resolution breaks for charly containers created during a concurrent bed window #149, a podman-6.0.1-rootless concurrent-window defect surfaced by the fix(candy): claude-code npm → official native installer #143 validator's two-bed roster) — and that same log shows both xurl checks PASS. Not this PR's defect; F-EXEC-HOME: podman exec HOME/user resolution breaks for charly containers created during a concurrent bed window #149 tracks it.
  • [PASS] 6. R2 no out-of-scope split: sibling npm-postinstall class (gemini's optional scripts still passing) documented in the CHANGELOG; the shared builder-template policy routed to the NAMED bed-image-hygiene batch. Discriminator holds: this PR is correct and complete without the template policy.
  • [PASS] 7. R3 no duplication: reuses the package's own download script; no reimplementation (grep: no other candy references install.js).
  • [PASS] 8. R4 no workaround: explicit execution of one audited script — no suppression, retry, sleep, env shim, or global allow-scripts policy change.
  • [PASS] 9. R5 hard cutover + grep self-test: nothing removed (one additive step + docs + version bump); git grep 2026.144.1443 outside CHANGELOG shows only other candies' own per-entity versions (content-derived identity, expected); no transitional/dual-mode path.
  • [PASS] 10. R6/R8/R9: worktree status inspected before every action (pre-existing M box/arch / m pkg/arch left untouched); R8 — my run's image label carries the new plan (pasted above); R9 — worktree binary 2026.200.0144 fresh (no charly/*.go newer than bin/charly), no host runtime dep added.
  • [PASS] 11. R10: disposable: true bed (verified in box/cachyos/charly.yml), MY OWN fresh-rebuild run 2026.200.1654 PASS 12/12 on the final tree, zero warnings; check-coverage that fails without the fix — the two xurl checks failed 2/171 pre-fix and pass now.
  • [PASS] 12. RDD/ADE/SDD: RDD spike pasted (mechanism proven before authoring); ADE — non-empty description: + 2 deterministic check: steps, validate exit 0; SDD N/A (no schema-shaped change).
  • [PASS] 13. concurrency mandate + anti-cheat: the class gate is one composing bed run serially — the serial form is the spec'd gate for candy config, not an idle-pass dodge; the one concurrent-window failure (2026.200.1517) is RCA-documented as F-EXEC-HOME: podman exec HOME/user resolution breaks for charly containers created during a concurrent bed window #149, never "flake/transient"-dismissed by anyone in this chain.
  • [PASS] 14. hard cutover — one atomic change commit (+ mechanical update-branch merge); no Phase-2/TODO in the diff.
  • [PASS] 15. ARCHITECTURE GATE — placement: CORRECT (the fix lives in the candy that installs xurl; nothing belongs further out or in). Per-item trace: no charly/*.go staged — no alias/kit-import/boundary items to trace.
  • [PASS] 16. disposable-only autonomy: all verification on disposable: true beds; no non-disposable resource touched.
  • [N/A] 17. clean architecture + Go gates — no Go changes in this diff (candy YAML + CHANGELOG only).
  • [PASS] 18. CHANGELOG present: CHANGELOG/2026.200.1305.md placeholder with matching H1 (I finalize the CalVer at merge).

Comments considered: none — the PR carries zero comments.

Cross-PR interactions considered:

Decision: PASS. The diff is exactly what the body claims; the npm-≥12 mechanism is spike-proven and RCA'd; my own serial composing-bed run on the bound final tree passed 12/12 with both xurl checks green in both scopes and zero warnings; every applicable rule verified from my own re-runs. Posting charly/pr-validator=success on 0d662d9, then finalizing the merge-time CalVer.

Assisted-by: Kimi Code Moonshot Kimi K3 (fully tested and validated)

atrawog added 2 commits July 19, 2026 19:07
Assisted-by: Kimi Code Moonshot Kimi K3 (fully tested and validated)
@atrawog
atrawog merged commit fef92cd into main Jul 19, 2026
@atrawog
atrawog deleted the fix/candy-xurl-postinstall branch July 19, 2026 17:09
@atrawog

atrawog commented Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — LANDED ✅ (outcome record)

Gated actions after the PASS verdict above — every outcome ALLOWED, verbatim:

  1. gh pr update-branch 148 → ✓ branch updated (absorbed fc40cc5 feat: configure Reasonix for OpenCharly #150 + f01e9dd fix: remove hardcoded system paths from reasonix.toml #151, reasonix harness-config only — final-tree delta required no bed re-run: no candy/Go/bed-machinery content in the delta).
  2. CalVer finalized 2026.200.1707 (guarded: no v2026.200.1707 tag, no CHANGELOG/2026.200.1707.md on main): git mv CHANGELOG/2026.200.1305.md → 2026.200.1707.md + H1 rewrite, staged-content self-verify # 2026.200.1707 — fix(candy): xurl — run the postinstall npm 12 blocks byte-exact; commit 03a8fe6 (1 file, rename+edit only — pre-existing M box/arch / m pkg/arch untouched).
  3. Push → c32375d..03a8fe6 fast-forward, no force.
  4. charly/pr-validator=success re-posted on final head 03a8fe6d217df073d46182e4aa8396b6d1f289be (remote-bound via git ls-remote).
  5. gh pr merge 148 --squash --delete-branch --match-head-commit 03a8fe6… → merged as fef92cd38555ce0b965b4c0caac776d7fdece582.
  6. Merged-tree == validated-tree proof: git rev-parse origin/main^{tree} 03a8fe6^{tree} → both 8408ca95b23ab8da430c485fbc47616da79c120d. ✅
  7. Annotated tag v2026.200.1707 on fef92cd pushed; git ls-remote --tags origin v2026.200.1707 → adf0cc143d5e3c8939ec65d6f5249444d303fde3; git cat-file -t → tag; git rev-list -n1 → fef92cd38555ce0b965b4c0caac776d7fdece582. ✅ Remote feat branch deleted by the merge.

No denials, no retries, no force-push, no --admin, no hook bypass anywhere in this run.

Assisted-by: Kimi Code Moonshot Kimi K3 (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