Domain ops: list, resolve, reference, and delete Media #190
Labels
No labels
kind
bug
kind
enhancement
wayfinder
grilling
wayfinder
map
wayfinder
prototype
wayfinder
research
wayfinder
task
workflow
needs-info
workflow
needs-triage
workflow
ready-for-agent
workflow
ready-for-human
workflow
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Reference
rosa/vernier#190
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
Implementation spec: Media management: Library page and editor picker — implementation spec (§1.2–1.3).
What to build
The domain vocabulary the media-manage web surface consumes: listing a user's Media, resolving a picked Media id into a Post's Photo, listing the Posts a Media appears in, and deleting a Media with detach. Pure domain + repository work, verifiable through tests — the Library and picker tickets build the UI on top.
Acceptance criteria
list_media_forreturns every Media the owner has, newest-first, with the ordering guaranteed by the repository rather than sorted by callers.resolve_owned_photoperforms the id-based existence + ownership check and yields a PhotoRef; foreign or missing ids resolve to nothing (callers must not be able to distinguish other users' Media from absent). No status gate — attaching a Processing Media is already legal via inline upload.resolve_owned_photo, so the ownership decision lives in one place. Behavior unchanged; existing tests pass untouched.list_posts_referencingreturns the Posts whose Photo points at the Media, any status, newest-first.delete_mediais owner-scoped: missing and foreign ids collapse to a single not-found error; a still-Processing Media is refused (the Reconciler owns that state's integrity); Ready and Failed both delete. Deletion detaches every referencing Post's Photo — including clearing the orphaned alt — and drops the rendition; disk returns via the existing reclamation tick, nothing extra here.mise run format,mise run ci, andmise run clippypass.Blocked by
None — can start immediately. (It edits the same Media Service and port modules as the filename-capture ticket, so running the two in parallel means a rebase, but neither gates the other.)