← back to Codex Review 2026 04 30

consensus/bankrupt-leads.md

29 lines

# Consensus — bankrupt-leads
Generated 2026-04-30T23:48:02-07:00. Source: codex review/fix/rereview/round-2 artifacts (round-3 was quota-blocked).

## Codex pass-1 review (top risks)
## Top Risks (P0 — fix this week)
- [src/poller.py](/Users/stevestudio2/Projects/bankrupt-leads/src/poller.py:37): only requests first 100 dockets and never follows pagination; busy courts silently lose leads. Fix: loop CourtListener `next` pages until exhausted.
- [src/poller.py](/Users/stevestudio2/Projects/bankrupt-leads/src/poller.py:45): poller inserts cases only; no code populates `filings`, downloads PDFs, or extracts text, so classify/extract/digest have no real input. Fix: implement filing/document ingestion or mark current scripts as nonfunctional scaffold.
- [src/extract.py](/Users/stevestudio2/Projects/bankrupt-leads/src/extract.py:77): extraction is not idempotent; rerunning a filing duplicates assets every time. Fix: add a natural key/unique constraint or delete/upsert assets per `filing_id` in one transaction.
- Secrets/auth/SQL injection: none observed.


## Round-1 applied
## Applied

- None — CODEX_REVIEW.md did not list P0/P1 findings matching the approved safe-fix categories.


## Still deferred for Steve

- P0 — src/poller.py:37 — poller only requests the first 100 CourtListener dockets and does not follow pagination — deferred because pagination changes pipeline behavior and is not one of the approved autonomous safe fixes.
- P0 — src/poller.py:45 — poller inserts cases only; no filing/document ingestion, PDF download, or text extraction path populates downstream inputs — deferred because implementing ingestion is a product/workflow change, not a safe surgical fix.
- P0 — src/extract.py:77 — extraction is not idempotent and reruns can duplicate assets — deferred because the reviewed fix requires schema/uniqueness or transactional delete/upsert semantics, and database schema/migration work is explicitly out of scope.
- P1 — src/llm.py:34 — malformed or empty Ollama JSON output can crash the job without filing-level error state — deferred because durable retry/error-state handling changes workflow semantics and was not in the approved safe-fix list.
- P1 — src/classify.py:70 — one missing or unreadable text_path aborts the whole classification batch after prior commits — deferred because per-filing error handling/state semantics were not in the approved safe-fix list.
- P1 — src/extract.py:91 — arbitrary LLM asset keys and invalid dates/numerics can fail DB writes mid-run — deferred because validation/coercion policy is domain-specific and not one of the approved safe fixes.
- P1 — src/poller.py:76 — one court request failure skips all remaining courts — deferred because court-level retry/logging behavior was not in the approved safe-fix list.
- P1 — src/schema.sql:27 — filings.case_id allows null and lacks ON DELETE behavior — deferred because SQL/schema changes are explicitly prohibited.