Knowledge Discovery
Some answers span four tools.
- Sunday 13 Seplast day of the reporting week
- A customer uses the productThe activity belongs to the week ending Sunday.
Team wiki · Reporting period
“A reporting week runs from Monday 00:00 UTC up to, but not including, the following Monday.”
names
inWeeklyReport() - Monday 14 Sepfirst day of the next week
- The week endsNew activity counts toward next week.
Repository · weekly-report.ts
occurred_at < week_end_utcthe boundary in
inWeeklyReport() - Sunday’s record arrivesThe import runs late, but the activity still belongs to last week.
Rollout issue · WR-218
“Weekend import missing from the weekly report.”
- The report is finalizedLate records have had nine hours to arrive.
Decision note · DR-021
“Keep the week; finalize at 09:00 Monday so late imports count.”
names WR-218 · about
inWeeklyReport()
Synthetic documents, code, issue and decision. Links shown are references: a wiki page or a decision naming a function, and a decision naming an issue key. Linking wiki pages to code and finding decisions are settings you turn on (decisions use the model you configure). Free includes six connectors (GitHub, GitHub Actions, GitHub Issues, and Claude Code, Codex and Cursor sessions); paid plans include every connector.
What the sources say
Two clocks, not a wrong label
occurred_at
Decides which week an event belongs to. Sunday 23:50 is last week, whenever it arrives.
received_at
Decides whether the event reached this report before it was finalized at 09:00 Monday.
Read both clocks in the code
function inWeeklyReport(event) {
const inReportingWeek =
event.occurred_at >= week_start_utc && event.occurred_at < week_end_utc;
const arrivedBeforeClose = event.received_at <= finalize_after;
return inReportingWeek && arrivedBeforeClose;
}The answer
The answer, with its sources

“The week does end on Sunday. The report waits until 09:00 Monday so weekend records that arrive late still count. See DR-021 and WR-218.”
Write the answer down next to the documents it came from, in the wiki page or the decision note, so the next person who asks finds it too.
Try it