Skip to content

[improve/#61] 커밋 추천 최소 신뢰도 기준 적용#62

Merged
Yujin1219 merged 5 commits into
developfrom
feat/wantkdd-match-threshold#61
May 18, 2026
Merged

[improve/#61] 커밋 추천 최소 신뢰도 기준 적용#62
Yujin1219 merged 5 commits into
developfrom
feat/wantkdd-match-threshold#61

Conversation

@wantkdd
Copy link
Copy Markdown
Collaborator

@wantkdd wantkdd commented May 15, 2026

✨ 작업 개요

적용사항-커밋 매칭에서 낮은 신뢰도 후보가 top_k를 채우기 위해 억지로 추천되는 문제를 개선했습니다.

📄 작업 내용

  • 커밋 추천 최소 신뢰도 기준을 70점으로 적용했습니다.
  • 70점 미만 후보는 recommended_commits에서 제외합니다.
  • top_k를 적용사항별 최대 반환 개수로 명확히 했습니다.
  • top_k가 작아도 최소 50개 후보를 조회해 70점 이상 후보 누락 가능성을 줄였습니다.
  • 추천 후보가 없으면 빈 배열로 응답하도록 테스트를 보강했습니다.
  • Swagger/DTO 설명에 추천 기준을 반영했습니다.

📌 관련 이슈

🔌 API 변경사항 (해당 시)

  • 응답 스키마 변경은 없습니다.
  • recommended_commits는 신뢰도 70점 이상 후보만 포함합니다.
  • 70점 이상 후보가 없으면 recommended_commits: [] 로 반환될 수 있습니다.
  • top_k는 항상 채우는 개수가 아니라 최대 반환 개수입니다.

💬 기타 사항

  • 실제 배포 Chroma 데이터 기준으로 50~69점 후보가 다수 false positive로 확인되어 70점 컷을 적용했습니다.
  • 50~69점 약한 후보를 별도로 노출하려면 후속으로 weak_candidates 같은 별도 필드/정책 검토가 필요합니다.

✅ 검증

  • uv run pytest: 106 passed
  • uv run ruff check: passed
  • uv run ruff format --check: passed

Summary by CodeRabbit

릴리스 노트

  • Documentation

    • API 문서에 신뢰도 70점 미만 후보 제외 기준 명시
    • 커밋 추천 응답 스키마 설명 업데이트
  • Tests

    • 신뢰도 임계값 검증 테스트 케이스 추가

Review Change Stack

wantkdd added 5 commits May 15, 2026 23:55
- 70점 미만 커밋 후보를 추천 응답에서 제외
- top_k가 작아도 최소 50개 후보를 조회하도록 풀 크기 보장
- top_k를 최대 추천 개수로 설명
- recommended_commits와 matched_applications에 70점 기준 명시
- 70점 미만 후보 제외 정책을 엔드포인트 설명에 추가
- 예시 응답 notice와 score_breakdown을 현재 스키마에 맞춤
- 50점 기준 추천 사유 분기를 제거해 70점 추천 정책과 혼동을 줄임
- 70점 후보 포함과 69점 후보 제외를 검증
- 낮은 신뢰도 후보가 추천 목록에서 제외되는 흐름을 검증
- 최소 후보 풀 크기로 Chroma 조회하는지 확인
@wantkdd wantkdd added the 🚀 Feat 기능 구현 및 수정 label May 15, 2026
@wantkdd wantkdd self-assigned this May 15, 2026
@wantkdd wantkdd requested a review from Yujin1219 May 15, 2026 14:57
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 30d3bf57-aa7f-4ba8-85d8-6af40149aa2b

📥 Commits

Reviewing files that changed from the base of the PR and between dc2a7d9 and e23daa3.

📒 Files selected for processing (5)
  • app/domains/commit/router.py
  • app/domains/commit/schemas.py
  • app/domains/commit/services/matching.py
  • app/domains/meeting_analysis/services/matching_scoring.py
  • tests/test_application_commit_matching.py
💤 Files with no reviewable changes (1)
  • app/domains/meeting_analysis/services/matching_scoring.py

📝 Walkthrough

Walkthrough

이 PR은 커밋 추천 기능의 최소 신뢰도 기준을 50점에서 70점으로 상향 조정하고, 매칭 로직의 임계값과 후보 풀 크기 계산을 상수화하며, API 스키마와 문서를 일관되게 갱신하고 포괄적인 테스트를 추가합니다.

Changes

커밋 추천 신뢰도 임계값 개선

Layer / File(s) Summary
매칭 로직 상수화 및 임계값 적용
app/domains/commit/services/matching.py
모듈 수준 상수(MIN_RECOMMENDATION_CONFIDENCE=70, MIN_COMMIT_CANDIDATE_POOL_SIZE=50, MAX_COMMIT_CANDIDATE_POOL_SIZE=100)를 정의하고, 추천 신뢰도 기준 70점을 매치 레코드 생성 시 적용하며, 후보 풀 크기를 min(MAX, max(MIN, top_k * 5)) 형태로 계산합니다.
API 스키마 및 문서 갱신
app/domains/commit/schemas.py, app/domains/commit/router.py
ApplicationCommitMatchRequest.top_k, ApplicationCommitMatchItem.recommended_commits, ApplicationCommitMatchResponse.matched_applicationsnotice 필드의 설명을 신뢰도 70점 기준으로 명시하고, 엔드포인트 문서와 예시 응답을 갱신하여 API 계약을 명확히 합니다.
기존 임계값 로직 제거
app/domains/meeting_analysis/services/matching_scoring.py
build_connection_reason()에서 기존 score.total < 50 임계치 기반 조기 반환을 삭제하고, 반대 방향 및 목표 불일치 조건이 연결 제한 사유 결정의 우선 역할을 하도록 변경합니다.
임계값 경계 조건 및 통합 테스트
tests/test_application_commit_matching.py
테스트 헬퍼 함수를 추가하고, MIN_RECOMMENDATION_CONFIDENCE 경계값에서 매치 레코드 포함/제외를 검증하는 단위 테스트 2개를 추가하며, 추천 후보 쿼리 호출 및 신뢰도 미만 후보 필터링 결과를 확인하는 통합 테스트를 추가합니다.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • WhyLog-App/Whylog-AI#18: 메인 PR이 적용사항-커밋 매칭 구현의 신뢰도 임계값과 후보 풀 크기 규칙을 직접 조정하므로 기존 결정사항-커밋 매칭 라우트/응답/로직과 관련이 있습니다.

Suggested labels

🛠 Fix

Suggested reviewers

  • yj-044
  • Yujin1219

Poem

🐰 일흔 점의 기준, 신뢰도 높여
얕은 추천은 모두 걸러
임계값 상수화로 명확히
테스트는 튼튼하게 다져
커밋 매칭이 한 걸음 나아갑니다 ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 커밋 추천 최소 신뢰도 기준 적용이라는 주요 변경사항을 명확하고 간결하게 요약하고 있습니다.
Description check ✅ Passed PR 설명이 템플릿의 모든 주요 섹션(작업 개요, 작업 내용, 관련 이슈, API 변경사항, 기타 사항)을 포함하고 있으며, 변경사항을 구체적으로 설명하고 있습니다.
Linked Issues check ✅ Passed PR의 모든 변경사항이 이슈 #61의 요구사항(70점 기준 적용, 낮은 신뢰도 제외, top_k 최대값 명확화, 테스트 강화)을 충족하고 있습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 이슈 #61의 커밋 추천 신뢰도 기준 적용에 관련되어 있으며, 범위를 벗어난 변경이 없습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/wantkdd-match-threshold#61

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Member

@Yujin1219 Yujin1219 left a comment

Choose a reason for hiding this comment

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

굿굿

@Yujin1219 Yujin1219 merged commit 22597d7 into develop May 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚀 Feat 기능 구현 및 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[improve] 커밋 추천 최소 신뢰도 기준 적용

2 participants