Skip to content

[Refactor] 로드맵 생성에서 사용자 notes 반영 우선순위 강화#104

Merged
iamb0ttle merged 2 commits into
mainfrom
refactor/103-roadmap-notes-priority
May 1, 2026
Merged

[Refactor] 로드맵 생성에서 사용자 notes 반영 우선순위 강화#104
iamb0ttle merged 2 commits into
mainfrom
refactor/103-roadmap-notes-priority

Conversation

@iamb0ttle

@iamb0ttle iamb0ttle commented May 1, 2026

Copy link
Copy Markdown
Member

1. 개요

2. 작업 내용

  • 로드맵 스켈레톤 프롬프트에서
    otes를 최우선 사용자 메모 섹션으로 분리하고 일반 선호보다 우선 반영하도록 규칙을 강화했습니다.
  • 최종 합성 프롬프트에서도
    otes를 title/summary/tags/commentary 생성의 핵심 제약으로 명시하고, 관련 프롬프트 검증 테스트를 추가했습니다.

3. AI 활용 및 검증

  • AI가 생성한 코드 포함

  • 100% 직접 작성

  • 검증 방법:

    • docker exec mohaeng pytest tests/test_roadmap_generation_simplified_pipeline.py
    • docker exec mohaeng ruff check app/graph/roadmap/nodes/skeleton.py app/graph/roadmap/nodes/finalize.py tests/test_roadmap_generation_simplified_pipeline.py
    • docker exec -w /workspace mohaeng pre-commit run --all-files 는 컨테이너 내 git 부재로 실행 불가

4. 스크린샷 (선택)

  • 없음

5. 체크리스트

  • uv run pre-commit run --all-files를 실행하여 통과했는가?
  • 스스로 코드를 한 번 리뷰했는가? (AI가 짠 코드 맹신 금지)
  • 불필요한 주석이나 print 문을 제거했는가?

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 사용자 메모가 로드맵 생성의 최우선 입력값으로 처리됩니다. 사용자의 우선순위 메모는 이제 제목, 요약, 태그, 설명 전반에 일관되게 적용되며 다른 선호사항과 충돌 시 우선 적용됩니다.
  • 테스트

    • 사용자 우선순위 메모의 적절한 우선순위 처리를 검증하는 테스트가 추가되었습니다.

@iamb0ttle iamb0ttle requested a review from zweadfx as a code owner May 1, 2026 08:17
@coderabbitai

coderabbitai Bot commented May 1, 2026

Copy link
Copy Markdown

요약

최종 로드맵 요약 프롬프트 생성에 정규화된 "최우선 사용자 메모" 필드를 통합하고, 스켈레톤 세그먼트 생성 프롬프트를 업데이트하여 사용자 우선순위 메모가 다른 선호도를 우선시하도록 수정했습니다.

변경 사항

그룹 / 파일 요약
프롬프트 생성 헬퍼 함수
app/graph/roadmap/nodes/finalize.py, app/graph/roadmap/nodes/skeleton.py
_build_summary_prompt_messages와 우선순위 메모 정규화 헬퍼 함수 추가. "최우선 사용자 메모" 필드를 제목, 요약, 태그, LLM 설명에 우선적으로 반영하도록 프롬프트 수정. 우선순위 메모가 다른 일반 선호도와 충돌할 때 우선권을 가지도록 명시적 지시문 추가.
테스트 커버리지 확대
tests/test_roadmap_generation_simplified_pipeline.py
새로운 헬퍼 함수 _build_segment_prompt_build_summary_prompt_messages 직접 실행. notes/priority_notes 포함 프롬프트 입력 구성 및 "최우선 사용자 메모" 우선순위 검증 테스트 케이스 추가.

예상 코드 리뷰 난이도

🎯 3 (보통) | ⏱️ ~20분

관련 이슈

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive PR 설명이 필수 섹션을 모두 포함하고 있으나, 섹션 2에서 일부 텍스트 손상(줄바꿈으로 인한 'notes' 오타)이 있고 섹션 5의 첫 번째 체크리스트 항목이 미완료로 표시되어 있습니다. 섹션 2의 텍스트 오류('otes')를 수정하고, 'uv run pre-commit run --all-files' 실행 여부를 명확히 하여 체크리스트를 정확히 업데이트해주세요.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 주요 변경사항을 명확하게 반영하고 있습니다. '로드맵 생성에서 사용자 notes 반영 우선순위 강화'는 변경사항의 핵심(사용자 메모 우선순위 강화)을 정확히 설명합니다.
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.

✏️ 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 refactor/103-roadmap-notes-priority

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

@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 (1)
app/graph/roadmap/nodes/finalize.py (1)

256-259: ⚡ Quick win

우선 메모 정규화 로직은 공용 유틸로 통합하는 편이 안전합니다.

동일한 _format_priority_notesapp/graph/roadmap/nodes/skeleton.py에도 있어 정책 변경 시 드리프트 가능성이 있습니다. 한 곳으로 모아 재사용하면 후속 변경 리스크를 줄일 수 있습니다.

예시 리팩터링 방향
+# app/graph/roadmap/prompt_notes.py
+def format_priority_notes(notes: str | None) -> str:
+    normalized = str(notes or "").strip()
+    return normalized if normalized else "없음"
-# app/graph/roadmap/nodes/finalize.py
-def _format_priority_notes(notes: str | None) -> str:
-    normalized = str(notes or "").strip()
-    return normalized if normalized else "없음"
+from app.graph.roadmap.prompt_notes import format_priority_notes
...
-        priority_notes = _format_priority_notes(course_request.notes)
+        priority_notes = format_priority_notes(course_request.notes)
-# app/graph/roadmap/nodes/skeleton.py
-def _format_priority_notes(notes: Any) -> str:
-    normalized = _normalize_text(notes)
-    return normalized if normalized else "없음"
+from app.graph.roadmap.prompt_notes import format_priority_notes
...
-    priority_notes = _format_priority_notes(request.notes)
+    priority_notes = format_priority_notes(request.notes)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/graph/roadmap/nodes/finalize.py` around lines 256 - 259, The
_format_priority_notes function in finalize.py is duplicated in skeleton.py and
should be extracted to a shared utility to avoid drift; create a single helper
(e.g., format_priority_notes) in a common module (for example a new or existing
utils/formatting module), move the normalization logic (str(notes or "").strip()
-> return "없음" when empty) into that helper, update both finalize.py and
skeleton.py to import and call the new helper name (replace references to
_format_priority_notes), and ensure function signature and return type remain
the same so callers need no further changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@app/graph/roadmap/nodes/finalize.py`:
- Around line 256-259: The _format_priority_notes function in finalize.py is
duplicated in skeleton.py and should be extracted to a shared utility to avoid
drift; create a single helper (e.g., format_priority_notes) in a common module
(for example a new or existing utils/formatting module), move the normalization
logic (str(notes or "").strip() -> return "없음" when empty) into that helper,
update both finalize.py and skeleton.py to import and call the new helper name
(replace references to _format_priority_notes), and ensure function signature
and return type remain the same so callers need no further changes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3e5a857c-a09b-49c8-8e1d-ea0b79afae30

📥 Commits

Reviewing files that changed from the base of the PR and between d9d2b4f and 32dfbba.

📒 Files selected for processing (3)
  • app/graph/roadmap/nodes/finalize.py
  • app/graph/roadmap/nodes/skeleton.py
  • tests/test_roadmap_generation_simplified_pipeline.py

@iamb0ttle iamb0ttle merged commit a89d0f1 into main May 1, 2026
3 checks passed
@iamb0ttle iamb0ttle deleted the refactor/103-roadmap-notes-priority branch May 1, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant