From 50aebf2d0214e34cb7ffd154139233cd73dd87e4 Mon Sep 17 00:00:00 2001 From: spark Date: Sat, 21 Nov 2026 20:08:23 +0000 Subject: [PATCH] Give each learnt correction its own moment. Frames ten seconds apart are one sequence, and a sequence only crops its picks, so the learning test was reading a frame that was never edited. --- apps/api/test/autopilot.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/api/test/autopilot.test.ts b/apps/api/test/autopilot.test.ts index 56eca7a..13944c4 100644 --- a/apps/api/test/autopilot.test.ts +++ b/apps/api/test/autopilot.test.ts @@ -443,7 +443,8 @@ describe("autopilot", () => { const { orgId, userId, eventId } = await setup(); await ctx.db.event.update({ where: { id: eventId }, data: { venue: "Pavilhão Flávio Sá Leite" } }); const photos: string[] = []; - for (let i = 0; i < 6; i++) photos.push(await shot(orgId, userId, eventId, i * 10_000, 300)); + // Farther apart than one sequence, so each frame is edited. A sequence only crops its picks. + for (let i = 0; i < 6; i++) photos.push(await shot(orgId, userId, eventId, i * 20_000, 300)); await runQueue(); await autopilot.decideBursts(new Date(Date.now() + 20_000)); // The photographer lifts the exposure (0.2 -> 0.5) and crops tighter on five of them. @@ -462,7 +463,7 @@ describe("autopilot", () => { expect(style).toMatchObject({ samples: 5, venue: "pavilhão flávio sá leite", offsets: { "light.exposure": 0.3 } }); expect(style!.cropFactor).toBeCloseTo(0.84, 1); - const next = await shot(orgId, userId, eventId, 100_000, 300); + const next = await shot(orgId, userId, eventId, 200_000, 300); await runQueue(); await autopilot.decideBursts(new Date(Date.now() + 20_000)); const edits = await ctx.db.photoEdit.findMany({ where: { photoId: next }, orderBy: { seq: "asc" } });