Skip to content

feat(smartlog): Phase 4 — topological DAG ordering + summary header · Refs #308 - #416

Merged
erishforG merged 1 commit into
release/1.0from
feat/auto-smartlog-dag-phase4
Sep 1, 2026
Merged

feat(smartlog): Phase 4 — topological DAG ordering + summary header · Refs #308#416
erishforG merged 1 commit into
release/1.0from
feat/auto-smartlog-dag-phase4

Conversation

@erishforG

Copy link
Copy Markdown
Owner

무엇

parsec smartlog 출력 순서와 요약 정보를 개선한다.

변경 설명
요약 헤더 추가 smartlog N worktrees · M stacked 한 줄로 전체 현황 파악
위상 정렬 렌더링 stacked 그룹이 알파벳 순서 대신 부모 그룹 바로 아래 표시
다단계 스택 지원 grandparent → parent → child 3단계 이상도 올바른 순서 보장
사이클 안전 placed HashSet으로 비정상 참조 루프에서도 무한 루프 방지
스택 헤더 개선 ○ <branch> ⤷ stacked on <ticket> 형식으로 시각적 연결 명확화

왜 (이슈 참조)

Refs #308 — smartlog DAG renderer 강화. Phase 1/2/3 이후 마지막 남은 렌더링 개선:

  • 알파벳 순서로 그룹이 분산되면 stacked PR 흐름을 파악하기 어려웠음
  • 요약 헤더가 없어 전체 worktree/stack 수를 트리 전체를 읽어야만 파악 가능

변경

  • src/cli/commands/smartlog.rs 1파일
    • topo_sort_groups() 신규 private 함수 (DFS 기반 위상 정렬)
    • render_text(): summary 헤더 추가, BTreeMap 직접 순회 → topo_sort_groups 사용
    • Phase 4 테스트 4개 추가

다음 Phase 힌트

리스크

low — 순수 렌더링 변경. GitHub API 호출 없음. 기존 struct/CLI surface 무변경.
출력 포맷 변경(요약 헤더 추가, 그룹 순서)이지만 기존 테스트 전부 통과.

롤백

git revert 1f85359 — 이전 알파벳 순서 렌더링으로 즉시 복원.

Test plan

  • cargo test -- smartlog: 29 tests pass (기존 25 + Phase 4 신규 4)
  • cargo build + cargo clippy -D warnings + cargo fmt --check: all clean
  • 로컬 smoke: parsec smartlog --no-overlay → 요약 헤더 + 트리 정상 출력 확인

@erishforG

… Refs #308

- Add summary header line: 'smartlog  N worktrees · M stacked' giving a
  quick count before the tree output
- Replace alphabetical BTreeMap iteration with topological group ordering
  via topo_sort_groups(): stacked groups now appear directly below their
  parent group instead of jumping alphabetically
- Multi-level stacks (grandparent → parent → child) are rendered in correct
  depth order thanks to recursive DFS from root bases
- Cycle-safe: a placed HashSet prevents infinite loops in unusual reference
  loops between worktree branches
- Stack group header updated to '○ <branch> ⤷ stacked on <ticket>' for
  cleaner visual connection to parent
- Add 4 new Phase 4 tests covering: summary counts, singular form, topo
  ordering across lexicographic gap, and multi-level three-deep stacks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@erishforG erishforG added the auto-improvement Daily auto-generated improvement PR/issue label Aug 31, 2026
@erishforG
erishforG merged commit 76d9058 into release/1.0 Sep 1, 2026
12 checks passed
@erishforG
erishforG deleted the feat/auto-smartlog-dag-phase4 branch September 1, 2026 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-improvement Daily auto-generated improvement PR/issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant