From 8f3a91bcd41ff7fa3536f2ad6359cf92afd021f3 Mon Sep 17 00:00:00 2001 From: Ben_Kosytorz Date: Thu, 8 Oct 2026 14:18:40 +0200 Subject: [PATCH] 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 /../_logs/ by default. Explicit --audit still wins. --- sorter.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sorter.py b/sorter.py index afdef1e..cedc964 100644 --- a/sorter.py +++ b/sorter.py @@ -15,7 +15,9 @@ Flags: --catalog FILE default data/library_catalog.json - --audit FILE default /sorter_applied.jsonl + --audit FILE default /../_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: