Skip to content
Source
Sign inSign up
fuko/rive-preview-player

Prune feedback bundles an agent read over 14 days ago #5

Mergedfukomerged 5 commits intomain fromfeat/feedback-cleanupmerged by fuko View on GitHub

fukocommented

Summary

  • Automatically prune complete feedback bundles after their read age exceeds 14 days, with CLI and environment options to change or disable cleanup.
  • Add prune-feedback for manual cleanup or dry runs, and document the behavior and options.

Testing

  • node --check passed for the changed JavaScript files.
  • Scratch-project checks covered old, recent, unread, incomplete, and malformed bundles, dry runs, disabled cleanup, and bare .riv targets.
  • Started the server against a fixture with an old bundle; confirmed the cleanup log and /api/feedback response.

Review follow-up (df66001)

  • Prune now refuses to run when .rive-preview or the feedback dir is reached through a symlink, so a linked folder can never send deletes outside the project. Tested: symlinked .rive-preview / feedback dirs remove nothing; a project reached through /tmp → /private/tmp and a bare .riv still prune.
  • Two Codex review rounds: the first found the symlink case (fixed above), the second found nothing.

Rebased onto main (after #7 wait-feedback) + review rounds

  • Rebased onto origin/main; the README section and the prune-feedback subcommand sit next to wait-feedback (additive conflicts only). Prune is compatible with #7 claims: consumers only claim/mark unread bundles, prune only deletes old read ones.
  • A bundle is now rename()d out of feedback/ to .pruning-<stamp>-<hex> before it is deleted, so a folder swapped for a symlink mid-prune can only lose the link (stress-tested with ~13k swaps). Leftovers from an interrupted prune are cleared only when they match that exact name and are real folders.
  • If a parent folder is swapped mid-prune, the move is verified and undone instead of deleted. A fully race-free version against a hostile local process would need dirfd-relative fs calls Node lacks; that is out of scope.
  • Re-verified after the rebase: scratch suite, live server on a test-fixture-audio copy (startup prune, prune after share, /api/feedback), and wait-feedback delivering a new bundle while the player runs.
  • Codex (gpt-6.1-sol, medium) review rounds until clean: final round NO FINDINGS.

🤖 Generated with Claude Code

    1. fuko merged this3317c94

    2. fuko closed this

Sign in to join this conversation.