chore: commit-msg 훅을 PIKI-Infra 정본에서 원격 배선#1
Conversation
커밋 타입 형식을 강제하는 commit-msg 훅이 이 repo 엔 없었다. 훅 정본은 PIKI-Infra(hooks/commit-msg)가 SSOT 로 소유하고, 이 repo 는 복사본을 체크인하지 않는다. - SessionStart 가 gh api 로 정본을 받아 git-common-dir/hooks 에 설치 (worktree 에서도 동작) - fetch 실패 시 기존 설치본 유지 (오프라인·권한 없음 안전, exit 0) - 검증: 배선 명령 실행 후 설치본이 정본과 바이트 동일, 형식 위반 커밋 거부(exit 1)·규약 커밋 통과 실측
📝 WalkthroughWalkthroughAdds a new ChangesSession Hook Configuration
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.claude/settings.json (1)
8-8: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winPin the hook fetch to a ref and add integrity checks.
.claude/settings.json:8pullshooks/commit-msgfromPIKI-Infra's default branch, so each session can install whatever is currently there.gh apisupportsref=, so pin this to a tag or commit SHA and consider a checksum/signature check before installing.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.claude/settings.json at line 8, The hook install command in the settings entry is fetching hooks/commit-msg from the repository default branch, which makes the installed hook mutable. Update the command in .claude/settings.json to use gh api with a fixed ref (tag or commit SHA) when downloading the hook, and add an integrity check such as verifying a checksum or signature before calling install. Keep the change localized to the settings command string so the hook source is pinned and validated before use.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.claude/settings.json:
- Line 8: The hook install command in the settings entry is fetching
hooks/commit-msg from the repository default branch, which makes the installed
hook mutable. Update the command in .claude/settings.json to use gh api with a
fixed ref (tag or commit SHA) when downloading the hook, and add an integrity
check such as verifying a checksum or signature before calling install. Keep the
change localized to the settings command string so the hook source is pinned and
validated before use.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: eedc9d31-1e13-47f5-b7ba-2f5f5443d0ce
📒 Files selected for processing (1)
.claude/settings.json
- 직전 배선은 자산 경로·설치 로직이 SessionStart 명령에 문장째 박혀, 자산이 늘면 소비 repo 전부를 다시 고쳐야 했다 - 부트스트랩은 'PIKI-Infra install.sh 를 받아 실행' 한 줄로 축소. 이 repo 에 남는 상수는 repo 좌표 1개 - 검증 실측: 설치본 제거 후 부트스트랩 실행으로 원격 정본 설치(바이트 동일), 형식 위반 커밋 거부 회귀 확인
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/settings.json:
- Line 8: The SessionStart command currently pulls and executes the remote
install script from the default branch, which is mutable. Update the command in
settings.json to reference an immutable ref for
repos/TeamPiKi/PIKI-Infra/contents/install.sh using gh api, and ideally add
checksum verification before piping to bash so the install path is pinned and
reproducible.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 72e5fb5b-6a76-435b-ba06-ffa62b765634
📒 Files selected for processing (1)
.claude/settings.json
- CodeRabbit 가용성 지적 수용분: install.sh 를 파이프로 바로 실행하면 문법 깨진 정본이 부분 실행될 수 있음. tmp 로 받아 bash -n 통과 시에만 실행 (실패 시 조용히 스킵, exit 0) - SHA pin·체크섬 제안은 기각 (배선의 존재 이유인 무전파 갱신 파괴 + 동일 신뢰 도메인) - 사유는 PR thread reply 에
Situation
커밋 타입 형식(
{type}: 제목)을 강제하는 commit-msg 훅이 PIKI-Server 에만 체크인돼 있고, 이 repo 엔 없었다. 훅을 repo 마다 복제하면 정본과 어긋나는(drift) 순간 규약이 갈라진다.Task
훅 정본을 PIKI-Infra(
hooks/commit-msg)가 SSOT 로 소유하고, 이 repo 는 복사본을 체크인하지 않은 채 배선만 갖는다.Action
.claude/settings.json신설: SessionStart 가 PIKI-Infra 의install.sh(정본 설치기)를 원격 fetch 해 실행하는 한 줄 부트스트랩TeamPiKi/PIKI-Infra) 1개$(git rev-parse --git-common-dir)/hooks에 설치해 worktree(.git이 파일인 경우)에서도 동작bash -n문법 검증 실패 시 실행·설치를 스킵하고 기존 설치본 유지, exit 0 (문법 가드는 CodeRabbit 가용성 지적 수용)Result
Summary by CodeRabbit