feat(health): Phase 3 — detect in-progress git ops (rebase/merge/cherry-pick) · Refs #414 - #415
Merged
Merged
Conversation
…ry-pick) · Refs #414 Adds three new read-only health indicators to `parsec health`: | Indicator | Detection | |------------------------|--------------------------------------------| | rebase_in_progress | .git/rebase-merge/ or .git/rebase-apply/ | | merge_in_progress | .git/MERGE_HEAD | | cherry_pick_in_progress| .git/CHERRY_PICK_HEAD | These catch the common "I started a rebase in worktree A and forgot about it" pattern that index.lock alone cannot detect (lock only exists while git runs). Works for both main worktrees (.git/ dir) and linked worktrees (.git file containing a gitdir: pointer). Detection failures soft-fail to false. Changes: - src/output/mod.rs: 3 new bool fields on HealthRecord - src/cli/commands/health.rs: resolve_git_dir() helper + detection logic - src/output/human.rs: ⚠ red tags + icon rollup for in-progress ops - src/output/json.rs: 3 new bool fields + all_healthy rollup update - 7 unit tests covering main/linked worktree layout + per-state detection Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pre-existing lint (clippy::for_kv_map) that started failing on CI ubuntu runner. workspace.rs:318 iterated over (key, value) pairs but only used values; replacing with .values_mut() satisfies the lint with no behaviour change. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
무엇
parsec health에 Phase 3 지표 3개를 추가한다: 진행 중인 git 작업 감지.rebase_in_progress.git/rebase-merge/또는.git/rebase-apply/디렉터리merge_in_progress.git/MERGE_HEAD파일cherry_pick_in_progress.git/CHERRY_PICK_HEAD파일왜 (이슈 참조)
Refs #414 — 멀티 worktree 환경에서 "worktree A에서 rebase 시작 후 worktree B로 이동해 방치" 패턴은
index.lock으로 감지되지 않는다. lock 파일은 git 명령 실행 중에만 존재하지만, rebase/merge/cherry-pick 은 중간 상태로 영구 잔류한다.변경
src/output/mod.rs:HealthRecord에 3개bool필드 추가 (additive — 하위 호환)src/cli/commands/health.rs:resolve_git_dir()헬퍼 추가 + Phase 1 lock 감지 로직 통합 + 3개 감지 추가src/output/human.rs: ⚠ 빨간 태그 3개 + 아이콘 rollup 포함src/output/json.rs: 3개 bool 필드 직렬화 +all_healthyrollup 반영linked worktree (이 파일인 경우) 도 올바르게 처리: 포인터 resolve.
다음 Phase 힌트
Phase 4 후보: bisect in-progress (
.git/BISECT_LOG) / revert in-progress (.git/REVERT_HEAD) 추가, 또는--warn-only-ops플래그로 op-in-progress만 필터링.리스크
low — 완전 read-only. 파일시스템 접근 실패 시
falsesoft-fail. 새 필드는 기존 JSON 소비자에 추가만 됨 (breaking change 없음).롤백
git revert <sha>또는 이 브랜치를 develop에서 revert. downstream 영향 없음.Test plan
cargo test -- health→ 7 unit tests 통과:resolve_git_dirmain/linked worktree 레이아웃rebase-merge/,rebase-apply/감지MERGE_HEAD,CHERRY_PICK_HEAD감지cc @erishforG