Skip to content

Fix critical build and analysis rerun failures#95

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-fa11
Draft

Fix critical build and analysis rerun failures#95
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-fa11

Conversation

@cursor

@cursor cursor Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Bug and impact

  • Build This App swallowed AI generation and GitHub/GitLab push failures, then emitted a terminal done SSE event. Users could be told a repo was successfully built even when files were missing, placeholder error files were pushed, or writes failed.
  • GitHub repos created by Build This App were public by default, risking exposure of generated proprietary code.
  • Analysis reruns deleted existing blueprints before the replacement analysis succeeded, so any GitHub/AI/database failure could permanently remove prior results.

Root cause

  • Build failures were converted to warnings or placeholder content instead of terminal errors, and push helpers did not throw on non-2xx responses.
  • The GitHub create-repo request used private: false.
  • /api/analyses/[id]/run called deleteBlueprintsByAnalysis at the start of the rerun before new blueprint rows existed.

Fix

  • Build This App now deduplicates file paths, creates GitHub repos privately, throws on generation/empty-output/push failures, and emits terminal SSE error without done.
  • Analysis reruns now insert the full replacement set first, clean up partial replacement rows on insert failure, and delete older blueprints only after all new rows are persisted.

Validation

  • pnpm exec eslint app/api/build-app/route.ts app/api/analyses/[id]/run/route.ts lib/queries.ts (passes with one pre-existing warning in lib/queries.ts)
  • pnpm exec tsc --noEmit
  • Temporary mocked route harness verified build success, generation failure, push failure, GitHub private repo creation, duplicate file dedupe, successful blueprint replacement cleanup, and failed replacement preserving old blueprint rows.
Open in Web View Automation 

Co-authored-by: Cole Collins <DealPatrol@users.noreply.github.com>
@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
repo-app-architect Ready Ready Preview, Comment Jun 16, 2026 11:11am
repofuse Ready Ready Preview, Comment, Open in v0 Jun 16, 2026 11:11am
v0-repo-app-architect Ready Ready Preview, Comment, Open in v0 Jun 16, 2026 11:11am

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.

1 participant