# SaneApps Canonical .gitignore
# Source of truth: infra/SaneProcess/templates/gitignore
# Sync via: ruby scripts/sync_check.rb --fix

# ═══════════════════════════════════════════════════════════════
# Build artifacts
# ═══════════════════════════════════════════════════════════════

build_log*.txt
build_output*.txt
test_output*.txt
*.log

# Xcode
*.xcuserstate
*.xcuserstatedata
xcuserdata/
DerivedData/
.derivedData/
.swiftpm/
build_debug/
build_release/
Packages/**/.build/
Packages/**/.swiftpm/
*.xcresult/
*.xccheckout/
*.xcworkspace/contents.xcworkspacedata

# macOS
.DS_Store

# Build
build/
.build/
.build-logs
.build-logs/
.build-minimal/
*.backup*
vendor/
.bundle/

# Release artifacts (distributed via Cloudflare R2, not repo)
releases/
*.dmg
*.xcarchive/
*.pkg
*.zip

# ═══════════════════════════════════════════════════════════════
# Claude Code auto-generated context files
# ═══════════════════════════════════════════════════════════════

# Nested CLAUDE.md files are auto-generated context — only root CLAUDE.md is real
**/CLAUDE.md
!/CLAUDE.md
SESSION_HANDOFF.md

# Agent artifacts
.agent/
.claude/
.claude-mem/

# ═══════════════════════════════════════════════════════════════
# Tooling
# ═══════════════════════════════════════════════════════════════

# Gemini/Agentic
.gemini
.gemini/
.mcp.json

# Claude Code - track project config, ignore user/transient state
.claude/settings.local.json
.claude/mcp_doctor_last.json
.claude/edit_state.json
.claude/memory.json
.claude/state.json
.claude/state.json.lock
.claude/phase_state.json
.claude/failure_state.json
.claude/audit.jsonl
.claude/audit_log.jsonl
.claude/prompt_log.jsonl
.claude/learnings.jsonl
.claude/SESSION_HANDOFF_*.md
.claude/archive/
.claude/*.log.old
.claude/*count*.json
.claude/enforcement_log.jsonl
.claude/sanetrack.log.old
.claude/sanetools.log.old
.claude/research_*.json*
.claude/enforcement_*.json
.claude/memory_checked.json
.claude/recent_actions.json
.claude/read_history.json
.claude/research-locks.json
.claude/user_patterns.json
.claude/bypass_mode.txt
.claude/saneloop-archive/
.claude/research/
.claude/rule_tracking.jsonl
.claude/sop-verify-state.json
.claude/bugs.md
.claude/hook_*.md
.claude/SOP*.md
.claude/PROJECT*.md

# IDE - Keep shared settings, ignore user-specific files
.cursor/settings.json
.vscode/settings.json
.vscode/tasks.json
.vscode/launch.json
.vscode/extensions.json
!.cursor/
!.vscode/

# Node/Wrangler
node_modules/
.wrangler/
.playwright-cli/
__pycache__/
*.pyc

# Serena
.serena/
.sane/

# ═══════════════════════════════════════════════════════════════
# Media (keep app assets, ignore test/marketing/root)
# ═══════════════════════════════════════════════════════════════

# Large media/test artifacts
*.mp4
*.mov
*.m4v
*.m4a
*.profraw
TranscriptionTest*/
TestReports/

# Images - ignore in root/tests, but keep app assets
/*.png
/*.jpg
/*.jpeg
/Screenshots/**/*.png
/Screenshots/**/*.jpg
/Tests/**/*.png
/Tests/**/*.jpg
marketing/*.png
marketing/*.jpg
!marketing/app-icon.png

# Keep all xcassets (app icons, etc)
!Resources/Assets.xcassets/**/*.png
!Resources/Assets.xcassets/**/*.jpg

# ═══════════════════════════════════════════════════════════════
# Release tooling
# ═══════════════════════════════════════════════════════════════

# Fastlane
fastlane/coverage/
fastlane/keys/
fastlane/report.xml
fastlane/test_output/
fastlane/gym_output/

# Local agent/research artifacts
.claude/research.md
.claude/.gitignore
.codex/research.md
DOCS_AUDIT_FINDINGS.md

# Code coverage
*.gcda
*.gcno
TestOutput.xcresult/
*.o

# Provisioning Profiles (sensitive)
Provisioning/

# CI artifacts
project.yml.ci_backup

# Sparkle (never commit private key)
sparkle_private_key.txt

# Local hook overrides
lefthook-local.yml

# ═══════════════════════════════════════════════════════════════
# Ephemeral docs (AI-generated, auto-cleaned)
# ═══════════════════════════════════════════════════════════════

reports/
*_AUDIT.md
*_REVIEW.md
CODE_REVIEW.md
WEBSITE_AUDIT.md
FEATURE_PLAN.md
BUG_TRACKING.md

# Generated output
Output/
outputs/

# Local test artifacts
MinimalTest/
*.bak
project.yml.bak
scripts/*.swift
