From 24cfaaeae000be7f24577293313bcb5f956412bb Mon Sep 17 00:00:00 2001 From: Vedant Madane <6527493+VedantMadane@users.noreply.github.com> Date: Tue, 25 Aug 2026 00:27:42 +0530 Subject: [PATCH] fix: fix: reject empty results arrays on POST /api/runs - Empty results[] stored total:0 with shouldFail false and could pass CI gates. - Return HTTP 400 when results is an empty array. Fixes #3 Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com> --- app/api/runs/route.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/api/runs/route.ts b/app/api/runs/route.ts index e838cee..e20e2d8 100644 --- a/app/api/runs/route.ts +++ b/app/api/runs/route.ts @@ -51,6 +51,12 @@ export async function POST(req: NextRequest) { { status: 400 }, ); } + if (body.results.length === 0) { + return NextResponse.json( + { error: "results[] must not be empty" }, + { status: 400 }, + ); + } const supabase = db();