# BidBrain, configured for Right Drive — what's done and what you do on the Mac

Configured 2026-08-19 for Mark (mark@rightdrive.co.uk). This replaces section 6
of the original setup guide; everything there is now done except the steps that
need your own logged in accounts.

## Already configured in this copy

- Buying rules and pricing maths: kept exactly as the original owner's as your
  starting point. £3,000 flat spread, 15% uplift, £10,000 governing threshold,
  gate of 90k miles / £11k reserve / 2 to 10 years / 210 miles / grades 1 to 3 /
  4 owners max, plus all the banned makes, models and engines. Refine them any
  time in `bidbrain/pricing.py`, then run `python3 test_pricing.py`.
- Clickdealer: fully switched off. No button, no banner, no daily read. Your DMS
  is DealerKit; when you want the "in stock / fills a gap" flags back, ask your
  Claude to build a DealerKit stock reader and flip `STOCK_FLAGS_ENABLED` in
  `daily_run.py`. Leave `monthly_run.py` unscheduled until then.
- Accounts email: `purchases_run.py` now emails accounts@rightdrive.co.uk. Only
  runs if you schedule it; it sends through the Mac's Mail app.
- Tests: all 106 pass on this copy.

## What you do on your Mac, in order

1. Put this folder somewhere plain in your home folder, e.g. `~/BidBrain`.
   Not Desktop, Documents or Downloads — macOS blocks scheduled jobs there.
2. Install the one dependency:
   `python3 -m pip install --user playwright`
   `python3 -m playwright install chromium`
   Then check: `python3 test_pricing.py` (all should pass).
3. Log into your own accounts, once each:
   `python3 login.py motorway`, `python3 login.py carwow`,
   `python3 login.py glass`, `python3 login.py cazana`
   For Glass's, tick "Don't ask for 30 days".
4. Set your dealer postcode in your Motorway and Carwow accounts. Distance
   filtering is measured from there, not from the code.
5. Carwow saved filter (the one thing left to paste in): in your Carwow dealer
   account, create and apply a saved filter matching the buying rules (age 2 to
   10, up to £11,000, up to 90k miles, grades 1 to 3, up to 4 owners, auction
   only, your distance). Copy the `saved_filter_id` number from the address bar
   into `CARWOW_SAVED_FILTER_ID` in `bidbrain/browser.py`. Until you do, the
   read uses your unfiltered stock list — it still works, just slower.
6. First run: `python3 daily_run.py` then `python3 serve.py`, and open
   http://localhost:8765/cockpit.html. Never run between 3:30pm and 5:00pm.
7. Optional, phone access: install Tailscale, sign in, then
   `/Applications/Tailscale.app/Contents/MacOS/Tailscale funnel --bg 8765`
8. Optional, automation: ask your Claude to set up the launchd schedule (see
   CLAUDE.md) for the daily run after 5pm and, if you want the accounts email,
   `purchases_run.py` at 3:50pm.

## Notes

- `CLAUDE.md` now has a "New owner, Right Drive" section at the top recording
  all of this, so any Claude session on your Mac picks up where this left off.
- Your logins, database and generated pages build up locally in `data/` and are
  never shared; `.gitignore` already excludes them.
