# Environment variables - NEVER commit actual .env files
.env
.env.local
.env.*.local
.env.production
.env.production.local
.env.secrets
.env.mcp
.env.development
.env.staging
.env.test

# Web frontend environment variables
web/.env
web/.env.*
!web/.env.example

# Preserve example files for documentation
!.env.example
!.env.auth.example
!.env.production.example
!.env.mcp.example

# E2E test fixtures (extracted from production — contains real URLs/data)
tests/e2e/fixtures/production/*.json
tests/e2e/fixtures/production/*/*.json
!tests/e2e/fixtures/production/.gitkeep

# Deploy-host runtime state (sitemap-diff snapshot, #27651) — only exists on
# the production server, never committed
.deploy-state/

# Concurrency load-harness evidence (#31545) — timestamped JSON/CSV run output,
# never committed
scripts/tmp/

# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
!emails/dist/
downloads/
!infra/downloads/
eggs/
.eggs/
lib/
!web/src/lib/
!infra/netcup/lib/
!scripts/lib/
!scripts/lib/*.sh
!services/cortex/general/lib/
!services/cortex/gateway/lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
.pytest_cache/
.coverage
htmlcov/
.tox/
.hypothesis/
.mypy_cache/
.dmypy.json
dmypy.json

# Node.js
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
package-lock.json
yarn.lock

# Next.js
.next/
out/
*.tsbuildinfo
next-env.d.ts

# Generated at build time — never commit (see web/scripts/generate-build-dates.mjs)
web/src/lib/build-dates.generated.json

# Dashboard preview rig output: screenshot packs and the Playwright storage
# state (a live session cookie). Never commit (#37991).
web/.dash-shots/

# Docker
docker-compose.override.yml

# IDEs
.vscode/
.idea/
*.swp
*.swo
*~
.DS_Store

# Logs
logs/
*.log

# Database
*.db
*.sqlite
*.sqlite3

# Secrets and credentials - CRITICAL: never commit these
secrets/
*.pem
*.key

# Proxy-ingress PoC (#28466) — locally-generated MITM CA + leaf certs, never commit
.proxy_ingress_ca/

# SOPS + age secrets management
# Keep encrypted secrets (.enc.yaml), ignore decrypted (.yaml in .secrets/)
.secrets/*.yaml
!.secrets/*.enc.yaml
# Age key files
*.age
prod.key
dev.key
*.p12
*.pfx
*.crt
*.cer
*.der
*.jks
*.keystore
*.backup
# Traefik dynamic config - generated at runtime, never commit
traefik/dynamic/active.yml
traefik/backups/
credentials.json
service-account*.json
*-credentials.json
*.secret
*.secrets
!.secrets/
!.secrets/*.enc.yaml
token.json
tokens.json

# Temporary files
tmp/
temp/
*.tmp

# OS
Thumbs.db
.DS_Store

# Test files (but allow tests in tests/ directories)
test_*.py
!tests/test_*.py
!tests/**/test_*.py
!**/tests/test_*.py
!**/tests/**/test_*.py
# Cortex Docker E2E suite (#34998) lives in services/cortex/e2e/, not tests/.
!services/cortex/e2e/test_*.py
*_test.py
# NOTE: TypeScript/JS *.test.ts(x)/*.test.js(x) are intentionally NOT ignored here.
# They were blanket-ignored from 2025-10-25 to 2026-07 as part of a general
# "chore: exclude test files, docs, and AI configs" cleanup commit — not to
# protect a build artifact or vendored path (git blame/log confirms no such
# rationale exists). That blanket rule silently untracked any *.test.ts(x)
# written outside a handful of allow-listed __tests__/ directories, so a
# developer could add a test, have it pass locally, and have it silently
# vanish from the commit with no error and no CI signal (see #31483/#31484).
# Only *.spec.ts(x) (Playwright e2e, confined to web/e2e/) remain ignored below.
!web/e2e/**
*.spec.ts
*.spec.tsx
*.spec.js
*.spec.jsx
!web/e2e/*.spec.ts
!web/e2e-extension/*.spec.ts
test_output/
test_results/
coverage/

# Documentation files (except critical ones)
*.md
!README.md
!CLAUDE.md
!/NORTHSTAR.md
!devdocs/*.md
!devdocs/**/*.md
!listings/official/**/agent.md
!listings/official/**/page.md
!web/src/content/docs/**/*.md
!services/herald/.gemini/GEMINI.md
!agent-skills/*/SKILL.md
!services/discord/.gemini/GEMINI.md
!services/discord/.sentinel/INSTRUCTIONS.md
!web/public/api-changelog.md
!.github/PULL_REQUEST_TEMPLATE.md
# Root files of the public SDK repository (mirrored by publish-sdks.yml)
!sdk/public-repo/*.md
# App Router routes whose segment is a file name (auth.md, agent-setup.md)
!web/src/app/(site)/*.md/
!shared/detection/corpus/BASELINE.md
!services/cortex/general/doctrine.md
!services/cortex/general/agents/*.md

# Scraping artifacts
storage/htmls/
DOCS_*.md
*_GUIDE.md
*_SUMMARY.md
*_CHECKLIST.md
*_PLAN.md
*_REPORT.md
*_STATUS.md
*_DESIGN.md
*_ARCHITECTURE.md
*_INTEGRATION.md
*_CONFIGURATION.md
FILE_TREE.txt
QUICK_REFERENCE.*

# Backup and temporary files
*.backup
*.bak
*.orig
*.swp
*.swo
*~
.*.swp
.*.swo

# AI/Agent configuration
.claude/*
!.claude/commands
!.claude/commands/*
.cursor/
.aider/
.continue/

# Infrastructure config files (contain secrets — use .example templates)
# The broad **/config.env glob is intentional: any config.env file anywhere in
# the tree is assumed to contain secrets (e.g. infra/discord-bot/config.env,
# infra/monitoring/config.env). The negation keeps *.example files tracked.
# If you need a tracked config.env in a specific directory, add a negation:
#   !infra/my-service/config.env  (and ensure it contains NO secrets)
**/config.env
!**/config.env.example
# Note: infra/netcup/env.production (no leading dot) is intentionally NOT matched
# by the .env.production rule above — it is the git-tracked source of truth for
# Netcup non-secret config (replica counts, tuning). Secrets are merged on top
# during deploy via merge-env-secrets.sh. Do NOT add a dot prefix to this file.
infra/monitoring/logs/*
!infra/monitoring/logs/.gitkeep

# Root cron monitoring checkpoints are production runtime state, not source.
# Keep them out of commits and preserve them across deploy-time `git clean`.
infra/monitoring/state/

# Cache and build artifacts
.cache/
.parcel-cache/
.turbo/
.vercel/
dist-ssr/
*.local

# Golden fixtures (large HTML + JSON output files)
shared/content/extraction_v2/fixtures/golden/

# QA screenshots
qa-*.png

# Editor artifacts
.vscode/settings.json
.idea/workspace.xml
*.iml

# ForgeDock local runtime state and local-only config (never commit)
.forge/
forge.yaml
credentials.yaml
devdocs-pi/

# Services are Poetry projects; uv lockfiles are local artifacts
services/*/uv.lock

# Search benchmark output (#36809)
tools/search_benchmark/results/

# ForgeDock lane scratch (never commit; leaks stale contracts between lanes)
.forge-lean/

# Search benchmark harness output (#38612)
scripts/search_bench/results/
