Skip to content

fix(distribution): harden the cold user path#7

Merged
random1st merged 1 commit into
mainfrom
voroninr/ran-495-user-path
Jun 11, 2026
Merged

fix(distribution): harden the cold user path#7
random1st merged 1 commit into
mainfrom
voroninr/ran-495-user-path

Conversation

@random1st

Copy link
Copy Markdown
Contributor

Summary

End-to-end cold-install audit (fresh public clone, isolated HOME, full user journey probed empirically): install → init (MCP + hook) → spec lifecycle → ci init/ci exec — all green after these fixes.

Fixed

  1. install.sh stale-prebuilt trap — preferred the tracked prebuilt over building from the checkout (same bug class fixed in update apply, PR chore(hygiene): Node 24 actions, --version flag, update-apply install priority #4). Now: cargo build first, prebuilt = warned fallback; rm before cp (fresh inode for macOS AMFI; existing codesign re-sign kept).
  2. Plugin install without CLI → exit 127 on every hook. All hook commands now carry an if-form command -v s5d guard: missing binary → exit 0 + one-line install hint at SessionStart; present binary → exit code passes through untouched so blocking enforcement hooks still block (verified both directions with a fake exit-2 binary; the naive && … || true form would have silently disabled enforcement).
  3. Manifest version drift — all three distribution manifests claimed 0.3.0 against the 0.11.x binary. Synced to 0.11.0-alpha.9; release agent now lists the four version touchpoints.

Audited clean

update apply: fetch + pull --ff-only before rebuild; tmp+rename install (inode-safe). Session-start update check: works with checkout, silent no-op without one.

193 tests green.

🤖 Generated with Claude Code

Findings from an end-to-end cold-install audit (fresh public clone,
isolated HOME, full lifecycle probe — install → init → spec lifecycle
→ ci init/exec all green after these fixes):

- install.sh preferred the tracked prebuilt over building from the
  checkout — the same silent-stale trap fixed in update apply (PR #4)
  lived on in the installer. Inverted: cargo build first, prebuilt is
  a warned fallback for toolchain-less hosts. rm before cp so the
  installed binary always gets a fresh inode (macOS AMFI; the codesign
  re-sign step already present stays as belt-and-suspenders).
- Plugin hooks failed with exit 127 on every session/tool-use for a
  marketplace install without the CLI binary. Every hook command is
  now guarded with an if-form "command -v s5d" check: absent binary
  means exit 0 (SessionStart prints a one-line install hint instead),
  and — deliberately if-form, not "&& ... || true" — a present
  binary's exit code passes through untouched so blocking enforcement
  hooks still block (verified both ways with a fake exit-2 binary).
- All three distribution manifests (.claude-plugin, .codex-plugin,
  gemini-extension) still claimed version 0.3.0 against an 0.11.x
  binary. Synced to 0.11.0-alpha.9 and added the four version
  touchpoints to the release agent so the next release cannot ship
  stale manifests.

update apply itself audited clean: fetch+pull --ff-only before
rebuild, tmp+rename install (inode-safe). 193 tests green.
@random1st
random1st merged commit 5f55bc6 into main Jun 11, 2026
3 checks passed
@random1st
random1st deleted the voroninr/ran-495-user-path branch June 11, 2026 11:17
random1st added a commit that referenced this pull request Jun 11, 2026
The alpha.9 release assets predate `s5d update auto`, while the
shipped hooks.json already calls it — a release-binary user with
updated skills would get a failing SessionStart hook (the same
hooks/binary desync class as the ci bootstrap paradox). Two fixes:

- SessionStart hook now degrades through a fallback chain: update
  auto → update check --hook → true. Any hooks/binary version skew
  in either direction lands on the best available behavior instead
  of a hook error.
- alpha.10 cut with all four version touchpoints synced (Cargo.toml,
  three distribution manifests) and the prebuilt rebuilt, per the
  release-agent checklist added in PR #7.
random1st added a commit that referenced this pull request Jul 1, 2026
The alpha.9 release assets predate `s5d update auto`, while the
shipped hooks.json already calls it — a release-binary user with
updated skills would get a failing SessionStart hook (the same
hooks/binary desync class as the ci bootstrap paradox). Two fixes:

- SessionStart hook now degrades through a fallback chain: update
  auto → update check --hook → true. Any hooks/binary version skew
  in either direction lands on the best available behavior instead
  of a hook error.
- alpha.10 cut with all four version touchpoints synced (Cargo.toml,
  three distribution manifests) and the prebuilt rebuilt, per the
  release-agent checklist added in PR #7.
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