import path from "node:path"; import { songDir, isSegment } from "./browse"; import { stateFile } from "./paths"; import { readJson, withStateLock, writeJsonAtomic } from "./state"; import { NOTE_LIMIT, type NoteMap } from "./note-types"; // --------------------------------------------------------------------------- // Notes on anything. // // The point of these is NOT to annotate a file for its own sake -- it is to be // able to hand a whole song's picture to someone (or to a model) in one paste, // without re-deriving it from scrollback. Every judgement made here has a // reason, and the reason is the part that gets lost: a variant named // `wide-triangle` records that a triangle build exists and nothing about why it // was tried or what was wrong with it. // // So notes are attached to TARGETS, not to files, and a target can be anything // the UI lets you select: // // song the song as a whole // file: a cut or a variant // cut: the cut SLOT -- notes survive a promote, and can // be written about a cut that does not exist yet // plan: one file in plan/ // thumb: one cover in thumb-manifest.json // source: an episode the clips come from // clip: