> ## 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.

# Study plan, and the questions you should be able to answer

> docs/architecture/09a-study-plan-and-qa-guide.mmd

```mermaid theme={null}
%% Calendar Effects · Guide 9a · Study plan, and the questions you should be able to answer · goes next to diagram 09-code-map.mmd
%% Miro: paste onto a board, or Creation bar > Diagram > Build with code. Read top to bottom.
flowchart TB
  T["GUIDE 9a · STUDY PLAN AND Q&A<br/>for the cross-review and the AI Usage Report"]

  subgraph S1["1 · STUDY PLAN · about 2 hours each"]
    direction LR
    s1["RUN IT<br/>run_everything.sh<br/>--skip-etl → PASSED"] --> s2["READ YOUR PART<br/>code + its guide"] --> s3["READ YOUR<br/>CROSS-REVIEW PART"] --> s4["BREAK IT<br/>EVENT_WINDOW → −3..+3<br/>explain what moved"] --> s5["ANSWER THE<br/>QUESTIONS BELOW"]
  end

  subgraph S2["2 · YOUR PART · and your cross-review pair, Nov 18–24"]
    direction TB
    p1["MAHAD<br/>signals.py · job.py<br/>compare.py · prices ETL"]
    p2["AREEJ<br/>car.py · stats.py · charts.py<br/>retail_clean.py"]
    p3["ANUSHIYA<br/>config/ · contracts.py<br/>study.py · run_everything.sh"]
    p4["SANCHI<br/>page views ETL · join_master.py<br/>producers · create_topics.py"]
    x1["PAIRS<br/>Mahad ↔ Areej<br/>Anushiya ↔ Sanchi"]
  end

  subgraph S3["3 · Q&A · THE DATA"]
    direction TB
    q1["Why split-adjusted prices?<br/>→ a split would look like a crash"]
    q2["Why isn't SPY a retailer?<br/>→ it's the market index"]
    q3["Why build master from prices?<br/>→ 1 row per stock-day"]
    q4["Where's US Thanksgiving?<br/>→ market closed · starts Friday"]
    q5["Why are some views 0?<br/>→ no record that day"]
    q6["Why commit clean/, not raw/?<br/>→ small, same for everyone"]
  end

  subgraph S4["4 · Q&A · THE STUDY"]
    direction TB
    q7["Market model?<br/>→ OLS line: ret vs market"]
    q8["Abnormal return?<br/>→ actual − predicted"]
    q9["CAR?<br/>→ ARs summed, days −5 to +5"]
    q10["Why −5 to +5?<br/>→ catch before and after"]
    q11["Why estimate on −125..−6?<br/>→ no look-ahead"]
    q12["Day 0?<br/>→ first trading day on or after"]
  end

  subgraph S5["5 · Q&A · THE STATISTICS"]
    direction TB
    q13["Why two market models?<br/>→ alerts can't see a window<br/>CARs must match batch"]
    q14["What does car_z add?<br/>→ stocks become comparable"]
    q15["Why cluster by date?<br/>→ 38 retailers share each date"]
    q16["Why Wilcoxon and BMP?<br/>→ agreement is stronger"]
    q17["Spike rule?<br/>→ views z ≥ 3 vs 28 days"]
  end

  subgraph S6["6 · Q&A · STREAMING"]
    direction TB
    q18["Micro-batch?<br/>→ ≤ 390 messages at once"]
    q19["Event vs processing time?<br/>→ day it's about vs arrival"]
    q20["7-day watermark?<br/>→ limits lateness, frees memory"]
    q21["A message 10 days late?<br/>→ dropped and counted"]
    q22["Why join with SPY?<br/>→ needs the market's return"]
    q23["What's in state?<br/>→ 130 days, pending, windows"]
  end

  subgraph S7["7 · Q&A · STREAMING, CONTINUED"]
    direction TB
    q24["Why pending rows?<br/>→ process in date order"]
    q25["Why is a retry safe?<br/>→ batch folders overwrite"]
    q26["Why 1 Kafka partition?<br/>→ strict order"]
    q27["Why FAILFAST?<br/>→ no silent nulls"]
    q28["Why --packages?<br/>→ Spark starts before the script"]
  end

  subgraph S8["8 · Q&A · CHECKS AND PROCESS"]
    direction TB
    q29["How do we know it's right?<br/>→ 3 methods, 2,280 CARs agree"]
    q30["What does compare catch?<br/>→ off by 1e-9, missing, doubled"]
    q31["Data contract?<br/>→ promised columns + types"]
    q32["Add a retailer or event?<br/>→ a config/ row, then the tests"]
    q33["What stops typed-in values?<br/>→ test_no_hardcoding"]
  end

  T --> S1 --> S2 --> S3 --> S4 --> S5 --> S6 --> S7 --> S8

  classDef head fill:#2C2C2A,stroke:#2C2C2A,color:#FFFFFF
  classDef step fill:#E1F5EE,stroke:#0F6E56,color:#085041
  classDef who fill:#F1EFE8,stroke:#5F5E5A,color:#444441
  classDef ask fill:#EEEDFE,stroke:#534AB7,color:#3C3489
  class T head
  class s1,s2,s3,s4,s5 step
  class p1,p2,p3,p4,x1 who
  class q1,q2,q3,q4,q5,q6,q7,q8,q9,q10,q11,q12,q13,q14,q15,q16,q17,q18,q19,q20,q21,q22,q23,q24,q25,q26,q27,q28,q29,q30,q31,q32,q33 ask
  style S1 fill:#FFFFFF,stroke:#B4B2A9
  style S2 fill:#FFFFFF,stroke:#B4B2A9
  style S3 fill:#FFFFFF,stroke:#B4B2A9
  style S4 fill:#FFFFFF,stroke:#B4B2A9
  style S5 fill:#FFFFFF,stroke:#B4B2A9
  style S6 fill:#FFFFFF,stroke:#B4B2A9
  style S7 fill:#FFFFFF,stroke:#B4B2A9
  style S8 fill:#FFFFFF,stroke:#B4B2A9
```


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