gabriel / musehub public
feat patch #47 task/fetch-bundle-cleanup #1 / 1
AI Agent gabriel · 129 days ago · May 12, 2026 · Diff

feat(#47): delete fetch bundle blob from MinIO after TTL

After wire_fetch_bundle stores a bundle for presigned download, schedule a fire-and-forget asyncio task that calls backend.delete(bundle_id) once ttl_seconds elapses. Cleanup is best-effort — failures are swallowed so the fetch response is never affected.

4 TDD tests (BC0–BC3): delete called after TTL, not called on inline path, failure is swallowed, exactly one delete per call.

sha256:46e81dddeede774999fe652687a67c51760ec542aed4be1d2ba910ec4b520ad6 sha
+23 ~1 symbols
sha256:5641ca97b657ea4a4a1c32337f4d838aa50e5d0fbbe0cb9dff859f10594db248 snapshot
+23
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes 24 symbols
~ tests/test_fetch_bundle_cleanup.py .py 23 symbols added
+ _make_commit function async_function _make_commit L91–133
+ _now function function _now L31–32
+ _store_object function async_function _store_object L65–88
+ _stub_backend function function _stub_backend L35–62
+ AsyncMock import import AsyncMock L21–21
+ AsyncSession import import AsyncSession L20–20
+ annotations import import annotations L12–12
+ asyncio import import asyncio L14–14
+ blob_id import import blob_id L23–23
+ call import import call L21–21
+ create_repo import import create_repo L25–25
+ datetime import import datetime L18–18
+ db import import db L24–24
+ fake_id import import fake_id L23–23
+ hashlib import import hashlib L15–15
+ msgpack import import msgpack L16–16
+ pg_insert import import pg_insert L19–19
+ pytest import import pytest L17–17
+ timezone import import timezone L18–18
+ test_bc0_bundle_deleted_after_ttl function async_function test_bc0_bundle_deleted_after_ttl L141–175
+ test_bc1_no_delete_on_inline_path function async_function test_bc1_no_delete_on_inline_path L183–212
+ test_bc2_cleanup_failure_is_swallowed function async_function test_bc2_cleanup_failure_is_swallowed L220–253
+ test_bc3_exactly_one_cleanup_per_call function async_function test_bc3_exactly_one_cleanup_per_call L261–290
← Older Oldest on task/fetch-bundle-cleanup
All commits
Newer → Latest on task/fetch-bundle-cleanup

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:46e81dddeede774999fe652687a67c51760ec542aed4be1d2ba910ec4b520ad6 --body "your comment"