**Not ready to merge as written, but the fixes are small and tomorrow is still realistic.** Four problems need fixing first; the most serious is that a failed export looks like a success to cron. I read only `export_job.py`, ran nothing, and took the test coverage from the docstring rather than opening `test_export_job.py`.

## Must fix before merge

1. **Failures are swallowed, so nobody finds out (`export_job.py:56-57`).** The `except Exception` logs one line and the process exits with code 0.
   - Case: the finance endpoint returns 503 at 02:00. Cron sees a successful run and nothing alerts, where it should see a non-zero exit with a traceback.
   - Fix: use `log.exception(...)` and re-raise (or `sys.exit(1)`).
   - A missed day is also never retried, because `run()` always exports "yesterday". Accept the day as an optional argument so it can be re-run by hand.

2. **Customer emails are written to the logs (`export_job.py:52`).** The log line includes `[row[1] for row in rows]`, which is every customer's email address for the day.
   - Case: 5,000 paid invoices puts 5,000 addresses in one log line, where the log should hold only the count and the date.
   - Fix: drop the list.

3. **The upload has no timeout (`export_job.py:42`).** `requests.post` without `timeout=` waits forever.
   - Case: the finance endpoint accepts the connection and stalls. The job hangs indefinitely holding a database connection, and the next night's run starts alongside it.
   - Fix: add `timeout=(10, 120)` or similar, and consider a small bounded retry.

4. **Amounts are formatted with float division (`export_job.py:37`).** `amount_cents / 100` produces a float, so the number of decimals varies.
   - Case: `amount_cents = 1000` is written as `10.0`, and `5` as `0.05`, where a finance file should say `10.00`.
   - Fix: `Decimal(amount_cents) / 100` quantized to two places, or export the integer cents.
   - This also assumes every currency has two decimal places: a JPY invoice would be divided by 100 incorrectly if stored in whole yen.

## Verify before merge

- **"Yesterday" depends on two clocks that may disagree (`export_job.py:47`, `:28`).** `date.today()` uses the host's timezone, while the database turns the bare date into midnight in its session timezone.
   - Case: the host is on UTC and the database session is on US Pacific. The 02:00 UTC run on Nov 14 asks for "Nov 13 Pacific", which still has six hours to go, and invoices paid in those hours are never exported.
   - If both are UTC this is fine. Either way, compute the window explicitly as timezone-aware timestamps so it does not depend on configuration.
- **Upload authentication.** The POST sends no credentials. Confirm the endpoint is authenticated some other way, such as a token in the URL or a network allowlist.

## Tests

The docstring says the tests cover only the CSV header and one row. Against your own standard, these are missing:
- the date window in `fetch_invoices`
- `upload` raising on a non-2xx response and on a timeout
- `run()` exiting non-zero on failure
- amount formatting (`1000` → `10.00`)
- the zero-invoice day

## Smaller things, fine as follow-ups

- **Import-time env read (`:16`):** `UPLOAD_URL = os.environ[...]` means any test importing the module needs the variable set. Read it inside `upload()` or pass it in.
- **No logging setup:** nothing configures logging, so when run as a script the `log.info` lines are dropped and only errors reach stderr. Add `logging.basicConfig` under `__main__`.
- **Non-atomic file write:** the CSV is written straight to its final path, so a crash mid-write leaves a partial file. Write to a temp file and rename.
- **Spreadsheet formulas:** an email starting with `=` or `+` would be treated as a formula if finance opens the CSV in Excel.

VERDICT: NOT READY
