Context
Follow-up to #5519. Import runs are keyed by a hashed source_key derived from the
import directory path. Checkpoint.start_run/2 deletes previous non-running runs for
the same source key before inserting a new one, so retention is bounded per directory.
Problem
If the import directory is renamed or moved, its runs (plus cascaded file checkpoints and
rejections) are orphaned under the old source key and are never cleaned up. The data
volume is small and bounded (at most one lingering run per abandoned path), so this is
cosmetic — but the rows accumulate forever with no way to remove them short of manual SQL.
Suggested change
Options, roughly in order of preference:
- On
Import startup (read_directory), delete non-:running runs whose source_key
differs from the current one — the import feature only ever serves a single directory,
so runs for other keys are unreachable by definition.
- Alternatively, a periodic or startup-time sweep that removes runs older than some
generous threshold.
Either way, import_file_checkpoints and import_rejections follow via the existing
on_delete: :delete_all references.
🤖Issue drafted with Claude Code (Fable 5 high) — sponsored by Claude for Open Source
Context
Follow-up to #5519. Import runs are keyed by a hashed
source_keyderived from theimport directory path.
Checkpoint.start_run/2deletes previous non-running runs forthe same source key before inserting a new one, so retention is bounded per directory.
Problem
If the import directory is renamed or moved, its runs (plus cascaded file checkpoints and
rejections) are orphaned under the old source key and are never cleaned up. The data
volume is small and bounded (at most one lingering run per abandoned path), so this is
cosmetic — but the rows accumulate forever with no way to remove them short of manual SQL.
Suggested change
Options, roughly in order of preference:
Importstartup (read_directory), delete non-:runningruns whosesource_keydiffers from the current one — the import feature only ever serves a single directory,
so runs for other keys are unreachable by definition.
generous threshold.
Either way,
import_file_checkpointsandimport_rejectionsfollow via the existingon_delete: :delete_allreferences.🤖Issue drafted with Claude Code (Fable 5 high) — sponsored by Claude for Open Source