Lau 9 founder review generation flow - #325
Conversation
…generation-flow Fix Inngest problem
Remove the legacy plaintext embedding credential columns from the company Drizzle schema and drop the runtime fallback reads that still queried them. Migration 0011 already drops those columns, so clean migration-replayed databases failed on full company selects/returning. Move the backfill script under apps/web and switch it to raw SQL so it can still migrate older db:push-shaped databases that retain the columns. Co-authored-by: Kien Le <kien-ship-it@users.noreply.github.com>
Restore the missing Changesets config and record a patch release note for the @launchstack/core schema/runtime alignment with migration 0011. Co-authored-by: Kien Le <kien-ship-it@users.noreply.github.com>
Assert the company Drizzle schema and credential read path stay aligned with migration 0011, and add an optional live DB check that select/insert succeed after the plaintext embedding columns are dropped. Co-authored-by: Kien Le <kien-ship-it@users.noreply.github.com>
…on tests for helpers and command
…t workspace evidence
read-only evidence collector command + tests, example snapshot, and handoff doc
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_58924395-92d7-4551-af8c-4628d1c3a761) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d676ad7d65
ℹ️ 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 body = normalizeSqlMigrationBody( | ||
| await readFile(join(migrationsDir, name), "utf8"), | ||
| ); | ||
| const checksum = createHash("sha256").update(body).digest("hex"); |
There was a problem hiding this comment.
Preserve historical migration checksums
For any database that previously applied 0005_experimental_embeddings.sql, the recorded checksum includes that file's BOM, but this new normalization computes its checksum after stripping the BOM. The runner therefore reports permanent drift and exits with status 1; editing the already-applied 0010 and 0011 migration bodies causes the same problem. Because the loop still applies 0016–0018 before exiting, deployments can mutate the database and then repeatedly fail every migration invocation. Preserve the original bytes for checksum calculation and normalize only the SQL passed for execution.
Useful? React with 👍 / 👎.
| } catch (error) { | ||
| await worker.markCollectionFailed(collectionContext, { errorCode: "evidence_collection_failed", errorMessage: "Evidence collection failed after retries." }).catch(() => undefined); | ||
| throw error; |
There was a problem hiding this comment.
Defer collection failure until retries are exhausted
When evidence collection encounters any transient database, embedding, or analyzer error, this catch immediately changes the run from collecting to failed before rethrowing. A configured function retry then begins with a failed run, so claimEvidenceCollection cannot reclaim it and the collector is never attempted again; the retries: 3 setting therefore provides no recovery for collection failures. Leave the run claimable during retries and mark it failed only from the final-failure handler.
Useful? React with 👍 / 👎.
| const suffix = `${operationType}:${operationKey}`; | ||
| return { | ||
| id: `fwrd_${randomUUID()}`, | ||
| eventId: `fwr-event:${runId}:${suffix}`.slice(0, 128), |
There was a problem hiding this comment.
Hash dispatch identifiers instead of truncating keys
For two retries of the same run whose request keys share the prefix that fits inside 128 characters, truncation produces the same eventId even though the full operation keys differ. On a later failure cycle, the second dispatch then conflicts with the unique event-ID index; onConflictDoNothing() suppresses the insert, and the subsequent lookup by the full operation key finds no row and throws. Use a bounded hash of the complete identity so valid long request keys cannot collide.
Useful? React with 👍 / 👎.
Summary
Related
Checklist
pnpm checkpasses (lint + typecheck)pnpm --filter @launchstack/web testpassespackages/core/changed —pnpm changeset).env.exampleandapps/web/src/env.tsTesting
Notes for reviewers
Note
High Risk
Large new async workflow, persistence, and LLM generation paths with citation semantics and multi-provider config; mistakes could affect data integrity, grounding, or provider/credential handling.
Overview
Introduces the Founder Weekly Review (LAU-9) generation pipeline end to end: API/dispatch can create runs without an evidence snapshot, workers move through
collecting→ immutable snapshot attach →generating→ draft/failed, with transactional outbox and retry rules that reuse the same run row and snapshot when present.Evidence and generation expand to evidence v2 (condensed document-change groups, deterministic materiality, optional bounded LLM materiality analyzer, customer-feedback chunks, founder context) plus a truncated generation evidence envelope and v2 review payload with strict citation/source-type rules, one same-snapshot semantic repair attempt, and updated concise generation prompts. LLM routing adds
FWR_GENERATION_PROVIDER(openai|kimi) with Moonshot chat-completions JSON mode and founder-review output token defaults; Markdown rendering is centralized for terminal/export with human-readable citations and no internal leaks.Also adds Changesets config, a @launchstack/core patch changeset for company embedding schema alignment, HANDOFF runbook, gitignore for web artifacts, and a large Jest surface (async collection, dispatch atomicity, lifecycle, Kimi transport, evaluators, document-change/materiality).
Reviewed by Cursor Bugbot for commit d676ad7. Bugbot is set up for automated code reviews on this repo. Configure here.