Skip to content

feat(platform): add overnight v1 foundation - #7

Open
TheophilusChinomona wants to merge 1 commit into
cmn-labs:mainfrom
TheophilusChinomona:feat/overnight-v1-foundation
Open

feat(platform): add overnight v1 foundation#7
TheophilusChinomona wants to merge 1 commit into
cmn-labs:mainfrom
TheophilusChinomona:feat/overnight-v1-foundation

Conversation

@TheophilusChinomona

Copy link
Copy Markdown

Switch discovery off Exa Websets to plain search so the local lead pipeline works on the current Exa plan. Add local Supabase migrations and provider plumbing needed for DeepSeek, Inngest, and safer retry/state handling.\n\nCapture the agreed product plan, current state, and overnight execution plan in root docs and docs/superpowers so the next session can resume from facts instead of scratch.

Switch discovery off Exa Websets to plain search so the local lead pipeline works on the current Exa plan. Add local Supabase migrations and provider plumbing needed for DeepSeek, Inngest, and safer retry/state handling.\n\nCapture the agreed product plan, current state, and overnight execution plan in root docs and docs/superpowers so the next session can resume from facts instead of scratch.
Copilot AI lite review requested due to automatic review settings August 10, 2026 21:15
@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

@TheophilusChinomona is attempting to deploy a commit to the CMN Labs Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@greptile-apps

greptile-apps Bot commented Aug 10, 2026

Copy link
Copy Markdown

Greptile Summary

The PR replaces Websets discovery with synchronous Exa search, adds shared OpenAI-compatible provider plumbing, improves enrichment retry state, and introduces local Supabase setup.

  • Plain-search results are normalized and inserted directly as leads before enrichment events are published.
  • AI calls now share configurable base URL and model selection for DeepSeek/OpenRouter compatibility.
  • Local migrations establish the existing application schema, grants, and system-enabled control.
  • Planning and current-state documents capture the proposed overnight implementation roadmap.

Confidence Score: 3/5

The PR should not merge until valid enrichment bios are preserved and failed enrichment-event publication becomes retryable.

The current parser deterministically discards generated lead bios, while transient Inngest publication failures leave newly created leads permanently pending even though discovery reports success.

Files Needing Attention: packages/autogtm-core/src/ai/enrichLead.ts; apps/autogtm/src/app/api/queries/_lib/startQueryRun.ts

Important Files Changed

Filename Overview
apps/autogtm/src/app/api/queries/_lib/startQueryRun.ts Implements synchronous discovery and direct lead creation, but silently loses enrichment work when event publication fails.
packages/autogtm-core/src/ai/enrichLead.ts Ports enrichment to chat completions but drops the requested bio field during response parsing.
packages/autogtm-core/src/ai/client.ts Centralizes OpenAI-compatible client and model configuration without an independently established defect.
apps/autogtm/src/inngest/functions.ts Preserves enriched status when a completed lead is retried.
packages/autogtm-core/src/clients/exa.ts Adds plain Exa search normalization for the existing lead-ingestion shape.
supabase/migrations/0001_autogtm_init.sql Adds a local migration representing the application schema and existing broad authenticated-user RLS model.

Reviews (1): Last reviewed commit: "feat(platform): add overnight v1 foundat..." | Re-trigger Greptile

Comment on lines 12 to 23
@@ -21,12 +22,6 @@ const EnrichedLeadSchema = z.object({
email: z.string().nullable().catch(null),
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Enrichment parser drops bio

Every successful response is parsed through EnrichedLeadSchema, which omits the explicitly requested bio field and therefore strips it before persistence, leaving campaign personalization, digests, and the dashboard without the generated summary.

Suggested change
const EnrichedLeadSchema = z.object({
category: AllowedCategorySchema.catch('other'),
full_name: z.string().catch('Unknown'),
title: z.string().catch(''),
bio: z.string().catch(''),
expertise: z.array(z.string()).catch([]),
social_links: z.record(z.unknown()).catch({}),
total_audience: z.number().catch(0),
content_types: z.array(z.string()).catch([]),
promotion_fit_score: z.number().catch(5),
promotion_fit_reason: z.string().catch(''),
email: z.string().nullable().catch(null),
});

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +148 to +151
await inngest.send(enrichmentEvents);
} catch (error) {
console.error('Lead enrichment dispatch skipped:', error);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Dispatch failure leaves pending leads

When publishing the enrichment event batch fails, this block suppresses the error after the query has already been marked completed, causing the newly inserted leads to remain pending indefinitely without any retry or recovery path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants