# 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/
# T006 audit_fix_2026_07_12: 例外 data/sample/ 是合成 fixture, 入仓
!data/sample/
!data/sample/**
!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/

# Docs build cache — `python scripts/count_mcp.py` writes MCP_COUNT.txt here
# (auto-generated by scripts/count_mcp.py, regenerated on each scan)
.docs-cache/

# Python testing
.pytest_cache/
.coverage
htmlcov/

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

# Notebooks (个人 notebook 默认忽略, 仅显式白名单入仓)
# T007 audit_fix_2026_07_12: 仓库自带的教学 notebook 通过 ! 显式白名单。
notebooks/_user_*/
notebooks/.ipynb_checkpoints/
!notebooks/00_quickstart.ipynb
!notebooks/01_did_lab.ipynb

# 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/_template/ 是骨架模板 (无 API key 调用, 无真实数据), 入仓
# 让用户能基于此创建自己的研究项目 (T005 audit_fix_2026_07_12)。
examples/*
!examples/_template/
!examples/_template/**

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

# T13 audit_fix_2026_07_12: silent-fallback warning log emitted by
# scripts/core/data_warning_notifier.py. Operators may inspect/delete freely;
# must never enter git history.
data_warnings.jsonl

# papers/finai_methodology/ — 本地 arXiv 草稿，不入仓 (comprehensive-audit 2026-07-14)
papers/finai_methodology/
papers/us_esg_financing/AUDIT*.md
papers/us_esg_financing/REFINED_DESIGN.md

# ── Internal audit / check reports (不推送到公开仓库, 2026-07-28) ─────────────
# 审计报告、bib 检查报告等仅供本地/内部使用, 与线上用户无关, 不入仓。
bib_check_report.md
bib_check_report*.md
docs/audit/
.archive/audit/
AUDIT_*.md
COMPREHENSIVE_AUDIT_*.md
*_AUDIT_REPORT.md
*_audit_report.md

# 知乎 / 营销发布物料 (仅本地, 不入公开仓库)
docs/zhihu-publish/

# ── audit-2026-07-21: 27 个未追踪文件 (.gitignore 缺口) ──────────────────
# 覆盖率临时文件 (pytest --cov-report=json / 调试)
core_cov.json
core_cov_backup.json
cov_tmp.json
full_cov.json
ncov.json
new_cov.json
sandbox_cov.json
scripts_cov.json
se_cov.json
.coverage_ci
# HITL 历史 / MCP 付费源警告
hitl_history.jsonl
paid_source_warnings.jsonl
# MCP 调用日志 (tool_calls tool 运行时生成)
data/tool_calls/*.jsonl
!data/tool_calls/.gitkeep
# 论文 docx 输出
papers/us_esg_financing/*.docx
# 本地草稿项目目录 (用户实验)
projects/*
!projects/.gitkeep
# 嵌套 git 目录 (.papers_git 是 paper versioning 子模块)
.papers_git/
# Audit reports (internal, should be in docs/audit/)
_audit_reports/
# Canvas interactive files (user-generated artifacts)
canvases/
# Session state (not source code)
output/.nora_session/
output/.clarify_session/
# CI artifacts
pytest-cs-*-log/
coverage-unified/
.coverage_ci
mypy-log/
# MCP server __pycache__ (43 servers × multiple versions)
mcp_servers/*/__pycache__/
mcp_servers/*/*/__pycache__/

