# Enki - Cognitive Memory Infrastructure
# Security-conscious .gitignore

# =============================================================================
# SECURITY CRITICAL - Never commit these
# =============================================================================

# Environment files with secrets
.env
.env.local
.env.*.local
*.env

# MCP server config (contains credentials)
.mcp.json

# Research materials (local reference only, not tracked)
docs/research/

# API keys and credentials
**/secrets/
**/credentials/
*.pem
*.key

# Database files (may contain user data)
*.db
*.db-shm
*.db-wal
*.db.*_backup
*.sqlite
*.sqlite3

# Daemon log archives
daemon.log.*

# Temp files with PID suffixes
*.tmp.*

# BIOS configuration (runtime, may contain user preferences)
*_bios.json

# Daemon discovery file (runtime, contains auth token)
.enki_daemon.json

# =============================================================================
# Python
# =============================================================================

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
/lib/
/lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

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

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# =============================================================================
# IDE / Editor
# =============================================================================

# VSCode
.vscode/
*.code-workspace

# PyCharm
.idea/

# Vim
*.swp
*.swo
*~

# =============================================================================
# OS
# =============================================================================

# macOS
.DS_Store
.AppleDouble
.LSOverride

# Windows
Thumbs.db
ehthumbs.db
Desktop.ini
nul

# =============================================================================
# Project Specific
# =============================================================================

# Runtime PID files (daemon lifecycle artifacts)
**/runtime/daemon.pid

# Runtime data directory (S536: centralized data_dir)
data/

# DRC-2 (ch.239, S1524): the MCP route-verdict registry is a record of
# JUDGEMENTS WITH REASONS -- "the local path is right for this tool, and
# here is why" -- not runtime state. S1525 found it untracked: 65 rulings
# lived on one box, a fresh clone would have re-derived every one of them
# (the exact toil the registry was built to end), and no verdict could be
# reviewed in a diff. Same shape as the MEK-1 / MPB-1 exceptions below --
# git cannot re-include a file whose parent directory is excluded, so the
# directory is un-ignored, its contents re-ignored, and only this one file
# let back through.
# ANCHORED to the repo root. Unanchored, ``data/`` matches a directory of
# that name at ANY depth, so an unanchored negation here re-included
# ui/ambient_display/data/, deploy/windows/tor/Data/ and every other nested
# data dir at once. Only the top-level runtime dir is meant.
!/data/
/data/*
!/data/mcp_route_verdicts.json

# TVP-1 (ch.230, S1538): the model price-curve table is a record of what
# a PROVIDER published -- windows, effective dates, the source URL -- not
# runtime state. It has to be tracked for three reasons: a fresh clone
# that lost it would silently price every peak hour at the valley rate;
# TVP-4 proposes edits to it and a proposal that cannot be diffed cannot
# be reviewed; and TVP-5's invoice reconciliation is only interpretable
# against the curve that was in force. Same re-include shape as the
# verdict registry above.
!/data/pricing/
/data/pricing/*
!/data/pricing/model_price_curves.json

# MEK-1 (ch.144, S1210): static knowledge catalogs under hands/marduk/data/
# are source-of-truth, not runtime state. Re-include only this subtree
# (the parent ``data/`` directory is still ignored; the un-ignore rules
# below let git walk into the empirical_knowledge subdirectory only).
!hands/marduk/data/
hands/marduk/data/*
!hands/marduk/data/empirical_knowledge/
!hands/marduk/data/empirical_knowledge/**

# MPB-1 (ch.171, S1410): the benchmark corpus is a versioned source
# artifact (packaged with enki.benchmarks.mpb), not runtime state.
!src/enki/benchmarks/mpb/data/
!src/enki/benchmarks/mpb/data/**

# Temporary files
TEMP/
tmp/
*.tmp
*.temp

# Logs
*.log
logs/

# Embeddings cache (can be large)
.embeddings_cache/

# Memory exports (may contain sensitive data)
exports/
*.memory.json

# Compiled binary artifacts (benchmarks, FFI builds)
*.obj
*.o
*.so.*

# Kur runtime artifacts (S992)
# Code-mutation backup files + sandbox working copies are transient --
# never commit them; they exist for rollback within a single daemon run.
*.kur-backup
data/kur/sandboxes/
data/kur/code_mutation_rounds/

# Code integrity manifest (build artifact, SEC-17)
enki_integrity.json

# Supply chain lockfile and SBOM (build artifacts, SEC-18)
enki_supply_chain.lock.json
enki_sbom.cdx.json

# Session dialogs (private collaboration history)
sessions_dialogs/

# Personal notes (scratch/copy-paste area - Claude should IGNORE)
docs/tips.md

# Private architecture/operations docs (local-only; never pushed)
# Contains operational details for infrastructure that must not leak:
# VPS hostnames, IPs, sudo usernames, network topology runbooks,
# Polymarket trading account credentials, privacy-funding-chain
# runbooks, etc. Per S1147 Option B decision: live secrets (SSH
# passphrases, proxyuser passwords, FlokiNET account credentials)
# are inlined directly in these docs rather than referenced via
# placeholders -- threat model accepts same-disk blast radius for
# the convenience of a single source of truth.
docs/private/

# Historical/archived documents (not for GitHub)
**/OLD/

# (docs/research/ covered by blanket rule above)

# Claude Code local settings.
# S1499: skills are NOT local settings -- they are shared operating
# procedure (table geometry, release checklist, persona panel) that any
# session invokes and that took real work to derive. Under the blanket
# ignore they lived in exactly one place, on one disk, with no backup:
# the S1482 "unique doc in a backup-denied folder" class. Settings and
# settings.local stay ignored -- those really are per-machine.
.claude/*
!.claude/skills/

# Serena (formerly used dev tool, retired)
.serena/

# Business-ideas scratch area (Claude + Luis private discussion space).
# NOT part of Enki's repo -- kept local only (like a shared notebook).
docs/business-ideas/

# Enki model weights at repo root (LLM checkpoints, e.g. Kronos).
# Anchored to repo root so Python packages named `models/` inside Hands/
# Organs (e.g. hands/marduk/src/marduk/models/) stay tracked.
/models/

# Anonymity VPN gateway secrets (ROADMAP ch.170 IDP) -- WireGuard client
# private keys must NEVER be committed. The template IS tracked.
deploy/anon/wg0.conf
deploy/anon/*.key
deploy/anon/tinyproxy.conf
deploy/anon/socks.env
# Ghost-tier Tor gateway (ROADMAP ch.173 IPG-2): kurt SOCKS5 credential
# (env_file for the tor-gateway container) + the staged GhostRelay copy the
# build consumes -- both generated, never committed.
deploy/anon/kurt.env
deploy/anon/tor-gateway/_ghost_relay.py

# S1421 MPB-2 OpenClaw plugin build artifacts (package-lock.json IS
# committed for reproducible builds; dist/ already matches the global
# dist/ rule above -- listed here for clarity)
clients/enki-memory-openclaw/node_modules/
clients/enki-memory-openclaw/dist/

# S1421 SDK testbed: never commit key material from the SDK ops folder
docs/reference/SDK/*
!docs/reference/SDK/*.md
!docs/reference/SDK/*.sh

# S1434 (i-0090): tests/benchmarks/output/ is a SCRATCH OUTPUT dir -- every
# benchmark writes here (mq3_baseline_TS, rac1_baseline_TS, consensus_metrics,
# parameter_sweep). Committing generated files INTO a write-target directory is
# what produced the "baseline that mutates with no writer" bug: a committed
# reference and machine-written scratch shared one folder, so any run (or a
# parallel session running an ad-hoc script -- i-0092) silently clobbered the
# reference. Inputs never share a directory with outputs. Nothing asserts on
# these; _load_baseline() already degrades gracefully via `if exists()`.
tests/benchmarks/output/

# S1502: pytest temp root relocated off the poisoned %TEMP% reparse point
data/runtime/pytest-temp/

# S1539: online-presence.md links real identity to persona handles -- never commit it.
docs/online-presence.md

# S1539 option A (Luis): the pseudonymous holder identity NEVER enters this repo's git
# history, which is authored throughout by Luis's real name. Templates stay tracked with
# <HOLDER> placeholders; the real values live only here, un-tracked, and in 1Password.
# Reversing this requires an explicit joint decision, never an implicit one.
reservations/.holder.env
reservations/.build/
