[dashboards] CRM UI for Dashboard Pro + crm-quick-start recipe#402
[dashboards] CRM UI for Dashboard Pro + crm-quick-start recipe#402alanshurafa wants to merge 5 commits into
Conversation
The integration was ported from a bigint-id codebase and parsed thought and job ids as numbers. On Open Brain (UUID primary keys) that breaks at runtime: upsert_thought returns a UUID that extractThoughtId rejects as "no thought_id", /execute 400s on a UUID job_id, and the pro dashboard's ingest routes reject every UUID with a positive-integer guard. Convert every ingestion id field (integration + both dashboards) from number to string, validate job ids as UUIDs, and replace the 0 "no id" sentinel with an empty string. Pairs with the smart-ingest-tables schema so a job completes end to end on a fresh UUID install. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Post-UUID conversion, the integer job_id examples return 400 ("must be a UUID"). Align the docs with the handler's UUID_RE check.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
OB1 PR Gate✅ Folder structure — All files are in allowed directories Result: All 15 checks passed! Ready for human review. Post-Merge TasksThese don't block merge — they're reminders for admins after this PR lands.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a453476d13
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const jobId = typeof body.job_id === "string" && UUID_RE.test(body.job_id.trim()) | ||
| ? body.job_id.trim() | ||
| : ""; | ||
| if (!jobId) return json({ error: "job_id is required (must be a UUID)" }, 400); |
There was a problem hiding this comment.
Keep smart-ingest execute accepting numeric job IDs
With the current smart-ingest schema, ingestion_jobs.id is still bigserial (schemas/smart-ingest/schema.sql:12-38), and createJob returns that Supabase value unchanged, so dry-run responses contain numeric job ids. The REST gateway also proxies only digit routes and sends { job_id: jobId } from integrations/rest-api/index.ts:325-891. Under those inputs this UUID-only check rejects every dry-run execution with a 400 before it can load the job, so keep accepting numeric ids here or migrate the schema and proxy routes in the same change.
Useful? React with 👍 / 👎.
| const UUID_RE = | ||
| /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i; | ||
| if (!UUID_RE.test(id)) { | ||
| return NextResponse.json({ error: "Invalid id" }, { status: 400 }); |
There was a problem hiding this comment.
Let Dashboard Pro forward numeric ingest job IDs
Dashboard Pro now rejects /api/ingest/1 locally, but the committed smart-ingest schema still creates numeric ingestion_jobs.id values and the REST gateway still exposes /ingestion-jobs/(\d+) (integrations/rest-api/index.ts:325-336). When /ingest returns a numeric dry-run job_id, the AddToBrain preview calls this route and gets Invalid id before it can fetch details or reach the execute route, so numeric job ids need to remain valid unless the backend schema/routes are changed together.
Useful? React with 👍 / 👎.
a453476 to
ad7b3b8
Compare
Adds the CRM surface to
open-brain-dashboard-pro: contact list, contact detail with editable facts, proposals review, relationship panel, and activity — plus arecipes/crm-quick-startseed script.Depends on #367 (dashboard UUID baseline). Stacked, so the diff shown includes #367 until it merges. Runtime dependencies: CRM schema #393/#394/#395 and CRM REST routes #399.