2026 04 22 Hassle Threshold Engine
Hassle Threshold Engine — Completion Log
Section titled “Hassle Threshold Engine — Completion Log”Date: 2026-04-22
Code: /home/ta/projects/mbr/hassle-engine/
Task file: _WorkingOn/Tasks/2026-04-08_Hassle-Threshold-Engine.md (closed)
What Was Built
Section titled “What Was Built”Python CLI tool that reads from rate-scanner/data/rates.db, evaluates user-defined savings thresholds, and produces alert payloads when the verified net benefit exceeds the user’s minimum.
Structure:
hassle-engine/├── hassle_engine/│ ├── engine.py # calculate_net_benefit() + evaluate_threshold()│ ├── models.py # UserThresholdConfig, RateRecord, AlertPayload (Pydantic)│ ├── db.py # read-only SQLite; filters to hisa/chequable only│ ├── alerts.py # build_alert_payload() with recommendation text + suppress_until│ └── cli.py # evaluate, evaluate-all, status commands + --dry-run├── config.yaml # all paths/thresholds; no hardcoded values in Python└── tests/ # 13/13 passedCLI commands:
hassle-engine evaluate --user-config path/to/user.json [--dry-run]hassle-engine evaluate-all --config-dir path/to/users/ [--dry-run]hassle-engine statusKey Design Decisions
Section titled “Key Design Decisions”- Read-only consumer of rates.db — hassle-engine never writes to rate-scanner’s DB
- Own state in hassle.db — suppress_until dates stored separately
- Category filter — db.py filters to
hisaandchequablecategories only; GICs excluded from alert evaluation - Users as JSON files (Phase A) —
data/users/; will switch to CRM API in Phase B
Test Evidence
Section titled “Test Evidence”uv run pytest tests/ -v → 13 passed, 0 warnings
Manual verification: TD 0.010% → Saven 2.85%, $50k balance, $50 time cost = $1,370 net/yr → alert fires ✓
Note on Rates
Section titled “Note on Rates”Best liquid savings account as of 2026-04-03 scrape: Saven Financial 2.85% (not EQ Bank 3.65% — that is a GIC, filtered out correctly).
Phase B Wiring
Section titled “Phase B Wiring”When CRM API is live: update config.yaml (users section) and db.py to pull user configs from Supabase instead of JSON files. No structural changes needed.
Session Also Covered
Section titled “Session Also Covered”- Renamed
/home/ta/projects/bmr/→/home/ta/projects/mbr/(typo fix) - Updated crontab, all shell scripts, Python path references, and 9 KB notes