Cameron Cordes and Claude Opus 5.5
8a5a7c19d7
test(filename_audit): seed library 2 before its image_exif row ( #151 )
...
run_audit_skips_disabled_and_offline_libraries inserted an image_exif
row for library 2, which migrations never create, tripping the
image_exif.library_id foreign key. Insert the libraries row first so
the suite is green on master again.
Also fix the cmp_owned clippy warning in the filename_audit bin.
Closes #151
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com >
2026-09-29 21:31:53 -04:00
Cameron Cordes
3aa6ce314c
feat(dates): pre-cutover audit utility for the filename date class ( #117 )
...
One-shot, operator-run, strictly read-only utility that lists every
filename-class file with its stored date/source and the date/source/
offset-source the re-based resolver would assign it — the human
spot-check that gates the production backfill drain (#118 ).
- src/filename_audit.rs: StoredDate/AuditRow/SkippedLibrary; walk +
PathExcluder (depth-0 guarded) + match_filename_date -> one
resolve_dates_batch pass with EMPTY priors (mirrors the drain
exactly); disabled and probe-stale libraries reported as skipped,
never partially processed; output stable-sorted by (library, path).
- src/bin/filename_audit.rs: operator binary (dotenv, DATABASE_URL,
EXCLUDED_DIRS, libraries::load_all, format_report).
- src/memories.rs: match_filename_date canonical matcher returning
FilenameMatch { pattern, date }; extract_date_from_filename is now
a thin wrapper (byte-for-byte behavior-preserving, verified by
review).
4 audit tests (inversion + utc_direct + exclusions, offline/disabled
skip, stable sort, report determinism incl. no debug quotes) + 2
matcher tests. 645 lib + 718 integration pass; clippy/fmt clean.
Standards review applied: {:?}->{}, depth-0 walk guard, dead
per-file exclude check removed, unused Default derive removed,
pattern column widened, doc comment reworded.
2026-09-25 18:03:38 -04:00