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

# Code map: where every idea lives

> docs/architecture/09-code-map.mmd

```mermaid theme={null}
%% Calendar Effects · 9 · Code map: where every idea lives. Pair with 09a-study-plan-and-qa-guide.mmd and 09b-choices-limits-ideas-guide.mmd.
%% Paste into Miro: Creation bar > Diagram > Build with code.
flowchart LR
  subgraph IDEAS["IDEA you may be asked about"]
    i1["What is studied<br/>retailers, events, titles, series"]
    i2["The study's numbers<br/>years, windows, thresholds"]
    i3["Data contracts<br/>columns and types"]
    i4["Event dates<br/>date rules"]
    i5["Returns and vol_ratio"]
    i6["Renamed Wikipedia articles"]
    i7["The master table"]
    i8["Replay and late data"]
    i9["Watermark, event time,<br/>stream-stream join"]
    i10["Per-stock state"]
    i11["Market model, AR, z-scores,<br/>attention spikes"]
    i12["Event window and CAR"]
    i13["Answer key"]
    i14["Significance tests,<br/>clustering, trend"]
    i15["Charts"]
    i16["Stream vs direct check"]
    i17["Stream vs answer key"]
    i18["No hard-coding"]
    i19["Commit safety"]
  end

  subgraph CODE["WHERE it lives · file :: function"]
    c1["config/*.csv<br/>contracts.py :: load_retailers, load_event_types,<br/>load_wiki_articles, load_retail_series, price_tickers"]
    c2["src/common/study.py<br/>src/common/settings.py"]
    c3["docs/data-contracts.md<br/>contracts.py :: CONTRACTS, require_contract,<br/>pandas_columns, parquet_columns, spark_schema"]
    c4["contracts.py :: expand_events, _parse_date_rule,<br/>_resolve_date_for_year, _nth_weekday_of_month"]
    c5["etl/prices_download.py, etl/prices_clean.py<br/>Spark Window + lag + rowsBetween(−20, −1)"]
    c6["config/wiki_articles.csv<br/>etl/pageviews_clean.py"]
    c7["etl/join_master.py"]
    c8["src/producers/replay_master.py,<br/>replay_to_files.py :: --late-fraction"]
    c9["src/streaming/job.py :: withWatermark,<br/>stocks.join(market), DropCounter"]
    c10["job.py :: run_ticker, applyInPandasWithState<br/>signals.py :: new_state, update, HISTORY_DAYS"]
    c11["signals.py :: fit_market_model, _fit_on,<br/>_zscore, _flag, _process_day"]
    c12["signals.py :: _process_day opens windows,<br/>_close_window computes CAR"]
    c13["src/eventstudy/car.py :: fit_market_model,<br/>attention_z, event_car, compute_cars"]
    c14["src/eventstudy/stats.py :: clustered_mean_test,<br/>one_sample_p, difference_row, trend_row"]
    c15["src/eventstudy/charts.py :: chart_car_path,<br/>chart_car_by_event, chart_online_vs_store..."]
    c16["scripts/check_streaming.py :: fit"]
    c17["src/streaming/compare.py :: compare<br/>scripts/compare_stream_batch.py"]
    c18["tests/test_no_hardcoding.py<br/>AGENTS.md rule 8, decision 0005"]
    c19[".claude/hooks/pre-commit-tests.sh<br/>tests/test_commit_hook.py"]
  end

  i1 --> c1
  i2 --> c2
  i3 --> c3
  i4 --> c4
  i5 --> c5
  i6 --> c6
  i7 --> c7
  i8 --> c8
  i9 --> c9
  i10 --> c10
  i11 --> c11
  i12 --> c12
  i13 --> c13
  i14 --> c14
  i15 --> c15
  i16 --> c16
  i17 --> c17
  i18 --> c18
  i19 --> c19
```


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