From 5e292e66ea384facf9582e96c827a7f3fa2cf600 Mon Sep 17 00:00:00 2001 From: null Date: Wed, 8 Jul 2026 23:22:47 -0500 Subject: [PATCH] =?UTF-8?q?docs(manual):=20batch=204=20review=20=E2=80=94?= =?UTF-8?q?=20DOW=20mode=20table=20was=20partial=20(missed=20Saturday)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The server-authoritative mode-aware deterministic selection sub-section listed the DOW -> mode map as: Monday mode_soft_monday, Tuesday mode_snack_mission, ..., Sunday mode_tiny_date_night But the source-of-truth WEEKDAY_MODE_TAGS table in functions/src/questions/assignDailyQuestion.ts has 7 entries, one per weekday: 0 Sunday mode_tiny_date_night (Slow Burn Sunday) 1 Monday mode_soft_monday (Mood Check Monday) 2 Tuesday mode_snack_mission (Tiny Win Tuesday) 3 Wednesday mode_no_phone_moment (Real One Wednesday) 4 Thursday mode_laugh_reset (Laugh It Off Thursday) 5 Friday mode_flirty_friday (Flirty Friday) 6 Saturday mode_weekend_side_quest (Side Quest Saturday) Saturday was missing. Replaced the partial listing with the full 7-entry table, the constant name, and a note that the map is also unit-tested (assignDailyQuestion.test.ts). Future reader can now grep the mode tag against both files at once. Other Batch 4 claims verified clean: - Schedule '0 23 * * *' America/Chicago, memory 512MiB, timeoutSeconds 300 in assignDailyQuestion source - all match. - Document shape: questionId, date, assignedAt, expiresAt - all match the create() payload (assignedAt is serverTimestamp, expiresAt is timestampAt6PmCst(nextDay)). - PAGE_SIZE = 300, ordered by __name__, startAfter pagination - matches. - The daily_question allow create rule uses isCoupleKeyAnswerCreate OR isSealedAnswerCreate - matches the manual's 'must match one of two shapes' claim. - The secure/{doc} read rule uses the partner-has-also-answered exists() check - matches the Reveal flow claim. - isSealedThreadAnswerCreate / Update have NO answerDate and NO isRevealed field - matches the Thread questions claim. --- docs/Engineering_Reference_Manual.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Engineering_Reference_Manual.md b/docs/Engineering_Reference_Manual.md index 66773ddf..9eafb07a 100644 --- a/docs/Engineering_Reference_Manual.md +++ b/docs/Engineering_Reference_Manual.md @@ -515,7 +515,7 @@ There is also `assignDailyQuestionCallable` for manual / on-demand assignment (u ### Server-authoritative mode-aware deterministic selection -The picker in `functions/src/questions/assignDailyQuestion.ts` mirrors the Android client's `DailyModeResolver` (DOW_DEFAULTS table: Monday `mode_soft_monday`, Tuesday `mode_snack_mission`, ..., Sunday `mode_tiny_date_night`). The same date -> the same couple -> the same question, with no randomness and no client/server split. This **kills the DQ-MISMATCH class** of bugs (one partner sees a different question than the other) and removes cross-timezone partner splits at the root. The frozen DOW -> mode map is unit-tested; if you add a weekday or change a mode tag, update both the client resolver and the server picker in the same change. The picker is also FROZEN against the daily question's `daily_fun_mc` content: `daily_fun_mc` rows are filtered out of the HowWell prediction pool and Desire Sync pool (server-side) to match the client-side guards shipped in R30. +The picker in `functions/src/questions/assignDailyQuestion.ts` mirrors the Android client's `DailyModeResolver` (DOW_DEFAULTS table, frozen in the function source as `WEEKDAY_MODE_TAGS`): Sunday `mode_tiny_date_night` (Slow Burn Sunday), Monday `mode_soft_monday` (Mood Check Monday), Tuesday `mode_snack_mission` (Tiny Win Tuesday), Wednesday `mode_no_phone_moment` (Real One Wednesday), Thursday `mode_laugh_reset` (Laugh It Off Thursday), Friday `mode_flirty_friday` (Flirty Friday), Saturday `mode_weekend_side_quest` (Side Quest Saturday). The same date -> the same couple -> the same question, with no randomness and no client/server split. This **kills the DQ-MISMATCH class** of bugs (one partner sees a different question than the other) and removes cross-timezone partner splits at the root. The frozen DOW -> mode map is unit-tested (`assignDailyQuestion.test.ts`); if you add a weekday or change a mode tag, update both the client resolver and the server picker in the same change. The picker is also FROZEN against the daily question's `daily_fun_mc` content: `daily_fun_mc` rows are filtered out of the HowWell prediction pool and Desire Sync pool (server-side) to match the client-side guards shipped in R30. ### Date math - known DST bug