Repository navigation
fix(hooks): Bash 보호경로 탐지 훅의 억제가 «이 세션 · 이 내용» 까지만 — 한 번 알린 경로가 클론 수명 내내 침묵하던 것 (#1746 K16) - #1777
Merged
Merged
Conversation
Owner
Author
🔵 SCAManager 분석 결과총점: 81/100 (등급 B) 점수 상세
정적 분석 이슈 (상위 10건)
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…내내 침묵하던 것 (#1746 K16) - 상태 = {세션, 경로 → 내용 지문}. 같은 세션·같은 내용만 조용하고, 다시 바뀌면 다시 알린다 - 매 실행 지금 더러운 경로만 남긴다 — 커밋·되돌림으로 깨끗해진 경로는 다음 변경에서 다시 알린다 - 다른 세션 · 세션 id 를 모르는 실행은 억제를 쓰지 않는다 - 깨진 입력·옛 형식·깊은 중첩 상태 파일에도 죽지 않고 «알리는» 쪽으로 간다(Grok 반례 2건 반영) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R4jYRzichV75XnYLSEFguX
xzawed
force-pushed
the
fix/k16-bash-hook-suppression
branch
from
October 28, 2026 22:40
6f6d07c to
e9f42cd
Compare
Owner
Author
🔵 SCAManager 분석 결과총점: 81/100 (등급 B) 점수 상세
정적 분석 이슈 (상위 10건)
|
|
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.



pytest tests/unit → 8631 passed / 5 skipped
무엇을 고쳤나 (#1746 K16 — 5건이 한 뿌리)
.claude/hooks/detect_protected_bash_write.py(테스트 불가 환경에서 보호 경로가 Bash 로 바뀌면 «알리는» PostToolUse 훅)의 억제 상태.git/protected-bash-write-reported가 알린 경로를 클론 수명 내내 쌓기만 했다 — 그 경로가 커밋·되돌림 뒤 다시 바뀌어도, 다른 세션에서 바뀌어도 다시는 알리지 않았다(P1-17 · P2-18 · P2-29 · P2-36 · P2-48).{"session": id, "reported": {경로: 내용 지문}}absent)RecursionError로 훅이 죽음판정·환경 조건(
can_run_tests())·보호 경로 정의(check_edit_allowed공유)·메시지 문구는 그대로다.증거
tests/unit/hooks/test_detect_protected_bash_write.py): 훅만 옛 판으로 되돌리면 이 파일 8 failed / 24 passed, 새 훅 32 passed ·tests/unit/hooks전체 292 passed.raising=False로 심었다(예: «같은 경로가 Bash 로 «다시» 바뀌었는데 침묵한다»).pre_push_gate.py: 16 OK · 1 FAIL 은 작업트리에node_modules가 없어서였고npm ci뒤check_lint_js_nonvacuous.py단독 재실행 통과.Grok claim-review
7a6afbaa 의 경과(같은 세션 3라운드):
RecursionError(ValueError 아님)라 안 잡힌다 · ④ 숫자session_id: 1이 저장된"1"과 같은 세션으로 합쳐진다 → 둘 다 코드로 고침(RecursionError포착 · 문자열 id 만 세션).""로 접혀 «id 없던 기록» 과 합쳐진다 → 코드로 고침(id 를 모르면 억제를 읽지도 쓰지도 않는다).can_run_tests()거짓» 전제를 빠뜨린 것(검증 가능한 환경에선 의도대로 침묵 —test_verifiable_environment_stays_silent가 지키는 설계). 그 아래 경로는 Grok 이 «다른 문자열 id 면seen == {}라 모든 더러운 경로를 알리고, id 를 모르면 읽기·기록을 건너뛰고 알린다» 로 확인했다. 문구 정밀도만 남아 여기서 멈췄다 — 최종 문구로 재판정은 받지 않았다(그래서 WEAKENED 로 적는다).실제로는 Claude Code 가 늘 UUID 문자열
session_id를 보내고 상태 파일은 훅 자신만 쓰므로(깊이 2) 1·2차 반례는 운영에서 생기지 않는다. 그래도 «모르면 알리는 쪽» 이 이 훅의 원칙이라 코드로 닫았다.사람이 볼 것
can_run_tests()거짓)에서만 말한다 — 이 PC·Codespaces 에서는 동작이 바뀐 것을 체감할 수 없다. 클라우드 세션에서 보호 경로(alembic/versions/·src/templates/*.html등)를 Bash 로 두 번 고쳐 두 번 다 알림이 뜨는지가 실사용 확인이다.스스로 판단한 것
.git이 파일이라 상태를 못 남겨 매번 알린다 — 종전과 같은 동작이고 «조용해지는 것보다 낫다» 주석대로라 이 PR 범위 밖으로 둔다.🤖 Generated with Claude Code
https://claude.ai/code/session_01R4jYRzichV75XnYLSEFguX