Skip to content

2026 04 22 Rate Scanner Layer1 Hardening

Rate Scanner — Layer 1 Hardening + Debt Expansion + Ops Dashboard

Section titled “Rate Scanner — Layer 1 Hardening + Debt Expansion + Ops Dashboard”

Date closed: 2026-04-22 Code repo: /home/ta/projects/mbr/ Task file: _WorkingOn/Tasks/2026-04-08_Rate-Scanner-Layer1-Hardening.md (closed)


Layer 1 Hardening (all 9 STANDARDS.md items — 2026-04-08)

Section titled “Layer 1 Hardening (all 9 STANDARDS.md items — 2026-04-08)”
ItemImplementation
Health Monitorscripts/health-check.sh — cron 0 13 * * * (09:00 ET); checks DB freshness, record count ≥10, 6 expected products, rates.json updated today
Anomaly Detectionrate_scanner/anomaly.py — >15% rate change triggers alert + export suppression; >10% warns; configurable via config.yaml
Fine Print Capturemin_balance_cad, product_promo_expiry, eligibility fields added to Pydantic models + rates.yaml + rates.json export
Daily Ops Reportrate_scanner/ops_report.py — writes 09_Logs/Ops/YYYY-MM-DD_Rate-Scanner-Ops.md after each run
Alert Suppressiondaily-run.sh reads health-check-status + anomaly-status sentinels before export; suppresses if either non-OK
notify_managerNon-blocking wrapper; falls back to logs/notifications.log until binary installed
Structured Logging[YYYY-MM-DD HH:MM:SS] LEVEL : message format; 5-run rotation; RUN STARTED/RESULT markers
Dry-Run Mode--dry-run on all CLI commands + passthrough in daily-run.sh
Test Suite38/38 tests passing

Root cause: uv tool install resolves __file__ to the tool cache, not the project directory. Fix: rate_scanner/_paths.py reads MBR_ROOT and RATE_SCANNER_DATA env vars, falling back to __file__-relative defaults. daily-run.sh switched to uv run from source.

Key pattern: For cron-triggered Python tools, use uv run from source directory — not uv tool install — to avoid path resolution issues.

22 new products added to rates.yaml + SQLite + rates.json:

  • credit_card_standard (6): Big 6 at 20.99% — all reference_only: true
  • credit_card_lowrate (6): MBNA True Line Gold 8.99% (best), TD/Scotia/BMO 12–14%
  • heloc (5): TD 4.95% (best), RBC/BMO 5.45%
  • mortgage_variable (1): BMO 5yr ~4.40% (needs_verification)
  • loc_unsecured (2): TD/Scotia at Prime+3%
  • auto_loan (2): TD/RBC at 6.99%

Ops dashboard updated with Debt Snapshot cards + inverted color logic (red = high-cost, green = low-cost).

Still missing: Big 6 fixed mortgage rates (2yr/3yr/5yr), credit union debt products.

  • Live at https://mbr-ops-dashboard.pages.dev
  • Step 6 added to daily-run.sh — auto-redeploys after each successful build (non-fatal)
  • Credentials: token from /home/ta/utils/web/web-deploy/.env (same as Step 4)

HashDescription
3330968Layer 1 hardening — all 9 items + 37 tests
67dfcadFix uv tool install path issues + ops dashboard
1520d3dDebt product expansion — 22 products
f4de9bfOps dashboard Step 6 in daily-run.sh

  • notify_manager binary not yet installed — alerts fall back to logs/notifications.log
  • Health sentinel may show FAILED if rates.json is >1 day old (e.g. after scraper outage) — clears automatically on next successful run
  • Mortgage fixed rates and credit union debt products not yet catalogued