Skip to content

Port Founder Weekly Review quality improvements onto current main - #333

Draft
EricLiu2795 wants to merge 1 commit into
mainfrom
lau-9-founder-review-quality-followup
Draft

Port Founder Weekly Review quality improvements onto current main#333
EricLiu2795 wants to merge 1 commit into
mainfrom
lau-9-founder-review-quality-followup

Conversation

@EricLiu2795

Copy link
Copy Markdown
Collaborator

Context

#317 rebuilt the core Founder Weekly Review pipeline on the current repository architecture, and #318 landed the scenario framework.

This PR does not merge or restore the historical LAU-9 branch wholesale. It ports only the remaining Founder Weekly Review quality improvements that were developed after the rebuild and were still missing from main.

What this PR adds

  • immutable raw document-change provenance
  • conservative deterministic no-op filtering
  • deterministic DocumentChangeGroups
  • factual-delta/materiality classification
  • optional bounded semantic materiality analysis through the current provider-neutral model seam
  • Evidence Snapshot v2 with document-change audit provenance and v1 read compatibility
  • Snapshot v2 projection through the existing bounded generation envelope
  • concise decision-oriented generation prompt v2
  • hard maximum of three items per generated section
  • FWR-specific 2,400-token generation ceiling through the current reasoning route
  • deterministic evaluation
  • diagnostic semantic evaluation
  • temporal/source-semantics regressions
  • extensions to the existing Founder review scenario test framework #318 scenario framework

Preserved current-main architecture

This PR intentionally does not restore:

  • historical FWR numbered migrations
  • deprecated schema placement
  • historical FWR-specific provider routing
  • Moonshot/Kimi/OpenAI transport code
  • historical Inngest/retry/dispatch implementations
  • old migration/checksum behavior
  • historical testDb replacement
  • historical scenario runner replacement

Validation

  • pnpm -r typecheck — PASS
  • root lint — PASS with only existing warnings / zero errors
  • changed-file lint — PASS
  • formatting check — PASS
  • git diff --check — PASS
  • engine migration integrity — PASS
  • product migration integrity — PASS
  • Founder Weekly Review tests:
    • 35 suites passed
    • 263 tests passed
    • 0 failed
    • 0 skipped
    • DB-gated suites executed against throwaway local databases

Realistic E2E

The realistic E2E successfully reached:

computed evidence collection
→ Snapshot v2 validation
→ document-change audit/group validation
→ isolated DB workflow setup
→ generation start

It then stopped before any provider request because the current structured-output adapter rejects the existing optional rationale schema form (z.string(...).optional()).

That schema form is unchanged from origin/main and is not introduced by this PR. This PR intentionally does not expand scope to modify the shared structured-output adapter.

Live provider calls were therefore not made during this final port validation.

Notes for reviewers

This is a selective port onto current main, not a rescue/rebase of #325.

v1 evidence snapshots remain readable while new collection emits the richer v2 audit boundary.

@vercel

vercel Bot commented Aug 16, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
launch-stack Error Error Aug 16, 2026 9:25am
pdr-ai-v2 Error Error Aug 16, 2026 9:25am

@Deodat-Lawson

Copy link
Copy Markdown
Owner

@codex

@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: e522570049

ℹ️ 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 citedText = citedSources
.map(source => `${source.title} ${source.excerpt}`)
.join(" ");
if (!/launch|ship|release|deploy|complete|implement/i.test(citedText)) {

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 Reject planned-only evidence as proof of shipping

When a cited document change says something like “the release is planned pending approval” without a future date, this regex treats the word release as an explicit shipping signal, while futureReleaseMentioned returns false because it finds no date. The deterministic evaluation used to gate run-founder-weekly-review-realistic-e2e.ts therefore passes a whatShipped claim supported only by preparation evidence, corrupting the experiment's quality result.

Useful? React with 👍 / 👎.

Comment on lines +463 to +464
function effectiveAnalyzedGroup(success: SuccessfulAnalysis): AnalyzedDocumentChangeGroup | null {
if (success.result.disposition === "non_material") return 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.

P2 Badge Preserve truncated groups after non-material analysis

When any changed fragment exceeds the 150-character per-side analyzer limit, the analyzer sees only a prefix, but a non_material response still removes the entire group here. If the unchanged wording is at the start and the actual business delta occurs later in the chunk, the model cannot observe that delta and the review silently loses material evidence; inputTruncated is recorded only as a warning and is not consulted before accepting this disposition. Truncated inputs should retain the deterministic fallback or otherwise be prevented from producing a destructive non-material decision.

Useful? React with 👍 / 👎.

Comment on lines +960 to +963
rawChanges: [...rawAuditById.values()].sort((a, b) =>
compareOrdinal(a.rawChangeId, b.rawChangeId)
),
groups: [...analyzedGroups].sort(compareFinalOrder).map(({ group, materiality }) => ({

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 Bound the audit to the v2 snapshot limits

When the retained version pairs contain more than 5,000 raw edits, or more than 2,500 structural groups, these complete arrays exceed DocumentChangeAuditSnapshotSchema's respective maxima in contracts.ts. The collector later passes this audit to FounderWeeklyReviewEvidenceSnapshotSchema.parse, so one sufficiently large document causes the whole evidence collection to fail rather than returning bounded evidence with a truncation warning. The raw and group audit entries need a coordinated limit that preserves group-to-raw references.

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.

2 participants