# Python cache and virtual environments
__pycache__/
*.py[cod]
*$py.class
.pytest_cache/
.mypy_cache/
.ruff_cache/
.venv/
venv/
env/
*.egg-info/
/dist/
/build/

# Local secrets and broker/API credentials
.env
.env.*
!.env.compose.example
!.env.live.example
ib_config.py
*_config.local.py
config.local.json
lean.local.json
# Rendered, secret-bearing Lean config produced by
# scripts/render_lean_credentials.py / `aq render-lean-config` from .env.live.
# The tracked lean.json stays all-empty; this is the copy with real keys filled.
lean.live.json

*.key
*.pem

# OS/editor noise
.DS_Store
Thumbs.db
.idea/
.vscode/
.claude/
docker-compose.override.yml
postgres-data/
redis-data/
grafana-data/
pgdata/

# Lean market data: too large for a public GitHub repo
data/**
!data/**/
!data/**/.keep
!data/**/.gitkeep

# Exception: small, hand-authored reference/config JSON files that this
# codebase documents as "checked in" and reads at runtime/test time (not
# bulk market data) - see tests/test_futures_risk.py, tests/test_ib_backfill.py,
# tests/test_train_cross_sectional_features.py, and development/Problems.md#10.
# The blanket data/** rule above silently excluded these from every fresh
# clone (including CI), which is why the tests reading them failed there.
!data/reference/*.json

# Lean object store / local runtime output
storage/
objectstore/

# Backtest results and generated reports
backtests/**
!backtests/
!backtests/.gitkeep

# Generated ML datasets and binary artifacts
ml/datasets/
ml/expert_datasets/
ml/expert_models/
ml/versions/
# Manual pre-rank-pivot snapshot (rollback point for the Stage 1-5
# rank-pivot roadmap work, development/Problems.md#43) - a local backup,
# never meant to be committed.
ml/_backup_pre_rank_pivot/
# Manual pre-smoke-test snapshot (rollback point before the V5.2.8
# gate_aware_ranking_weights Codespace smoke test, development/Problems.md#94)
# - a local backup, never meant to be committed.
ml/_backup_pre_v528_gate_aware_smoke_test/
# Manual pre-full-retrain snapshot (rollback point before the V5.2.9
# full production retrain with gate_aware_ranking_weights enabled) - a
# local backup, never meant to be committed.
ml/_backup_pre_v529_full_retrain/
ml/model.pt
ml/scaler.pkl
ml/*.pkl
ml/*.pt
ml/*.pth
ml/*.onnx

# Generated ML/runtime JSON artifacts
ml/dataset_inventory.json
ml/dataset_manifest.json
ml/expert_dataset_manifest.json
ml/feature_schema.json
ml/model_weights.json
ml/scaler_stats.json
ml/training_metrics.json
ml/expert_training_metrics.json
# Multitask/sequence/gating model artifacts - these were previously tracked
# (an inconsistency with every other generated model artifact above, which
# was already gitignored), so a real trained model's weights could end up
# committed to the public repo. Untracked via `git rm --cached` alongside
# this rule so it's actually impossible, not just something to remember.
ml/multitask_model.json
ml/multitask_feature_schema.json
ml/multitask_training_metrics.json
ml/sequence_model.json
ml/sequence_feature_schema.json
ml/sequence_training_metrics.json
ml/gating_model.json
ml/gating_feature_schema.json
ml/gating_training_metrics.json
# Topology overlay + RL sizing artifacts (Phase 4.12/4.12.3,
# development/Problems.md #71) - same reasoning as the multitask/sequence/
# gating rules above: a trained model's weights must never end up
# committed to the public repo just because it's a newer artifact type.
ml/topology_model.json
ml/topology_feature_schema.json
ml/topology_training_metrics.json
ml/rl_sizing_model.json
ml/rl_sizing_feature_schema.json
ml/rl_sizing_training_metrics.json

# Generated visualization/runtime feeds
visualization/state.json
visualization/scene.json
visualization/topology_state.json
visualization/grafana/
# V5.2.2 book-history diagnostic log - per-date live book selections
# (roles/raw scores/weights) from a real backtest. Off by default
# (phase_v2.diagnostics.book_history.enabled), but gitignored regardless
# so an accidental enable+commit can't leak it - same rationale as the
# ml/evaluation/ reports below. Wildcarded (not just the exact filename) so
# the per-run isolated extracts used for reconciliation (e.g.
# book_history_v524_only.jsonl, book_history_v525_only.jsonl - see
# development/Problems.md #91) are covered too; book_history_v524_only.jsonl
# was committed in V5.2.4's commit before this gap was caught, untracked
# alongside this fix (V5.2.5).
visualization/book_history*.jsonl

# Generated evaluation reports (aq evaluate --...) - reveal historical
# model selections/scores (book composition by date, rank scores,
# calibrated thresholds), effectively derived model IP, not source - same
# rationale as the ml/*_model.json weight-artifact rules above.
# Regenerable by re-running the command that wrote them.
ml/evaluation/

# Logs and temporary files
.coverage
coverage.xml
htmlcov/
*.log
*.tmp
*.bak
# Obsidian vault for project graphs and AI handoffs
Aether-quant-Obsidian-Vault/

# Webui (React/Vite) build artifacts and dependencies
webui/node_modules/
webui/dist/

# Matplotlib font cache, redirected here by main.py so it persists across
# Lean CLI's ephemeral per-backtest Docker containers instead of rebuilding
# every run (see Problems.md)
.matplotlib_cache/

# scripts/profile_inference.py's pstats dump - regenerable output, not source
scripts/profile_inference_output*.txt
scripts/profile_subsystems_output*.txt
# scripts/order_events_audit.py's output dump (V5.3.1) - regenerable
# diagnostic output, not source.
scripts/order_events_audit_output*.txt

# cpp_inference_ext/'s compiled build artifacts - regenerable via
# `pip install -e cpp_inference_ext/`, never source. The .pyd itself is
# also gitignored (never a hard dependency - the whole point is that
# most checkouts run without it, falling back to NumPy).
cpp_inference_ext/build/
cpp_inference_ext/*.egg-info/
cpp_inference_ext/*.pyd
cpp_inference_ext/*.so
cpp_inference_ext/install_log*.txt

# Aether-Vault (`av` CLI) local repo bootstrap - machine-local tool state
# (retraining/vault_client.py's commit target), not project source.
.av/

# scripts/profile_subsystems.py's main.py::_build_model_input() profiling
# side-channel log (development/Problems.md #36) - regenerable diagnostic
# output, not source.
model_input_timing.log
