Archilyzer · Source

archilyzer

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

commit 48ef4cfe838b471b53083d3382b5be41008687dd
parent f0ba25104e9d86ef3bfa3815ef2eb47346d9be67
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Sun, 18 Oct 2026 03:41:12 -0400

umtool: e2e for the new-project form's phrase seed — the seed select offers "a phrase across channels" with no source; phrase + channels make a chronological montage timeline (s01…, montage n/of, fetchPad 0), phrase-scan.json and the README checklist; a bad expression is refused in the form and makes nothing. 2/2 in the full umtool suite (558 passed)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Diffstat:
Aumtool/e2e/phrase-seed.spec.ts | 67+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 67 insertions(+), 0 deletions(-)

diff --git a/umtool/e2e/phrase-seed.spec.ts b/umtool/e2e/phrase-seed.spec.ts @@ -0,0 +1,67 @@ +import { test, expect } from "@playwright/test"; +import { existsSync, readFileSync, rmSync } from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import * as urls from "./urls"; + +// Release 33: the new-project form's "a phrase across channels" seed. With no +// source, the seed select offers the phrase; its four fields go to the +// scaffold, which scans the fixture corpus (testchan's cue files, whose lines +// say "The … fixture opens/speaks/begins") and writes a chronological timeline, +// phrase-scan.json beside it, and the README's checklist. + +const HERE = path.dirname(fileURLToPath(import.meta.url)); +const FIXTURE = path.join(HERE, "..", ".e2e-song"); + +test("the new-project form seeds a montage from a phrase said across channels", async ({ page }) => { + const slug = "phrase-seed-probe"; + const dir = path.join(FIXTURE, slug); + rmSync(dir, { recursive: true, force: true }); + try { + await page.goto(urls.projectsHref()); + await page.locator("[data-new-project]").click(); + const seed = page.locator("[data-new-seed]"); + await expect(seed.locator("option")).toHaveText(["an empty timeline", "a phrase across channels"]); + await expect(page.locator("[data-new-phrase]")).toHaveCount(0); + await page.locator("[data-new-slug]").fill(slug); + await seed.selectOption("phrase"); + await page.locator("[data-new-phrase]").fill("fixture (opens|speaks|begins)"); + await page.locator("[data-new-channels]").fill("testchan"); + await page.locator("[data-new-create]").click(); + await page.waitForURL(`**/projects/${slug}`); + + const doc = JSON.parse(readFileSync(path.join(dir, "video.manifest.json"), "utf8")); + const clips = doc.timeline as Array<{ id: string; channel: string; cutStart: number; cutEnd: number; montage: { n: number; of: number; match: string } }>; + expect(clips.length).toBeGreaterThanOrEqual(3); + clips.forEach((c, k) => { + expect(c.id).toBe(`s${String(k + 1).padStart(2, "0")}`); + expect(c.channel).toBe("testchan"); + expect(c.cutEnd).toBeGreaterThan(c.cutStart); + expect(c.montage.n).toBe(k + 1); + expect(c.montage.of).toBe(clips.length); + expect(c.montage.match).toMatch(/fixture (opens|speaks|begins)/i); + }); + expect(doc.render.fetchPad).toBe(0); + const scan = JSON.parse(readFileSync(path.join(dir, "phrase-scan.json"), "utf8")); + expect(scan.instances).toHaveLength(clips.length); + expect(readFileSync(path.join(dir, "README.md"), "utf8")).toContain("Clips seeded from a phrase scan"); + } finally { + rmSync(dir, { recursive: true, force: true }); + } + expect(existsSync(dir)).toBe(false); +}); + +test("a phrase seed with a bad expression says so in the form, and makes nothing", async ({ page }) => { + const slug = "phrase-seed-bad"; + const dir = path.join(FIXTURE, slug); + rmSync(dir, { recursive: true, force: true }); + await page.goto(urls.projectsHref()); + await page.locator("[data-new-project]").click(); + await page.locator("[data-new-slug]").fill(slug); + await page.locator("[data-new-seed]").selectOption("phrase"); + await page.locator("[data-new-phrase]").fill("slow (news"); + await page.locator("[data-new-channels]").fill("testchan"); + await page.locator("[data-new-create]").click(); + await expect(page.locator("[data-new-error]")).toContainText("not a regular expression"); + expect(existsSync(dir)).toBe(false); +});