Skip to content

fix: prune old manifest backups after discover runs#6

Open
Vishwaspatel2401 wants to merge 1 commit intobalgaly:masterfrom
Vishwaspatel2401:fix/manifest-backup-cleanup
Open

fix: prune old manifest backups after discover runs#6
Vishwaspatel2401 wants to merge 1 commit intobalgaly:masterfrom
Vishwaspatel2401:fix/manifest-backup-cleanup

Conversation

@Vishwaspatel2401
Copy link
Copy Markdown

Summary

Fixes #4 — manifest backup files were created on every skit discover run but never cleaned up, causing unbounded disk growth.

After writing a new backup, the fix scans for all manifest.backup-*.json files in skitHome, sorts them by name (timestamps sort lexicographically), and deletes all but the 5 most recent.

Changes

  • src/commands/discover.js — added backup pruning block immediately after the backup is written

Behaviour

  • First 5 discover runs: all backups kept as before
  • 6th run onwards: oldest backup is deleted, keeping exactly 5
  • Cleanup errors are silently ignored (non-critical path)

Testing

All 375 previously passing tests continue to pass. The 6 failing tests are pre-existing failures unrelated to this change.

Keep only the 5 most recent manifest.backup-*.json files after each
discover run to prevent unbounded disk growth on long-running systems.

Closes balgaly#4

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Manifest backup files accumulate indefinitely with no cleanup

1 participant