Spans dir: rotation / TTL so ~/.local/share/repo-recall/spans/ doesn't grow without bound #55

Open
opened 2026-05-23 20:55:28 +00:00 by coilysiren · 0 comments
Owner

Originally filed by @coilysiren on 2026-05-09T02:09:56Z - https://github.com/coilysiren/repo-recall/issues/68

Cleanup debt from the LUCA tracer (luca#27).

Problem

The spans ingest dir (~/.local/share/repo-recall/spans/ or REPO_RECALL_SPANS_DIR) is append-only today. Every subagent run drops one file. There is no rotation, no TTL, no GC.

repo-recall's cache wipes on every restart and re-ingests on every refresh, which means the cost of accumulated spans hits both directory walks and the wipe-rebuild cycle. With the SubagentStop hook live globally (coilysiren/coilyco-ai's promote-to-global issue), file count grows roughly N-subagents per session, which gets out of hand fast.

Candidate fixes

  • TTL on disk: a small GC pass at refresh time that deletes files older than N days. Symmetric with the existing 30d cutoff repo-recall already uses for commits/churn.
  • repo-recall spans gc verb (HTTP or CLI) that operators or cron can invoke.
  • Capped-count rotation: keep the most-recent K spans, drop older ones. Simpler than TTL but lossier.
  • Producer responsibility: have o2r and the hook script delete after successful ingest. Couples producer to consumer; rejected unless there's a strong reason.

Default recommendation: TTL during refresh, with a config var REPO_RECALL_SPANS_TTL_DAYS defaulting to 30.

Done when

  • ~/.local/share/repo-recall/spans/ does not grow indefinitely.
  • The chosen mechanism is documented in AGENTS.md alongside the existing data-source guidance.
  • A test exercises the GC path (drops an old-mtime span file and asserts it's removed at refresh).
_Originally filed by @coilysiren on 2026-05-09T02:09:56Z - [https://github.com/coilysiren/repo-recall/issues/68](https://github.com/coilysiren/repo-recall/issues/68)_ Cleanup debt from the LUCA tracer (luca#27). ## Problem The spans ingest dir (`~/.local/share/repo-recall/spans/` or `REPO_RECALL_SPANS_DIR`) is append-only today. Every subagent run drops one file. There is no rotation, no TTL, no GC. repo-recall's cache wipes on every restart and re-ingests on every refresh, which means the cost of accumulated spans hits both directory walks and the wipe-rebuild cycle. With the SubagentStop hook live globally (coilysiren/coilyco-ai's promote-to-global issue), file count grows roughly N-subagents per session, which gets out of hand fast. ## Candidate fixes - **TTL on disk**: a small GC pass at refresh time that deletes files older than N days. Symmetric with the existing 30d cutoff repo-recall already uses for commits/churn. - **`repo-recall spans gc`** verb (HTTP or CLI) that operators or cron can invoke. - **Capped-count rotation**: keep the most-recent K spans, drop older ones. Simpler than TTL but lossier. - **Producer responsibility**: have o2r and the hook script delete after successful ingest. Couples producer to consumer; rejected unless there's a strong reason. Default recommendation: TTL during refresh, with a config var `REPO_RECALL_SPANS_TTL_DAYS` defaulting to 30. ## Done when - `~/.local/share/repo-recall/spans/` does not grow indefinitely. - The chosen mechanism is documented in AGENTS.md alongside the existing data-source guidance. - A test exercises the GC path (drops an old-mtime span file and asserts it's removed at refresh).
coilysiren added
P4
and removed
P3
labels 2026-05-31 07:01:11 +00:00
Sign in to join this conversation.
No labels
P0
P1
P2
P3
P4
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coilyco-flight-deck/repo-recall#55
No description provided.