Summary
Report and ledger exports build complete query results and CSV line arrays in memory. Data growth can exhaust serverless memory or time limits and produce partial operator downloads.
Repository evidence
app/api/admin/reports/export/route.ts materializes report datasets before calling toCsv.
app/api/transactions/ledger/export/route.ts and lib/security/audit-export.ts accumulate full row arrays/strings.
Scope
- Page through stable sort keys and stream CSV with backpressure.
- Set explicit row/time budgets and return an async export job for oversized requests if needed.
- Record export status, row count, checksum, and terminal failure.
Acceptance criteria
Tests
Non-goals
- Adding new report fields or changing CSV formula-safety behavior.
Summary
Report and ledger exports build complete query results and CSV line arrays in memory. Data growth can exhaust serverless memory or time limits and produce partial operator downloads.
Repository evidence
app/api/admin/reports/export/route.tsmaterializes report datasets before callingtoCsv.app/api/transactions/ledger/export/route.tsandlib/security/audit-export.tsaccumulate full row arrays/strings.Scope
Acceptance criteria
Tests
Non-goals