Phase 8 introduces WeeklySynthesis — an LLM-generated record that aggregates a user's
DailyReflection entries for a given week into structured insights. Before the user-triggered
synthesis can run, the system must answer three questions:
DailyReflection entries fall inside that window?These rules must be deterministic and unambiguous so that the UI can correctly gate the trigger and store synthesis records against a stable key.
We will define a week as Monday 00:00 – Sunday 23:59 in the device's local timezone (ISO 8601 week starting on Monday), identified by its ISO week key (e.g.
2026-W09).
Minimum threshold: A WeeklySynthesis will only be produced for weeks that contain at
least 3 completed DailyReflection entries. If fewer exist, the trigger is disabled in the
UI and no synthesis row is created.
Trigger window: The user may trigger synthesis for week N starting from Saturday of week N onward (i.e. day 6 of the ISO week). This supports a "weekend review" model where the user reflects on the bulk of their week (Mon–Fri) before it formally closes on Sunday. Synthesis for a past week (week_key < current week) is triggerable at any time, subject to the minimum threshold.
Day membership: A DailyReflection belongs to the week that contains its day_key date
(using the same Monday-anchored ISO week logic).
Week key format: WeeklySynthesis records are keyed by week_key in the form YYYY-Www
(e.g. 2026-W09), consistent with the day_key strategy established in ADR-0017.
WeeklySynthesis row either represents
a complete-enough week or does not exist. This avoids explaining "incomplete" states in the UI.YYYY-Www key mirrors the day_key pattern and is human-readable, unambiguous, and
stable for storage as a primary key.week_key from LocalDate using WeekFields.ISO and evaluate
whether LocalDate.now().dayOfWeek >= DayOfWeek.SATURDAY before enabling the trigger button.week_key and status = COMPLETED.COMPLETED synthesis already exists for that week.WeeklySynthesis for a given week gracefully (no error state,
simply "not yet available" or "Review available from Saturday").day_key is
determined at write time for each reflection (ADR-0017), so the week key derivation is stable.week_key ambiguous and prevents stable storage
keying.week_key column on weekly_syntheses will reference the ISO week, not a foreign key
to individual reflections.