test(claude): linked worktree/서브모듈 gitfile 미추종 FN 회귀 가드 (Task3 No-go)#24
Merged
Conversation
ralplan 합의 결과 No-go 확정 — 프로덕션 로직 변경 0, 현 안전 FN 동작을
회귀 테스트로 고정하고 doc을 강화한다.
변경 내용:
- src/claude.rs:404 주석 확장: linked worktree/서브모듈 gitfile 동작 설명,
안전 FN(canonicalize Err→None) 명시, gitdir 추종 미지원 근거(공격면) 추가
- 신규 테스트 2개:
· derive_from_cwd_gitfile_not_followed_none: cwd/.git가 정규 파일(절대/상대
gitdir 양 케이스)이면 derive_git_branch_from_cwd가 None을 반환함을 고정
· derive_git_branch_gitfile_worktree_not_followed_none: workspace git_worktree가
gitfile 워크트리를 가리켜도 derive_git_branch가 None을 반환함을 고정
4게이트 그린: fmt/clippy -D warnings/test 342통과(+2)/build --release
신규 테스트는 현 코드에서 이미 그린(프로덕션 로직 추가 없이 FN 동작 확인됨).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…inel HEAD
quad-review consensus blocker(Codex HIGH/Forge Major/Claude MEDIUM): 기존
회귀 테스트가 gitdir 타깃을 비존재 경로로 써서, 미래에 gitfile 추종을
추가해도 타깃 HEAD가 부재해 여전히 None → 추종 회귀를 포착 못 함(가드 무력).
수정: gitdir 타깃 디렉터리를 실재화하고 그 안에 유효 HEAD(ref: refs/heads/
sentinel-*)를 둔다. 현재는 미추종이라 None(그린) 유지하되, 누가 gitfile
추종을 구현하면 Some("sentinel-*")을 반환해 None 단언이 깨진다 = 추종 회귀를
실제로 포착하는 mutation-resistant 가드가 됨. 절대/상대 gitdir + 양 진입점
(derive_git_branch_from_cwd, derive_git_branch) 커버.
doc 정정: canonicalize Err 원인을 ENOTDIR(.git 정규파일 하위 HEAD 탐색 불가)로
명확화, "신뢰 불가 입력"을 추종 가정법으로 표현.
quad-review-loop round 1, PR #24, consensus blocker fix.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
무엇을 / 왜
linked worktree(
git worktree add)·서브모듈은<base>/.git가gitdir: <path>를 담은 정규 파일이고 실제 HEAD는 그 gitdir(보통 main repo 하위 =<base>밖)에 있다. understatus는 이 gitfile 추종을 의도적으로 미지원한다(현재<base>/.git/HEAD경로 부재로 canonicalize Err → None = 안전 false-negative).ralplan 합의(Planner→Architect→Critic, No-go 확정):
ref: refs/heads/X내용 노출). 기각.<base>경계: Architect가git worktree add실증 → 표준 worktree·서브모듈 HEAD는 항상<base>밖 → (C)는 표준 케이스 0% 커버 = value 0 + 새 공격면 = 순손실. 기각.문제: 이 안전 FN을 고정하는 테스트가 없어, 누가 무심코 gitfile 파싱을 추가하면 회귀를 못 잡음. Critic이 필수 산출물로 지적.
변경 (프로덕션 로직 0)
.git을gitdir:(절대/상대../) 담은 정규 파일로 만들고derive_git_branch_from_cwd·derive_git_branch양 진입점 모두None반환 고정.read_branch_from_git_dir): linked worktree + 서브모듈 gitfile 미추종 = 의도된 안전 FN, gitdir 추종 미지원 근거(공격면·gitfile 내용=신뢰 불가 입력) 명문화.검증
~/.cargo/bin/cargo): fmt / clippy -D warnings / test 342 passed(328+14, +2) / 0 failed / build --release🤖 Generated with Claude Code