# Bug Report: add-outputs-retention ## O1 — GC tick-count semantic: cutoff uses `max_seen` from filenames, not `state.iteration_count` The formula `cutoff = max_seen - retention + 1` uses the max tick index found in filenames, NOT `state.iteration_count`. If the `.state.loop` advances to iteration_count=N but the output files for tick N haven't been written yet (crash after step 10 write but before GC), the next tick will see max_seen = N-1 and compute a cutoff that deletes one fewer group than expected. On the next tick, N is written and GC catches up. **Not a bug** — SPEC D-O5 explicitly chose filename-based max_seen over iteration_count for robustness. Self-healing on the next tick. ## O2 — GC doesn't iterate recursively If a future version nests files inside `outputs/` subdirectories (e.g., `outputs/tick5/`), `os.listdir` at the top level won't see them. The regex won't match, so they're preserved. Only top-level `tick{N}-*` files are affected. **Not a bug** — SPEC D-O6: regex `^tick(\d+)-` matches only top-level files. Nested subdirs preserved. Not a current concern. ## Verdict PASS — no blockers.