**The nightly export isn't ready to merge tomorrow, because it can fail without anyone finding out.** There are two blockers, and both are quick fixes. I judged it against the docstring ("export yesterday's paid invoices to finance's upload endpoint") because I had no other requirements. I did not open `test_export_job.py`. I relied on the docstring's description of it.

## Blockers

1. **High: failures are swallowed, so cron reports success.** At `export_job.py:56-57`, `except Exception` logs one line and never re-raises, so the process exits 0.
   - **Failing case:** the finance endpoint returns a 500 at 02:00. The job logs "export failed", exits 0, and cron sees no problem. Finance gets no file for that day, and nobody finds out until someone asks.
   - **Expected:** the process exits non-zero so cron or monitoring can alert. Use `log.exception(...)` and re-raise, which also records the traceback (currently there is none).

2. **High: customer emails are written to logs.** At `export_job.py:52`, `[row[1] for row in rows]` logs every customer email at INFO level every night. Logs are usually kept longer and shared more widely than the export directory. Log the count and the date only.

## Should fix before or soon after merge

3. **Medium: no timeout on the upload.** `requests.post` at `export_job.py:42` has no `timeout`, so a stalled endpoint hangs the cron job indefinitely. Add something like `timeout=30`.

4. **Medium: test coverage is thin.** By your own docstring, the only tests cover the CSV header and one row. Nothing covers these cases:
   - `fetch_invoices` and its day boundaries
   - the upload
   - a failing upload (which would have caught blocker 1)
   - a day with no invoices

   Blocker 1 needs a failing-path test anyway.

5. **Medium: money is formatted as a float.** At `export_job.py:37`, `amount_cents / 100` produces floats. For example, 1999 cents gives `19.99`, but a 500-cent invoice gives `5.0`, not `5.00`. Finance tooling that parses amounts may care about the format. `Decimal` or `f"{cents // 100}.{cents % 100:02d}"` is safer.

## Minor

6. `UPLOAD_URL = os.environ[...]` at line 16 runs at import time. Importing the module in tests, or anywhere without that variable set, raises `KeyError`. `DATABASE_URL` is read lazily in `run()`, so the two are inconsistent.
7. `EXPORT_DIR` is hardcoded. The file contains customer emails and is written with default permissions and never cleaned up. Consider making the path configurable and restricting its permissions.

## Speculative (no evidence either way)

- **Timezone:** `date.today()` uses the server's local time, and the SQL compares `paid_at` against a plain date, which uses the DB session timezone. If those differ from finance's definition of "yesterday", invoices near midnight could land on the wrong day. I can't tell from the code.
- **Re-runs:** a manual re-run overwrites the file and uploads a second time. Whether finance's endpoint deduplicates is unknown.
- **Empty days:** a day with no paid invoices uploads a header-only file. That may or may not be what finance wants.
- **Spreadsheet formulas:** an email beginning with `=` could be treated as a formula if someone opens the CSV in a spreadsheet. This is unlikely.

Fixing blockers 1 and 2 (plus a test for the failure path) and adding the upload timeout is probably an hour of work. That should still fit your merge tomorrow.

VERDICT: NOT READY
