Skip to content

Merge core/csmDict into main#992

Merged
chae-dahee merged 43 commits into
mainfrom
core/CSMDict
Oct 16, 2025
Merged

Merge core/csmDict into main#992
chae-dahee merged 43 commits into
mainfrom
core/CSMDict

Conversation

@chae-dahee

@chae-dahee chae-dahee commented Oct 14, 2025

Copy link
Copy Markdown
Contributor

ready for CSM Pagination!! 🎉🎉
react 레포지토리에서 테스트 결과 FCP 를 약 60% 단축할 수 있었습니다! (58.740s → 23.148s) <Issue #991>

2025-10-15.3.35.50.mov

“chae-dahee” and others added 30 commits September 22, 2025 16:21
[FEAT] CSMDict 최신 → 과거 순서 정렬
- Add mergedIntoStem flag to track merge parents
- Limit squash range to next merge point to prevent over-squashing
- Fix commit sorting order (oldest to newest)
- Update test cases with proper mergedIntoStem flags
- Translate Korean comments to English in CommitNode.ts

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Extract utility functions from buildCSMNode into csm.util.ts
 - getMergeParentCommit: Get merge parent commit
 - findSquashStartNodeIndex: Find node index in stem
 - findSquashEndIndex: Find end index for squash collection
 - collectSquashNodes: Collect nodes and remove from stem
 - extractNestedMergeParents: Extract nested merge parents

- Create csm.const.ts for magic number constants
 - MERGE_PARENT_INDEX: Merge parent index
 - FIRST_PARENT_INDEX: First parent index

- Refactor buildCSMNode function
 - Reduce function length from 72 lines to ~50 lines
 - Remove non-null assertions (! operator)
 - Improve type safety with optional chaining
 - Add clear comments for each step

- Add comprehensive JSDoc documentation
 - Document all public and private functions
 - Add parameter and return type descriptions
- Add buildPaginatedCSMDict function with cursor-based pagination
- Support perPage parameter to control page size
- Implement lastCommitId cursor for next page navigation
- Add comprehensive test coverage (8 test cases)
- Extract buildPRDict utility function to reduce duplication
- Export buildPaginatedCSMDict from package entry point

The new function enables efficient lazy loading of CSM nodes
for large repositories, improving performance and memory usage.

Related: #916

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Extract buildCSMNodesWithPR to eliminate code duplication
- Add comprehensive JSDoc documentation with examples
- Improve validation consistency across functions
- Enhance variable naming (prDict, baseStem)
- Add stemDict.size validation to buildPaginatedCSMDict

This refactoring improves maintainability and reusability
while preserving all external behavior. All tests pass.

Related: #916

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Consolidate MERGE_PARENT_INDEX and FIRST_PARENT_INDEX into a single FIRST_PARENT_INDEX constant, and rename getMergeParentCommit to getFirstParentCommit to improve code consistency and clarity.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…port

- Add octopus merge test (4 parents)
- Add single parent commit early return tests
- Add non-existent parent commits edge case test
- Add all invalid parents edge case test

All 9 tests passing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…clarity

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
feat(engine): CSM Squash Merge 로직 개선
refactor(engine): CSM 코드 구조 및 가독성 개선
…ation

feat(engine):  Pagination 기능을 가진 CSM Dictionary Builder 구현
- Updates the 'fetchClusterNodes' function to consume the new paginated API from the engine.
- Updates interface to handle pagination requests and the new data structure.
@chae-dahee
chae-dahee requested review from a team as code owners October 14, 2025 09:29

@nxnaxx nxnaxx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

와아 두 분 다 정말 수고 많으셨습니다!!👍🏻👍🏻👍🏻

@ytaek

ytaek commented Oct 15, 2025

Copy link
Copy Markdown
Contributor

드뎌 메인 브랜치로!! 환영합니다!!

@ytaek ytaek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아.. linting된 파일이 많았네요;; 머지하기 좀 무섭긴 합니다만 일단 LGTM 입니다!!
고생하셨어요!!

@chae-dahee
chae-dahee merged commit e30cc35 into main Oct 16, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants