Skip to content

test(hooks): make ask-end-option tests hermetic - #1075

Merged
devseunggwan merged 2 commits into
mainfrom
issue-1070-test-hermetic-ask-end
Aug 22, 2026
Merged

devseunggwan merged 2 commits into
mainfrom
issue-1070-test-hermetic-ask-end

Conversation

@devseunggwan

Copy link
Copy Markdown
Owner

무엇이 바뀌나

test_block_ask_end_option.sh 가 개발자 셸 환경과 무관하게 같은 결과를 냅니다. 지금은 이 변수를 켜 둔 사람에게만, 자기 변경과 무관한 실패로 보입니다.

원인 — 훅은 결함이 없습니다

훅의 모드 결정은 문서화된 우선순위 그대로 동작합니다: PRAXIS_ASK_END_STRICT 가 PRAXIS_ASK_END_ADVISORY 를 이깁니다. 테스트의 advisory 케이스가 PRAXIS_ASK_END_ADVISORY=1 만 인라인으로 주입하고 상속된 STRICT 는 그대로 뒀습니다.

$ env | grep PRAXIS_ASK_END
PRAXIS_ASK_END_STRICT=1

$ bash tests/hooks/preflight-gate/test_block_ask_end_option.sh
PASS: 69   FAIL: 2
  - advisory mode + korean end marker, neutral message
  - advisory mode + english end marker, neutral message

CI 에는 이 변수가 없어서 CI 는 초록입니다. 그래서 여태 안 잡혔고, 실제로 PR #1066 작업 중 스위트가 TEST SUITE FAILED 로 끝나 원인을 가릴 때까지 자기 변경의 회귀 여부를 알 수 없었습니다.

커밋 2개 — 같은 계열이 하나 더 있었습니다

첫 커밋이 이슈가 지목한 STRICT 누수를 닫습니다. 그런데 PRAXIS_ASK_END_ADVISORY 에도 같은 노출이 있고, 이쪽이 더 크게 깨집니다.

$ PRAXIS_ASK_END_ADVISORY=1 bash tests/hooks/preflight-gate/test_block_ask_end_option.sh
  - [#922-pos] '세션 종료 —' separator label still blocks
  - [#515-d1] "I'm done ..., proceed" is NOT a stop signal → block
  - [#515-d1] 'wrap up the PR tests and deploy' is NOT a stop → block
  ... (6건 실패)

default 케이스가 통째로 advisory 로 뒤집힙니다. 두 번째 커밋이 세 갈래(strict / advisory / default) 모두에서 두 변수를 다 해제해, 각 케이스가 자기 전제를 스스로 세우게 합니다. strict 는 우선순위상 영향이 없지만 예외 없이 두는 편이 다음 사람에게 읽힙니다.

검증 — 네 가지 환경 상태 전수

$ (둘 다 없음)                                        PASS: 71  FAIL: 0
$ PRAXIS_ASK_END_STRICT=1                             PASS: 71  FAIL: 0
$ PRAXIS_ASK_END_ADVISORY=1                           PASS: 71  FAIL: 0
$ PRAXIS_ASK_END_STRICT=1 PRAXIS_ASK_END_ADVISORY=1   PASS: 71  FAIL: 0

$ shellcheck tests/hooks/preflight-gate/test_block_ask_end_option.sh
(출력 없음 = clean)

$ python3 scripts/check-plugin-manifests.py
plugin-manifest check OK

변수가 아예 없는 환경에서도 71/71 이라는 것이 env -u 가 부재 시에도 안전함을 보이는 대조입니다.

다른 테스트 파일의 같은 노출

없습니다. 확인 범위는 grep -rln "PRAXIS_ASK_END" tests/ 가 낸 나머지 3개 파일(tests/test_block_message.py, tests/test_critic_pre_lock_probe.sh, tests/hooks/completion-verify/test_negative_existence_verdict_gate.sh) 이고, 셋 다 이 변수를 문자열 리터럴로만 언급합니다 — 체크리스트 텍스트 assert, spec 인용, sibling 컨벤션 주석입니다. 훅을 실행하며 환경을 상속시키는 자리는 없습니다.

훅 코드와 spec 은 무변경입니다.

Pre-commit verified: bash tests/hooks/preflight-gate/test_block_ask_end_option.sh 를 네 가지 환경 조합에서 실행 → 전부 PASS 71 / FAIL 0, shellcheck → clean, python3 scripts/check-plugin-manifests.py → plugin-manifest check OK
Caller chain verified: N/A — 테스트 파일 1개만 바뀌었고 프로덕션 심볼을 추가·변경·제거하지 않았습니다. 훅 block-ask-end-option 의 코드·spec·매니페스트 등록은 무변경입니다.

Closes #1070

advisory 및 default 케이스에서 상속된 PRAXIS_ASK_END_STRICT 환경변수를
격리하여 개발자 셸 환경이 테스트에 새지 않도록 수정합니다.

훅의 우선순위는 STRICT > ADVISORY 이므로, advisory 케이스가 의도한
advisory 모드로 동작하려면 상속된 STRICT를 해제해야 합니다.

default 케이스도 같은 노출을 가집니다 — 현재는 기본값이 strict라
결과가 우연히 일치하지만, 기본값이 바뀌면 조용히 어긋날 수 있습니다.
양쪽 모두에 env -u PRAXIS_ASK_END_STRICT를 추가하여 명시적으로 환경을
관리하고 미래 드리프트를 차단합니다.

검증:
- PRAXIS_ASK_END_STRICT=1 환경: 71/71 통과 (이전 69/71)
- STRICT 미설정 환경: 71/71 통과 (이전과 동일)
- 다른 테스트 파일 노출: 없음 (grep 확인)

Confidence: high
Not-tested: full CI suite (delegated to user)
앞 커밋은 STRICT 만 격리했다. ADVISORY 도 같은 노출이고, 이쪽이
더 크게 깨진다 — `PRAXIS_ASK_END_ADVISORY=1` 이 export 된 셸에서
default 케이스가 통째로 advisory 로 뒤집혀 6건이 실패한다.

세 갈래 모두 자기 전제를 스스로 세우도록 두 변수를 다 해제한다.
strict 는 우선순위상 영향이 없지만, "이 케이스의 모드는 이 줄이
정한다" 를 예외 없이 두는 편이 다음 사람에게 읽힌다.

네 가지 환경 상태(둘 다 없음 / STRICT / ADVISORY / 둘 다) 전부
71/71 통과.

Confidence: high
Not-tested: 없음 — 4개 환경 조합 전수 실행
Session-Id: 986b3ff6-861d-4339-9c8a-4442f03ed2df
@devseunggwan devseunggwan self-assigned this Aug 22, 2026
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@devseunggwan, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 28 minutes

Limit details: You’ve used the included review currently available.

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?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8bf45349-c541-422d-80a8-2fb6367f7a1a

📥 Commits

Reviewing files that changed from the base of the PR and between 53edd02 and da6cb1a.

📒 Files selected for processing (1)
  • tests/hooks/preflight-gate/test_block_ask_end_option.sh

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devseunggwan
devseunggwan merged commit 088e3e6 into main Aug 22, 2026
10 checks passed
@devseunggwan
devseunggwan deleted the issue-1070-test-hermetic-ask-end branch August 22, 2026 09:38
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.

test(hooks): ask-end-option advisory cases leak the dev env

1 participant