It isn't ready to merge tomorrow. The job can fail every night and still look successful, and it writes customers' email addresses into the logs. The test file named in the docstring, `test_export_job.py`, isn't in this directory, so I couldn't check its coverage.

I reviewed `export_job.py` only. I haven't run it.

## Blocking issues

**1. Failures are swallowed, so cron never sees them (High)**
- `run()` catches `Exception` at `export_job.py:56-57`, logs it, and returns normally. The process exits 0.
- Example: the finance endpoint returns a 500 at 02:00. `raise_for_status()` raises and the error is logged. Cron sees a success, and finance silently has no file for that day.
- Expected: a non-zero exit, or a re-raise, so cron or monitoring can alert.

**2. Customer emails are written to the logs (High)**
- Line 52 logs `[row[1] for row in rows]`, which is every customer email for the day.
- That is personal data in log files, and it grows with invoice volume. The count is enough to log.

**3. Money is exported as a float (High)**
- Line 37 writes `amount_cents / 100`. In Python 3 that is a float, so the output depends on float formatting.
- Example: `1999` cents is written as `19.99`, and `100` cents as `1.0`, not `1.00`.
- Finance files usually need exactly two decimals. Use `Decimal(amount_cents) / 100` formatted to two places, or write integer cents.

**4. The date window uses the server's local date and an ambiguous timestamp (Medium)**
- Line 47 uses `datetime.date.today()`, which is the server's local date.
- Line 21 compares `paid_at` against a plain date. If `paid_at` is `timestamptz` and the database session timezone differs from the server's, "yesterday" shifts by hours.
- Example: a payment at 23:30 on the 13th could land in the 14th's file, or be missed.
- I can't see the schema, so confirm the column type and pick an explicit timezone, probably UTC.

## Should fix

**5. Re-runs overwrite the file, and a partial upload can't be retried safely (Medium)**
- The path is fixed per day (line 48) and is opened with `"w"`.
- A cron retry after a partial upload re-uploads a file with no idempotency key. Finance may get duplicates.
- Confirm with finance whether the endpoint de-duplicates on filename.

**6. No timeout on the upload (Medium)**
- `requests.post` at line 42 has no `timeout`, so a hung endpoint blocks the job forever.

**7. `UPLOAD_URL` is read at import time (Low)**
- Line 16 raises `KeyError` as soon as the module is imported, including by a test, if the variable is unset.
- Read it inside `run()`, or pass it in.

**8. Structure and tests (Medium, per your standards)**
- The docstring says the only test covers "CSV header and one row".
- Nothing covers the failure path, an empty day, the date window, the amount formatting, or the upload.
- `run()` mixes dates, the database connection, files and HTTP, so it is hard to test.
- `EXPORT_DIR` is hardcoded to `/var/exports`.

## Minor
- The file isn't deleted after upload, so old exports pile up in `/var/exports`.
- `conn.close()` is fine, but psycopg2's `with conn` doesn't close the connection, so the current approach is correct.
- A day with zero invoices still uploads a header-only file. That may or may not be what finance wants.

## Speculative (I can't confirm these from the code)
- `paid_at` might be NULL for some `PAID` rows, which would make `paid_at.isoformat()` fail.
- The endpoint might need authentication. I see none, but it may be handled by network rules.

## What's good
The query is parameterized, so there's no injection risk. The functions are small, the connection is closed in `finally`, and `newline=""` is correct for CSV.

## Smallest path to merge tomorrow
1. Re-raise or exit non-zero on failure.
2. Remove the emails from the log line.
3. Format amounts as two-decimal strings.
4. Add a timeout.
5. Add tests for each of those four.

Together those are roughly an hour of work. Items 4 and 5 need answers from finance and the schema, so ask them today.

VERDICT: NOT READY
