{'heading': "How the app's constitution profile and check-in actually work", 'summary': 'In `Ayurveda & Asana Yoga` (`AyurvedaConstitution.swift`), you can set your baseline constitution (`Prakriti`) either by choosing one of **13 self-declared type presets** (`Single`, `Dual` 50/50 or 60/40, or `Sama / Tridoshic`) or by answering the **12-question adult-life questionnaire**. You can also layer a **5-question recent check-in** (`Vikriti` over the past 1–2 weeks), which blends at 70% weight into your active target for 7 days and then decays linearly back to your baseline Prakriti by day 30.', 'bullets': ['12 Prakriti questions with rotated options: Covers lifelong build, weight tendency, skin, hair, appetite, post-meal sensation, weather preference, daily energy, sleep, natural pace, conversation style, and response under pressure.', 'Honest near-tie notes (`AyurvedaConstitutionResult.classify`): When the top two doshas are within 1 answer (`<= 1/12`), the app labels a dual type and notes: *"The leading profiles are within one answer, so the questionnaire does not separate them."*', '5-question Vikriti check-in: Tracks recent `Sleep`, `Digestion`, `Appetite`, `Energy`, and `Skin` over the past week or two.', '7-to-30-day decay math (`vikritiWeight`): Recent check-ins carry `0.7` (70%) weight for days 0–7, then fade linearly from `0.7` to `0.0` between day 7 and day 30.']}
In `Ayurveda & Asana Yoga` (`AyurvedaConstitution.swift`), you can set your baseline constitution (`Prakriti`) either by choosing one of **13 self-declared type presets** (`Single`, `Dual` 50/50 or 60/40, or `Sama / Tridoshic`) or by answering the **12-question adult-life questionnaire**. You can also layer a **5-question recent check-in** (`Vikriti` over the past 1–2 weeks), which blends at 70% weight into your active target for 7 days and then decays linearly back to your baseline Prakriti by day 30.
12 Prakriti questions with rotated options: Covers lifelong build, weight tendency, skin, hair, appetite, post-meal sensation, weather preference, daily energy, sleep, natural pace, conversation style, and response under pressure.
Honest near-tie notes (`AyurvedaConstitutionResult.classify`): When the top two doshas are within 1 answer (`<= 1/12`), the app labels a dual type and notes: *"The leading profiles are within one answer, so the questionnaire does not separate them."*
5-question Vikriti check-in: Tracks recent `Sleep`, `Digestion`, `Appetite`, `Energy`, and `Skin` over the past week or two.
7-to-30-day decay math (`vikritiWeight`): Recent check-ins carry `0.7` (70%) weight for days 0–7, then fade linearly from `0.7` to `0.0` between day 7 and day 30.
Two Ways to Set Your Baseline Prakriti: 13 Presets or 12 Questions
If you already know the traditional profile you want to use—for example, from working with an Ayurvedic practitioner—you do not have to take a quiz. Under `AyurvedaDeclaredTypeOption.all`, the app offers 13 explicit presets grouped into `Single` (`Vata`, `Pitta`, `Kapha` at 100%), `Dual` (both `Even pair` 50%/50% and leading-dosha `60%/40%` pairs such as `Vata–Pitta (Vata leads)` vs. `Pitta–Vata (Pitta leads)`), and `Balanced` (`Sama / Tridoshic` at 33.3% each).
If you prefer a guided reflection, the 12-question profile (`AyurvedaConstitutionQuestion.all`) asks about patterns that have held true *"for most of your adult life"*—covering frame/build, weight stability, skin feel, hair texture, appetite regularity, post-heavy-meal feel, preferred weather, daily energy curve, sleep depth, natural pace, conversation style, and reaction under pressure. To prevent you from unconsciously picking "Option A" twelve times in a row, the code rotates the Vata, Pitta, and Kapha option order on every question (`[.vata, .pitta, .kapha]`, `[.pitta, .kapha, .vata]`, `[.kapha, .vata, .pitta]`).
- Lifelong frame of reference: Answer the 12 questions based on your long-term adult baseline rather than how you felt during a cold or stressful week.
- Rotated choice order: Prevents position bias while answering.
- Per-profile storage: Each user profile in the app stores its own independent `AyurvedaConstitutionRecord`.
How the App Scores Dual Types, Sama Profiles, and Near-Ties
Most online dosha quizzes force a dramatic single-dosha label even when your answers are split 5–4–3. In `AyurvedaConstitutionResult.classify(distribution:answerCount:)`, the app uses transparent proportion thresholds (`oneAnswer = 1.0 / 12.0` ≈ `8.33%`) and prints an explicit `uncertaintyNote` whenever two or three doshas finish within one question of each other.
First, if the gap between your highest dosha and lowest dosha is within one answer (`top.value - bottom.value <= oneAnswer`), the result is classified as **`Sama / Tridoshic`** with the note: *"Your answers are distributed evenly across the three traditional profiles."* Second, if the second-highest dosha accounts for at least 25% of your answers (`>= 3` out of 12) OR sits within one answer of the top dosha (`top.value - second.value <= oneAnswer`), the app assigns a dual label (`Top–Second`, such as `Vata–Pitta`) and, when within one answer, adds: *"The leading profiles are within one answer, so the questionnaire does not separate them."* Otherwise, it assigns the single leading dosha.
- 4–4–4 or 5–4–3 split: Classified as `Sama / Tridoshic` because a single question swing separates highest and lowest.
- Second dosha `>= 25%` (3+ of 12 answers): Classified as a Dual profile (`Top–Second`).
- Top two within 1 answer (e.g., 5–5–2 or 5–4–3): Displays the near-tie uncertainty note so you know neither dosha dominates sharply.
How the 5-Question Vikriti Check-In Blends and Decays Over 30 Days
In Ayurveda, your lifelong baseline (`Prakriti`) is distinguished from your current short-term state (`Vikriti`). A person with a Kapha-leading baseline can still experience a dry, restless, sleep-disrupted Vata flare during winter travel, or a warm, acidic Pitta week during summer heat. To capture that without overwriting your baseline, `AyurvedaCheckInQuestion.all` offers a 5-question check-in asking how your `Sleep`, `Digestion`, `Appetite`, `Energy`, and `Skin` have felt *"over the past week or two."*
Because a short-term check-in from two months ago should not permanently override your baseline, `AyurvedaConstitutionRecord.vikritiWeight(at:)` applies a time-decay curve: for the first **7 days** after a check-in, your active `target(at:)` blends **70% recent check-in (`alpha = 0.7`) and 30% baseline Prakriti (`1 - alpha = 0.3`)**. Between **day 7 and day 30**, `alpha` decays linearly toward zero (`0.7 * (1 - (age - 7d) / 23d)`), and after **30 days**, your target automatically returns to 100% baseline Prakriti until you log a fresh check-in (or snooze the prompt for 7 days via `snoozeCheckIn`).
- Days 0 to 7 after check-in: Active target = 70% Vikriti check-in + 30% baseline Prakriti.
- Days 7 to 30 after check-in: Check-in weight fades smoothly from 70% down to 0%.
- Where the active target is used: Powers the `Supportive / Mixed / Less supportive` food fit banner (`AyurvedaSectionView`), the `Daily Ayurveda` summary ring, and `RIGHT NOW` practice sorting (`PracticesView`).
Frequently Asked Questions
Does taking the 5-question check-in erase my 12-question Prakriti result?
No. `AyurvedaConstitutionRecord` stores `prakriti` and `latestCheckIn` separately. Even when you re-save your baseline Prakriti, `AyurvedaConstitutionStore.save` preserves your `previousCheckIn`.
How does the app calculate the Ayurvedic sleep window from my constitution?
`AyurvedaSleepRecommendation` blends traditional bedtime anchors (`21:30` for Vata/Pitta, `21:45` for Kapha) and wake anchors (`06:00` for Vata, `05:30` for Pitta, `05:00` for Kapha) weighted by your Prakriti proportions and rounded to the nearest 5 minutes.
Is the constitution questionnaire a medical diagnostic tool?
No. Both the 12-question profile and the 5-question check-in are educational self-reflection tools for organizing traditional food and practice preferences—never a medical diagnosis.





