feat: #37 하루 마감 및 복구안 생성 로직 구현 - #38
Open
wngjs8114 wants to merge 2 commits into
Open
Conversation
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.
관련 이슈
Closes #37
작업 내용
하루 계획 마감(
finalize_daily_plan)과 분량유지형/핵심집중형 복구안 생성(generate_recovery_options) 로직 구현. 계획 자체는 사용자 승인 전까지 건드리지 않고,RecoveryPlan/RecoveryPlanItem만 생성한다.구조
progress_recorder.pyfinalize_daily_plan(daily_plan): 마감 처리 + 복구 필요 판단 +recovery.py위임record_progress(): 마감된 계획의 항목은 수정 거부하도록 방어 추가recovery.py(신규)generate_recovery_options(): 분량유지형/핵심집중형 두 안 생성scheduler.allocate_tasks_to_days()를 재사용해 재배치 계산마감 정책
filter(finalized_at__isnull=True).update(...))로 원자적 선점, SQLite에서도 안전하게 중복 마감 방지IncompleteProgressError시finalized_at도 트랜잭션 롤백으로 원복record_progress()로 해당 계획 항목 수정 불가복구안 정책
maintain_volume_failure_reason반환low+optional → low+basic → medium+optional순으로 하나씩 제외하며 재배치 시도.importance=high또는depth=core는 절대 제외 안 함. 최소 1개 작업은 반드시 남기며, 전부 제외해야 하는 상황이면core_focus=None+ 실패 사유 반환remaining_minutes큰 것부터 →order/id내림차순remaining_minutes: 최신speed_factor로estimated_max재계산 후,PARTIAL은 남은 완료율만큼만 반영 (평균값이 아닌 보수적 기준 — speed_calibrator의 평균값과는 목적이 다름)NOT_DONE은actual_minutes입력값과 무관하게 항상 0으로 고정 저장이번 PR 범위 밖
apply_recovery_plan()— 사용자가 복구안을 선택해 실제 계획에 반영 (다음 PR)테스트
python manage.py test planner→ 82개 통과 (기존 67 + 신규 15)