git/intake/main
issues/0023-fix-an-album-can-sit-in-the-archive-with-no-journa.md
15 lines973 B last change raw · source · history

title: fix: an album can sit in the archive with no journal record status: closed labels: [] created: 2026-09-14 closed:


Found by the audit of 2026-09-14.

The journal is the only thing that knows an album exists. An album is promoted into the archive before its record is written, so a process killed in between -- OOM, power loss, SIGKILL -- leaves a complete album that verify says nothing about, audit does not count, and a later run happily files a second copy beside.

Neither command looked at the archive at all, so it could not notice. library verify now lists every album directory in the archive that no journal record names, and library audit counts them as needing attention. Both report the count in --json.

The same commit fixes a name-search loop in the "both" collision path: it treated any error from os.Stat as "the name is free" unless it was NotExist, so an unreadable parent directory would have spun looking for a name it could never check.