potiuk opened a new pull request, #200: URL: https://github.com/apache/airflow-steward/pull/200
## Summary The `post-checkout` hook templates shipped in #184 (per-repo, installed by `/setup-steward adopt`) and #199 (global, installed under whole-user scope) both contained the line: ```bash /setup-steward verify --auto-fix-symlinks || true ``` `/setup-steward verify` is a **Claude Code slash command**, not a shell command. The hook fires in the operator's shell (when `git checkout` / `git worktree add` runs), where there is no slash-command dispatcher. The shell tries to execute the literal path `/setup-steward`, fails with `/setup-steward: No such file or directory`, and `|| true` swallows the exit code — but the stderr line still prints on every `git checkout`. Bug reported during real-world use: ``` $ git checkout main Your branch is up to date with 'origin/airflow-s'. /Users/jarekpotiuk/code/airflow-s/.git/hooks/post-checkout: line 11: /setup-steward: No such file or directory ``` The global hook in #199 had a `command -v /setup-steward` guard so it was silent. The per-repo template did not. ## Fix Drop the steward-verify chunk from both templates entirely. Symlink-drift reconciliation cannot be done from a shell hook (the operation needs a Claude Code session); it now happens **lazily** — the next time the operator opens Claude Code in the worktree, the framework skills' pre-flight drift check surfaces missing symlinks and `/setup-steward verify` (or any skill that needs the symlink) prompts for the fix. This is consistent with how every other framework-state check already works. ### What landed - **`adopt.md` Step 10** — hook template rewritten without the `/setup-steward verify --auto-fix-symlinks` line. Comment header now describes the hook's single responsibility (chain into `sandbox-add-project-root.sh`). Added a "Why no symlink reconciliation here" note explaining the slash-command-from-shell issue and the lazy-reconciliation alternative; instructs adopters with the old broken line in their installed hook to replace it (or rely on `setup-isolated-setup-update`'s drift sweep). - **`tools/agent-isolation/git-global-post-checkout.sh`** — same drop. The previous `command -v /setup-steward` guard masked the bug but encoded a wrong design. Updated header comment to explain why the apache-steward reconciliation chunk is intentionally absent. - **`unadopt.md`** — two stale references updated: the inventory table row and the removal-procedure description for the post-checkout hook both now describe the current (post-fix) hook content. The removal procedure also calls out the obsolete-line case explicitly so unadopt against a stale hook still does the right thing. ## Test plan - [ ] On an adopter repo with the broken hook in place: copy the new Step-10 template into `.git/hooks/post-checkout`, run `git checkout <branch>`, confirm no `No such file or directory` error fires. - [ ] Run `/setup-steward adopt` on a fresh adopter repo, inspect the installed `.git/hooks/post-checkout`, confirm it matches the new template (no `/setup-steward` slash command line). - [ ] Run `/setup-isolated-setup-install` in whole-user mode, inspect `~/.claude/git-hooks/post-checkout`, confirm the same. - [ ] Open Claude Code in a steward-adopted worktree whose symlinks are dangling (simulate via `rm .claude/skills/security-issue-sync`); confirm `/setup-steward verify` detects + offers to fix the drift on the next invocation. - [ ] Run `/setup-steward unadopt` against a repo with the OLD broken hook line; confirm the procedure handles it (per the updated unadopt.md description) rather than failing to match the verbatim template. Generated-by: Claude Code (Opus 4.7) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
