fix(atelier): fire version-drift hook on all atelier sessions#799
Merged
Conversation
SessionStart 버전 드리프트 알림 hook(check-cli-version.sh)이 두 겹 게이트로 autopilot 프로젝트에서만 작동해, 정작 드리프트가 잦은 plugin-dev/git-only 환경에서 침묵했다. - check-cli-version.sh: 런타임 autopilot 게이트(github-autopilot.local.md 체크) 제거 + atelier 미설치 시 무음 exit 0 (미사용 환경 노이즈 방지). 설치 && installed < plugin 일 때만 1줄 안내. - setup.md: 등록을 Step 2b(autopilot 모듈)에서 Step 0b(공통)로 이동. 버전 드리프트는 autopilot 전용이 아니라 CLI 라이프사이클 관심사 (Step 0 ensure-binary 와 한 쌍: setup 시점 보장 vs 이후 드리프트 알림). 미설치/최신/상위 무음, 과거 버전만 경고 — 3개 상태 수동 검증. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…tup-registered
check-cli-version SessionStart hook 을 setup 시점 settings.json 등록 대신
플러그인이 hooks/hooks.json 으로 직접 선언하도록 전환.
- hooks/hooks.json: SessionStart "*" → check-cli-version.sh 선언.
플러그인 활성화 시 자동 적용, ${CLAUDE_PLUGIN_ROOT} 가 활성 버전 경로로
해석되어 frozen-path 문제 원천 차단.
- setup.md: 직전 커밋의 Step 0b(공통 등록) 제거 — 더 이상 setup 이 이 hook 을
등록하지 않음. Step 0 ensure-binary 와의 관계만 주석으로 남김.
guard-pr-base/protect-stagnation 은 autopilot 고유(opt-in)라 setup 등록 유지.
NOTE: 기존 setup 으로 settings.json 에 frozen 경로 등록된 사용자는
plugin-declared hook 과 command 문자열이 달라 dedup 되지 않아 둘 다 실행됨.
레거시 SessionStart 항목 제거는 별도 마이그레이션.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
/simplify 4-angle 리뷰 후속: - check-cli-version.sh: command -v atelier 검사를 최상단으로 이동(효율). hook 이 모든 세션에서 실행되므로 미설치 환경(다수)에서 plugin.json grep|head|sed 파이프라인·stdin 처리 전에 builtin 검사로 즉시 종료. - setup.md Step 2b: 제거된 "Step 0b" 를 가리키던 dangling 참조 수정 → plugin-declared(hooks.json) 안내로 교정. - setup.md Step 3: frozen 마이그레이션 표에서 check-cli-version 을 "제거만(재등록 안 함)" 으로 변경. plugin-declared 로 대체됐는데 settings.json 으로 재등록하면 SessionStart 이중 실행되던 모순 제거. - tool-layer-boundary.md: hook 등록의 제3형식(plugin-declared hooks.json)을 규칙에 명시 — 기존 "shim OR hook register" 이분법에서 hooks.json 이 위반으로 오독되던 갭 보완. Simplify findings (skipped): - compare_semver 가 ensure-binary.sh 와 중복 — pre-existing 부트스트랩 shim (바이너리 부재 시 동작해야 해 CLI 위임 불가, 공유 sourcing 컨벤션 없음). 이 PR 이 만들거나 악화시키지 않았고 dedup 은 범위 밖. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
hooks.json 의 SessionStart command 를 escaped-quote 형태에서 bare 형태로 통일.
이전: "\"${CLAUDE_PLUGIN_ROOT}\"/hooks/check-cli-version.sh"
이후: "${CLAUDE_PLUGIN_ROOT}/hooks/check-cli-version.sh"
둘 다 shell form 으로 동작하지만(args 없음 → sh -c 해석), repo 전역이
bare 형태를 사용하고 tool-layer-boundary.md 규칙 line 49 의 이 스크립트
예시도 bare 라 일관성을 맞춤. plugin cache 경로는 공백이 없어 quote 불필요.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
왜
atelier --version(설치 바이너리)이 플러그인 버전과 별개로 뒤처질 수 있어요. 이미 SessionStart 알림 hook(check-cli-version.sh)이 있었지만 두 겹 게이트 때문에 autopilot 프로젝트에서만 작동했어요:github-autopilot.local.md없으면 즉시 skip그래서 정작 버전 드리프트가 가장 잦은 plugin-dev repo / git-only 사용자가 사각지대였어요. (이 repo 에서 설치본이 0.4.3 인데 플러그인은 0.5.3 이어도 아무 안내가 없던 게 그 증상)
무엇을
버전 드리프트 알림을 atelier 를 쓰는 모든 세션으로 넓히고, 등록 방식을 setup 시점 → 플러그인 직접 선언으로 바꿨어요. 이건 autopilot 관심사가 아니라 CLI 라이프사이클 관심사예요 — Step 0(
ensure-binary)이 setup 시점을 보장하면, 이 hook 은 그 이후 드리프트를 알리는 한 쌍이에요.어떻게
hooks/hooks.json(신규):SessionStart "*"→check-cli-version.sh를 플러그인이 직접 선언. 플러그인 활성화 시 자동 적용되고,\${CLAUDE_PLUGIN_ROOT}가 활성 플러그인 버전 경로로 해석돼 frozen-path 문제를 원천 차단해요. setup 등록이 필요 없어요.hooks/check-cli-version.sh: 런타임 autopilot 게이트 제거. atelier 미설치면 무음exit 0(미사용 환경 노이즈 방지).installed < plugin일 때만 1줄 안내. (SessionStart stdout 은 세션 컨텍스트로 노출됨)commands/setup.md: check-cli-version 의 setup 등록을 제거.guard-pr-base·protect-stagnation은 autopilot 고유(opt-in)라 Step 2b 에 그대로.확인 방법
3개 상태 수동 검증 (
check-cli-version.sh):make validate-ci→ 0 failed (21 invariants present),hooks.json유효 JSON별도 처리 (이 PR 범위 밖)
기존 setup 으로
~/.claude/settings.json에.shhook 4종이.../atelier/0.4.3/...frozen 경로로 등록된 사용자는, plugin-declared hook 과 command 문자열이 달라 dedup 되지 않아 둘 다 실행돼요. 레거시 SessionStart 항목 제거(및 frozen guard hook 들 갱신)는 setup 마이그레이션/환경 정리건으로 분리했어요.🤖 Generated with Claude Code