feat: FedEntry에 kind/applies_to/tags 필드 추가#241
Merged
seyoung4503 merged 3 commits intoJul 19, 2026
Conversation
비즈니스 용어를 Metric/Table/Rule/Dimension으로 분류할 수 있도록 FedEntry에 kind, applies_to, tags 필드를 추가한다. - FedEntry: kind, applies_to, tags 필드 추가 (기존 JSON 하위호환) - term_custom tool spec: 세 파라미터 노출 - _fmt_entry: kind 배지 표시 (`metric` 등) - 신규 테스트 3개: round-trip, 하위호환, kind 배지 렌더링 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pre-commit black check (--all-files) was consistently failing on master and all PR branches. This commit formats all Python files to make CI green. No logic changes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
|
머지 가능합니다. 테스트 124개 통과. diff가 45파일인데 43개는 확인한 것:
이대로 머지하고, 아래는 후속 PR에서 챙겨주시면 좋겠습니다. 1. 들어온 값을 무조건 문자열로 바꿔 쉼표로 자르고 있어서, 값이 비면 2. 3. |
3 tasks
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.
#️⃣ Issue Number
없음
📝 요약(Summary)
한 줄 요약: 비즈니스 용어에 '종류' 분류를 추가해, 모호한 표현이 들어왔을 때 더 정확한 SQL을 생성할 수 있는 기반을 마련합니다.
해결하려는 문제
사용자가 "이번달 활성고객의 순매출 알려줘"라고 질문할 때, 시스템은 세 가지 전혀 다른 종류의 정보를 알아야 합니다.
기존에는 이 세 가지가 KV 저장소에 동일한 형태의 문자열로 뒤섞여 있었습니다. LLM이 용어를 꺼내도 "이게 필터 조건인지, 분류 기준인지, 테이블 설명인지" 스스로 판단해야 했고, 이는 SQL 생성 오류의 원인이 됐습니다.
이번 변경으로 달라지는 것
용어 등록 시 종류(
kind)를 함께 저장합니다.metricdimensionruletable같은 질문에서 LLM은 이제 "활성고객(metric)은 WHERE 절에, 고객 등급(dimension)은 GROUP BY에, 환불 제외(rule)는 AND 조건에 쓴다"는 판단을 더 정확하게 할 수 있습니다.
정의가 없는 경우
용어 정의가 등록되어 있지 않아도 동작합니다. 기존
Ambiguous Term Policy에 따라 LLM이 DB 스키마 기준으로 가장 합리적인 해석으로 SQL을 실행하고, 사용한 해석을 사용자에게 명시한 뒤 등록 여부를 묻습니다. 사용자가 확인하면 그 시점부터 정의가 쌓입니다. 쓸수록 정확해지는 구조입니다.다음 PR과의 관계
이
kind필드는 PR2(OKF bundle)에서 용어를metrics/,tables/,rules/폴더로 분리 저장하는 데 사용됩니다. 이번 PR은 그 기반을 마련하는 작업입니다.💬 To Reviewers
이 PR은 총 4개로 구성된 시리즈의 첫 번째입니다. 의존성 순서대로 순차 머지 부탁드립니다.
FedEntry.from_json()의 하위호환 처리(d.get("kind", "")) 방식이 적절한지 확인 부탁드립니다.kind값 검증(enum 강제)은 tool spec의enum제약으로만 처리했습니다.FedEntry레벨에서 추가 검증이 필요한지 의견 주시면 감사합니다.PR Checklist