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
- Host:
rdmbair15m5(Apple Silicon, macOS 27.0) - Canonical Dev Sync:
rdmsm4x:~/dev/apps/rdDB/
Changes Delivered
- Core Data Models & Purpose Taxonomy
(
Sources/RDDBCore/Models.swift):- Added
public var purpose: String?toFileRecord. - Defined
public enum FilePurpose: String, CaseIterable, Sendable, Codableencompassing:receipts(absorbing receiptroo),invoices,contracts,bookmarks,credentials,screenshots,code,correspondence,reports,media, andother.
- Added
- Database Engine Enhancements
(
Sources/RDDBCore/Database.swift):- Added
purpose TEXTcolumn andidx_files_purposeindex to SQLite schema in WAL mode. - Updated
upsertFile,upsertFilesBatch,updateFileTaxonomy,updateFileTaxonomyBatch,searchFiles,getCustomerCorpus, andparseFileRowto bind and parsepurpose. - Added
getFilesByPurpose(purpose:limit:)andgetPurposeCounts() -> [String: Int]. - Protected
USER_OVERRIDErecords from bulk re-classification overwrite.
- Added
- Receiptroo Absorption & Heuristics
(
Sources/RDDBClassifier/ClassifierEngine.swift):- Implemented
inferPurpose(file: FileRecord) -> Stringanalyzing 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, andreceiptrooexports. - Updated
classifyAllUncategorizedandclassifyWithLLMto populatepurposeacross the corpus while preserving existing taxonomy and badges.
- Implemented
- macOS UI Purpose Vault
(
Sources/rdDB/RDDBApp.swift):- Added
case purpose = "Purpose Vault"toNavigationItem. - Created
PurposeVaultViewpresenting cards with live counters, color-coded badges, and one-click filtering for all 10 purpose categories. - Added quick filter chips in
ModernLibraryViewand updatedAppState.purposeCounts.
- Added
- Stateless MCP Server
(
Sources/RDDBMCP/main.swift):- Added
query_by_purpose(filtering by purpose category) andget_purpose_summary(purpose distribution counts) tools.
- Added
- Command-Line Interface
(
Sources/rddb-cli/main.swift):- Added
rddb-cli purpose [summary|<purpose>]command and updatedsearchoutput to show purpose labels.
- Added
- 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.ipscrash logs in~/Library/Logs/DiagnosticReports.
- rooDB Rename Migration Plan
(
~/.agent-coordination/requests-to-claude/roodb-migration-plan.md):- Formulated zero-data-loss migration plan including
PRAGMA integrity_checkverification before/after DB move, launchd descriptor migration, and rollback procedures. - Dispatched to
claude@rdmbair15m5andclaude@rdmsm4xviaagent_msg.zsh.
- Formulated zero-data-loss migration plan including
Verification Evidence
zsh scripts/test.zsh: 163 tests passed, 0 failures, 0.ipsfiles.swift run rddb-cli purpose summary: executed successfully.rsynctordmsm4x:~/dev/apps/rdDB/: synchronized 308 files.- Git commit on
main:b778c07.