sorter: write audit + low-confidence doc beside the library, never inside it

The library may be a seeded torrent whose file set is frozen; the
sorter_applied.jsonl / sorter_low_confidence.txt bookkeeping now goes
to <library>/../_logs/ by default. Explicit --audit still wins.
This commit is contained in:
2026-10-08 14:18:40 +02:00
parent 390ce8b024
commit 8f3a91bcd4
+8 -2
View File
@@ -15,7 +15,9 @@
Flags:
--catalog FILE default data/library_catalog.json
--audit FILE default <library>/sorter_applied.jsonl
--audit FILE default <library>/../_logs/sorter_applied.jsonl
(bookkeeping stays OUT of the library, which may be a
seeded torrent; --audit still overrides)
"""
from __future__ import annotations
@@ -85,7 +87,11 @@ def main() -> None:
catalog = load_catalog(args.catalog, dropped=dropped)
if dropped:
log.info("Dropped systems: %s", ", ".join(sorted(dropped)))
audit = args.audit or (args.library / "sorter_applied.jsonl")
# Bookkeeping must never land inside the library itself (it may be a
# seeded torrent whose file set is frozen): default to a _logs folder
# beside it. An explicit --audit overrides this.
audit = args.audit or (args.library.parent / "_logs" / "sorter_applied.jsonl")
log.info("Audit file: %s", audit)
provenance = None
if args.provenance: