← back to Codex Review 2026 04 30
consensus/professional-directory.md
29 lines
# Consensus — professional-directory
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)
- [agents/api-agent/server.js](/Users/stevestudio2/Projects/professional-directory/agents/api-agent/server.js:18), [agents/ingest-agent/server.js](/Users/stevestudio2/Projects/professional-directory/agents/ingest-agent/server.js:47): no auth on mutating/control endpoints; localhost CSRF or any proxy exposure can trigger imports, opt-outs, or CRM edits. Add shared auth middleware, Origin checks, and protect all `POST` routes.
- [agents/ingest-agent/server.js](/Users/stevestudio2/Projects/professional-directory/agents/ingest-agent/server.js:55), [agents/crawler-agent/server.js](/Users/stevestudio2/Projects/professional-directory/agents/crawler-agent/server.js:48): request body can override child-process env, including DB/source URLs. Remove arbitrary env merging; allowlist only safe knobs like `LIMIT`.
- [agents/api-agent/server.js](/Users/stevestudio2/Projects/professional-directory/agents/api-agent/server.js:166): API references `suggested_domain`, `domain_available`, `starred`, `contacted_at`, `is_chain`, `lead_score`; schema lacks them at [db/schema.sql](/Users/stevestudio2/Projects/professional-directory/db/schema.sql:63). Fresh deploy breaks org routes. Add a migration or remove those fields.
## Round-1 applied
## Applied
- None — no P0/P1 review item matched the permitted safe-fix categories without changing behavior, schema, auth policy, or operational semantics.
## Still deferred for Steve
- P0 — agents/api-agent/server.js:18 — no auth on mutating/control endpoints — deferred because adding shared auth and Origin policy is not one of the allowed safe fixes and needs owner decisions for credentials and exposure model.
- P0 — agents/ingest-agent/server.js:47 — no auth on importer control endpoint — deferred for the same auth policy reason.
- P0 — agents/ingest-agent/server.js:55 — request body can override child-process env — deferred because replacing env override behavior with an allowlist changes operator workflow and is not in the allowed safe-fix list.
- P0 — agents/crawler-agent/server.js:48 — request body can override child-process env — deferred for the same operator-workflow reason.
- P0 — agents/api-agent/server.js:166 — API references organization columns absent from checked-in schema — deferred because this requires schema/migration work, which is explicitly out of scope.
- P1 — scripts/run-all-night.sh:29 — failed stages continue and final output still says complete — deferred because fail-fast/final-status behavior is operational policy, not one of the allowed safe fixes.
- P1 — agents/ingest-agent/importers/npi.js:189 — NPI reruns can insert duplicate locations and phones — deferred because the recommended fix requires database constraints/migrations, explicitly out of scope.
- P1 — agents/ingest-agent/importers/npi.js:346 — row-level DB failures are counted as skipped and job may finish done — deferred because failure-threshold policy is not in the allowed safe-fix list.
- P1 — scripts/dedupe.js:80 — org merge updates/deletes multiple tables without a transaction — deferred because it is not in the allowed safe-fix list and affects data repair behavior.
- P1 — agents/api-agent/server.js:727 — imported website values become clickable hrefs without protocol allowlisting — deferred because changing rendered/exported public-facing HTML behavior is outside the safe-fix list and public-facing copy/HTML is out of scope.
- P1 — agents/shared/compliance.js:58 — rate limiter is in-memory and non-atomic per process — deferred because shared queue/lock design changes cross-process behavior and is not one of the allowed safe fixes.