# Python
__pycache__/
**/__pycache__/
*.py[cod]
*.pyo
*.pyd
*.egg-info/
dist/
build/
*.whl
.venv/
venv/
.nox/
.coverage
.coverage.*
htmlcov/
.pytest_cache/
.ruff_cache/
.mypy_cache/
.pyre/
.pytype/

# Databases
*.db
*.sqlite
*.sqlite3
*.db-journal

# Jupyter
.ipynb_checkpoints/
*.ipynb_checkpoints
profile_default/

# Data — 保留示例数据文件，忽略运行时生成的数据
data/*.json
data/*.xlsx
data/*.db
data/*.csv
data/charts/
data/finance/
data/pipeline_drafts/
data/review_cache/
!data/national_province_data_2026.json

# 动态实验目录：未来新增的 .json 不追踪（已追踪的 policy_database.json 保留）
data/policy_experiments/*.json
!data/policy_experiments/policy_database.json

# Local paper cache (downloaded PDFs for offline reading; large binary)
knowledge/papers_fulltext/
knowledge/papers_meta/

# Models
*.pt
*.pth
*.ckpt
*.h5

# Output
reports/
figures/
logs/
*.log

# OS
.DS_Store
Thumbs.db
*.swp
*.swo

# Cursor IDE
# .cursor/settings.json 不提交（含MCP server paths等环境相关配置）
# .cursor/rules/ 是项目规范文档，需要提交版本控制
# .cursor/skills/ 和 .cursor/agents/ 包含 Cursor 原生 Skill 系统与 Agent 指令
# 顺序重要: 先 .cursor/ 排除, 然后逐个反白名单
.cursor/*
!.cursor/rules/
!.cursor/rules/**
!.cursor/skills/
!.cursor/skills/**
!.cursor/agents/
!.cursor/agents/**

# Env
.env
.env.local
.env.*.local
.env.production
.env.development
.env.staging
.env.test
# Local MCP server secrets
mcp_servers/*/.env
mcp_servers/*/.env.local
mcp_servers/*/.cache

# Secrets / keys / certificates (NEVER commit)
*.pem
*.key
*.p12
*.pfx
*.cer
*.crt
*.der
id_rsa
id_rsa.*
id_ed25519
id_ed25519.*
id_ecdsa
id_ecdsa.*
id_dsa
id_dsa.*
authorized_keys
known_hosts
.netrc
.gnupg/
.aws/credentials
.gcp/credentials.json
.azure/
config.json
secrets.json
credentials.json
service-account*.json
gha-creds-*.json

# GitHub social preview (generated by scripts/gen_social_preview.py, regenerated in CI)
.github/social-preview.png

# LaTeX
*.aux
*.bbl
*.blg
*.log
*.out
*.toc
*.synctex.gz
*.fdb_latexmk

# Weights & Biases
wandb/

# Cache
.cache/

# Python testing
.pytest_cache/
.coverage
htmlcov/

# Temp files
*.tmp
*.bak
*~
*.swp
*.py.bak

# Notebooks
notebooks/

# Streamlit
.streamlit/

# Project-specific (local experiments — not for public repo)
tariff_research/
output/
results/
.cache/.last_session
# ────────────────────────────────────────────────────────────
# Local experiment artifacts (added 2026-07-11, audit GITHUB_STAR_AUDIT §5.3)
# These are runtime outputs that must never enter git history.
# ────────────────────────────────────────────────────────────
*.parquet
*.feather
*.arrow
output/**/*.log
output/**/*.pdf
output/**/*.png
output/**/*.json
output/**/*.tex
output/**/*.staged
# Keep pipeline scripts (.py) tracked; ignore everything else under output/
output/fin-experiments/case_studies/staged/
output/fin-experiments/case_studies/output/
output/fin-experiments/case_studies/results/
# Papers — event_runs/ and future local experiments are auto-generated
papers/event_runs/
papers/output/
# Local data staging (CSV that get produced by pipeline scripts)
papers/*/mcp_raw/
papers/*/stage_data/
papers/*/panel_data.csv
papers/*/table*_*.csv
# Only add future paper subdirectories here if they are truly local experiments.
# Example (if needed in the future):
# papers/local_experiment_notes/

# Local planning / 路线图
STAR_GROWTH_PLAN.md
MANUAL_TASKS.md
*.local.md

# examples/ — 案例脚本依赖 DEEPSEEK_API_KEY 且质量参差，不上传
examples/

# MCP servers — 保留代码和元数据，忽略运行时生成文件
mcp_servers/*/server.log
mcp_servers/*/.cache/
mcp_servers/*/data/
mcp_servers/*/__pycache__/

# Node.js
node_modules/

# Cursor Canvas artifacts
canvases/

# Scripts — 核心代码，必须保留！不要忽略
# 用户自行生成的临时脚本请放在 scripts/generated/ 并添加到上面忽略
.github/internal-reports/
.site/
docs/tutorials/TUTORIALS_README.md

# ── Local development experiments (not for public repo) ──────────────────────
# audit-2026-07-04 PR-2: previously the 7 scripts/core modules below were
# gitignored, so CI never collected or tested them despite being present
# in developer local checkouts and shipped in the finai-research-workflow
# wheel. PR-2 ('pytest tests/' — unify batch architecture) exposed the gap:
# the test for debate_arena failed because the corresponding source file
# was not in git. Removed 7 entries so the source files are now tracked.
#
# The remaining 14 tests/test_*.py entries are kept ignored for now:
# they pre-date the audit cleanup and use APIs that don't match the
# current code. Re-adding them (or deleting for good) is part of PR-6
# (audit-2026-07-04) — coverage push to 60%.
tests/test_debate_calibrator_bridge.py
tests/test_econometrics_DEPRECATED.py
tests/test_institutional_holdings.py
tests/test_journal_compile.py
tests/test_kleibergen_paap.py
tests/test_langgraph_pipeline.py
tests/test_mediation_test.py
tests/test_new_modules_2026.py
tests/test_new_modules_v181.py
tests/test_new_modules_v184.py
tests/test_p2_fixes.py
tests/test_panel_threshold_regression.py
tests/test_placebo_permutations.py
tests/test_prisma_compliance.py

# ── Local data & telemetry ───────────────────────────────────────────────────
data/alternative_data/
data/customs/
data/esg/
data/macro/
data/pipeline_telemetry.jsonl
data/policy/
data/processed/
data/user_uploaded/
pipeline_telemetry.jsonl
did_results.json
.bias_history.db

# ── MCP server untracked tools ───────────────────────────────────────────────

# ── Local audit & development files ─────────────────────────────────────────
AUDIT_2026-06-10.md
AUDIT_2026-06-25.md
AUDIT_FALSE_POSITIVES*.md
MCP_STATUS*.md
docs/MANUAL_TASKS_RUNBOOK.md
docs/adr/ADR-002-provenance-chain.md
scripts/DEPRECATED.md
scripts/benchmark_econometrics.py
scripts/deprecated/research_workflow.py
scripts/entity_list_data_fetcher.py
mcp_servers/user_chinese_literature/Dockerfile

# ── Disabled / skipped test variants (internal) ────────────────────────────────
*.disabled

# ── Coverage reports (generated by pytest --cov-report=json) ───────────────────
coverage.json
.coverage.json
*.coverage.json

# ── Personal access tokens / secrets (defense in depth) ───────────────────────
# Avoid accidental commits of GitHub PATs, API keys, etc. stored in ad-hoc files
*.pat
PAT.tex
PAT.txt
PAT.md
