Repository navigation
feat(hooks): enumerate all required tokens on first block - #967
Conversation
branch-name-check 거부 메시지가 정규식만 보여줘 매번 허용 <type> 값을 재추론해야 했다 (issue #941). 정규식의 마지막 alternation 그룹을 파싱해 "allowed <type> values: feat, fix, ..." 를 verbatim 으로 함께 보여준다. 커스텀 PRAXIS_BRANCH_NAME_REGEX 가 alternation 그룹 2개 미만이면 기존처럼 정규식만 표시한다 (fallback). 검증: 실제 훅을 직접 실행해 출력 문자열 확인 — 기본 정규식은 allowed <type> values 절 포함, 커스텀 단순 정규식은 미포함(fallback) 확인. tests/hooks/preflight-gate/test_branch_name_check.sh 에 positive/negative 케이스 2건 추가, 106 passed / 0 failed. Confidence: high Not-tested: PRAXIS_BRANCH_NAME_REGEX 를 alternation 그룹이 3개 이상인 형태로 오버라이드하는 경우(마지막 그룹만 취하는 휴리스틱의 다른 코너)
verify-commit-flag-override 는 자기 토큰(override flag)만 알려줘, git commit 에 걸리는 다른 형제 게이트(block-commit-without-codex-review, commit-title-format-check, commit-title-length-check, block-sciomc-finding-commit, pre-commit-staged-file-enumeration)는 각각의 재시도에서만 발견됐다 (issue #941). #931/#933 의 verb_gate_checklist 레지스트리는 gh pr create/merge, AskUserQuestion 만 배선했고 git commit 은 "배선할 훅이 없어 죽은 코드가 된다"며 명시적으로 범위 밖으로 뒀는데, 그 사이 6개 git-commit 게이트가 이미 존재해 전제가 낡았다. hooks/_lib/block_message.py 는 이슈 #951 이 동시에 수정 중이라 건드리지 않고, 이 훅 자신의 impl.py 안에 로컬 GIT_COMMIT_GATE_CHECKLIST 상수로 구현했다 — 이 훅이 유일한 호출자이고, 각 토큰은 형제 훅의 실제 소스에서 직접 전사했다 (#931 이 쓴 것과 같은 규율). 검증: 실제 훅을 git commit -n -m 으로 직접 실행해 deny 메시지에 5개 형제 게이트 토큰이 모두 출력되는지 확인. tests/hooks/preflight-gate/test_verify_commit_flag_override.sh 에 positive(T01, 5개 토큰 전부 포함)/negative(T02, override 없으면 완전 침묵) 케이스 추가, 40 passed / 0 failed. Confidence: high Not-tested: git commit 표면에 미래에 새 게이트가 추가될 때 이 로컬 체크리스트가 자동으로 갱신되지 않음 (수동 동기화 필요)
verify-commit-flag-override 의 우회 안내가 "env var 설정" 과 "플래그 제거" 를 동등한 선택지로 제시해, 전역 CLAUDE.md 가 요구하는 "사유 진술 + 사용자 승인 둘 다" 를 만족했는지 확인할 방법이 없었다 (issue #941 — 6건 게이트 차단 중 --no-verify 1건이 이 category 문제로 분류됨). 우회 경로를 BOTH 요구사항을 명시하는 절차로 바꿨다: (1) 근본 수정이 불가능한 구체적 사유 진술, (2) 이 특정 우회에 대한 사용자의 명시적 승인 — 둘 다 있어야 PRAXIS_SKIP_COMMIT_FLAG_CHECK=1 을 설정하는 것이 유효하다. 검증: 실제 훅을 git commit -n -m 으로 직접 실행해 deny 메시지에 "BOTH of the following are required" 문구가 출력되는지 확인. tests/hooks/preflight-gate/test_verify_commit_flag_override.sh 에 T01b 케이스 추가, 41 passed / 0 failed. Confidence: high Not-tested: 훅은 메시지로 요구사항을 서술할 뿐 사용자 승인 여부를 기계적으로 검증하지 않음 — PRAXIS_SKIP_COMMIT_FLAG_CHECK=1 설정 자체는 여전히 에이전트가 스스로 할 수 있음 (프로세스 신뢰 경계는 메시지 텍스트가 아니라 사용자 감독)
shellcheck SC2005 — echo "$(payload ...)" 는 command substitution 을 다시 echo 하는 불필요한 우회. payload 함수는 이미 stdout 에 쓰므로 파이프에 직접 연결한다. 검증: shellcheck --severity=warning 로 SC2005 미검출 확인(원래 style-tier 로 CI 를 막지는 않았음), tests/hooks/preflight-gate/test_verify_commit_flag_override.sh 41 passed / 0 failed 유지. Confidence: high
|
Warning Review limit reached
Next review available in: 41 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Verification — e9b5fb5 (rev 2)
1차 런은 Unverified
Evidence 1 — branch-name-check 기본 정규식 allowed types 절훅을 직접 실행해 출력 문자열을 확인 — 코드만 읽고 "이렇게 나올 것"은 증거가 아니므로 실제 stdout 을 캡처했다. Evidence 2 — 커스텀 정규식 fallback (fabricated list 없음)alternation 그룹이 1개뿐인 커스텀 정규식으로 실행해
Evidence 3 — verify-commit-flag-override 형제 게이트 5개 열거
5개 형제 게이트 이름이 모두 출력에 등장함을 확인 (전체 원문은 Evidence 4 — 사유+승인 BOTH 요구 명시동일 출력에서 우회 절차 텍스트 확인. 이전에는 "env var 설정" 과 "플래그 제거" 가 대등한 either/or 로 제시됐다 — 사유+승인 요구가 텍스트에 없었다. Evidence 5 — override 없는 정상 커밋은 완전 침묵 (negative control)체크리스트가 정상 커밋에 새어나오지 않음을 확인 — Evidence 6 — block-pr-without-caller-evidence / output-block-falsify-advisory 는 변경 없음이 PR 이 두 훅의 코드를 전혀 건드리지 않았으므로, 기존 동작을 실제 실행으로 재확인해 "이미 충족돼 있었다"는 PR 본문의 주장을 뒷받침한다.
Evidence 7 — 드리프트 가드 미저촉
Evidence 8 — 전체 CI 진입점, 두 차례 실행 (조건 상이)
1차 런 (markdownlint-cli2 미설치 상태):
2차 런 (markdownlint-cli2 설치 후, markdownlint 스텝이 실제로 실행됨): markdownlint 는 advisory 스텝이라 findings 존재가 EXIT 코드에 영향을 주지 않는다. 이 7건이 내 편집으로 생긴 것인지 확인하기 위해 동일 파일·동일 줄·동일 규칙 7건 — origin/main 에 이미 있던 위반이며 이 PR 의 편집으로 발생하지 않았다. 억제하지 않고 그대로 두었다. 개별 스위트도 사전 확인됨: History
|
|
Verification updated — |
배경
게이트가 차단할 때 걸린 토큰 하나만 알려줘 라운드트립이 반복되는 문제 (issue #941). 6/6 차단률로 탐지 자체는 문제가 없으므로, 이 PR 은 안내 품질만 다룬다 (새 게이트 추가 없음).
#873 중복 판정 — 부분 중복 (확장)
gh issue view 873과 PR #931/#933 실제 코드·출력을 확인한 결과:hooks/_lib/block_message.py의_VERB_CHECKLISTS레지스트리 +verb_gate_checklist(verb)(feat(hooks): enumerate verb gates on first block #931/fix(hooks): emit verb checklist on both channels #933).gh pr create,gh pr merge,AskUserQuestion3개 verb 배선 완료.block-pr-without-caller-evidence와output-block-falsify-advisory는 실제 훅 실행으로 확인한 결과 이미 통합 안내를 발화 중이었다 — 이 두 훅에 대해서는 feat(hook): enumerate all required tokens on block #941 작업목록 2번이 선행 구현으로 이미 충족돼 있었다.git commitverb — "배선할 훅이 없어 죽은 코드가 된다"는 이유로 제외됐으나, 그 시점에도 이미git commit표면에 6개 형제 게이트(block-commit-without-codex-review / commit-title-format-check / commit-title-length-check / block-sciomc-finding-commit / pre-commit-staged-file-enumeration / verify-commit-flag-override 자신)가 존재해 전제가 낡아 있었다.branch-name-check의 branch-creation verb 는 형제 게이트가 없어 멀티게이트 열거 자체가 해당하지 않는다 (작업목록 3번으로 별도 처리).결론: 이 PR 은 #873 의 신규 구현이 아니라 확장이다.
verify-commit-flag-override(git commit) 만 실제 gap 이었다.변경 사항
<type>값을 verbatim 으로 함께 표시. 정규식의 마지막 alternation 그룹을 파싱하며, 커스텀PRAXIS_BRANCH_NAME_REGEX가 alternation 그룹 2개 미만이면 기존처럼 정규식만 표시 (fallback, 안전).git commit표면에 걸리는 5개 형제 게이트(block-commit-without-codex-review / commit-title-format-check / commit-title-length-check / block-sciomc-finding-commit / pre-commit-staged-file-enumeration)를 첫 차단 시 한 번에 열거. 각 토큰은 형제 훅의 실제 소스에서 직접 전사했다 (feat(hooks): enumerate verb gates on first block #931 이 쓴 것과 같은 규율).block-pr-without-caller-evidence,output-block-falsify-advisory— 변경 없음. 실제 훅 실행으로 이미 통합 안내가 발화 중임을 확인했다 (아래 검증 앵커 참조).hooks/_lib/block_message.py비접촉 결정git commit형제 체크리스트를verb_gate_checklist("git commit")로 공유 레지스트리에 얹지 않고,verify-commit-flag-override/impl.py안에 로컬 상수GIT_COMMIT_GATE_CHECKLIST로 구현했다. 이유:이 훅이 유일한 호출자라 공유할 필요가 없다 (YAGNI).
_VERB_CHECKLISTS["AskUserQuestion"]의 manifest 기반 드리프트 가드(test_ask_and_merge_checklists_match_the_hook_registry)와 달리, git-commit 형제 6개 게이트는hooks/manifest.json의matcher로 구분되지 않는다 (46개 훅이 전부Bashmatcher 공유) — 레지스트리로 옮겨도 같은 종류의 드리프트 가드를 만들 수 없다.소스에서 "git commit 에 반응하는 훅 집합"을 도출하는 대안도 검토했으나, git-commit 형제 6개 훅이 서로 다른 5종의 감지 방식을 쓰고 있어 단일 정규식/AST 패턴으로 신뢰성 있게 열거할 수 없다:
block-commit-without-codex-reviewtokens[j] == "commit"block-sciomc-finding-committokens[j] == "commit"(위와 동일 패턴이지만 다른 파일)verify-commit-flag-overrideargv[i] != "commit"commit-title-length-checkkey == "commit_title"(커밋 타이틀이 별도 파싱 단계를 거쳐 도달)commit-title-format-checkpre-commit-staged-file-enumerationhooks/preflight-gate/가 아니라hooks/advisory-nudge/아래 위치 — 디렉터리 스캔 범위 자체가 다른 5개와 다름이 열거가 "균일 판별자가 없다"는 결론의 근거다. 균일 판별자가 있다면 그 자체로 이 6개 훅의 구현을 통일하는 별도 리팩터가 필요하다는 뜻이고, 그건 feat(hook): enumerate all required tokens on block #941 범위 밖이다. 잘못된 휴리스틱은 오탐(무관한 PR 차단)과 미탐(아무것도 안 잡음) 두 실패 모드만 낳으므로, 드리프트 테스트는 넣지 않기로 했다 — 근거는 커밋 a669dce 의
Not-tested:트레일러에도 남겼다.이번 PR 은
hooks/_lib/block_message.py를 전혀 수정하지 않는다.범위 밖 (이슈 본문에 명시)
/tmp규약 (별건)커밋
7c25b0cfeat(hooks): show allowed types in branch-name denya669dcefeat(hooks): list sibling git-commit gates on flag-override denyea3db2bfix(hooks): require reason and approval for flag-overridee9b5fb5refactor(tests): drop useless echo in commit-flag fixtures검증
Caller chain verified:
_extract_allowed_types,GIT_COMMIT_GATE_CHECKLIST모두 신규 심볼이며 호출부는 각 훅 파일 내부 1곳뿐 (grep 으로 확인, 외부 호출자 없음)Pre-commit verified: 아래 검증 앵커 코멘트 참조 — 훅 직접 실행 출력, 개별 테스트 스위트 106/0·41/0, ruff/shellcheck/manifest/invariants clean, 전체
./scripts/run-tests.sh결과는 검증 앵커에 추가 예정Closes #941