Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit 8a779745415c28e2f08d5223ea6c280ce5e005d1
parent 1b6606996e959b1dd3ae4e73b7c2c0ce1d1a4a78
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Wed, 11 Nov 2026 06:55:18 -0500

e2e: clean after capture is tested on its real story -- the channel's Quick check listed it (a fresh availability-verdict.json naming the video) before the audio goes; and the converse: with only a two-day-old listing and a check already asked for, the captured video keeps its audio and Run speaker work says "awaiting an availability check"

Since acd7f2b1 the automatic clean always needs a fresh verdict; the spec's
corpus had none, so the positive test waited out its 60 s for a delete that
the rule correctly refused (the orchestrator's suite at 1b660699). The
product rule is unchanged. The converse seeds requestedAt within the max age
so no real check is enqueued to race the next test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Diffstat:
Meditor/e2e/speakers-run.spec.ts | 39+++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+), 0 deletions(-)

diff --git a/editor/e2e/speakers-run.spec.ts b/editor/e2e/speakers-run.spec.ts @@ -27,6 +27,17 @@ function dataRel(videoId: string, file: string): string { return `${testPaths().transcriptsDir}/channels/${SLUG}/data/${videoId}/${file}`; } +// The channel's availability verdict (availability-verdict.json beside its +// config) — what the Quick check writes after a listing, and the only thing +// clean after capture trusts: `ids` named by a listing at `checkedAt`, and the +// last check it asked for. +async function seedVerdict(v: { checkedAt: string | null; ids: string[]; requestedAt?: string }): Promise<void> { + await writeFile( + resolvePath(`${testPaths().transcriptsDir}/channels/${SLUG}/availability-verdict.json`), + JSON.stringify({ version: 1, ...v }) + "\n", + ); +} + async function seedTranscript(videoId: string): Promise<void> { await writeFile(resolvePath(dataRel(videoId, "transcript.json")), '{"transcription":[{"text":"hi"}]}\n'); } @@ -138,6 +149,9 @@ test("clean after capture: Run speaker work removes a captured video's audio at await resetData("one-transcribe-channel-with-audio"); await writeSettings(settings({ diarization: { cleanAfterCapture: true } })); await seedTranscript("vidA"); + // The channel was listed an hour ago by its Quick check, and the listing named + // vidA: the one verdict clean after capture deletes on. + await seedVerdict({ checkedAt: new Date(Date.now() - 3_600_000).toISOString(), ids: ["vidA", "vidB", "vidC"] }); await fetch(`${baseUrl}/api/test/invalidate-cache`).catch(() => {}); await generateReport(page, SLUG); @@ -158,6 +172,31 @@ test("clean after capture: Run speaker work removes a captured video's audio at expect(body.line).toMatch(/^waiting: .* · freed this run: .* · /); }); +test("clean after capture with no fresh listing: the captured video keeps its audio, awaiting an availability check", async ({ page }) => { + test.setTimeout(SLOW); + await resetData("one-transcribe-channel-with-audio"); + await writeSettings(settings({ diarization: { cleanAfterCapture: true } })); + await seedTranscript("vidA"); + // The last listing is two days old (older than cleanVerdictMaxAgeHours, 24), + // and a check was asked for an hour ago — so nothing new is requested here, + // and nothing may be deleted on the old listing. + await seedVerdict({ + checkedAt: new Date(Date.now() - 48 * 3_600_000).toISOString(), + ids: ["vidA", "vidB", "vidC"], + requestedAt: new Date(Date.now() - 3_600_000).toISOString(), + }); + await fetch(`${baseUrl}/api/test/invalidate-cache`).catch(() => {}); + await generateReport(page, SLUG); + + await page.goto(channelStage(SLUG, "speakers")); + await page.getByRole("button", { name: "Run speaker work", exact: true }).click(); + await expect.poll(async () => pathExists(dataRel("vidA", "diarization.json")), { timeout: 60_000 }).toBe(true); + const output = page.getByLabel("Run speaker work output"); + await expect(output).toContainText("awaiting an availability check", { timeout: 60_000 }); + await expect(output).toContainText("a check was requested at"); + expect(await pathExists(dataRel("vidA", "audio.m4a"))).toBe(true); +}); + test("the readout: the Cleanup stage names the audio held for speakers; /cleanup and the lane card print the line", async ({ page }) => { test.setTimeout(SLOW); await resetData("one-transcribe-channel-with-audio");