fix: 세션 설정 정리 + 분석 결과 cascade soft delete + 질문 풀 토큰 절감#41
Merged
Conversation
운영 코드 분석에서 발견된 4가지 이슈 일괄 패치. ## F1. SessionCreateRequest Bean Validation 정리 - maxQuestions @min(1) → @min(2). applyPool 자동 종료 검사 없고 applyFollowup 에서만 종료 → 1 설정해도 최소 첫질문+꼬리질문 2개. 최소값 2로 명시. - maxDurationMinutes 시간 기반 자동 종료 미구현 → @Min/@Max/@NotNull 제거, nullable 허용 (DB 저장만 유지, Sprint 4 에서 정식 분기). - SessionMode 사용처 entity·DTO 외 0건 → @NotNull 풀고 null 시 default ONLINE. ## F2. Resume/GithubRepository 삭제 시 AnalyzedDocument cascade soft delete - Resume/Repository/AnalyzedDocument 에 markDeleted() 도메인 메서드 추가 (User.markDeleted() 동일 패턴). - ResumeService.delete / GithubRepositoryService.delete 가 entity.markDeleted() 호출 + ResumeDeletedEvent / RepositoryDeletedEvent 발화. - document.application.AnalyzedDocumentCascadeListener 가 두 이벤트 수신 → 관련 AnalyzedDocument soft delete. - 직접 의존 회피 (ArchUnit 도메인 cycle 차단 — resume/github 가 document import X). - 임베딩(document_embeddings) 은 컨텍스트 선택 시 deleted=false 만 노출되므로 별도 정리 불필요. ## F3. AI 질문 풀 토큰 낭비 차단 - Core QuestionsCallbackService.applyPool 이 questions[0] 만 INSERT 하고 나머지 폐기. envelope.max_questions=10 면 LLM 출력 9개 버려져 토큰 약 10배 낭비. - AI QuestionsConsumer 에 initial_pool_size (default 1) 추가, envelope 무시. - settings.questions_initial_pool_size = 1. 풀 저장 도입 시 늘리기 쉬움. ## 테스트 - Backend BUILD SUCCESSFUL (ArchUnit 도메인 cycle 통과) - AI 144 passed (test_questions_consumer max_questions assertion 갱신)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
운영 코드 분석에서 발견된 4가지 이슈 일괄 패치.
F1. SessionCreateRequest Bean Validation 정리
F2. Resume/GithubRepository 삭제 시 AnalyzedDocument cascade soft delete
F3. AI 질문 풀 토큰 낭비 차단
테스트
변경 사항