# =============================================================================
# PRODUCTION BUILD ARTIFACTS
# =============================================================================

# Maven target directory and build artifacts
/target/
# Gradle build cache
/.gradle/
*.jar
!/gradle/wrapper/gradle-wrapper.jar
*.zip
*.war
*.ear
*.nar

# Compiled class files
*.class

# Build directories
/build/
/out/
/dist/

# =============================================================================
# PYTHON ENVIRONMENT AND CACHE
# =============================================================================

# Python bytecode
__pycache__/
*.py[cod]
*$py.class
*.so

# Virtual environments
.venv/
venv/
env/
ENV/
.env/

# Python distribution / packaging
.Python
build/
develop-eggs/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
*.manifest
*.spec

# =============================================================================
# TESTING AND DEVELOPMENT
# =============================================================================

# Test artifacts
.pytest_cache/
.tox/
.nox/
.coverage
.coverage.*
.cache
.benchmarks/
htmlcov/
.nyc_output
coverage.xml
*.cover
*.py,cover
.hypothesis/

# Test reports and logs
test-results/
test-reports/
*.xml
*.html

# =============================================================================
# LOGS AND RUNTIME FILES
# =============================================================================

# Application logs
*.log
logs/*.log
logs/*.json
logs/production_deploy_*.log
logs/advanced_dev_cycle_*.log
logs/comprehensive_mcp_test_*.json
logs/documentation_evaluation_*.json

# Keep log directory structure but ignore contents
logs/*
!logs/.gitkeep
!logs/README.md

# Runtime and temporary files
*.tmp
*.temp
*.swp
*.swo
*~
.DS_Store
._.DS_Store
.Trashes
.fuse_hidden*

# =============================================================================
# IDE AND EDITOR FILES
# =============================================================================

# IntelliJ IDEA
.idea/
*.iml
*.iws
*.ipr
out/

# Eclipse
.project
.classpath
.settings/
.metadata/
bin/
tmp/

# VS Code
.vscode/
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# NetBeans
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

# Sublime Text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
*.sublime-workspace
*.sublime-project

# Vim
*.swp
*.swo
*~

# Emacs
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*

# =============================================================================
# SYSTEM FILES
# =============================================================================

# Windows
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
*.stackdump
[Dd]esktop.ini
$RECYCLE.BIN/
*.cab
*.msi
*.msix
*.msm
*.msp
*.lnk

# macOS
.DS_Store
.AppleDouble
.LSOverride
Icon
._*
.Spotlight-V100
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
.fseventsd
.TemporaryItems
.apdisk

# Linux
*~
.directory
.fuse_hidden*
.nfs*

# =============================================================================
# ENVIRONMENT AND CONFIGURATION
# =============================================================================

# Environment files
.env
.env.*
!.env.template
.envrc

# Configuration overrides
config/local.properties
application-local.yml
application-local.yaml

# =============================================================================
# SECURITY AND SENSITIVE DATA
# =============================================================================

# Keys and certificates
*.key
*.pem
*.crt
*.p12
*.pfx
secrets/
private/
.ghidra-cred

# Database files
*.db
*.sqlite
*.sqlite3
# SQLite sidecars (WAL mode produces -shm + -wal; rollback-journal mode produces -journal).
# These are session-scoped runtime artifacts; the canonical state lives in the .db itself.
*.db-shm
*.db-wal
*.db-journal

# =============================================================================
# MAVEN AND JAVA
# =============================================================================

# Maven Wrapper
.mvn/
!/.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
mvnw
mvnw.cmd

# Java crash logs
hs_err_pid*
replay_pid*

# =============================================================================
# GHIDRA SPECIFIC
# =============================================================================

# Ghidra project files
*.gpr
*.rep/
*.lock

# Ghidra analysis files
*.gzf

# =============================================================================
# DEPLOYMENT AND PRODUCTION
# =============================================================================

# Deployment artifacts
deploy/
release/
staging/

# Docker
.dockerignore
Dockerfile.local
docker-compose.override.yml

# Kubernetes
*.local.yaml
*.local.yml

# Cloud provider configs
.aws/
.azure/
.gcp/

# =============================================================================
# DOCUMENTATION GENERATION
# =============================================================================

# Generated documentation
docs/_build/
docs/build/
site/
.mkdocs/

# =============================================================================
# NODE.JS (if used for tooling)
# =============================================================================

# Dependency directories
node_modules/
jspm_packages/

# npm
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Coverage directory used by tools like istanbul
coverage/
*.lcov

# nyc test coverage
.nyc_output

# =============================================================================
# PROJECT SPECIFIC EXCLUSIONS
# =============================================================================

# Third party JAR files from Ghidra
lib/*.jar

# Temporary development files
*.backup
*.bak
*.orig
*.rej
.merge_file_*
*.txt

# Archive files
*.7z
*.dmg
*.gz
*.iso
*.rar
*.tar
*.zip

# Runtime configuration
.claude/
.benchmarks/

# Migration and temporary scripts
migrate_*.py.bak
*_backup.*
temp_*

# Test outputs and reports
test_output/
test-output/
allure-results/
allure-report/
junit/
reports/
live-all-mcp-tools-report.json

# Performance and profiling
*.prof
*.trace
*.mem

# =============================================================================
# FINAL CATCH-ALL PATTERNS
# =============================================================================

# Any directory named 'build' at any level
**/build/

# Any directory named 'dist' at any level
**/dist/

# Any directory named 'target' at any level
**/target/

# Temporary directories
tmp/
temp/
.tmp/
.temp/
.tmp_pytest/

# =============================================================================
# ORDINAL FIX LOGS (Temporary - not part of repo)
# =============================================================================

# Ordinal fix log files (historical logs from automated fixing)
ordinal_fix_log*.txt
ordinal_fix_log.txt

# =============================================================================
# GENERATED GHIDRA SCRIPTS (Auto-created during function documentation)
# =============================================================================

# Address-specific fix/recreate scripts created by Claude during documentation
# These are one-time use scripts and should not be committed
# Note: FixFunctionParameters.java and FixFunctionParametersHeadless.java are legitimate scripts
ghidra_scripts/RecreateFunction*.java
ghidra_scripts/RecreateFUN_*.java
ghidra_scripts/RecreateFun*.java
ghidra_scripts/RecreateFunc*.java
ghidra_scripts/Recreate_*.java
ghidra_scripts/FixFunction6*.java
ghidra_scripts/FixFUN_*.java
ghidra_scripts/FixFun6*.java
ghidra_scripts/FixFunc6*.java
ghidra_scripts/Fix6fc*.java
ghidra_scripts/CreateFunctionAt*.java
ghidra_scripts/SimpleDisasm*.java
ghidra_scripts/SimpleFix*.java
ghidra_scripts/SimpleRecreate*.java
ghidra_scripts/AggressiveFix*.java
ghidra_scripts/ClearAndRecreate*.java
ghidra_scripts/ExpandFunc*.java
ghidra_scripts/ExpandFunction*.java
ghidra_scripts/CheckInstr*.java
ghidra_scripts/Debug6*.java
ghidra_scripts/DisassembleAt*.java
ghidra_scripts/InspectAddress*.java
ghidra_scripts/InspectListing*.java
ghidra_scripts/MinimalFix*.java
ghidra_scripts/QuickFix*.java
ghidra_scripts/TestSimple.java


# =============================================================================
# FUNCTION HASH INDEX AND PROGRESS TRACKING
# =============================================================================

# Function hash index (user-specific, regenerated per binary)
function_hash_index.json

# Completeness tracking state (local analysis state)
completeness-tracking.json

# Worker progress files (parallel processing state)
functions-progress-worker*.json

# =============================================================================
# WORKFLOW LOCAL STATE FILES
# =============================================================================

# RE loop runtime state (project-specific, regenerated per session)
workflows/loop_state.json
workflows/learnings.md
workflows/proposals.json
workflows/community_names.json
workflows/community/*.csv
workflows/survey_*.json

# Ghidra manager config (contains local paths)
workflows/.ghidra_manager_config.json

# Improvement loop state (session-specific)
workflows/.improvement_state.json
workflows/.self_improvement_state.json

# Session and quality history
workflows/.session_history.json
workflows/.quality_history.json

# Workflow logs and reports
workflows/logs/
workflows/reports/

# =============================================================================
# TEST OUTPUT DIRECTORIES
# =============================================================================

# Quality reports from automated testing
quality-reports/

# Model comparison test output
model-comparison-output/

# Global data analysis reports (regenerated)
global_data_analysis_report.md

# Windows NUL file artifacts
nul

# =============================================================================
# PERSONAL MEMORY (Total Recall)
# =============================================================================

CLAUDE.local.md

# =============================================================================
# PROJECT-SPECIFIC ANALYSIS REPOS (nested repos, tracked separately)
# =============================================================================
# Project-specific analysis files live in their own repos inside this workspace.
# Clone them as needed: git clone <repo-url> <folder-name>

# Diablo 2 analysis: https://github.com/bethington/d2-ghidra-analysis
d2-analysis/

# =============================================================================
# PROJECT-SPECIFIC FILES (Not part of universal ghidra-mcp)
# =============================================================================
# These files are specific to individual reverse engineering projects
# (e.g., Diablo 2) and should not be committed to the universal repo.

# DLL export/ordinal mapping files (project-specific binaries)
dll_exports/
# Exception: the small fixture used by tests/unit/test_address_map.py is
# source-of-truth for that test and must stay in git.
!tests/fixtures/dll_exports/
!tests/fixtures/dll_exports/**

# Project-specific examples and reference data
examples/

# Function documentation output (generated per-binary)
output/

# Function tracking and todo lists (project-specific)
FunctionsTodo.txt

# Project-specific batch processing scripts
apply_prefix_renames.py
batch-unify-ordinals.bat

# Project-specific session notes and enhancement docs
MEMORY.md
ISSUES.md
SHARED_SERVER_ENHANCEMENT.md

# Project-specific analysis/investigation documents
docs/Analysis_*.md
docs/Detailed_Investigation_*.md
docs/Investigation_*.md

# Project-specific Ghidra scripts (D2/ordinal-specific)
ghidra_scripts/AnalyzeD2*.py
ghidra_scripts/AutoTypeD2*.py
ghidra_scripts/CreateD2*.py
ghidra_scripts/DetectD2*.py
ghidra_scripts/DetectD2*.java
ghidra_scripts/DetectAndApplyD2*.java
ghidra_scripts/DebugOrdinalRename.py
ghidra_scripts/ExportOrdinalLister.py
ghidra_scripts/ResolveOrdinalImports*.java
ghidra_scripts/UltimateOrdinalFixer.py
ghidra_scripts/UnifyOrdinalNames*.java
ghidra_scripts/AutoFixOrdinalLinkage.py
ghidra_scripts/ExportDLLFunctionMappings*.java
.worktrees/

# D2/PD2S12 Project-specific todo tracking
FunctionsTodo-*.txt
pd2s12-*.txt

# Temporary analysis state files
completeness_tmp.json
schema_tmp.json
schema_dump.json
*_tmp.json

# One-off extraction/utility scripts
extract_*.py
apply_prefix_renames.py
audit_*.py
audit-*.json

fun-doc/state.json
fun-doc/state.json.bak
fun-doc/state.json.*_bak
fun-doc/state.json.*.bak
fun-doc/state.json.corrupt-*
fun-doc/state.json.truncated-*
fun-doc/state.json.before-*
# Demonstrably-stale recovery snapshots get moved to fun-doc/archive/ over
# time (see fun-doc/archive/README.md). Ignored wholesale — nothing in
# there is read at runtime, but the directory + its README are committed.
fun-doc/archive/*
!fun-doc/archive/README.md
fun-doc/inventory.json.before-*
fun-doc/global_inventory.json
fun-doc/global_inventory.json.before-*
fun-doc/logs/
fun-doc/priority_queue.json
fun-doc/debug/
fun-doc/inventory.json
fun-doc/inventory.json.tmp
fun-doc/provider_pauses.json
fun-doc/provider_pauses.json.tmp

# fun-doc audit loop runtime state (registry + pending-trigger queue).
# The subpackage code at fun-doc/audit/*.py IS tracked; only runtime
# artifacts generated by the watcher are ignored.
fun-doc/audit/registry.json
fun-doc/audit/registry.json.tmp
fun-doc/audit/queue.jsonl
fun-doc/audit/queue.jsonl.*-archived

# Playwright MCP scratch directory (snapshots, screenshots, console logs)
.playwright-mcp/

# AI tool config directories (Gemini, etc.) — local only, not project config
.gemini/

# fun-doc historical analysis snapshots (large per-project state files)
fun-doc/state_*.json
fun-doc/benchmark/bh/source/
