Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011H9PaWUM4t2rhjjxakE29e
Owner
Author
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.
Fixes #61
원인
accept 가 작업 worktree 를 다시 만드는 중(
ensureWorktree→git worktree add)에 강제로 끝나면, git 은 등록과 HEAD 는 남깁니다. 하지만 체크아웃은 일부만 된 상태로 멈춥니다. 이때 관리 폴더에 잠금locked가 이유initializing으로 남습니다. 다음 accept 의ensureWorktree(harness/lib/integrate.js:88)는 "등록돼 있고 그 브랜치의 루트이면 쓸 수 있다"고만 봅니다. 그래서 그 worktree 를 그대로 썼습니다. 이어서commitInto(..., 'uncommitted work before accept')→commitAll의git add -A가 빠진 파일을 모두 삭제로 커밋했습니다. 이슈에 보고된 79개 파일 · 서브모듈 등록 삭제가 여기서 생겼습니다.resume도 같은 검사(loop.js:263)를 쓰므로 같은 위험이 있었습니다.수정
git.js:worktreeList가 porcelain 의locked <이유>줄을 읽습니다. 새 함수interruptedAdd(root, wt)는 잠금 이유가initializing인지 봅니다.incompleteWhy(wt)는 안내 문구를 만듭니다. 안내: git 명령이 돌고 있지 않으면git worktree remove --force --force "<wt>"로 지운 뒤 명령을 다시 실행하라.ensureWorktree(accept)는 이런 worktree 를 보면 거절하고 위 안내를 냅니다.resume은interrupted로 멈추고 같은 안내를 냅니다.commitAll은 이런 worktree 에서WORKTREE_INCOMPLETE로 던집니다. 이 오류는cancel같은 다른 경로에도 적용됩니다.cli.js는 이 오류를LOCK_HELD처럼 운영 오류로 다루고, 하네스 결함으로 기록하지 않습니다.재현 테스트
tests/unit/test_v5_integrate.jsIN-18c. 작업을 done 으로 만든 뒤 상황을 흉내 냅니다: worktree 를--no-checkout으로 다시 만들고,locked에initializing을 쓰고, 파일 하나만 체크아웃해 둡니다.harness/를 stash 로 되돌려 확인): accept 가uncommitted work before accept로feature.txt·src/two.txt등 빠진 파일 전부의 삭제를 작업 브랜치에 커밋했고, 검사 실패로 거절됐습니다.commitAll은 던지지 않았습니다. 3개 검사가 실패합니다.half-created· 안내 포함) 작업 브랜치·main 은 그대로입니다.commitAll은WORKTREE_INCOMPLETE를 던집니다. 안내대로 지운 뒤 다시 accept 하면accepted이고, 파일이 모두 남습니다.검증
node tests/run.js→ 1053 PASS / 0 FAIL, 종료 코드 0. 이 클라우드 환경에서는GH_TOKEN/GITHUB_TOKEN을 지우고 돌렸습니다(BR-15·16 이 로그인 없음을 가정합니다. fix: factory 통합 worktree 의 검사가 바꾼 추적 파일을 되돌려 카드 병합 실패·재실행을 막는다 (#51) #52·fix: 검사 자손이 출력 파이프를 붙들어도 결과를 낸다 · 등록만 지워진 worktree 폴더 정리와 이어받기 안내 (#53 #54) #55·fix: accept 검사가 다시 쓴 outside_git_ok 산출물을 되돌린다 · 남은 index.lock 은 운영 오류로 안내 (#57 #58) #59 와 같습니다).test_v5_resources.js)이 한 번 실패했습니다. 수정하지 않은 main 에서도 이 컨테이너에서 4번 중 3번 실패하므로, 이 PR 과는 관계없는 흔들림입니다(이 PR 은resources.js를 건드리지 않습니다). 다시 돌렸을 때는 통과했습니다.적대적 검토
worktree add에서 체크아웃 전에locked=initializing을 쓰고, 끝나면 지웁니다. 그래서 이 잠금이 남아 있다는 것은 add 가 중간에 끊겼다는 확실한 신호입니다. 사람이git worktree lock --reason initializing을 직접 쓰는 경우는 거의 없습니다. 다른 이유의 잠금이나 이유 없는 잠금은 판정에 영향을 주지 않습니다.worktreeList호출이 하나 늘어날 뿐이고, 동작은 같습니다. porcelain 출력은 CRLF 를 이미\r?\n으로 나눕니다. 경로 비교는 기존samePath를 씁니다(Windows 짧은 이름 · 링크 포함).git worktree add를 직접 부르는 곳에는 새 검사를 넣지 않았습니다. 다만 그 경로에서 커밋하면commitAll의 방어선에 걸립니다.Generated by Claude Code