ROL Finance · Agent Training

Mazda's Training Process Receipt & Document Intake — what's done, what's next

Mazda has been trained on the company's receipt / document intake operating procedure. The full 8-step pipeline was validated end-to-end on a real Walmart receipt, the supporting tools were built or extended, and the procedure is now authored into Mazda's memory (memfs file system/receipt_intake_procedure.md + attached block) and confirmed live in her context.

What has been accomplished

DoneThe operating procedure, validated live

Every step below was run for real on a scanned Walmart receipt (an HP OfficeJet 8122e printer + HP 923 ink), not just designed on paper:

  1. Scan — dashboard ROL Finance → Scanners or tools/run_scan_image.sh (WIA 300dpi → scan.jpg).
  2. Show for review — tools/open_scan_jpg.sh / dashboard "Show Image" so EG confirms the correct document.
  3. Cheap classify + route — classify_scan.py (Gemini Flash) returns receipt / bank_statement / tax_document / other.
  4. Parse into an expense record — parse_and_categorize.py, now extracting merchant_city / merchant_state as separate fields.
  5. Investigate cryptic items only — investigate_item.py uses Gemini google_search grounding to identify SKU-like descriptions (e.g. 4KOT3LN → HP 923 ink) with sources.
  6. Resolve vendor_key — via VendorCategoryStore; No Vendor Key = failure (red-tab in report.html, exit).
  7. Categorize — with the high-confidence (≥0.85) item-override rule (printer+ink → Office>Supplies, overriding Walmart's "Personal" default).
  8. Store — only after vendor_key resolves and zero failures.

DoneTooling built or extended

ArtifactWhat it doesStatus
tools/classify_scan.pyCheap Gemini-Flash document-type classifier (route before parsing)New
receipt_parsing_tools/investigate_item.pyGemini Google-Search grounding to resolve cryptic/OCR-garbled line items + category hintNew
receipt_engine.py + modelsAdded merchant_city/merchant_state to the receipt schema & parsing promptExtended
Dashboard Scanners "Start Scan"Greys out while the scanner needs a power-cycle ("Restart the Scanner Please")Fixed

DoneEncoded into Mazda's memory

Authored the proper file-first way and verified live:

DoneInfrastructure enabler — the "ghost container"

memfs authoring had been blocked by a recurring Docker "ghost": two Docker engines (native dockerd + Docker Desktop) ran in parallel, and Desktop hijacked the docker socket so the live fleet was invisible to the CLI and letta-memfs lost its network. This was diagnosed and resolved to a single native engine with all services healthy (letta, memfs git, bridge, logger php+mysql, executor); the live DB was backed up first (~/ghost_migration/). See memory ghost-container-root-cause-docker-desktop-2026-06-24.

One open infra item: disable Docker Desktop's WSL integration + autostart on the Windows side so the two-engine split can't return on next login. Quick post-reboot check: docker info --format '{{.Name}}' should read DESKTOP-SHDBATI, not docker-desktop.

Next suggested training steps

Generated for the ROL Finance project · Mazda receipt-intake training. Companion memory: ghost-container-root-cause-docker-desktop-2026-06-24, procedure source of truth: memfs system/receipt_intake_procedure.md.