Fleet changelogs · dev.ecs0.net
rdmbair15m5-changelog-20260823-1128-purpose-filter-architecture-and-receiptroo-absorption

rdmbair15m5-changelog-20260823-1128-purpose-filter-architecture-and-receiptroo-absorption

Summary

Architected and implemented the first-class Purpose Filter system across rdDB (RDDBCore, RDDBClassifier, RDDBMCP, rdDB.app, and rddb-cli), absorbing receiptroo's receipt identification capabilities, with 163/163 crash-gated passing tests (zero DiagnosticReports .ips crash logs) and prepared the gated rooDB rename migration plan.

Scope & Target Hosts

Changes Delivered

  1. Core Data Models & Purpose Taxonomy (Sources/RDDBCore/Models.swift):
    • Added public var purpose: String? to FileRecord.
    • Defined public enum FilePurpose: String, CaseIterable, Sendable, Codable encompassing: receipts (absorbing receiptroo), invoices, contracts, bookmarks, credentials, screenshots, code, correspondence, reports, media, and other.
  2. Database Engine Enhancements (Sources/RDDBCore/Database.swift):
    • Added purpose TEXT column and idx_files_purpose index to SQLite schema in WAL mode.
    • Updated upsertFile, upsertFilesBatch, updateFileTaxonomy, updateFileTaxonomyBatch, searchFiles, getCustomerCorpus, and parseFileRow to bind and parse purpose.
    • Added getFilesByPurpose(purpose:limit:) and getPurposeCounts() -> [String: Int].
    • Protected USER_OVERRIDE records from bulk re-classification overwrite.
  3. Receiptroo Absorption & Heuristics (Sources/RDDBClassifier/ClassifierEngine.swift):
    • Implemented inferPurpose(file: FileRecord) -> String analyzing filenames, extensions, source stores (Safari, Chrome, Mail), and OCR preview text.
    • Integrated full receipt pattern detection matching Uber, Lyft, POS, store purchases, apple.com/bill, subtotal, tax, and receiptroo exports.
    • Updated classifyAllUncategorized and classifyWithLLM to populate purpose across the corpus while preserving existing taxonomy and badges.
  4. macOS UI Purpose Vault (Sources/rdDB/RDDBApp.swift):
    • Added case purpose = "Purpose Vault" to NavigationItem.
    • Created PurposeVaultView presenting cards with live counters, color-coded badges, and one-click filtering for all 10 purpose categories.
    • Added quick filter chips in ModernLibraryView and updated AppState.purposeCounts.
  5. Stateless MCP Server (Sources/RDDBMCP/main.swift):
    • Added query_by_purpose (filtering by purpose category) and get_purpose_summary (purpose distribution counts) tools.
  6. Command-Line Interface (Sources/rddb-cli/main.swift):
    • Added rddb-cli purpose [summary|<purpose>] command and updated search output to show purpose labels.
  7. Verification & Crash-Gate Test Suite (Tests/RDDBCoreTests/PurposeFilterTests.swift):
    • Added unit tests for diverse corpus purpose inference, database filtering, purpose counts, and receiptroo absorption parity.
    • Ran scripts/test.zsh: 163/163 tests passed in 3.92s with ZERO .ips crash logs in ~/Library/Logs/DiagnosticReports.
  8. rooDB Rename Migration Plan (~/.agent-coordination/requests-to-claude/roodb-migration-plan.md):
    • Formulated zero-data-loss migration plan including PRAGMA integrity_check verification before/after DB move, launchd descriptor migration, and rollback procedures.
    • Dispatched to claude@rdmbair15m5 and claude@rdmsm4x via agent_msg.zsh.

Verification Evidence