This repository was archived by the owner on Sep 8, 2026. It is now read-only.
feat(cli): --help 에서 deprecated 서브명령을 별도 구획으로 분리한다 - #373
Merged
Merged
Conversation
`context-guard --help` 는 새 사용자가 가장 먼저 읽는 표면인데, 27개 서브명령을 설명 없이 한 덩어리로 나열하면서 0.14.0 이 deprecated 로 표시한 다섯 헬퍼를 "Common subcommands" 안에 그대로 두고 있었다. help 출력에 "deprecat" 문자열이 한 번도 나오지 않았다. 각 헬퍼는 이미 자기 소스에 [deprecated] 표식을 갖고 있다. 그러나 디스패처는 헬퍼를 import 하지도 실행하지도 않고 명령 매니페스트를 데이터로만 읽으므로 (신뢰 경계상 의도된 설계다) 목록을 상수로 둘 수밖에 없다. 상수와 헬퍼가 갈라지는 것이 이 방식의 유일한 위험이라, 그것만 정확히 막는 테스트를 함께 넣는다. - context_guard_cli.py: DEPRECATED_SUBCOMMANDS 를 추가하고 print_help 가 "Common subcommands" 와 "Deprecated, still shipped (see docs/guide.md before using)" 두 구획으로 나눠 출력한다. 모든 서브명령은 여전히 정확히 한 번 나온다. - tests/test_cli_deprecation_surface.py: 배포되는 plugins/context-guard/bin 사본을 읽어 [deprecated] 표식이 있는 헬퍼 집합과 상수가 정확히 일치하는지 검사한다. 매핑이 (helper, *고정인자) 형태인 doctor/reference/scan 은 첫 요소만 본다. - 새 테스트 파일을 PROVIDER_FREE_SUPPORT_PATHS 에 선언한다. context_pack.py:6343 의 "P3 live-evidence contract 가 핀해서 계속 배포한다" 는 문구는 이번에 고치지 않았다. 확인해 보니 P3 v4 가 canonical_packer 로 실제로 핀하는 것은 맞고(허위가 아니라 불완전한 서술이다), Stage-2 protected-surface manifest 도 같은 파일을 lstat 으로 잡고 있어 P3 를 풀어도 삭제되지 않는다. 그 한 줄을 고치려면 보호 표면과 P3 두 캐스케이드를 모두 돌려야 해서 비용이 이득보다 크다. 변이 4종이 모두 잡히는 것을 확인했다: 집합에서 pack 제거, 비-deprecated 인 audit 추가, help 를 한 덩어리로 되돌리기, 매니페스트에 없는 이름 추가. 검증: tests.test_cli_deprecation_surface + stage2 13건 OK, ci_test_gate fast 76건 OK, 실제 3.11 compileall exit 0, sync_plugin_copies --check 동기화 확인, prepublish_check --skip-tests OK, release_preflight 경고 없음. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DE3AupXcyv64SEuQeTckSh
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 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 |
GLM 리뷰의 지적 (2)가 타당했다. `"[deprecated]" in text` 는 파일 전체 부분문자열 검색이라 changelog 성 주석, docstring 의 언급, 로그 문자열만으로도 "이 헬퍼는 deprecated 를 선언했다" 로 오판한다. 더 나쁜 방향은 게이밍이다. 드리프트 테스트가 실패했을 때 무관한 위치에 문자열을 끼워 넣어 흡수하면 잘못된 의미론이 조용히 고정된다. 이제 헬퍼가 실제로 선언하는 두 자리에만 매치한다. - 셸 진입점의 선행 주석: 들여쓰기 4칸 이내의 `# [deprecated]` - 파이썬 진입점의 argparse: `description="[deprecated]` (괄호로 감싼 형태 포함) `\[deprecated\]\b` 를 쓰지 않는다. `]` 가 비단어 문자라 뒤에 단어 문자가 와야만 경계가 생기는데 실제 선언은 `] ` 로 이어져서 아무것도 매치하지 않았다. 이 버그는 아래 표 케이스가 잡아냈다. 패턴 케이스 8종을 직접 확인했다. 셸 선행 주석·argparse 한 줄·argparse 괄호 분할은 탐지하고, docstring 언급·로그 문자열·깊게 들여쓴 주석·`help=` 인자·줄 중간 언급은 탐지하지 않는다. 배포 사본 전체에 돌리면 정확히 deprecated 헬퍼 6개만 나온다. GLM 의 지적 (4)는 조치하지 않았다. kit 소스만 고치고 미러를 빠뜨리는 경로는 이 테스트가 아니라 `scripts/sync_plugin_copies.py --check` 가 잡고, 그 스텝은 fast-pr 에 이미 있다. 그 사실을 docstring 에 적어 두었다. 변이 4종이 모두 잡히는 것을 확인했다: 상수에서 pack 제거, 비-deprecated 인 audit 추가, 헬퍼가 선언을 잃는 경우, 그리고 무관한 헬퍼에 표식을 붙여 침묵시키려는 시도. 검증: tests.test_cli_deprecation_surface 4건 OK, ci_test_gate fast 76건 OK, sync_plugin_copies --check 동기화 확인. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DE3AupXcyv64SEuQeTckSh
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
문제
context-guard --help는 새 사용자가 가장 먼저 읽는 표면인데, 27개 서브명령을 설명 없이 한 덩어리로 나열하면서 0.14.0 이 deprecated 로 표시한 다섯 헬퍼를 "Common subcommands" 안에 두고 있었다. help 출력 41줄에deprecat문자열이 한 번도 나오지 않았다.왜 상수인가
각 헬퍼는 이미 자기 소스에
[deprecated]표식을 갖고 있다(context_compress.py,context_filter.py,context_pack.py,tool_schema_pruner.py,statusline.sh,statusline_merged.sh). 그러나 디스패처는 헬퍼를 import 하지도 실행하지도 않고 명령 매니페스트를 데이터로만 읽는다. 이는docs/safety-reference.md가 명시한 신뢰 경계다. 따라서 목록은 상수일 수밖에 없고, 상수와 헬퍼가 갈라지는 것이 유일한 위험이라 그것만 정확히 막는 테스트를 함께 넣는다.결과
모든 서브명령은 여전히 정확히 한 번 나온다(테스트로 고정).
드리프트 가드
tests/test_cli_deprecation_surface.py는 배포되는plugins/context-guard/bin사본을 읽어[deprecated]표식이 있는 헬퍼 집합과 상수가 정확히 일치하는지 검사한다. 매핑이(helper, *고정인자)형태인doctor/reference/scan은 첫 요소만 본다.변이 4종이 모두 잡힌다.
pack제거audit추가의도적으로 하지 않은 것
context_pack.py:6343의 "P3 live-evidence contract 가 핀해서 계속 배포한다" 는 문구는 고치지 않았다. 확인해 보니 허위가 아니라 불완전한 서술이다. P3 v4 가canonical_packer로 실제로 핀하는 것은 맞고, 동시에 Stage-2 protected-surface manifest 도 같은 파일을lstat으로 잡고 있어 P3 를 풀어도 삭제되지 않는다. 그 한 줄을 고치려면 보호 표면과 P3 두 캐스케이드를 모두 돌려야 해서 비용이 이득보다 크다.검증
조상 SHA 를 고정하지 않으므로 squash 로 병합해도 된다.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DE3AupXcyv64SEuQeTckSh