# CLEANUP-2: Untrack runtime and transient artifacts from git [agent]

blocked_by: []
unlocks: [CLEANUP-3]

## Goal

Stop tracking files that should never have been committed. These files exist in
`.gitignore` already but were added to git before the rules were in place. Use
`git rm --cached` to untrack without deleting from disk (runtime state must stay).
Use `git rm` to actually delete TLC transient outputs (they're regenerable).

## Operations

### 1. Untrack .db files (keep on disk — Substrate runtime state)

```bash
cd /workspace/hypermemetic/plexus-substrate
git rm --cached arbor.db claudecode.db loopback.db orcha.db cones.db templates.db changelog.db
```

These are SQLite databases used by activations at runtime. They must stay on disk
for Substrate to function. `git rm --cached` untracks without deleting.

### 2. Untrack .DS_Store (keep on disk is fine, it's harmless)

```bash
git rm --cached .DS_Store
```

### 3. Delete and untrack TLC trace files (.bin)

These are generated by running TLC. Regenerable by re-running:
`java -jar tla2tools.jar -workers 4 -config <spec>.cfg <spec>.tla`

```bash
git rm plans/DispatchTdd_TTrace_1773533780.bin
git rm plans/MediumBatch_TTrace_1773534895.bin
git rm plans/DispatchTdd_TTrace_1773533780.tla
git rm plans/MediumBatch_TTrace_1773534895.tla
```

Also check for any SubstrateResilience trace files:
```bash
ls plans/SubstrateResilience_TTrace_*.bin plans/SubstrateResilience_TTrace_*.tla 2>/dev/null
git rm plans/SubstrateResilience_TTrace_*.bin plans/SubstrateResilience_TTrace_*.tla 2>/dev/null || true
```

### 4. Delete and untrack TLC states/ directory

```bash
git rm -r plans/states/
```

This removes all timestamped TLC state checkpoint directories. They're transient
model-checker outputs; re-running TLC regenerates them. The actual TLA+ specs
(`DispatchTdd.tla`, `MediumBatch.tla`, `SubstrateResilience.tla`) are NOT touched.

## Commit

```bash
git commit -m "chore: untrack runtime artifacts and transient TLC outputs

Remove .db files, .DS_Store, TLC trace files, and TLC states/ from git.
These are either runtime state (kept on disk) or regenerable model-checker
outputs. All were tracked despite being listed in .gitignore.

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

## Verification

After committing:
- `git status` should show `.db` files and `.DS_Store` as untracked (not deleted)
- `ls *.db` should still show the files on disk
- `plans/states/` should not exist in git; may or may not exist on disk
- `plans/*.bin` should not appear in `git ls-files plans/`
