> ## Documentation Index
> Fetch the complete documentation index at: https://calendar-effects.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 2026-11-18 · Sanchi · Late-data test passes on the cluster (task #7)

* **Done:**
  * Ran the late-data test on the SFU cluster against the team topic `calendar-effects-master`, using the commands in `docs/handoffs/2026-11-18-mahad-cluster-kafka.md`.
  * `src/producers/replay_master.py --seconds-per-day 0 --late-fraction 0.02` sent all 27,654 messages, of which 527 (1.9%, seed 732) went 3 trading days late.
  * `src/streaming/job.py --source kafka --max-per-trigger 110 --once` on YARN, output to HDFS `calendar-effects/stream`. The first run stopped when the VPN dropped; HDFS `calendar-effects/stream` and `calendar-effects/checkpoint` were cleared and the job re-run inside `tmux`. The producer was not re-run, so the topic holds each message once.
* **Results** (HDFS output copied to the laptop as `data/stream-late/`):
  * `scripts/check_streaming.py data/stream-late`: OK. 25,050 daily rows and 600 event CARs match the direct computation (largest difference 1.67e-16 for abnormal returns, 1.53e-16 for CAR). The 90 rows only in batch are the last trading days the watermark holds back (stream ends 2025-12-17), the same as the on-time run.
  * `scripts/compare_stream_batch.py --stream data/stream-late`: OK. 600 of 600 windows match Areej's answer key, none on one side only; every column within 1e-9 (largest 3.55e-15, `car_z`). Same significance call in 590 of 590 windows with a CAR.
  * Mean CAR by event is unchanged from the on-time run: Black Friday 1.43%, Cyber Monday 0.77%, Prime Day 1.31%, Halloween −1.83%, Chinese New Year 0.13%.
  * So 2% of messages arriving 3 trading days late changes no result: the 7-day watermark keeps them and they land on the right day.
* **Note for the report:** HD's Chinese New Year 2017 window has 11 of 11 spike days. That is real reader traffic, not a data error: Home Depot's views jumped from about 1,500 a day to 2,000–3,500 from mid-January to early February 2017 (8,852 on Jan 15), under both article titles. A useful example that an attention spike is not always caused by a calendar event.
* **Decisions:** none.
* **Contracts:** no change.
* **Next:**
  1. Review my files changed under decision 0005 and fill in "Agreed by".
  2. Report: results section (Nov 23 onward).
  3. Walkthrough of my part for Mahad's video, by Nov 28.
* **Blocked on / needs from others:** nothing.
  * **Mahad:** #7 is done; the late-data numbers above can go in the video.
  * **Clean-up:** HDFS `calendar-effects/stream` and `calendar-effects/checkpoint` hold the late-test output; delete them before the next run on the team topic.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.