rename-receipts
Section titled “rename-receipts”Deterministic renamer for Accounting reference artifacts (Bills, receipts, statements) to the Naming System.md §4 convention (Vendor_YYYY-MM-DD.pdf, folder-collapsed).
Project
Section titled “Project”- Location:
D:\FSS\Software\Utils\PythonUtils\rename_receipts\ - Package:
uv-managed, own git repo
Quick Start
Section titled “Quick Start”cd D:\FSS\Software\Utils\PythonUtils\rename_receiptsuv syncuv run rename-receipts D:\FSS\Accounting # dry-run (default)uv run rename-receipts D:\FSS\Accounting --executeScope (hardcoded, 2026-07-29; extended 2026-08-17)
Section titled “Scope (hardcoded, 2026-07-29; extended 2026-08-17)”Bills\,Expenses\AI Tools\,Statements\Chequing\,Statements\CreditCard\Statements\Investments\2025\(BMO Investorline) —AccountNumber_MMYYYY.pdf→AccountNumber_YYYY-MM.pdf(day dropped; statement already carries its exact date inside). Other years not in scope (untouched, stillMMYYYY).- Only files dated on/after
CUTOFF_DATE(2025-06-01) — set inmain.py(Investments plan is not cutoff-gated; Talbot asked for all 12 of 2025) - Vendor/date extraction is per-folder deterministic logic, not AI — see module docstring for how each folder’s pattern is parsed
Known gotcha: WSL/drvfs delete lock
Section titled “Known gotcha: WSL/drvfs delete lock”os.rename() and even rm can fail with PermissionError deleting specific pre-existing files on /mnt/d from WSL, even with -rwxrwxrwx shown — not systemic (a freshly-created test file deletes fine), likely a transient lock (backup/AV scan) on that specific file. The utility copies + byte-verifies + deletes; on a delete failure it leaves both old and new copies (zero data loss) and prints a Remove-Item PowerShell command to finish cleanup from Windows.
First run (2026-07-29)
Section titled “First run (2026-07-29)”FY26+ (≥2025-06-01) rename across the 4 in-scope folders: Bills\ needed 0 changes (already compliant), 25 files renamed elsewhere (7 receipts, 18 statements). 3 of the 25 hit the WSL delete-lock above and needed a manual PowerShell Remove-Item — full decision trail: Core/Processes/Logs/2026-07-29_File-Naming-Reference-Artifacts.md.
Investments run (2026-08-17)
Section titled “Investments run (2026-08-17)”Statements\Investments\2025\ (BMO Investorline) joined §4-adjacent naming (day dropped, decided by Talbot). Added plan_investments(), dry-run verified, executed — 12 of 12 files renamed clean, no lock issues. Still-deferred vault-wide-beyond-Accounting rename tracked in Core/Processes/Tasks/File-Naming-Vault-Wide-Rollout.md.