Repository navigation
fix(hooks): offer the code extension when git-kb code is not installed - #18
Conversation
git-kb code moved out of core into the git-kb-code extension, which git-kb runs from PATH. SessionStart now checks for git-kb-code before recommending git-kb code commands or git-kb code doctor, and offers installation when only core is installed.
|
No actionable comments were generated in the recent review. WalkthroughThe session-start script now selects code-intelligence guidance based on GitKB setup state and whether ChangesSession-start guidance
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Possibly related PRs
Suggested reviewers: Merge Risk:
|
git-kb before 1.0.0 has git-kb code built in, with no git-kb-code program, so looking for git-kb-code on PATH reported current releases as lacking code intelligence. Run git-kb code --help instead, which answers for both, and drop the claim that Homebrew installs the extension.
gitkb/gitkb-core#1701 moved
git-kb codeinto thegit-kb-codeextension, which core runs only when it is onPATH(crates/gitkb-cli/src/plugin.rs). Before this change, SessionStart recommendedgit-kb code …whenever coregit-kbwas installed, and on a 1.0 core-only install those commands fail.The hook now runs
git-kb code --help. It is accurate for both kinds of install: before 1.0.0 (the current public release, 0.2.19)codeis built in, and from 1.0.0 it is the extension. Looking forgit-kb-codeonPATHwould wrongly report "missing" for every 0.2.x user.git-kb codeworks: same guidance as before. A full KB getsgit-kb doctor --check repos,kb --jsonandgit-kb code doctor --json.git-kb codecommands. The hook says code intelligence needs the extension and to use raw search for now. It offerscurl -fsSL https://get.gitkb.com/install.sh | bash(installs the extensions from 1.0.0) or the release'sgitkb-code-<platform>.tar.gz. It does not offer Homebrew, because that formula installsgit-kbalone. A full KB still getsgit-kb doctor --check repos,kb --json.The replacement of
git-kb doctor --check repos,code,kbwas already merged in #16.Tests: the shared setup puts a stub
git-kb-codeonPATH. The two new cases (plain repo, full KB) wrapgit-kbso thatgit-kb codefails. Both work with CI's 0.2.19 and with post-split core.Checks (devbox):
make release-checkpasses, including all 14 bats tests, shellcheck 0.10.0 andclaude plugin validate; its warnings (missing icon, README install line) were already there. All 14 bats tests also pass against a post-split core build (a837694fd), and theregit-kb code --helpexits 2 when the extension is missing. Mutation check: making the probe always succeed fails exactly the two new tests.Review
Changes from the review panel (opus, sol, astra), in commit 85e27eb:
git-kbis missing, the hook no longer tells the user to rungit-kb code doctor/git-kb code indexunconditionally. It says to checkgit-kb code --helpafter installing, and to use grep and file reads if that fails.tests/session-start.batsrequires both halves.plugin/skills/gitkb/SKILL.mdadds the same probe to First Checks (… && echo code-available || echo code-missing). Oncode-missingthe agent runs nogit-kb codecommands, uses grep and file reads, and offers the extension. The code sections are now explicitly "whengit-kb codeis available".git-kb-code mcpserves a plain Git repo (git-kb-code/src/main.rsCodeCommands::Mcp→context::find_code_root, which acceptsGitOnly), andgit-kb code init clauderegisters it. The README now separates "this plugin registers no MCP server" from "coregit-kb mcpneeds a full KB". The hook and the skill no longer say "MCP is supported after full KB setup today".git-kb-codesucceeds only for exactly--help; the core-only wrapper and the "git unavailable" stub match onlycode --help. Mutation: probe changed togit-kb code --hlep→ tests 1, 4, 5, 10 fail on both the devbox's pre-split core and a post-split core. With the old doubles on post-split core, those four passed.git-kb code --helpfailed" rather than "not installed". The install script is described as adding the extensions only with GitKB 1.0.0 and later. The full-KB sentence no longer reads "… or X, and Y".Checks (devbox):
make release-checkpasses, including 14/14 bats, shellcheck 0.10.0 andclaude plugin validate(same pre-existing warnings). 14/14 bats also pass with post-split core first onPATH.