Skip to content

[Feat] 서버 루틴 추천과 로컬 fallback 구현 - #99

Draft
MinHeokChoi wants to merge 1 commit into
feat/#96-account-voice-selectionfrom
feat/#98-server-routine-recommendation
Draft

[Feat] 서버 루틴 추천과 로컬 fallback 구현#99
MinHeokChoi wants to merge 1 commit into
feat/#96-account-voice-selectionfrom
feat/#98-server-routine-recommendation

Conversation

@MinHeokChoi

Copy link
Copy Markdown
Contributor

✨ PR 유형

어떤 변경 사항이 있나요??

  • 새로운 기능 추가
  • 버그 수정
  • 사용자 UI 디자인 변경 및 추가
  • 코드에 영향을 주지 않는 변경사항
  • 코드 리팩토링
  • 주석 추가 및 수정
  • 문서 수정
  • 테스트 추가, 테스트 리팩토링
  • 빌드 부분 혹은 패키지 매니저 수정
  • 파일 혹은 폴더명 수정
  • 파일 혹은 폴더 삭제

🛠️ 작업내용

  • 실제 Swagger의 bearer POST /routine-groups/ai-generate Target·DTO·RemoteDataSource를 추가했습니다.
  • ServerRoutineSuggestionService가 routine/step title, description, 130개 step, exact CHECK/TIMER/INPUT, step별 13600초를 검증합니다.
  • 서버 응답은 remote ID를 보존하지 않고 routine·alarm·step 모두 새 local UUID, localOnly인 editable draft로 변환합니다.
  • async RoutineSuggestionCoordinator가 로그인 중에만 서버를 시도하고 signed-out, airplane/transport, timeout, 5xx, decoding, missing result, validation 실패에서는 기존 LocalTemplateSuggestionService를 사용합니다.
  • 요청 전후 signed-in member ID를 비교해 계정 전환 중 도착한 이전 계정 서버 결과를 폐기하고 local draft로 대체합니다.
  • 서버 요청은 선택 goal/keyword와 사용자가 직접 입력한 freeform text만 200자로 제한해 보내며 alarm/weekdays, voice, 음성 녹음, STT transcript는 포함하지 않습니다. DTO description과 네트워크 로그에도 입력·token·body를 남기지 않습니다.
  • alarm time, weekdays, goal/keyword/freeform 입력은 로컬 draft 상태에 그대로 유지합니다.
  • 추천 source는 서버 맞춤 추천/기기 내 추천으로 표시하되 원시 오류나 사용자 입력은 UI에 노출하지 않습니다.
  • confirm 전에는 SwiftData를 쓰지 않으며, confirm 시 화면에서 검토한 동일 routine/step UUID를 기존 Onboarding/Local Routine Repository 경로로만 저장합니다.
  • 자동 저장·자동 덮어쓰기, Routine/Run sync, 서버 TTS는 포함하지 않습니다.

검증

  • P8 XCTest: 9 passed
  • 전체 signed 직렬 XCTest: 385 passed, 0 failed, 0 skipped
  • signed Keychain foundation 직렬 XCTest: 14 passed, 0 failed, 0 skipped
  • iPhone 16 Simulator Debug build: passed
  • generic iPhone Debug/Release build: passed
  • bash Scripts/check-iphone-functional-gate.sh: passed
  • exact V4 bash Scripts/check-swiftdata-boundary.sh: passed
  • plutil -lint Moru/Info.plist Moru/Moru/Moru.entitlements: passed
  • git diff --check: passed
  • 실제 OpenAPI 문서 조회: 확인 완료
  • 인증된 실제 서버 AI 생성 E2E: 미검증
  • 실제 iPhone: 미검증

📋 추후 진행 상황

  • 실제 계정으로 AI 생성 응답 품질, latency, 운영 오류 code를 확인해야 합니다.
  • client validation bound(title 80, description 500, step 30개, step title 100, duration 1~3600초)는 Swagger에 제한이 부족해 안전한 local editor 범위로 적용했습니다. 서버 계약이 구체화되면 함께 조정해야 합니다.
  • P9에서 계정 기능 출시·개인정보 문구와 서버 전송 입력 정책을 최종 정리합니다.

📌 리뷰 포인트

  • 서버 결과가 confirm 전에 어떤 SwiftData/Repository write도 만들지 않는지 확인해 주세요.
  • account 전환 중 stale server response가 새 계정에 표시되지 않는지 확인해 주세요.
  • alarm/weekdays와 onboarding 입력을 서버 결과가 덮어쓰지 않는지 확인해 주세요.
  • 실패 종류와 무관하게 local-only 추천·편집·저장이 계속 가능한지 확인해 주세요.
  • voice/STT/transcript/token/body가 요청 계약 또는 로그에 들어가지 않는지 확인해 주세요.

✅ Checklist

  • 커밋 메시지 컨벤션에 맞게 작성했습니다
  • P7 동결 branch를 base로 사용했습니다
  • SwiftData V4와 Routine/Run localOnly 계약을 유지했습니다
  • Draft OPEN 상태로 생성하며 merge하지 않습니다

Closes #98

DO NOT MERGE — v2 stacked PR 일괄 검토 대기

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a56ba7ae-c7a7-4e2f-8c2b-0c8a82d7c10a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#98-server-routine-recommendation

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.

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