# What must never enter a commit.
#
# This list and the --exclude flags in run_backup.sh / .dockerignore cover the same
# ground on purpose, but they are three separate mechanisms: git, tar and Docker
# each read only their own. Adding an entry here does NOT change what goes into a
# backup archive, and editing run_backup.sh does not change what git tracks. Keep them
# in step by hand.
#
# There is deliberately no .gitignore entry that can be overridden with `git add
# -f` for the two secret-bearing paths below. .gitignore does not apply to files
# that are already tracked, so if .env or a private key is ever committed by
# accident, adding the line afterwards fixes nothing -- the history still has it.
# Rotating the key is the only real remedy.

# --- secrets ---------------------------------------------------------------
# .env is machine-local configuration and may hold TOMTOM_API_KEY. The negation
# is required: a bare `.env*` would swallow .env.example, which is the committed
# template with the same settings and no values filled in.
.env
.env.*
!.env.example

# certs/ is generated by make-cert.sh -- server.key, server.crt, openssl.cnf.
certs/

# Belt and braces, matching run_backup.sh: catch key material that lives outside
# certs/. *.crt is not a secret, but certs/ is regenerated wholesale anyway.
*.key
*.pem
*.p12
*.pfx
*.crt

# --- generated at runtime --------------------------------------------------
# .run/ holds server.pid, written by run_server.sh. A committed server.pid is a
# PID belonging to whoever committed it, and stop_server.sh signals whatever
# holds that number on the machine that checks it out.
.run/

# logs/ holds server.log, also written by run_server.sh. It grows without bound
# while the server runs, so committing it would make the repo grow on every
# start. Logs are reproducible by starting the server, so nothing is lost.
logs/

# backups/ is archives of this tree. Committing them means every commit carries
# a full copy of the project, and a backup would end up containing a backup.
backups/

# __pycache__/ and *.pyc are regenerated on the next run and differ per Python
# version, so a stale copy in git is worse than no copy.
__pycache__/
*.pyc
*.pyo
.pytest_cache/

# --- regenerable data ------------------------------------------------------
# data/ is the working copy the tools actually read; clean_all.sh already lists it
# under GENERATED and deletes it wholesale. data-example/ is the tracked template,
# and the two large files have one-command regenerators:
#
#   cp -r data-example data
#   python3 make-postal-data.py    # -> data/postal_codes.csv  (~42,300 rows, 2.4 MB)
#   python3 make-people-data.py    # -> data/people.json      (20 reps)
#
# .dockerignore excludes data/ for a different reason -- it is bind-mounted into
# the container rather than baked in -- but the two lists agree on the outcome.
data/

# --- local environments ----------------------------------------------------
# Used by the OPTIONAL retrieval layer (requirements-rag.txt): a venv holding
# LangChain and the embedding backend. Not required -- the agent runs on the
# standard library alone -- but ~360 MB that must never be committed.
.venv/
venv/

# The vector index built by the retrieval layer. Regenerated from data/, which
# is not committed, so committing this would be committing derived data that
# cannot be rebuilt from what is here. Also written into the Docker image's
# build context otherwise (.dockerignore), and left out of backups by
# run_backup.sh -- three mechanisms, same reason, each reading only its own.
.rag-cache/

# Map tiles cached by web.py's /api/tile proxy. Same reasoning as .rag-cache:
# derived from a public source, safe to delete, and worthless in a backup. Bounded
# to 64 MB by TILE_CACHE_MAX_MB in web.py, so it cannot quietly eat a disk.
.tile-cache/

# --- OS cruft --------------------------------------------------------------
# Both, because this tree is worked on from macOS and Windows: the .cmd scripts
# are the Windows path.
.DS_Store
Thumbs.db
desktop.ini
