[Architect] Refs #204 — adopt dose_variants design (ADR-0001)
Resolves the long-pending dose variant decision before Phase 1 schema work:
- habit.dose_variants[] added (id/label/dose_text/context_tags/condition_tags/is_minimum), no cardinality cap.
- tracker_entry gains variant_id + context_snapshot{location,condition}.
- reflection gains weekly minimum_ratio (hint-only).
- data-model.md: R9 (≤4) retired; new R9 (no cap, UX-side enforcement) + R10 (weekly minimum_ratio hint, no threshold).
- docs/adr/0001-dose-variants.md captures rationale + alternatives.
Why now: Phase 1 (#204) needs the final schema shape before Drift DDL is drawn.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -43,8 +43,37 @@
|
||||
"type": "integer", "minimum": 1,
|
||||
"description": "Atomic Habits #5 habit stacking 순서"
|
||||
},
|
||||
"min_dose": { "type": "string", "description": "시작 doseo (Tiny Habits)" },
|
||||
"target_dose": { "type": "string" },
|
||||
"min_dose": { "type": "string", "description": "시작 dose (Tiny Habits). dose_variants 사용 시 deprecated 가능" },
|
||||
"target_dose": { "type": "string", "description": "dose_variants 사용 시 deprecated 가능" },
|
||||
"dose_variants": {
|
||||
"type": "array",
|
||||
"description": "상황·컨디션별 도즈 옵션. 개수 제한 없음 (R9 폐기). 매일 체크인 시 context_tags/condition_tags 매칭으로 추천. 최소 1개 항목의 is_minimum=true 권장 (없어도 됨).",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["id", "label", "dose_text"],
|
||||
"properties": {
|
||||
"id": { "type": "string", "description": "habit 안에서 unique. tracker_entry.variant_id 참조" },
|
||||
"label": { "type": "string", "description": "사용자가 보는 짧은 이름 (예: '짐-메인', '집-아침')" },
|
||||
"dose_text": { "type": "string", "description": "실제 도즈 표현 (예: '데드 리프트 60kg 5x5', '푸시업 5회')" },
|
||||
"context_tags": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "장소·상황 태그 (예: ['짐'], ['집','아침'], ['출장'])"
|
||||
},
|
||||
"condition_tags": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" },
|
||||
"description": "컨디션 태그 (예: ['좋음'], ['피곤','수면부족'])"
|
||||
},
|
||||
"is_minimum": {
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "최소 도즈(tiny) 여부. 주간 reflection의 'minimum 비율' 가드 계산에 사용"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"started_at": { "$ref": "enums.schema.json#/$defs/DateString" },
|
||||
"ended_at": { "$ref": "enums.schema.json#/$defs/DateString" },
|
||||
"tags": { "type": "array", "items": { "type": "string" } },
|
||||
|
||||
@@ -17,6 +17,12 @@
|
||||
"missed": { "type": "string", "description": "결석/lapse 패턴 — 자책 아닌 데이터 처리" },
|
||||
"adjust": { "type": "string", "description": "다음 주기에 바꿀 것 1개만" },
|
||||
"identity_note": { "type": "string", "description": "L3 정체성 변화 감각 (옵션)" },
|
||||
"minimum_ratio": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"maximum": 1,
|
||||
"description": "scope=weekly에 한해 집계. 해당 기간 done 체크인 중 is_minimum=true variant 비율. application layer 계산. UI: 'tiny가 자주 고정' 감지 hint 용 (강제 X)."
|
||||
},
|
||||
"created_at": { "$ref": "enums.schema.json#/$defs/DateTimeString" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,19 @@
|
||||
"date": { "$ref": "enums.schema.json#/$defs/DateString" },
|
||||
"value": { "$ref": "enums.schema.json#/$defs/TrackerValue" },
|
||||
"logged_at": { "$ref": "enums.schema.json#/$defs/DateTimeString" },
|
||||
"note": { "type": "string", "maxLength": 200, "description": "선택. 길게 쓰지 말 것" }
|
||||
"note": { "type": "string", "maxLength": 200, "description": "선택. 길게 쓰지 말 것" },
|
||||
"variant_id": {
|
||||
"type": "string",
|
||||
"description": "선택된 habit.dose_variants[].id. value=done일 때만 의미 있음. value=blank면 무시."
|
||||
},
|
||||
"context_snapshot": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"description": "체크인 시점 컨텍스트 (variant 추천에 쓰인 입력). 회고·집계용 스냅샷.",
|
||||
"properties": {
|
||||
"location": { "type": "string", "description": "예: '짐', '집', '출장'" },
|
||||
"condition": { "type": "string", "description": "예: '좋음', '보통', '나쁨'" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user