Skip to content
This repository was archived by the owner on Jul 24, 2026. It is now read-only.

launch: discover smalltalk hooks in a packaged layout (<pkg>/lib/smalltalk) - #86

Draft
schickling-assistant wants to merge 1 commit into
mainfrom
schickling-assistant/2026-07-20-bold-kapor-31
Draft

launch: discover smalltalk hooks in a packaged layout (<pkg>/lib/smalltalk)#86
schickling-assistant wants to merge 1 commit into
mainfrom
schickling-assistant/2026-07-20-bold-kapor-31

Conversation

@schickling-assistant

@schickling-assistant schickling-assistant commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

The bug

discoverSmalltalkDir derives a candidate from the st binary as <smalltalk>/bin/st → grandparent (launch.ts:62). That holds for a git checkout. But a packaged install puts st at <pkg>/bin/st while the repo lives at <pkg>/lib/smalltalk:

convoy checks:  <pkg>/examples/claude-code/hooks/session-start.sh        MISSING
actually at:    <pkg>/lib/smalltalk/examples/claude-code/hooks/...       EXISTS

The grandparent lands on <pkg>, one level above the hooks, so hasHooks misses. The hooks ship in the package — they're just undiscoverable.

Why it matters

On a Nix box with a correct install and nothing misconfigured, this surfaces as a blocking doctor failure:

✗ smalltalk hooks NOT found — set SMALLTALK_DIR or put `st` on PATH
✗ 1 blocking issue

That reads as "convoy is broken" on a working setup. The only workaround is exporting SMALLTALK_DIR, which a new adopter has no way to guess. It also defeats the friendly-first-command UX from #63 — the blocking check keeps even doctor --quick at rc=1 on a fresh machine.

I hit this adopting convoy: every green result depended on an env var set by hand.

The fix

Try each candidate both as the repo root and as <candidate>/lib/smalltalk. Additive — discovery already tolerates four layouts (SMALLTALK_DIR, ST_BIN, st on PATH, sibling checkout); this is a fifth real one. The root is still checked first, so a checkout keeps winning.

Verification

Against the real package with SMALLTALK_DIR unset:

discovered: /nix/store/qcr867...-smalltalk-0.3.0/lib/smalltalk

Two tests added: hooks found under <pkg>/lib/smalltalk, and the candidate root still preferred when both carry hooks. npm test -- launch.test.ts → 28 passed.

One pre-existing failure at launch.test.ts:543 is unrelated — it's a sandbox git-identity guard on my machine (git config user.email t@t), not this change.

🤖 Generated with Claude Code

Posted on behalf of @schickling
field value
agent_name 🔭 cl2-reach
agent_session_id 7a700216-dccd-4fa8-b12b-9c713ee61e93
agent_tool Claude Code
agent_tool_version 2.1.215
agent_runtime Claude Code 2.1.215
agent_model claude-opus-4-8
runtime_profile /nix/store/0f9xcsqcqq0gaa3pz4pqhlicckigyhmh-coding-agent-runtime-profile/share/coding-agents/profile.json
skills_manifest /nix/store/isfy3lpiqjmxz4r0gwxw38nk2s9469hz-agent-skills-corpus/share/agent-skills/manifest.json
worktree convoy/schickling-assistant/2026-07-20-bold-kapor-31
machine dev3
tooling_profile dotfiles@b831303

…ltalk)

`discoverSmalltalkDir` derives a candidate from the `st` binary as
`<smalltalk>/bin/st` -> grandparent. That holds for a git checkout, but a
PACKAGED install puts `st` at `<pkg>/bin/st` while the repo itself lives at
`<pkg>/lib/smalltalk`. The grandparent is then `<pkg>` — one level ABOVE
`examples/claude-code/hooks`, so `hasHooks` misses.

The hooks ship in the package; they are just undiscoverable. On a Nix box
with a correct install and nothing misconfigured, that surfaces as a
BLOCKING doctor failure:

    ✗ smalltalk hooks NOT found — set SMALLTALK_DIR or put `st` on PATH
    ✗ 1 blocking issue

which reads as "convoy is broken" on a working setup, and is only worked
around by exporting SMALLTALK_DIR — something a new adopter has no way to
guess. It also fails the pre-init friendly-first-command UX, since the
blocking check keeps `doctor --quick` at rc=1.

Try each candidate BOTH as the repo root and as `<candidate>/lib/smalltalk`.
Additive: discovery already tolerates four layouts, this is a fifth real
one, and the root is still checked first so a checkout keeps winning.

Verified against the real package with SMALLTALK_DIR unset:

    discovered: /nix/store/...-smalltalk-0.3.0/lib/smalltalk

Tests: two cases — hooks found under `<pkg>/lib/smalltalk`, and the root
still preferred when both carry hooks.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GFGkKcB3iojR4TtFaCgPDF
agent-session-id: 7a700216-dccd-4fa8-b12b-9c713ee61e93
agent-tool: Claude Code
agent-tool-version: 2.1.215
agent-model: claude-opus-4-8
agent-runtime-profile: /nix/store/0f9xcsqcqq0gaa3pz4pqhlicckigyhmh-coding-agent-runtime-profile/share/coding-agents/profile.json
agent-skills-manifest: /nix/store/isfy3lpiqjmxz4r0gwxw38nk2s9469hz-agent-skills-corpus/share/agent-skills/manifest.json
tooling-profile: dotfiles@b831303
@schickling
schickling requested a review from myobie July 20, 2026 19:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant