Skip to content

[Fix] 자기소개서 채점 프롬프트 및 서버 검증 강화#111

Merged
whc9999 merged 2 commits into
mainfrom
fix/refine-scoring
Jul 4, 2026
Merged

[Fix] 자기소개서 채점 프롬프트 및 서버 검증 강화#111
whc9999 merged 2 commits into
mainfrom
fix/refine-scoring

Conversation

@whc9999

@whc9999 whc9999 commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

✨ 어떤 이유로 PR를 하셨나요?

  • feature 병합
  • 버그 수정(아래에 issue #를 남겨주세요)
  • 코드 개선
  • 코드 수정
  • 배포
  • 기타(아래에 자세한 내용 기입해주세요)

📋 세부 내용 - 왜 해당 PR이 필요한지 작업 내용을 자세하게 설명해주세요

  • 채점 프롬프트에 jobFit, impact, completeness 세부 평가 기준 반영
  • fabricated status를 단순 근거 부족이 아닌 명백한 모순/비현실적 과장으로 한정
  • reason, improvement, sentence 작성 규칙을 프롬프트에 명확히 추가
  • LLM score 대신 jobFit/impact/completeness 가중합으로 총점 계산
  • 하위 점수 0~100 범위 검증 추가
  • invalid status 및 missing 분석 항목 제외 처리
  • sentence 원문 포함 여부, 중복 제거, 문항당 최대 3개 제한 강화
  • improvement 지시문 표현 제거 로직 보강
  • 관련 AnalysisService 테스트 보완

📸 작업 화면 스크린샷

⚠️ PR하기 전에 확인해주세요

  • 로컬테스트를 진행하셨나요?
  • 머지할 브랜치를 확인하셨나요?
  • 관련 label을 선택하셨나요?

🚨 관련 이슈 번호 [#91 ]

Summary by CodeRabbit

  • Bug Fixes
    • Analysis results now use stricter validation and more consistent scoring, preventing invalid scores from being saved.
    • Duplicate, missing, or malformed analysis entries are filtered out more reliably, improving result quality and stability.
    • Re-running an analysis now replaces older results more consistently, and repeated sentences are handled better.

- 채점 프롬프트에 jobFit, impact, completeness 세부 평가 기준 반영
- fabricated status를 단순 근거 부족이 아닌 명백한 모순/비현실적 과장으로 한정
- reason, improvement, sentence 작성 규칙을 프롬프트에 명확히 추가
- LLM score 대신 jobFit/impact/completeness 가중합으로 총점 계산
- 하위 점수 0~100 범위 검증 추가
- invalid status 및 missing 분석 항목 제외 처리
- sentence 원문 포함 여부, 중복 제거, 문항당 최대 3개 제한 강화
- improvement 지시문 표현 제거 로직 보강
- 관련 AnalysisService 테스트 보완
@whc9999 whc9999 self-assigned this Jul 4, 2026
@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@whc9999, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 21 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 62dcbef7-c44e-491f-a5a3-7381154a8700

📥 Commits

Reviewing files that changed from the base of the PR and between 37c12f0 and 0830735.

📒 Files selected for processing (5)
  • src/main/java/com/jobdri/jobdri_api/domain/analysis/dto/llm/AnalysisLlmResponse.java
  • src/main/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisAiClient.java
  • src/main/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisImprovementRules.java
  • src/main/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisService.java
  • src/test/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisServiceTest.java
📝 Walkthrough

Walkthrough

The AnalysisAiClient prompt logic was refactored into reusable constants with stricter output-validation rules. AnalysisService now validates LLM-returned scores, computes a weighted overall score, and applies stricter sentence/status parsing and deduplication when building question analyses. AnalysisServiceTest expectations and coverage were updated accordingly.

Changes

Analysis prompt and scoring update

Layer / File(s) Summary
Prompt constants and output validation rules
src/main/java/.../AnalysisAiClient.java
Introduces reusable OUTPUT_SCHEMA/EVALUATION_CRITERIA/STATUS_AND_WRITING_RULES constants, adds a rule forbidding guessed Korean exposure labels, and replaces the output verification block with a stricter checklist (substring, status, wording, integer score range constraints).
Score validation and weighted score calculation
src/main/java/.../AnalysisService.java
Adds score-bound and weight constants, validates required score fields and their ranges in analyze(...), and computes overall score via a weighted-rounding helper instead of clamping.
Question analysis building and status parsing
src/main/java/.../AnalysisService.java
Trims/validates sentences, parses status returning null for invalid values, deduplicates by (questionId, sentence), caps analyses per question, tracks progressive sentence search indices, and replaces instruction-like improvement detection logic.
Test expectation updates and new coverage
src/test/java/.../AnalysisServiceTest.java
Updates score assertions across existing tests, adds tests for weighted score calculation, out-of-range score errors with credit refund, status/sentence filtering, deduplication, per-question caps, and a new analysisItem helper.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: prompt tuning and stronger server-side validation for self-introduction scoring.
Description check ✅ Passed The description follows the template and covers purpose, details, checklist, and issue number, with only the screenshot section left empty.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/refine-scoring

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
src/main/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisService.java (1)

357-374: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Banned-phrase list duplicated between prompt text and Java code.

The instruction-like detection logic (regex + .contains() checks) mirrors the 금지 표현 list defined in AnalysisAiClient's STATUS_AND_WRITING_RULES (Line 149: 추가하세요, 보완하세요, 수정해주세요, 수정하세요, 작성해주세요, 작성하세요, 필요합니다, 해야 합니다, 해주세요, 명확히 해야). Today both lists are in sync, but they live in separate files with no shared reference, so a future addition to one (e.g., updating the prompt's banned phrases) can silently drift from the other, letting non-compliant improvement text through or over-filtering valid ones.

Consider extracting the canonical phrase list into a single shared constant that both the prompt text and the Java filter derive from.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/main/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisService.java`
around lines 357 - 374, The banned-phrase detection in AnalysisService is
duplicated from the STATUS_AND_WRITING_RULES prompt in AnalysisAiClient, which
risks the two lists drifting over time. Extract the canonical “금지 표현” phrases
into a shared constant or helper that both AnalysisService’s improvement filter
and AnalysisAiClient’s prompt generation use, and update the regex/.contains()
checks to derive from that single source.
src/main/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisAiClient.java (1)

32-32: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Unused score field still required in schema despite server discarding it.

OUTPUT_SCHEMA (Line 32) and the self-verification checklist (Line 250) still instruct the model to produce score, but AnalysisService.analyze(...) now computes the persisted score entirely from jobFit/impact/completeness weights and never reads llmResponse.score(). Since AnalysisLlmResponse is bound via .text(AnalysisLlmResponse.class), the field is still part of the derived JSON schema, so the model keeps spending output tokens generating a value nobody uses.

Consider dropping score from the schema/record (or explicitly documenting why it's intentionally retained, e.g. as a self-consistency nudge for the model) to avoid confusing future maintainers and to save tokens.

Also applies to: 242-254

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/main/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisAiClient.java`
at line 32, Remove the unused score requirement from the LLM contract in
AnalysisAiClient: update OUTPUT_SCHEMA and the self-verification checklist so
AnalysisLlmResponse no longer asks the model to emit score, since
AnalysisService.analyze(...) ignores llmResponse.score() and computes the
persisted score from jobFit, impact, and completeness instead. If score is
intentionally kept for model guidance, document that explicitly in the
AnalysisLlmResponse schema and checklist; otherwise delete the field from the
record/schema to avoid wasted tokens and confusion.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@src/main/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisAiClient.java`:
- Line 32: Remove the unused score requirement from the LLM contract in
AnalysisAiClient: update OUTPUT_SCHEMA and the self-verification checklist so
AnalysisLlmResponse no longer asks the model to emit score, since
AnalysisService.analyze(...) ignores llmResponse.score() and computes the
persisted score from jobFit, impact, and completeness instead. If score is
intentionally kept for model guidance, document that explicitly in the
AnalysisLlmResponse schema and checklist; otherwise delete the field from the
record/schema to avoid wasted tokens and confusion.

In
`@src/main/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisService.java`:
- Around line 357-374: The banned-phrase detection in AnalysisService is
duplicated from the STATUS_AND_WRITING_RULES prompt in AnalysisAiClient, which
risks the two lists drifting over time. Extract the canonical “금지 표현” phrases
into a shared constant or helper that both AnalysisService’s improvement filter
and AnalysisAiClient’s prompt generation use, and update the regex/.contains()
checks to derive from that single source.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 93eda773-a55c-46a9-98f8-282d63139a9a

📥 Commits

Reviewing files that changed from the base of the PR and between 82510d1 and 37c12f0.

📒 Files selected for processing (3)
  • src/main/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisAiClient.java
  • src/main/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisService.java
  • src/test/java/com/jobdri/jobdri_api/domain/analysis/service/AnalysisServiceTest.java

- LLM 응답 DTO와 프롬프트 스키마에서 미사용 score 필드 제거
- 서버 총점 계산 흐름에 맞춰 self-verification checklist 정리
- improvement 금지 표현 목록을 공용 helper로 분리
- 프롬프트와 서버 검증 로직이 동일한 금지 표현 목록을 참조하도록 변경
- AnalysisService 테스트 fixture를 변경된 LLM 응답 DTO에 맞게 수정
@whc9999 whc9999 merged commit 8751ea3 into main Jul 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant