Skip to content

Lau 9 founder review generation flow - #325

Open
Deodat-Lawson wants to merge 30 commits into
mainfrom
lau-9-founder-review-generation-flow
Open

Lau 9 founder review generation flow#325
Deodat-Lawson wants to merge 30 commits into
mainfrom
lau-9-founder-review-generation-flow

Conversation

@Deodat-Lawson

@Deodat-Lawson Deodat-Lawson commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Summary

Related

Checklist

  • pnpm check passes (lint + typecheck)
  • pnpm --filter @launchstack/web test passes
  • Changeset added (if packages/core/ changed — pnpm changeset)
  • New env vars documented in .env.example and apps/web/src/env.ts
  • UI changes exercised in a browser (not just a green build)
  • Docs updated if behavior changed

Testing

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.

EricLiu2795 and others added 30 commits July 22, 2026 15:44
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>
read-only evidence collector command + tests, example snapshot, and handoff doc
@vercel

vercel Bot commented Aug 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
launch-stack Ready Ready Preview Aug 15, 2026 5:59am
pdr-ai-v2 Ready Ready Preview Aug 15, 2026 5:59am

@cursor

cursor Bot commented Aug 15, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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)

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 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".

Comment on lines +92 to 95
const body = normalizeSqlMigrationBody(
await readFile(join(migrationsDir, name), "utf8"),
);
const checksum = createHash("sha256").update(body).digest("hex");

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 Badge 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 👍 / 👎.

Comment on lines +88 to +90
} catch (error) {
await worker.markCollectionFailed(collectionContext, { errorCode: "evidence_collection_failed", errorMessage: "Evidence collection failed after retries." }).catch(() => undefined);
throw 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 Badge 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),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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.

4 participants