Skip to content

Conversation

@toothlessdev
Copy link
Owner

📎 Related issues

📦 Scope

  • @patchlogr/core
  • @patchlogr/cli
  • @patchlogr/oas
  • @patchlogr/inspector
  • @patchlogr/types
  • docs, examples
  • tests
  • ci / cd / infra
  • other (아래에 명시)

📌 Summary

  • 기존 2-depth 해시트리를 재귀형태로 변경

🧠 Context

  • 추후 파티셔닝, 청킹시 HashTree 의 확장성을 고려한 재귀형태의 해시트리구조로 변경

⚠️ Impact

  • No Breaking Changes
  • Breaking Change
  • Versioning 영향 있음 (major / minor / patch)
  • 내부 리팩토링만 포함

✅ Checklist

  • 요구사항 명세 충족
  • 테스트 추가 / 수정
  • deterministic output 확인

@toothlessdev toothlessdev self-assigned this Jan 22, 2026
@toothlessdev toothlessdev added the enhancement New feature or request label Jan 22, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @toothlessdev, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant refactoring within the "@patchlogr/core" package, transitioning from a rigid 2-depth hash tree to a recursive hash tree structure for handling partitioned specifications. This change is driven by the need for improved scalability and extensibility, particularly for future partitioning and chunking functionalities. The update modifies the output of partitioning functions, making it a breaking change, but lays a robust foundation for advanced data management.

Highlights

  • Recursive Hash Tree Structure: The core data structure for partitioning specifications has been refactored from a fixed 2-depth hash tree to a more flexible and extensible recursive hash tree. This introduces new types like "HashInternalNode" and "HashLeafNode".
  • Updated Partitioning Functions: The "partitionByMethod" and "partitionByTag" functions now return a "PartitionedSpec" containing a recursive "HashNode" structure, replacing the previous "Map"-based output. This is a breaking change to the API.
  • Enhanced Test Coverage: Existing test files for "partitionByMethod" and "partitionByTag" have been updated to validate the new recursive hash tree output, ensuring correctness of the refactored logic.
  • Type Definition Broadening: The "stableStringify" utility function's input type has been broadened from "Record<string, unknown>" to "any" to accommodate the new recursive data structures.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

github-actions bot commented Jan 22, 2026

Test Results

76 tests   76 ✅  1s ⏱️
17 suites   0 💤
 3 files     0 ❌

Results for commit b887d6d.

♻️ This comment has been updated with latest results.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이 PR은 파티셔닝 로직을 재귀적인 해시 트리 구조로 리팩터링하여 확장성을 향상시키는 훌륭한 변경입니다. 전반적인 구조 변경은 명확하고 목적에 부합합니다. 다만, partitionByMethod.tspartitionByTag.ts 파일 간에 상당한 코드 중복이 발견되었습니다. 두 함수는 그룹화 키를 결정하는 로직만 다를 뿐, 전체적인 구조(그룹화, 리프 노드 생성, 중간 노드 생성, 루트 노드 생성)가 거의 동일합니다. 유지보수성을 높이기 위해 이 중복되는 로직을 별도의 헬퍼 함수로 추출하는 것을 강력히 권장합니다. 이 헬퍼 함수는 spec과 그룹화 키를 반환하는 콜백 함수를 인자로 받아 PartitionedSpec을 생성하도록 만들 수 있습니다. 이렇게 하면 코드 중복을 제거하고 향후 새로운 파티셔닝 전략을 추가하기 용이해집니다.

@toothlessdev toothlessdev merged commit fda733c into develop Jan 22, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor to Recursive hash tree structure

2 participants