Skip to content

feat(hook): harden hard-gate — repo-root resolution + opt-in objective checks (v0.1.12) - #30

Merged
HyeonsangKim merged 1 commit into
mainfrom
fix/hardgate-cwd-objective-checks
Jul 10, 2026
Merged

feat(hook): harden hard-gate — repo-root resolution + opt-in objective checks (v0.1.12)#30
HyeonsangKim merged 1 commit into
mainfrom
fix/hardgate-cwd-objective-checks

Conversation

@HyeonsangKim

Copy link
Copy Markdown
Contributor

Summary

도그푸딩으로 발견한 하드 게이트 hook의 두 약점을 고친다. v0.1.12.

Changes

  1. cwd 결합 수정 — hook과 auto-commit Step 3.5가 .wigtn/gate-passgit rev-parse --show-toplevel 기준으로 해석. 하위 디렉토리에서 커밋해도 정상 PASS를 오차단하지 않는다. (도그푸딩에서 hook이 세션 cwd에 결합돼 있어 서브디렉토리 커밋을 오차단하는 걸 발견.)
  2. PASS 날조 방어 (opt-in) — repo 루트에 실행권한 있는 .wigtn/checks.sh(예: npm test && npm run typecheck)를 두면 hook이 커밋 직전 직접 실행, non-zero면 차단. 게이트 보증을 "리뷰가 일어났음" → **"객관 검증이 실제로 통과했음"**으로 올린다(모델이 test/typecheck exit code는 못 꾸밈). 파일 없으면 기존 무마찰.

Verification

격리 하네스 5/5 시나리오: 서브디렉토리+toplevel 허용 · checks 실패 차단 · checks 통과 허용 · 수동 허용 · gate-pass 없음 차단.

정직한 한계

  • 객관 체크는 opt-in(checks.sh 있을 때만). 없으면 여전히 "리뷰 발생"만 강제.
  • checks.sh는 hook에서 동기 실행 → 느린 스위트는 커밋을 지연시킴(타입체크·핵심 테스트 권장).

🤖 Generated with Claude Code

…e checks (v0.1.12)

Two fixes surfaced by dogfooding the pipeline end-to-end:

- cwd fix: resolve .wigtn/gate-pass at git toplevel in both the hook and
  auto-commit Step 3.5, so committing from a subdirectory no longer false-blocks
  a legitimately-passed gate (hook was coupled to session cwd, not the commit repo).
- anti-fabrication: hook runs an optional repo-root .wigtn/checks.sh before a
  pipeline commit; a non-zero exit blocks. This binds the gate to real
  test/typecheck exit codes a model cannot fabricate — upgrading the guarantee
  from "a review happened" to "objective checks actually passed". No file -> old
  frictionless behavior.

Verified in an isolated harness: 5/5 scenarios (subdir+toplevel allow,
checks-fail block, checks-pass allow, manual allow, missing-gate-pass block).
Bump 0.1.11 -> 0.1.12.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@HyeonsangKim
HyeonsangKim merged commit df607f4 into main Jul 10, 2026
1 check passed
@HyeonsangKim
HyeonsangKim deleted the fix/hardgate-cwd-objective-checks branch July 10, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant