# Python
__pycache__/
*.py[cod]
*$py.class
*.egg-info/
.pytest_cache/
.mypy_cache/
.ruff_cache/

# Virtual environments
.venv/
venv/
env/

# Secrets — R2 credentials, API keys, etc.
.env
.env.local
.env.*.local
# Wrangler local dev secrets (e.g. apps/bet-checker[/api]/.dev.vars holds the
# Supabase SERVICE-ROLE key — the master credential that can read every user's
# email). Wrangler's convention is `.dev.vars` + per-env `.dev.vars.<env>`. These
# must NEVER be committed; the wrangler.toml comments tell operators to write the
# key here, so the ignore rule is what keeps a `git add -A` from leaking it.
.dev.vars
.dev.vars.*

# OS / editor cruft
.DS_Store
Thumbs.db
desktop.ini
*.swp
*.swo
.idea/

# Claude Code local-only settings (user-specific overrides)
.claude/settings.local.json
# Runtime lock for scheduled tasks (per-machine state, not source).
.claude/scheduled_tasks.lock

# Raw / mapped sport data — regeneratable, large, or both. Anything in
# data/ stored as json/csv/parquet/sql is treated as data and not committed
# (source code under data/ uses .py/.txt/.sh and is unaffected).
data/**/*.json
data/**/*.csv
data/**/*.parquet
data/**/*.sql
# ...except DB migrations under raw-data scaffolding — those are source.
!data/*/event_data_raw/_db/migrations/*.sql
# ...and the curated Retrosheet-converter skip list — reviewed source, not data.
!data/mlb/retrosheet/rr_skip_list.json
# ...and the curated PGA event-exclusion list (team/exhibition events the
# fetcher's validation gates direct the operator to extend) — reviewed source.
!data/pga/event_data_raw/excluded_events.json
# ...and the curated ATP exclusion + final-set-rules lists — reviewed source.
!data/atp/event_data_raw/excluded_events.json
!data/atp/event_data_raw/final_set_rules.json

# Generated mapper progress sidecar — the human-readable companion to the
# (already-ignored, ~3GB) _stream_checkpoint.bin; the mapper rewrites it every
# run and its real cross-machine transport is R2/rclone, not git. It's .txt, so
# it slips past the ".txt is source" assumption above — ignore it explicitly.
data/**/_mapped_through.txt

# SQLite databases under raw-data scaffolding (generated by seeder).
data/**/*.db
data/**/*.db-journal
data/**/*.db-shm
data/**/*.db-wal

# Build/simulation artifacts — outputs, not source. Keep the dirs themselves
# (scaffolding) but ignore everything inside.
artifacts/trained-models/*
artifacts/simulations/*
artifacts/sim-cache/*
# Diagnostic probe outputs (per-batter CSVs, pitch charts/heatmaps, scratch
# analysis scripts) — all regenerable from the probes in simulating/mlb/src/bin.
artifacts/diagnostics/
# Sweep archives pulled from R2 (e.g. artifacts/sweeps/2026-05-16/) and
# any ad-hoc smoke/RCA backups (artifacts/v11_smoke_2025-04-18/) are
# all bulk generated outputs, not source. Ignore the whole sweeps/
# subtree plus anything named like v*_smoke_*.
artifacts/sweeps/
artifacts/v*_smoke_*/
!artifacts/trained-models/.gitkeep
!artifacts/simulations/.gitkeep

# Per-game sim cache binaries (regenerable).
*.bin

# Colocated working model weights. Canonical versioned copies live under
# artifacts/trained-models/; working files next to model source are local.
# Two patterns: the older *_nn_artifact.torch (single working file) and
# the newer {model}_{build_id}.torch (per-build naming used by the
# build.sh / stage.sh flow in training/mlb/pitch_result/).
*_nn_artifact.torch
training/**/*.torch

# Local nev caches: warm-start artifact stash for `nev train --warm-start`
# (copies of the previous date's build, regenerable). Outside training/ so the
# rule above doesn't cover it.
.nev-cache/
# Per-model benchmark state. Locally generated by benchmark.sh; the
# canonical/promoted outputs live under artifacts/trained-models/.
training/**/benchmark.json

# Rust build artifacts under simulating/.
**/target/

# Node.js (apps/*).
node_modules/
.wrangler/
# Vite/Worker build output — regenerated by `npm run build` per app.
apps/*/dist/
# TypeScript project-reference build caches, written next to each tsconfig by
# `tsc -b`. Machine-local and regenerable; never source.
*.tsbuildinfo

# Log files everywhere are regenerable per-execution outputs, not source.
*.log
# Sim run logs (regenerable, per-execution) -- whole dir.
simulating/mlb/scripts/sim_logs/

# Root-level scratch / inspection scripts (ad-hoc, not source).
/_*.py
/tmp_*.py
/tmp_*.csv
/tmp_*.json
/tmp_*.txt

# Local scratch dir for ad-hoc analyses (e.g. agent-generated lookups
# and inspection scripts). Regenerable, machine-local.
/.tmp/
# Dot-prefixed scratch files/dirs at repo root (ad-hoc diagnostic logs,
# sim-output stashes, model backups -- e.g. .tmp_sim_*.log,
# .tmp_sims_fix/, .tmp_cs_orig2/, .tmp-worktrees/). Regenerable,
# machine-local. Covers both `_` and `-` separators.
/.tmp_*
/.tmp-*
_tmp_calibrate.txt

# Video binaries do not belong in git — they bloat the repo and history.
# Keep them on disk (and in R2 for anything the site/board serves), not tracked.
*.mp4
*.MP4
*.mov
*.MOV

# Daily chalk reports are GENERATED (chalk-report.mts output), one per slate.
# The thread drafts written from them are tracked; the raw JSON is not, or the
# directory accrues a file a day forever. marketing/content/chalk-report.md is
# the hand-written doc and stays tracked — only the dated JSON is ignored.
marketing/content/chalk-report-*.json
