`export_job.py` is not ready to merge tomorrow. It has two blocking problems, both in `run()`: a failed export looks like a success, and customer emails go into the logs. The code is short and readable, but the tests don't cover most of what it does.

## Blocking

1. **Failures are swallowed** (`export_job.py:56-57`). `run()` catches every exception, logs it, and then exits with code 0.
   - Example: the finance endpoint returns a 500 and `raise_for_status()` raises. The error goes to the log, but cron still reports success, and nothing alerts anyone. Finance silently misses a day of invoices.
   - Fix: re-raise after logging, or call `sys.exit(1)`. Either way the exit code must be non-zero.

2. **Customer emails are logged** (`export_job.py:52`). The `log.info` call writes every customer's email address, `[row[1] for row in rows]`, into the logs on every run.
   - That is personal data in a place with likely wider access and longer retention than the database.
   - Fix: log only the count and the date.

3. **The tests are missing from the repo.** The docstring says `test_export_job.py` covers a CSV header and one row, but that file doesn't exist in this directory.
   - Even if it did, it would leave out the failure path, the day boundaries, the money conversion, and the upload.
   - That falls short of your standard that nothing is done without happy-path and failure tests.
   - Fix: add tests for the failure exit code (blocker 1) and for the money conversion and day window below.

## High

4. **Amounts can be wrong in the CSV** (`export_job.py:37`). `amount_cents / 100` is float division.
   - Example: 1999 cents is written as `19.99`, which is fine. But a currency with no minor unit (JPY) or three decimals (KWD) gets the wrong value. Also, `5000` cents writes as `50.0`, not `50.00`, which a finance parser may reject.
   - Fix: use `Decimal(amount_cents) / 100` and format with two decimals. Check how finance handles non-2-decimal currencies.

5. **The day window depends on server timezone** (`export_job.py:47`, `export_job.py:28`). `date.today()` uses the server's local zone, and the query compares `paid_at` against bare dates.
   - Example: if `paid_at` is stored in UTC and the server is not in UTC, invoices paid near midnight land in the wrong day's file, or in none or two.
   - Fix: make the zone explicit (UTC, or finance's reporting zone) and test the boundary.

## Medium

6. **A re-run overwrites the file and re-uploads it, with no idempotency check.** If the upload succeeded but something later failed, a retry may send finance a duplicate. Ask whether the endpoint dedupes by filename.

7. **`requests.post` has no timeout** (`export_job.py:42`). A hung endpoint will block the cron job indefinitely, and the next night's run can pile up behind it. Add `timeout=30` or similar.

8. **`UPLOAD_URL = os.environ["FINANCE_UPLOAD_URL"]` is read at import time** (`export_job.py:16`). Importing the module in tests, or with the variable unset, raises `KeyError`. It also makes the module hard to test. Read it inside `run()` or `upload()`.

## Low

9. **No empty-day handling.** A day with zero invoices produces a header-only CSV that is still uploaded. That may be what finance wants, but confirm it.
10. **`EXPORT_DIR` is hardcoded** to `/var/exports`. Make it configurable. Nothing creates the directory either, so a missing directory fails (and is swallowed, per item 1).
11. **No log configuration** in the script. Without a handler, `log.info` output may go nowhere under cron, so nothing records the successful runs.

## Suggested path to tomorrow

The two blockers are small fixes: about two lines for the exit code and one line for the log. The tests are the larger piece. Write the failure-path test first, then fix item 1 so it passes. The money formatting (4) and day window (5) are the next fixes, each with a test. The remaining items can be tracked as follow-ups, but don't skip them silently.

VERDICT: NOT READY
