docs(manual): batch 4 review — DOW mode table was partial (missed Saturday)

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.
This commit is contained in:
null 2026-07-08 23:22:47 -05:00
parent 0af6f24ab8
commit 5e292e66ea
1 changed files with 1 additions and 1 deletions

View File

@ -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