Context
Flagged as a non-blocking observation in PR #526 review.
apps/server/src/media/repo/writes.ts:8 imports toRow from ./reads:
import { toRow } from "./reads";
toRow is a private mapper (typeof watchlistItems.$inferSelect → ActiveRow) defined in reads.ts and used by both reads.ts and writes.ts. The current cross-file dependency means any signature change to toRow touches both files, and the coupling is implicit (reads → internal detail leaked to writes).
Proposed fix
Move toRow to a dedicated apps/server/src/media/repo/row.ts (or cursor.ts) so both reads and writes import from a shared, clearly-named location. Makes the coupling explicit and easier to find.
Why deferred
Low risk in practice — toRow is unexported and the dependency direction is clear from naming. Deferred to avoid scope creep in #526.
Context
Flagged as a non-blocking observation in PR #526 review.
apps/server/src/media/repo/writes.ts:8importstoRowfrom./reads:toRowis a private mapper (typeof watchlistItems.$inferSelect → ActiveRow) defined inreads.tsand used by bothreads.tsandwrites.ts. The current cross-file dependency means any signature change totoRowtouches both files, and the coupling is implicit (reads → internal detail leaked to writes).Proposed fix
Move
toRowto a dedicatedapps/server/src/media/repo/row.ts(orcursor.ts) so both reads and writes import from a shared, clearly-named location. Makes the coupling explicit and easier to find.Why deferred
Low risk in practice —
toRowis unexported and the dependency direction is clear from naming. Deferred to avoid scope creep in #526.