Not ready to merge as it stands: the job can fail without anyone finding out, it writes customer emails into the logs, and the upload can hang forever. The four must-fix items are small, so tomorrow is still realistic if they go in with tests.

This is from reading `export_job.py` only; I did not run anything. `test_export_job.py`, which the docstring cites, is not in the working directory, and I found no requirements document, so I judged against the docstring: export yesterday's paid invoices to finance every night.

## Must fix before merge

1. **A failed export looks like a success (high).** `export_job.py:56-57` catches every exception, logs one line and lets the process exit with code 0.
   - Concrete case: the finance endpoint returns 503, cron records a clean run, and finance gets no file.
   - The log line also drops the traceback.
   - Fix: use `log.exception(...)` and re-raise (or `sys.exit(1)`).

2. **A missed day cannot be re-exported (high, combined with 1).** `run()` always computes yesterday (`export_job.py:47`) and takes no date argument. If the night of the 13th fails, the only way to recover is to edit the code. Fix: accept an optional date on the command line.

3. **Customer emails are written to the log (high, privacy).** `export_job.py:52` logs the full list of `customer_email` values on every run. Fix: log the count only.

4. **The upload has no timeout (medium-high).** `requests.post` at `export_job.py:42` waits indefinitely if the endpoint stalls. The process then hangs with the database connection open, and the next night's run starts alongside it. Fix: `timeout=(10, 120)` or similar.

5. **Tests cover only the CSV writer (high against your own standards).** By the docstring, the tests check the header and one row. Nothing covers the date window in `fetch_invoices`, an upload failure, or `run()`. The fixes for 1, 2 and 4 each need a test.

## Should fix, can follow shortly after

6. **Logging is never configured (medium).** No handler is set up, so when run as a script both `log.info` lines are dropped. Only the error line reaches stderr, so a successful run leaves no trace. Add `logging.basicConfig(level=logging.INFO)` under `__main__`.

7. **"Yesterday" depends on the server's timezone (medium).** `datetime.date.today()` at `export_job.py:47` uses machine local time, and the query compares bare dates against `paid_at`.
   - Concrete case: with the server on UTC and finance on Pacific time, an invoice paid at 17:30 Pacific on the 13th lands in the file for the 14th.
   - Whether that is wrong depends on which day boundary finance expects; pin the timezone explicitly either way.

8. **Amounts are formatted inconsistently (low-medium).** `amount_cents / 100` at `export_job.py:37` writes 1000 cents as `10.0` and 1050 as `10.5`, not `10.00` and `10.50`. Use `Decimal` or `f"{amount_cents / 100:.2f}"`. A NULL `amount_cents` or `paid_at` raises and, because of item 1, silently kills the whole export.

9. **Configuration is read in two different places (low).** `FINANCE_UPLOAD_URL` is read at import (`export_job.py:16`), so importing the module in a test fails without it. `DATABASE_URL` is read inside `run()`. Read both in `run()` or a small config function.

10. **The CSV is written in place and never cleaned up (low).** `/var/exports` is hardcoded, a crash mid-write leaves a partial file, and files containing customer emails accumulate with default permissions. Write to a temporary file and rename it, and decide on retention.

11. **No explicit file encoding (low).** `open(path, "w", newline="")` at `export_job.py:33` uses the locale default, which under cron may not be UTF-8. Add `encoding="utf-8"`.

## Speculative, worth a quick check

- **Authentication:** the upload sends no credentials. That is fine if the URL carries a token or the network is restricted; otherwise it is a gap.
- **Currencies:** dividing by 100 is wrong for currencies without two decimal places. A 500 JPY invoice would export as `5.0`, if such currencies are stored.
- **Duplicate uploads:** a re-run posts the same file again. Does the finance endpoint de-duplicate?
- **Spreadsheet formulas:** an email starting with `=` or `+` would be treated as a formula if finance opens the CSV in Excel.
- **Memory:** `fetchall()` loads the whole day into memory, which only matters if daily volume is very large.

The SQL is parameterised, the connection is always closed, and the functions are small and single-purpose, so the structure does not need to change.

VERDICT: NOT READY
