commit 89965e5cdc26fae5daffdb75fbc170f7886dc298
parent 521299fad5eb244d8459ec7669f2958b75dc4673
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 14 Oct 2026 02:38:59 -0400
umtool e2e: projects, browse and inbox-engine follow /projects and /tools
The decision-list tests read the decisions API (one row per decision) and the
Inbox's cards; the project called find is an ordinary project now, and the
reserved names under app/projects are ["at"].
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
5 files changed, 76 insertions(+), 53 deletions(-)
diff --git a/umtool/e2e/article-delete.spec.ts b/umtool/e2e/article-delete.spec.ts
@@ -42,7 +42,7 @@ test.beforeAll(async ({ playwright }) => {
"/articles",
"/browse/reports/delete-fixture",
"/browse/reports/delete-fixture/takes",
- "/browse",
+ "/work",
]);
});
diff --git a/umtool/e2e/browse.spec.ts b/umtool/e2e/browse.spec.ts
@@ -13,7 +13,8 @@ import { caps, NO_SONG_DATA } from "./capabilities";
const dur = (s: number) => `${Math.floor(s / 60)}:${String(s % 60).padStart(2, "0")}`;
test("the index lists both songs, and says which cuts are missing", async ({ page }) => {
- await page.goto("/browse");
+ // The projects index (/browse until P3, which made /browse Work).
+ await page.goto("/projects");
// A project id is a PATH now, so the suffix is what identifies a song
// regardless of how deep the fixture nests it.
await expect(page.locator("[data-project$='/alpha']")).toBeVisible();
@@ -216,7 +217,7 @@ test("operations follow the declared structures", async ({ request }) => {
const trim = j.operations.find((o: { id: string }) => o.id === "trim-hooks");
expect(trim.blocked).toBeUndefined();
- expect(trim.href).toBe("/browse/trim/mk-hooks");
+ expect(trim.href).toBe("/tools/trim/mk-hooks");
expect(j.problems).toHaveLength(0);
// A structure pointing at nothing is REPORTED, not refused -- you point the
@@ -245,7 +246,7 @@ test("the song page links to the trim editor once hooks are declared", async ({
await page.goto("/browse/alpha");
await expect(page.locator("[data-op=trim-hooks]")).toHaveAttribute("data-blocked", "0");
await page.locator("[data-op=trim-hooks]").getByRole("link").click();
- await expect(page).toHaveURL(/\/browse\/trim\/mk-hooks/);
+ await expect(page).toHaveURL(/\/tools\/trim\/mk-hooks/);
});
// ---------------------------------------------------------------------------
@@ -343,7 +344,7 @@ test("a new song gets the shape but NO cut files", async ({ request, page }) =>
// Through the one "new project" door, which took over from /api/browse/init.
const r = await request.post("/api/projects/new", { data: { kind: "song", slug: "gamma", title: "Gamma" } });
expect(r.ok()).toBe(true);
- expect((await r.json()).href).toBe("/browse/gamma");
+ expect((await r.json()).href).toBe("/projects/gamma");
await page.goto("/browse/gamma");
// Every cut must read as a hole. A zero-byte wide.mp4 would read as built.
diff --git a/umtool/e2e/inbox-engine.spec.ts b/umtool/e2e/inbox-engine.spec.ts
@@ -63,7 +63,10 @@ test("one row per decision, each with the inbox's fields; the counts add up", as
expect(d.action?.href).toBe(d.href);
}
// The rows openDecisions() always made are still there, project ids intact.
- expect(items.some((d) => d.kind === "shadowed-name" && d.project === "find")).toBe(true);
+ // (The fixture's project `find` is no longer shadowed since P3 moved the
+ // tools to /tools: no project has a shadowed-name row.)
+ expect(items.some((d) => d.kind === "manifest-invalid" && d.project === "reports/no-origin-fixture")).toBe(true);
+ expect(items.some((d) => d.kind === "shadowed-name")).toBe(false);
});
test("the generation era's decisions come from disk", async ({ request }) => {
diff --git a/umtool/e2e/projects.spec.ts b/umtool/e2e/projects.spec.ts
@@ -4,6 +4,7 @@ import { execFileSync } from "node:child_process";
import { readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
+import * as urls from "./urls";
// ---------------------------------------------------------------------------
// The registry, and the claim that adding a kind is cheap.
@@ -28,8 +29,11 @@ import { fileURLToPath } from "node:url";
const HERE = path.dirname(fileURLToPath(import.meta.url));
const UMTOOL = path.join(HERE, "..");
+// The projects index is /projects (it was /browse until P3, which made /browse
+// Work). Its filters and cards are unchanged.
+
test("the index lists every kind, and says which state each project is in", async ({ page }) => {
- await page.goto("/browse");
+ await page.goto(urls.projectsHref());
// The chip's number must EQUAL the number of cards, because the counts come
// from the unfiltered set. Asserting that relationship rather than a magic
@@ -64,7 +68,7 @@ test("the index lists every kind, and says which state each project is in", asyn
});
test("a kind chip filters, and the counts do not move when it does", async ({ page }) => {
- await page.goto("/browse");
+ await page.goto(urls.projectsHref());
const chip = page.getByRole("link", { name: /^report video \d+$/ });
const before = await chip.textContent();
@@ -83,7 +87,7 @@ test("a kind chip filters, and the counts do not move when it does", async ({ pa
});
test("?q= survives the filters it was typed under, and is one pasteable URL", async ({ page }) => {
- await page.goto("/browse?kind=report-video");
+ await page.goto(urls.projectsHref({ kind: "report-video" }));
await page.getByLabel("filter projects").fill("localhost");
await page.getByRole("button", { name: "filter" }).click();
@@ -93,27 +97,35 @@ test("?q= survives the filters it was typed under, and is one pasteable URL", as
await expect(page.locator("[data-project='reports/localhost-fixture']")).toBeVisible();
});
-test("the two siteOrigin defects are BLOCKING, and nothing else is", async ({ page }) => {
- await page.goto("/browse/decisions?severity=blocking");
+// The decision list became the Inbox (P3), which shows one CARD per piece and
+// kind; the rows these rules make are read from the decisions API, one row per
+// decision, the way the MCP reads them.
+type Row = { kind: string; project: string; target: string; severity: string; why: string; piece?: string };
+const decisions = async (request: import("@playwright/test").APIRequestContext) =>
+ ((await (await request.get("/api/browse/decisions")).json()) as { items: Row[] }).items;
+test("the two siteOrigin defects are BLOCKING, and nothing else is", async ({ request, page }) => {
+ const items = await decisions(request);
// These are the two that shipped in real videos: one manifest with no
// siteOrigin (19 QR codes reading `undefined/?v=…`) and one pointing at
// localhost (codes that resolve to nothing on a phone).
- const origins = page.locator("[data-decision='manifest-invalid'][data-target='provenance.siteOrigin']");
- await expect(origins).toHaveCount(2);
-
- await expect(
- page.locator("[data-project='reports/no-origin-fixture'] [data-decision='manifest-invalid']"),
- ).toContainText("undefined");
- await expect(
- page.locator("[data-project='reports/localhost-fixture'] [data-decision='manifest-invalid']"),
- ).toContainText("localhost");
+ const origins = items.filter((d) => d.kind === "manifest-invalid" && d.target === "provenance.siteOrigin");
+ expect(origins.map((d) => d.project).sort()).toEqual(["reports/localhost-fixture", "reports/no-origin-fixture"]);
+ expect(origins.every((d) => d.severity === "blocking")).toBe(true);
+ expect(origins.find((d) => d.project === "reports/no-origin-fixture")?.why).toContain("undefined");
+ expect(origins.find((d) => d.project === "reports/localhost-fixture")?.why).toContain("localhost");
+
+ // And the Inbox carries each as a Blocking card on its piece.
+ await page.goto(urls.homeHref());
+ const blocking = page.locator("[data-group=blocking]");
+ await expect(blocking.locator("[data-piece='p:reports/no-origin-fixture'][data-card='manifest-invalid']")).toContainText("undefined");
+ await expect(blocking.locator("[data-piece='p:reports/localhost-fixture'][data-card='manifest-invalid']")).toBeVisible();
});
test("a clip that ends mid-sentence is reported once, and lockEnd acknowledges it", async ({
- page,
+ request,
}) => {
- await page.goto("/browse/decisions?kind=clip-mid-sentence");
+ const items = await decisions(request);
// Scoped to one project rather than counted globally: the bench specs get
// their own writable copy of this manifest, so a global count would be
@@ -122,47 +134,48 @@ test("a clip that ends mid-sentence is reported once, and lockEnd acknowledges i
// c01 ends inside "And this one runs on and because". c04 ends inside
// "trailing off and then" but sets lockEnd -- which is the author saying "I
// meant to cut here", so it must NOT appear.
- const rows = page.locator(
- "[data-project='reports/report-fixture'] [data-decision='clip-mid-sentence']",
- );
- await expect(rows).toHaveCount(1);
- await expect(rows).toHaveAttribute("data-target", "c01");
+ const rows = items.filter((d) => d.project === "reports/report-fixture" && d.kind === "clip-mid-sentence");
+ expect(rows.map((d) => d.target)).toEqual(["c01"]);
});
-test("an unpunctuated source is said ONCE, not once per clip", async ({ page }) => {
- await page.goto("/browse/decisions?kind=no-punctuation");
+test("an unpunctuated source is said ONCE, not once per clip", async ({ request }) => {
+ const items = await decisions(request);
// vid2 has no terminator anywhere, and one clip cites it. Six real projects
// produced forty-odd of these rows before they were collapsed, which is an
// inbox whose blocking rows have scrolled off the top -- so the assertion is
// ONE row per project, not one per source.
- await expect(
- page.locator("[data-project='reports/report-fixture'] [data-decision='no-punctuation']"),
- ).toHaveCount(1);
+ expect(items.filter((d) => d.project === "reports/report-fixture" && d.kind === "no-punctuation")).toHaveLength(1);
});
-test("a project named for a tool page is BLOCKING, and the tool page still wins", async ({
+test("a project named like a tool has its own address now; the old one is still the tool", async ({
page,
+ request,
}) => {
- await page.goto("/browse");
+ // Under /browse a project called `find` lost its route to the phrase console
+ // and was BLOCKING. The tools moved to /tools in P3, so /projects/find is the
+ // project's, and the only reserved name under /projects is `at`.
+ await page.goto(urls.projectsHref());
const card = page.locator("[data-project='find']");
- await expect(card).toHaveAttribute("data-routing", "shadowed");
- // Its link goes to the escape hatch, not to an address that renders something
- // else. Before this it linked to /browse/find and failed silently.
- await expect(card).toHaveAttribute("href", /\/browse\/at\?path=find/);
+ await expect(card).toHaveAttribute("data-routing", "ok");
+ await expect(card).toHaveAttribute("href", "/projects/find");
+ await page.goto(urls.projectHref("find"));
+ await expect(page.getByText("Shadowed By A Tool Page").first()).toBeVisible();
+ expect((await decisions(request)).some((d) => d.kind === "shadowed-name")).toBe(false);
+ // The old address is still the tool: /browse/find → /tools/find.
await page.goto("/browse/find");
- // The phrase console, not the project.
+ await expect(page).toHaveURL(/\/tools\/find$/);
await expect(page.locator("[data-project='find']")).toHaveCount(0);
- await page.goto("/browse/at?path=find");
- // The banner says it and so does the decision row -- both are correct, so the
- // assertion takes the first rather than pretending only one exists.
- await expect(page.getByText(/is a tool page/).first()).toBeVisible();
- await expect(page.getByText("Shadowed By A Tool Page")).toBeVisible();
+ // The escape hatch still opens a project by its path (an unroutable name's
+ // only address), and says nothing is wrong with a routable one.
+ await page.goto(urls.projectAtHref("find"));
+ await expect(page.getByText("Shadowed By A Tool Page").first()).toBeVisible();
+ await expect(page.getByText(/is a page of its own/)).toHaveCount(0);
});
test("a pass-through folder chain collapses for DISPLAY and never in the URL", async ({ page }) => {
- await page.goto("/browse");
+ await page.goto(urls.projectsHref());
// `deep` holds no projects and one child, so the heading reads as one label.
await expect(page.locator("[data-folder='reports/deep/nested']")).toContainText("deep / nested");
@@ -184,7 +197,8 @@ test("the song URLs that already existed still mean the same thing", async ({ pa
await page.goto("/browse/alpha");
await expect(page.locator("[data-cut=wide]")).toBeVisible();
await page.goto("/browse/alpha/wide");
- await expect(page).toHaveURL(/\/browse\/alpha\/wide/);
+ // The old address rides its redirect to the same view.
+ await expect(page).toHaveURL(/\/projects\/alpha\/wide/);
// The cut page's own breadcrumb, which is the thing that proves the VIEW
// resolved rather than the project page having been served for both URLs.
await expect(page.getByText(/^every note \(\d+\)$/)).toBeVisible();
@@ -194,11 +208,14 @@ test("the song URLs that already existed still mean the same thing", async ({ pa
await expect(page.locator("[data-cut=wide]")).toBeVisible();
});
-test("every tool page under /browse still wins its route", async ({ page }) => {
+test("every tool page that was under /browse still answers, at /tools", async ({ page }) => {
for (const p of ["/browse/decisions", "/browse/find", "/browse/sources", "/browse/faces"]) {
const res = await page.goto(p);
expect(res?.status(), `${p} should still be 200`).toBe(200);
}
+ for (const p of [urls.findHref(), urls.sourcesHref(), urls.facesHref()]) {
+ expect((await page.goto(p))?.status(), `${p} should be 200`).toBe(200);
+ }
});
// ---------------------------------------------------------------------------
@@ -261,8 +278,8 @@ test("no page or lib outside the registry special-cases a kind", () => {
expect(offenders, `kind ids leaked outside the registry:\n${offenders.join("\n")}`).toEqual([]);
});
-test("the reserved names are exactly the static pages under app/browse", () => {
- const real = readdirSync(path.join(UMTOOL, "app", "browse"), { withFileTypes: true })
+test("the reserved names are exactly the static pages under app/projects", () => {
+ const real = readdirSync(path.join(UMTOOL, "app", "projects"), { withFileTypes: true })
.filter((e) => e.isDirectory() && !e.name.startsWith("["))
.map((e) => e.name)
.sort();
@@ -275,8 +292,9 @@ test("the reserved names are exactly the static pages under app/browse", () => {
).trim(),
) as string[];
- // A tenth tool page must not silently make a project unreachable.
+ // A second static page must not silently make a project unreachable.
expect([...declared].sort()).toEqual(real);
+ expect(real).toEqual(["at"]);
});
test("a kind the registry has never seen appears everywhere, with no code edit", () => {
@@ -547,7 +565,8 @@ test("new project offers the brand preset, and only a branded scaffold carries r
const slug = "brand-ui-probe";
const created = path.join(FIXTURE, slug);
rmSync(created, { recursive: true, force: true });
- await page.goto("/");
+ // The form lives on the projects index (+ Create → A project) until /create (P5).
+ await page.goto(urls.projectsHref());
await page.locator("[data-new-project]").click();
const brand = page.locator("[data-new-brand]");
await expect(brand).toHaveValue("");
@@ -555,7 +574,7 @@ test("new project offers the brand preset, and only a branded scaffold carries r
await page.locator("[data-new-slug]").fill(slug);
await brand.selectOption("archilyzer-media");
await page.locator("[data-new-create]").click();
- await page.waitForURL(`**/browse/${slug}`);
+ await page.waitForURL(`**/projects/${slug}`);
expect(renderOf(FIXTURE, slug).brand).toBe("archilyzer-media");
rmSync(created, { recursive: true, force: true });
});
diff --git a/umtool/lib/work/facets.test.mjs b/umtool/lib/work/facets.test.mjs
@@ -41,7 +41,7 @@ test("lifecycle defaults to active; all shows every piece", () => {
test("the old /browse keys: a project kind finds the article whose video it is; state, template, open", () => {
assert.equal(keepRow(row(), { kind: "vid" }), true);
- assert.equal(keepRow(row(), { kind: "song" }), false);
+ assert.equal(keepRow(row(), { kind: "jingle" }), false);
assert.equal(keepRow(row(), { state: "built", template: "report" }), true);
assert.equal(keepRow(row(), { state: "draft" }), false);
assert.equal(keepRow(row(), { open: "1" }), false);