Skip to content

[feat] 다정이 제거, 슬픔이 추가, 기쁨이에게 다정이 성격 추가 - #133

Merged
kite707 merged 11 commits into
devfrom
feat/112-sadness-character
Aug 12, 2026
Merged

[feat] 다정이 제거, 슬픔이 추가, 기쁨이에게 다정이 성격 추가#133
kite707 merged 11 commits into
devfrom
feat/112-sadness-character

Conversation

@kite707

@kite707 kite707 commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

🔗 연관 이슈

📌 개요

감정 캐릭터에서 다정이를 빼고 슬픔이를 넣습니다. 다정이가 맡던 "챙기는" 포지션은 기쁨이 보이스 카드가 흡수하고, 슬픔이는 조언 대신 "그럴 만했다"를 먼저 주는 역할을 맡습니다.

🔧 주요 변경사항

  • EmotionType·PromptCharacterId에서 WARM/dajeong을 제거하고 SADNESS/seulpeum을 추가했습니다. 캐릭터는 계속 6종입니다.
  • 프롬프트 3종(COMMON·COMMENT·CARD)을 갱신하는 마이그레이션 V26을 추가했습니다. COMMON은 유저-캐릭터 경계 규칙의 이름 목록, 기쁨이 보이스 카드, 다정이 자리의 슬픔이 보이스 카드가 바뀌고, COMMENT는 진영 분류 한 줄, CARD는 대변 방식 한 줄이 바뀝니다.
  • 백오피스 플레이그라운드 캐릭터 목록과 대시보드 감정 색상표에 슬픔이를 반영했습니다.

🌐 API · DB 영향

  • API 변경: MessageResponse.emotionType의 허용값에서 WARM이 빠지고 SADNESS가 들어갑니다. excludeCharacters도 같습니다.
  • DB 마이그레이션: 두 개이며 스키마 변경은 없습니다.
    • V26llm_settings의 COMMON·COMMENT·CARD 프롬프트를 UPDATE하고, 각 타입의 리비전을 max+1로 채번해 함께 남깁니다.
    • V27messages·cards·conversations·generation_log를 비웁니다.
  • 하위 호환: ⚠️ 호환성 깨짐 — emotion = 'WARM'으로 저장된 카드·메시지는 enum 매핑에 실패합니다. 아직 실사용자 배포 전이라 보존할 데이터가 없다고 판단해 상수를 남기지 않고, 남은 행은 V27로 정리합니다.

V27을 수동 SQL이 아니라 마이그레이션으로 넣은 이유는 순서 때문입니다. 정리가 배포보다 늦으면 그 사이에 새 코드가 WARM 행을 읽다가 500이 나는데, Flyway는 앱이 트래픽을 받기 전에 실행되므로 그 구간 자체가 생기지 않습니다. 다정이 행만 골라 지우면 replies_to_message_id·root_message_id가 사라진 메시지를 가리켜 스레드가 끊기므로 네 테이블을 통째로 비웁니다. 서로를 참조하는 컬럼이 이 네 테이블 안에만 있어 끊어진 참조는 남지 않고, 새로 만든 환경에서는 대상 행이 없어 아무 일도 하지 않습니다.

되돌릴 수 없는 작업이므로 prod 배포 전에 덤프를 뜹니다.

💬 리뷰 포인트

처음에는 selectable 플래그로 다정이를 "저장된 값으로는 유효하되 새로 뽑히지는 않는" 상태로 두고 신규 생성에서만 제외했는데, 배포 전이라 지켜야 할 과거 레코드가 없다는 게 확인돼서 제거했습니다. 그 장치를 두면 "캐릭터 전체"가 entries(저장·번역 가능)와 SELECTABLE(신규 생성 가능)로 쪼개집니다. 이후에 누가 entries를 무심코 쓰면 다정이가 다시 생성 후보에 들어가는데, 예외도 나지 않고 조용히 그렇게 됩니다. 이 판단이 맞는지 봐주세요.

프롬프트를 백오피스 수동 저장이 아니라 마이그레이션으로 넣은 것도 봐주시면 좋겠습니다. 프롬프트의 단일 원본은 DB지만, V23 시드에 다정이가 그대로 남아 있어 새로 만든 환경은 슬픔이 보이스 카드가 없는 상태가 됩니다. 이때 LLM이 임의로 지어내고 파싱은 성공하므로, 에러 없이 생성 품질만 떨어집니다. 각 환경의 리비전이 전부 v1이라(아무도 편집한 적 없음) 조건 없는 UPDATE로 덮어쓸 편집분도 없습니다.

@kite707 kite707 self-assigned this Aug 12, 2026
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown

Test Results

525 tests  +3   525 ✅ +3   1m 56s ⏱️ -12s
 75 suites +1     0 💤 ±0 
 75 files   +1     0 ❌ ±0 

Results for commit 525dc60. ± Comparison against base commit 797dcdf.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown

Test Coverage

Overall Project 81.45% 🍏
Files changed 100% 🍏

File Coverage
MessageResponse.kt 100% 🍏
EmotionType.kt 100% 🍏
PromptCharacterId.kt 100% 🍏
PromptPreviewRequest.kt 100% 🍏

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

WARM 감정을 제거하고 SADNESS 감정을 추가했습니다. 프롬프트 캐릭터 매핑, 관리 화면, API 문서, 데이터베이스 마이그레이션, 골든 파일과 관련 테스트를 갱신했습니다.

Changes

감정 캐릭터 전환

Layer / File(s) Summary
감정 계약과 캐릭터 매핑
src/main/kotlin/com/nexters/gamss/emotion/..., src/main/kotlin/com/nexters/gamss/llm/prompt/..., src/main/kotlin/com/nexters/gamss/conversation/controller/dto/..., src/main/kotlin/com/nexters/gamss/admin/controller/dto/..., admin-web/src/pages/..., src/test/kotlin/com/nexters/gamss/llm/prompt/...
EmotionTypePromptCharacterId에서 WARM을 제거하고 SADNESS를 추가했습니다. API 문서와 관리 화면의 감정 목록을 갱신했습니다. 프롬프트 ID의 양방향 매핑과 미등록 ID 예외를 테스트합니다.
프롬프트 마이그레이션과 골든 파일
src/main/resources/db/migration/..., src/test/resources/prompts/..., src/test/kotlin/com/nexters/gamss/llm/settings/...
COMMON, COMMENT, CARD 프롬프트를 SADNESS 기준으로 변경했습니다. 변경된 프롬프트를 새 리비전으로 저장합니다. 골든 파일 비교 테스트의 기준을 전체 마이그레이션 적용 결과로 변경했습니다.
감정 전환 검증
src/test/kotlin/com/nexters/gamss/card/..., src/test/kotlin/com/nexters/gamss/conversation/..., src/test/kotlin/com/nexters/gamss/llm/parsing/...
카드, 대화, 댓글 생성과 댓글 파싱 테스트의 감정 데이터를 WARM에서 SADNESS로 변경했습니다.

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

🚥 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 제목은 WARM 제거, SADNESS 추가, 기쁨이 역할 변경이라는 주요 변경사항을 명확하게 요약합니다.
Description check ✅ Passed 연관 이슈, 개요, 주요 변경사항, API·DB 영향, 호환성, 리뷰 포인트를 모두 포함합니다.
Linked Issues check ✅ Passed PR은 관련 이슈 #112를 명시하며, 이슈 목표와 변경사항이 일치합니다.
Out of Scope Changes check ✅ Passed 마이그레이션, 프롬프트, 백오피스, API 문서, 테스트 변경이 모두 PR 목표에 포함됩니다.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/112-sadness-character

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.

Actionable comments posted: 2

🤖 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.

Inline comments:
In
`@src/main/resources/db/migration/V26__replace_dajeong_with_seulpeum_prompts.sql`:
- Around line 1-16: In
src/main/resources/db/migration/V26__replace_dajeong_with_seulpeum_prompts.sql
lines 1-16, add idempotent data cleanup for every schema-confirmed emotion
column in messages, cards, conversations, and generation_log, converting
persisted 'WARM' values to 'SADNESS' before normal reads occur, alongside the
existing prompt update. In
src/main/kotlin/com/nexters/gamss/emotion/domain/EmotionType.kt lines 4-14, no
direct change is required because the migration must make removal of WARM safe
for existing and newly initialized databases.

In
`@src/test/kotlin/com/nexters/gamss/card/controller/dto/CardCalendarResponseTest.kt`:
- Line 52: Update the test around CardCalendarResponseTest to assert that the
first grouped result’s emotions equals listOf("SADNESS"), alongside the existing
date assertion. This must verify SADNESS serialization and date grouping through
CardCalendarResponse.emotions.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 41af65fa-525e-4ed6-b842-6d9cc92398af

📥 Commits

Reviewing files that changed from the base of the PR and between 797dcdf and 6928854.

📒 Files selected for processing (18)
  • admin-web/src/pages/dashboard/usage-section.tsx
  • admin-web/src/pages/prompt-playground.tsx
  • src/main/kotlin/com/nexters/gamss/admin/controller/dto/PromptPreviewRequest.kt
  • src/main/kotlin/com/nexters/gamss/conversation/controller/dto/MessageResponse.kt
  • src/main/kotlin/com/nexters/gamss/emotion/domain/EmotionType.kt
  • src/main/kotlin/com/nexters/gamss/llm/prompt/PromptCharacterId.kt
  • src/main/resources/db/migration/V26__replace_dajeong_with_seulpeum_prompts.sql
  • src/test/kotlin/com/nexters/gamss/card/controller/dto/CardCalendarResponseTest.kt
  • src/test/kotlin/com/nexters/gamss/conversation/controller/ConversationControllerIntegrationTest.kt
  • src/test/kotlin/com/nexters/gamss/conversation/domain/MessageTest.kt
  • src/test/kotlin/com/nexters/gamss/conversation/service/CommentGenerationServiceTest.kt
  • src/test/kotlin/com/nexters/gamss/conversation/service/MessageThreadOrderTest.kt
  • src/test/kotlin/com/nexters/gamss/llm/parsing/CommentFeedValidatorTest.kt
  • src/test/kotlin/com/nexters/gamss/llm/prompt/PromptCharacterIdTest.kt
  • src/test/kotlin/com/nexters/gamss/llm/settings/PromptSeedIntegrationTest.kt
  • src/test/resources/prompts/CARD.default.txt
  • src/test/resources/prompts/COMMENT.default.txt
  • src/test/resources/prompts/COMMON.default.txt

@kite707
kite707 requested a review from theminjunchoi August 12, 2026 15:03
@kite707 kite707 changed the title [feat] 다정이 제거하고 슬픔이 추가 [feat] 다정이 제거, 슬픔이 추가, 기쁨이에게 다정이 성격 추가 Aug 12, 2026

@theminjunchoi theminjunchoi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

수고하셨어요! 이대로 가면 백오피스에서 프롬프트 수정안해도 적용될 것 같네용

@kite707
kite707 merged commit 5227b2d into dev Aug 12, 2026
7 checks passed
@kite707
kite707 deleted the feat/112-sadness-character branch August 12, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] 다정이 제거, 슬픔이 추가, 기쁨이에게 다정이 성격 추가

2 participants