Skip to content

fix: plan_completion_guard 정책 정합성 회복 및 위험 권한 제거 (#44)#45

Merged
robinjoon merged 1 commit into
mainfrom
ticket/#44
May 3, 2026
Merged

fix: plan_completion_guard 정책 정합성 회복 및 위험 권한 제거 (#44)#45
robinjoon merged 1 commit into
mainfrom
ticket/#44

Conversation

@robinjoon
Copy link
Copy Markdown
Member

Summary

  • plan_completion_guard.pyREQUIRED_PLAN_FILES에서 context.md 제거. docs/work-planning-rules.md의 2종(plan.md + checklist.md) 정책과 일치시킴
  • 2종 문서만 있는 미완료 plan에서 가드가 exit=0으로 거짓통과하던 결함을 회귀 테스트 3건으로 고정
  • .claude/settings.json의 위험한 와일드카드 삭제 allow 항목 제거(allow: []). block_dangerousPreToolUse 보조 방어선으로 유지

Why

다른 에이전트의 평가에서 두 가지 결함이 확인됨:

  1. 정책-가드 불일치: 정책은 2종 문서를 요구하지만 가드는 3종을 요구해, 정책에 맞춰 작성된 미완료 plan을 차단하지 못함. 기존 테스트가 3종 구조로 작성돼 있어 결함을 잡지 못한 상태.
  2. 권한 설계 결함: 위험한 명령을 allow로 넓게 허용한 뒤 훅으로 다시 막는 구조는 훅이 깨지면 방어선이 사라짐. 권한은 좁게, 훅은 보조로 두는 게 옳은 설계.

Closes #44

Test plan

  • 회귀 재현: 임시 디렉토리에 plan.md + checklist.md(미완료)만 두고 가드 호출 → 패치 전 exit=0, 패치 후 exit=2 차단 확인
  • test_plan_completion_guard.py 10/10 통과 (기존 7 + 신규 3)
  • test_work_plan_enforcer.py 34/34 통과 (회귀 없음)
  • block_dangerous 보조 방어선 동작 확인(PreToolUse Bash 매처 유지)

비고

  • test_block_dangerous.py(pytest) 12건 실패는 본 PR 이전부터 존재한 결함(soft-warn 케이스가 hard-block으로 동작). git stash 전후 동일하게 재현되어 본 PR 범위 밖으로 분리, 별도 후속 작업으로 처리 예정.

- REQUIRED_PLAN_FILES에서 context.md 제거하여 work-planning-rules.md
  (plan.md + checklist.md 2종) 정책과 일치
- 2종 문서 미완료 plan에서 거짓통과되던 결함을 회귀 테스트로 고정
- .claude/settings.json의 위험한 와일드카드 allow 제거,
  block_dangerous는 보조 방어선으로 유지

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@robinjoon robinjoon merged commit 4e45105 into main May 3, 2026
1 check passed
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.

fix: plan_completion_guard 정책 정합성 회복 및 위험 권한 제거

1 participant