# CLEANUP-3: Strengthen .gitignore to prevent recurrence [agent]

blocked_by: [CLEANUP-2]
unlocks: []

## Goal

The `.gitignore` already lists `*.db`, `plans/states/`, and `plans/*.bin` but
those files were tracked anyway. After CLEANUP-2 untracks them, add any missing
rules and verify the file is correct so they can never be re-added by accident.

## Read the current .gitignore first

```bash
cat /workspace/hypermemetic/plexus-substrate/.gitignore
```

## Changes to make

### 1. Ensure .DS_Store is ignored

If `.DS_Store` is not already in `.gitignore`, add it:

```
# macOS
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
```

### 2. Ensure the TLC output rules are correct

The existing rules `plans/states/` and `plans/*.bin` should cover TLC outputs.
Verify they are present. If the `.bin` rule only matches one level, check whether
it also covers trace `.tla` files generated by TLC (these have names like
`DispatchTdd_TTrace_1773533780.tla`). Add if missing:

```
# TLC model checker outputs (regenerable)
plans/states/
plans/*_TTrace_*.bin
plans/*_TTrace_*.tla
```

The more specific `*_TTrace_*` pattern is safer than `plans/*.bin` since it won't
accidentally ignore a legitimately committed `.bin` if one ever appears.

### 3. Ensure .db rule is correct

Verify `*.db` is present. If the `.db` files are in the repo root, a root-level
`*.db` rule should be sufficient. If they ever move to a subdirectory like `data/`,
the rule may need updating — but for now root-level `*.db` is correct.

## Commit

```bash
git commit -m "chore: strengthen .gitignore for macOS artifacts and TLC outputs

Add .DS_Store rules. Tighten TLC trace pattern to *_TTrace_*.{bin,tla}
to be explicit rather than matching all .bin files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>"
```

## Verification

```bash
# Confirm no .db files are tracked
git ls-files '*.db'  # should return nothing

# Confirm no TLC traces are tracked
git ls-files 'plans/*.bin' 'plans/*.tla' | grep TTrace  # should return nothing

# Confirm .DS_Store is not tracked
git ls-files '.DS_Store'  # should return nothing

# Sanity: still track the real TLA+ specs
git ls-files 'plans/*.tla'  # should show DispatchTdd.tla, MediumBatch.tla, SubstrateResilience.tla
```
