**`export_job.py` is not ready to merge as it stands: three blockers, each a small fix, so tomorrow is still reachable if they are fixed and tested first.** I only read `export_job.py`; I did not open `test_export_job.py`, run anything, or see the `invoices` schema.

## Blockers

1. **A failed export looks like a successful one (`export_job.py:56-57`).** `run()` catches every exception, logs one line and exits with code 0.
   - Case: the finance endpoint returns 503 at 02:00. Cron sees success, nobody is alerted, and finance has no file for that day. Expected: a non-zero exit and a traceback.
   - Fix: use `log.exception(...)` and re-raise, or drop the `except` entirely.

2. **The upload can hang forever (`export_job.py:42`).** `requests.post` has no `timeout`.
   - Case: the endpoint accepts the connection and never responds. The job never ends and never fails, holding its database connection open.
   - Fix: add `timeout=(10, 120)` or similar.

3. **Customer email addresses are written to the log (`export_job.py:52`).** Every customer's email for the day goes into one INFO line.
   - Today nothing configures logging, so the line is dropped when cron runs the script. It starts leaking the moment someone adds a log handler.
   - Fix: log the count only.

## Should fix before or right after merge

| Severity | Problem | Concrete case |
|---|---|---|
| High | Tests cover only the CSV header and one row, per the docstring. Nothing covers the date window, a failed upload, or `run()`. | Blocker 1 would have been caught by a test for a failed upload. |
| Medium | A missed day cannot be re-run (`:47`). `run()` always uses yesterday, with no date argument. | Tuesday's export fails and is noticed on Thursday. The only recovery is editing the code. |
| Medium | Amounts are formatted inconsistently (`:37`). `amount_cents / 100` is a float. | 1999 is written as `19.99`, but 2000 is written as `20.0` and 1050 as `10.5`. Expected `20.00` and `10.50`. Use `f"{amount_cents / 100:.2f}"` or `Decimal`. |
| Medium | "Yesterday" has no stated timezone (`:47`, `:28`). It is the host's local date, compared in the database session's timezone. | Host on UTC, finance on US Eastern: an invoice paid at 21:00 Eastern on 13 Nov lands in the 14 Nov file. Needs confirming against the `paid_at` column type and what finance expects. |
| Medium | No success log is visible. With no logging configured, INFO lines are discarded; only errors reach stderr. | After a good run there is no record of how many invoices were exported. |
| Medium | The upload sends no credentials (`:42`). | Fine only if the URL itself carries a token or the endpoint is network-restricted. I could not tell which. |

## Low severity

- **Import-time env read (`:16`):** `FINANCE_UPLOAD_URL` is read on import, so importing the module without it raises `KeyError`. `DATABASE_URL` is read inside `run()`; do the same for both.
- **Files left on disk (`:48`, `:33`):** CSVs with customer emails accumulate in `/var/exports` with default permissions and no cleanup. A crash mid-write leaves a partial file under the final name.
- **Re-runs duplicate:** running twice for the same day uploads the same file twice. Whether that double-counts depends on the finance endpoint.
- **Empty days:** a day with no paid invoices uploads a header-only file. Confirm finance wants that.
- **Spreadsheet formulas (`:37`):** an email starting with `=` or `+` runs as a formula if finance opens the CSV in Excel.
- **Memory (`:29`):** `fetchall()` loads the whole day at once. Fine at normal volumes.
- **Hard-coded path (`:15`):** `EXPORT_DIR` is not configurable, unlike the URL.

## What it takes to merge tomorrow

Fix the three blockers (about ten lines), add tests for a failed upload and for the date window, and add an optional date argument for re-runs. The timezone and credentials rows need an answer from you or finance, not code from me.

VERDICT: NOT READY
