**Not ready to merge tomorrow.** There are three blocking problems: a failed export looks like a success, every customer email address ends up in the logs, and the test file named in the docstring doesn't exist. None of these is a big fix, so tomorrow is still possible if they're addressed today.

I've grouped the findings by severity.

## Blocking (high)

1. **Failures are hidden** (`export_job.py:56-57`). Any error (database, CSV write, upload returning 500) is caught, logged on one line, and the script exits with code 0. Cron sees success and nobody gets alerted.
   - Example: the finance endpoint is down at 02:00. The log says `export failed: 503 Server Error`, the exit code is 0, finance gets no file, and nobody finds out until finance asks.
   - Fix: log with `log.exception(...)` so the stack trace is kept, then re-raise so the process exits non-zero.

2. **Customer emails go into the logs** (`export_job.py:52`). The INFO line prints `[row[1] for row in rows]`, which is every customer's email, every night. That's personal data in your log pipeline and in whatever retention and access rules apply there. Log only the count.

3. **There are no tests.** The docstring says "Tested by test_export_job.py", but that file isn't in the directory. Even as described, a header plus one row wouldn't cover the risky parts. At minimum, test:
   - how amounts are formatted
   - the start and end of the date window
   - that a failed upload makes `run()` raise
   - that an empty day still works

## Should fix before merge (medium)

4. **Amounts are written as floats** (`export_job.py:37`). `amount_cents / 100` gives `10.0` for 1000 cents and `0.1` for 10 cents. Finance tools may expect `10.00`, and float rounding can creep into totals. It also assumes every currency has 2 decimal places: a JPY invoice of 500 would export as `5.0`. Use `Decimal` and format by currency, or export the integer cents unchanged.
5. **The upload has no timeout** (`export_job.py:42`). If the endpoint stops responding, the job hangs indefinitely and nothing fails. Pass `timeout=`, and consider a small retry.
6. **"Yesterday" depends on the server's timezone** (`export_job.py:47`). `date.today()` uses the host's local time. The query compares `paid_at` against plain dates, so the database session's timezone decides where the day starts and ends. If the server and database disagree (say, one is UTC and the other local time), invoices near midnight land on the wrong day or are missed. Pick one explicit timezone (UTC, or whatever finance defines as a day) and use it in both places.
7. **You can't re-run a missed day.** The date is hardcoded to yesterday, so after a failure there's no way to backfill it. Accept an optional `--date` argument.
8. **Files with personal data are left on disk.** The CSVs in `/var/exports` contain emails and are never cleaned up, and their permissions are left at whatever the default is. Delete each file after a successful upload, or restrict the directory's permissions and set a retention period.

## Minor (low)

9. `UPLOAD_URL` is read when the module is imported (`export_job.py:16`), so importing it without the environment variable crashes. That's also why it's hard to test. Read it inside `run()` or `upload()`.
10. The file isn't written atomically. If the write is interrupted, a partial file stays at the final path. Write to a temporary file and rename it.
11. On a day with zero invoices, the job uploads a header-only file. That may be what finance wants, but confirm with them.

## Order of work for today

Fix 1 to 3 first; they block the merge. Fixes 4 to 6 are about an hour together and prevent wrong or missing finance data, so I'd include them. Fixes 7 to 11 can wait for a follow-up ticket, as long as you log it as known debt.

VERDICT: NOT READY
