Archilyzer · Source

archilyzer

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

commit 7aec7f0eddcbe3c04e42b4fa8510b1beb2abf678
parent 00218022a1e51deca31e8dbd93b6844821853a77
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Tue, 13 Oct 2026 13:28:06 -0400

umtool: release 27 S8 e2e (article-new, article-iterations, article-compare) and docs

- article-new: /drafts redirects, the policy (presets, a route, caps refused
  by the editor, the key file and never a key), a new article on the local
  pipeline through the stub, landing on its iterations.
- article-iterations: an article in the making on /articles and its tab;
  narrate; use, revise, copy with model, cancel and the editor's refusal; the
  video chain run as a umtool job, stopping at windows (the stub serves none)
  and resumable there.
- article-compare: ops applied and refused, the failed check, the section
  only one side has, both cuts; the tab's compare boxes.
- The chain's steps read down; the channel list says it is loading.
- docs/sites.md: the /articles pages, the iterations and the policy.

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

Diffstat:
Mumtool/components/articles/ChainPanel.tsx | 2+-
Mumtool/components/articles/NewArticleForm.tsx | 2+-
Mumtool/docs/sites.md | 33+++++++++++++++++++++++++++++++++
Aumtool/e2e/article-compare.spec.ts | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aumtool/e2e/article-iterations.spec.ts | 141+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aumtool/e2e/article-new.spec.ts | 109+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 345 insertions(+), 2 deletions(-)

diff --git a/umtool/components/articles/ChainPanel.tsx b/umtool/components/articles/ChainPanel.tsx @@ -70,7 +70,7 @@ export default function ChainPanel({ article, n, label }: { article: string; n: return ( <section aria-label={`${label} video chain`} data-chain={label} className="mt-2 rounded border border-[var(--color-line)] bg-[var(--color-ink)] p-2 text-[12px]"> {chain && ( - <ol className="grid gap-x-4 gap-y-0.5 sm:grid-cols-2"> + <ol className="grid gap-x-4 gap-y-0.5 sm:grid-flow-col sm:grid-rows-5"> {chain.steps.map((s, i) => ( <li key={s.name} data-chain-step={s.name} data-step-status={s.status} className="flex items-center gap-2"> <span className="num w-5 text-right text-[var(--color-dim)]">{i + 1}</span> diff --git a/umtool/components/articles/NewArticleForm.tsx b/umtool/components/articles/NewArticleForm.tsx @@ -80,7 +80,7 @@ function ChannelPicker({ value, onChange }: { value: string[]; onChange: (v: str </button> </li> ))} - {shown.length === 0 && <li className="text-[12px] text-[var(--color-dim)]">no channel matches</li>} + {shown.length === 0 && <li className="text-[12px] text-[var(--color-dim)]">{all ? "no channel matches" : "loading channels…"}</li>} </ul> )} </fieldset> diff --git a/umtool/docs/sites.md b/umtool/docs/sites.md @@ -11,6 +11,11 @@ the one file it writes there is a report's `notes.json` (docs/notes.md). | `/sites/<site>/<report>` | the article with its notes (below) | | `/sites/<site>/<report>?tab=source` | the article's workspace files, its own draft opened | | `/sites/<site>/<report>/evidence` | every citation, one per screen (`?c=<id>`) | +| `/articles` | the homepage's article store (`transcripts/reports/`), the same columns; above it, the articles **in the making** (iterations, no `report.json` yet) | +| `/articles/new` | a new article: question, channels (the editor's), dates, the sweep (agent on Claude, pipeline on the local model), model, cap; and the **generation policy** | +| `/articles/<id>?tab=iterations` | the article's iterations (below) | +| `/articles/<id>/compare?a=<n>&b=<n>` | two iterations side by side: sections and findings (what the other lacks marked), ops applied and refused, failed checks, both cuts | +| `/drafts` | redirects to `/articles/new` | ## Where an article comes from @@ -31,6 +36,34 @@ the one file it writes there is a report's `notes.json` (docs/notes.md). report id (± `polemic-`) in the draft's workspace, when exactly one matches; several are listed as "possible". +## Generated articles: iterations (release 27) + +An article made by a model is a series of **iterations** (`i1`, `i2`, …: common's +`lib/report/iterations.ts`). umtool **starts** them and never writes one: each is +a `report-draft` job the EDITOR runs, asked over its ops API with the shared +`WORKER_TOKEN` (`lib/articles/generation.ts`). The token stays on the server. + +| on an iteration | what happens | +|---|---| +| **Use this iteration** | the article's `report.json` becomes its report — common's `makeCurrent`, the registry's writer (locked, validated; the audience and the attached video kept) | +| **New iteration** | a `revise-report` or `revise-video` of it, from feedback, on a model | +| **Copy with model** | the same kind, base, question or feedback, on another model | +| **Narrate** | a narration step over its cut, on a model | +| **Cancel** | `job cancel` on its editor job; the log's last lines are polled every 2.5 s while it runs | +| **Make the video** | the chain (`lib/report/chain.mjs`) as a umtool job: its ten steps, each one's status, resume or **from** a step, cancel | +| **compare** | tick two, then **Compare iN and iM** | + +The list shows each one's kind, model, parent, copy, status, cost per model, +minutes, ops applied and refused, and checks; which is the article and which the +video; the article's spend and the day's API spend against the daily cap (the +editor's usage ledger). A `research` iteration carries its research queue +(`ResearchSlot`). + +**The policy** (`/articles/new`) is `settings.generation`: the presets (`code`, +`balanced`, `api`, `local` — each writes its routes), a route per task, the +models, the caps. It is written through the editor's settings action. The API +key is never shown or taken: only its file's path and whether the file exists. + ## Reading and noting The article renders in a ~70ch column with its notes in a rail (a drawer below diff --git a/umtool/e2e/article-compare.spec.ts b/umtool/e2e/article-compare.spec.ts @@ -0,0 +1,60 @@ +import { test, expect } from "@playwright/test"; +import { WARM_TIMEOUT, warm } from "./warm"; + +// --------------------------------------------------------------------------- +// /articles/<id>/compare?a=&b= (release 27 S8): two iterations side by side — +// each one's report (sections, findings; what the other side lacks marked), +// the ops applied and refused, the failed checks, and both cuts when both +// have a project. Over zeta (e2e/fixtures/iterations-fixture.mjs), read-only. +// --------------------------------------------------------------------------- + +test.beforeAll(async ({ playwright }) => { + test.setTimeout(WARM_TIMEOUT); + await warm(playwright, ["/articles/zeta/compare?a=1&b=2", "/articles/zeta?tab=iterations"]); +}); + +test("a report revision beside its parent: ops applied and refused, the failed check, the section it added", async ({ page }) => { + const res = await page.goto("/articles/zeta/compare?a=1&b=2"); + expect(res?.status()).toBe(200); + const a = page.locator("[data-side='1']"); + const b = page.locator("[data-side='2']"); + await expect(a.getByRole("heading", { name: "i1" })).toBeVisible(); + await expect(b.getByRole("heading", { name: "i2" })).toBeVisible(); + + await expect(a.locator("[data-ops-applied]")).toHaveAttribute("data-ops-applied", "0"); + await expect(b.locator("[data-ops-applied]")).toHaveAttribute("data-ops-applied", "2"); + await expect(b.locator("[data-ops-refused]")).toHaveAttribute("data-ops-refused", "1"); + await expect(b.locator("[data-op='refused']")).toContainText("no finding f7"); + await expect(b.locator("[data-failed-checks]")).toContainText("a quote not found within ±90 s"); + await expect(a.locator("[data-failed-checks]")).toHaveCount(0); + + // The section only the revision has, and the finding it reworded. + await expect(b.locator("[data-section='Later']")).toHaveAttribute("data-only", "here"); + await expect(a.locator("[data-section='The claim'] [data-finding]")).toHaveAttribute("data-changed", "yes"); + await expect(b.locator("[data-section='Coverage'] [data-finding]")).not.toHaveAttribute("data-changed", "yes"); + + // Only one side has a project: no cuts. + await expect(page.locator("[data-cut]")).toHaveCount(0); +}); + +test("a video revision beside its parent: the same report, both cuts, the narration it changed", async ({ page }) => { + await page.goto("/articles/zeta/compare?a=1&b=3"); + const b = page.locator("[data-side='3']"); + await expect(b).toContainText("report of i1"); + await expect(page.locator("[data-cut]")).toHaveCount(2); + await expect(b.locator("[data-cut-entry='t0']")).toHaveAttribute("data-changed", "yes"); + await expect(b.locator("[data-cut-entry='t0']")).toContainText("The vote, in her words."); + await expect(b.locator("[data-cut-entry='a1']")).not.toHaveAttribute("data-changed", "yes"); +}); + +test("the Iterations tab's compare boxes open the page; an unknown iteration is named", async ({ page }) => { + await page.goto("/articles/zeta?tab=iterations"); + await page.getByRole("checkbox", { name: "compare i1" }).check(); + await page.getByRole("checkbox", { name: "compare i2" }).check(); + await page.getByRole("link", { name: "Compare i1 and i2" }).click(); + await expect(page).toHaveURL(/\/articles\/zeta\/compare\?a=1&b=2$/); + await expect(page.locator("[data-side]")).toHaveCount(2); + + await page.goto("/articles/zeta/compare?a=1&b=9"); + await expect(page.getByRole("main").getByRole("alert")).toContainText("no iteration i9"); +}); diff --git a/umtool/e2e/article-iterations.spec.ts b/umtool/e2e/article-iterations.spec.ts @@ -0,0 +1,141 @@ +import { test, expect, type Page } from "@playwright/test"; +import { readFileSync, rmSync } from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import { WARM_TIMEOUT, warm } from "./warm"; + +// --------------------------------------------------------------------------- +// An article's Iterations tab (release 27 S8), over the editor stub: its +// report-draft "runs" an iteration by writing it into the fixture's article +// store (running after 1 s, done after 3 s), never an LLM. +// +// zeta an article in the making with four iterations (the fixture): +// read, and narrated (a step on i1) +// iter-e2e made here through the stub, then used, revised, copied, +// cancelled and taken into the video chain; removed after +// --------------------------------------------------------------------------- + +const HERE = path.dirname(fileURLToPath(import.meta.url)); +const FIXTURE = path.join(HERE, "..", ".e2e-song"); +const STUB_LOG = path.join(FIXTURE, "editor-stub.requests.json"); +const ARTICLE = "iter-e2e"; +const stubAsked = (route: string) => + (JSON.parse(readFileSync(STUB_LOG, "utf8")) as { route?: string; [k: string]: unknown }[]).filter((r) => r.route === route); + +test.beforeAll(async ({ playwright }) => { + test.setTimeout(WARM_TIMEOUT); + await warm(playwright, ["/articles", "/articles/zeta", "/api/articles/iterations?article=zeta", "/api/articles/policy"]); +}); +test.afterAll(() => rmSync(path.join(FIXTURE, "articles", ARTICLE), { recursive: true, force: true })); + +const card = (page: Page, n: number) => page.locator(`[data-iteration='${n}']`); + +test("an article in the making: listed as such on /articles, and opened on its iterations", async ({ page }) => { + await page.goto("/articles"); + // Not a row of the store's table: the registry does not list it yet. + await expect(page.locator("[data-article='articles/zeta']")).toHaveCount(0); + const row = page.locator("[data-pending-article='zeta']"); + await expect(row).toContainText("i4 failed"); + await row.getByRole("link", { name: "zeta" }).click(); + await expect(page).toHaveURL(/\/articles\/zeta\?tab=iterations$/); + + await page.goto("/articles/zeta"); + await expect(page.locator("[data-article-meta] [data-status]")).toHaveAttribute("data-status", "pending"); + await expect(page.getByRole("link", { name: "iterations", exact: true })).toHaveAttribute("aria-current", "page"); + const list = page.getByRole("region", { name: "iterations", exact: true }); + await expect(list).toHaveAttribute("data-iterations", "4"); + // Newest first. + await expect(page.locator("[data-iteration]").first()).toHaveAttribute("data-iteration", "4"); + + await expect(card(page, 1).locator("[data-usage-model='claude-sonnet-5-5']")).toContainText("$0.42"); + await expect(card(page, 2).locator("[data-ops-applied]")).toHaveAttribute("data-ops-applied", "2"); + await expect(card(page, 2).locator("[data-checks-failed]")).toHaveAttribute("data-checks-failed", "1"); + await expect(card(page, 3)).toContainText("of i1"); + await expect(card(page, 4)).toHaveAttribute("data-status", "failed"); + await expect(card(page, 4).locator("[data-copy-of]")).toHaveAttribute("data-copy-of", "1"); + await expect(card(page, 4)).toContainText("the model stopped at its cap"); + // Today's spend, from the fixture's usage ledger, against the daily cap. + await expect(list.locator("[data-today-usd]")).toHaveAttribute("data-today-usd", "0.42"); + await expect(list.locator("[data-today-usd]")).toContainText("of $20.00"); +}); + +test("narrate an iteration's cut on a model: a step, its job followed to done", async ({ page }) => { + await page.goto("/articles/zeta?tab=iterations"); + const one = card(page, 1); + await one.getByRole("combobox", { name: "narration model for i1" }).selectOption("claude-sonnet-5-5"); + await one.getByRole("button", { name: "Narrate" }).click(); + await expect(page.getByRole("status").filter({ hasText: "i1 started" })).toBeVisible(); + await expect(one.locator("[data-step='narrate']")).toHaveAttribute("data-step-status", "done", { timeout: 20_000 }); + const asked = stubAsked("report-draft").at(-1)!; + expect(asked).toMatchObject({ task: "narrate", article: "zeta", iteration: 1, model: "claude-sonnet-5-5", authorization: "Bearer umtool-e2e-token" }); +}); + +test("use, revise, copy with model, cancel: each through the editor, the list following its jobs", async ({ page, request }) => { + test.setTimeout(120_000); + const made = await request.post("/api/articles/generate", { + data: { task: "sweep", article: ARTICLE, question: "What was said about the vote?", channels: ["sitechan"], model: "qwen3:8b" }, + }); + expect(made.status()).toBe(200); + expect(await made.json()).toMatchObject({ ok: true, iteration: 1 }); + + await page.goto(`/articles/${ARTICLE}`); + await expect(card(page, 1)).toHaveAttribute("data-status", "done", { timeout: 20_000 }); + + // USE THIS ITERATION: the registry writes the article's report.json. + await card(page, 1).getByRole("button", { name: "Use this iteration" }).click(); + await expect(page.getByRole("status").filter({ hasText: "the article is i1" })).toBeVisible(); + await expect(card(page, 1).locator("[data-current='article']")).toBeVisible(); + const report = JSON.parse(readFileSync(path.join(FIXTURE, "articles", ARTICLE, "report.json"), "utf8")); + expect(report.title).toBe("Sweep: What was said about the vote?"); + + // A NEW ITERATION of the report, on the local model, from feedback. + await card(page, 1).getByRole("button", { name: "New iteration" }).click(); + const form = page.getByRole("form", { name: "new iteration from i1" }); + await form.getByRole("combobox", { name: "model for the new iteration from i1" }).selectOption("qwen3:8b"); + await form.getByRole("textbox", { name: "feedback" }).fill("Say when she said it."); + await form.getByRole("button", { name: "Start iteration" }).click(); + await expect(card(page, 2)).toBeVisible(); + await expect(page.getByRole("log", { name: "i2 progress" })).toContainText("report-draft revise-report", { timeout: 10_000 }); + await expect(card(page, 2)).toHaveAttribute("data-status", "done", { timeout: 20_000 }); + await expect(card(page, 2).locator("[data-ops-refused]")).toHaveAttribute("data-ops-refused", "1"); + expect(stubAsked("report-draft").at(-1)).toMatchObject({ task: "revise-report", article: ARTICLE, iteration: 1, feedback: "Say when she said it.", model: "qwen3:8b" }); + + // COPY WITH MODEL: the same base and feedback on another model. + await card(page, 2).getByRole("combobox", { name: "copy i2 on model" }).selectOption("claude-sonnet-5-5"); + await card(page, 2).getByRole("button", { name: "Copy with model" }).click(); + await expect(card(page, 3).locator("[data-copy-of]")).toHaveAttribute("data-copy-of", "2"); + await expect(card(page, 3)).toHaveAttribute("data-status", "done", { timeout: 20_000 }); + await expect(card(page, 3).locator("[data-usage-model='claude-sonnet-5-5']")).toContainText("$0.37"); + expect(stubAsked("report-draft").at(-1)).toMatchObject({ task: "revise-report", copyOf: 2, model: "claude-sonnet-5-5" }); + + // CANCEL a running one (the stub keeps "slow" running until cancelled). + await card(page, 1).getByRole("button", { name: "New iteration" }).click(); + await form.getByRole("textbox", { name: "feedback" }).fill("Go slow on this one."); + await form.getByRole("button", { name: "Start iteration" }).click(); + await expect(card(page, 4)).toHaveAttribute("data-status", "running", { timeout: 10_000 }); + await card(page, 4).getByRole("button", { name: "Cancel i4" }).click(); + await expect(card(page, 4)).toHaveAttribute("data-status", "cancelled", { timeout: 10_000 }); + expect(stubAsked("job").at(-1)).toMatchObject({ verb: "cancel", ids: [expect.stringMatching(/^stub-draft-/)] }); + + // The editor's refusal is shown in its words. + await card(page, 1).getByRole("button", { name: "New iteration" }).click(); + await form.getByRole("textbox", { name: "feedback" }).fill("refuse"); + await form.getByRole("button", { name: "Start iteration" }).click(); + await expect(page.getByRole("region", { name: "iterations", exact: true }).getByRole("alert")).toContainText("the stub refuses this feedback"); +}); + +test("make the video: the chain's steps, run as a umtool job, resumable where it stopped", async ({ page }) => { + test.setTimeout(150_000); + await page.goto(`/articles/${ARTICLE}?tab=iterations`); + await card(page, 1).getByRole("button", { name: "Make the video" }).click(); + const chain = page.getByRole("region", { name: "i1 video chain" }); + await expect(chain.locator("[data-chain-step]")).toHaveCount(10); + await chain.getByRole("button", { name: "Run the chain" }).click(); + // `current` runs (the article is i1 already); `windows` asks the editor for + // the cited windows, which the stub does not serve — so the chain stops + // there, recorded, and a start resumes at it. + await expect(chain.locator("[data-chain-step='current']")).toHaveAttribute("data-step-status", "done", { timeout: 120_000 }); + await expect(chain.locator("[data-chain-step='windows']")).toHaveAttribute("data-step-status", "failed", { timeout: 60_000 }); + await expect(chain.locator("[data-chain-job]")).toHaveAttribute("data-chain-job", "failed"); + await expect(chain.getByRole("combobox", { name: "i1 chain from step" })).toContainText("resume (windows)"); +}); diff --git a/umtool/e2e/article-new.spec.ts b/umtool/e2e/article-new.spec.ts @@ -0,0 +1,109 @@ +import { test, expect } from "@playwright/test"; +import { readFileSync, rmSync } from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import { WARM_TIMEOUT, warm } from "./warm"; + +// --------------------------------------------------------------------------- +// /articles/new (release 27 S8): the generation policy (written through the +// editor's settings action, the key never shown) and a new article's first +// iteration — a sweep the editor runs — over the editor stub. +// +// WRITES articles/new-e2e/ (through the stub; removed after) and the stub's +// in-memory policy (put back to `balanced` after) +// --------------------------------------------------------------------------- + +const HERE = path.dirname(fileURLToPath(import.meta.url)); +const FIXTURE = path.join(HERE, "..", ".e2e-song"); +const STUB_LOG = path.join(FIXTURE, "editor-stub.requests.json"); +const ARTICLE = "new-e2e"; +const stubAsked = (route: string) => + (JSON.parse(readFileSync(STUB_LOG, "utf8")) as { route?: string; [k: string]: unknown }[]).filter((r) => r.route === route); + +test.beforeAll(async ({ playwright }) => { + test.setTimeout(WARM_TIMEOUT); + await warm(playwright, ["/articles/new", "/api/articles/policy", "/api/articles/channels"]); +}); +test.afterAll(async ({ request }) => { + rmSync(path.join(FIXTURE, "articles", ARTICLE), { recursive: true, force: true }); + await request.post("/api/articles/policy", { data: { routes: { sweep: "code", "revise-report": "api", "revise-video": "local", narrate: "local" } } }); +}); + +test("/drafts is /articles/new now, and /articles links to it", async ({ page }) => { + await page.goto("/drafts"); + await expect(page).toHaveURL(/\/articles\/new$/); + await page.goto("/articles"); + await page.getByRole("link", { name: "new article" }).click(); + await expect(page).toHaveURL(/\/articles\/new$/); +}); + +test("the policy: presets write their routes, a route alone makes it custom, caps are the editor's to refuse; the key is a file", async ({ page }) => { + await page.goto("/articles/new"); + const policy = page.getByRole("region", { name: "generation policy" }); + await expect(policy).toHaveAttribute("data-policy-preset", "balanced"); + await expect(policy.getByRole("button", { name: "balanced" })).toHaveAttribute("aria-pressed", "true"); + // The key FILE's path (the editor's read redacts it; settings.json names it) + // and whether a file is there — never a key. + await expect(policy.locator("[data-key-file-exists]")).toContainText("anthropic.env"); + await expect(policy.locator("[data-today-usd]")).toHaveAttribute("data-today-usd", "0.42"); + + await policy.getByRole("button", { name: "api", exact: true }).click(); + await expect(policy).toHaveAttribute("data-policy-preset", "api"); + expect(stubAsked("settings").at(-1)).toMatchObject({ + patch: { generation: { routes: { sweep: "api", "revise-report": "api", "revise-video": "api", narrate: "api" } } }, + authorization: "Bearer umtool-e2e-token", + }); + + await policy.getByRole("combobox", { name: "route narrate" }).selectOption("local"); + await expect(policy).toHaveAttribute("data-policy-preset", "custom"); + + await policy.getByRole("textbox", { name: "cap sweep" }).fill("50"); + await policy.getByRole("button", { name: "Save caps" }).click(); + await expect(policy.getByRole("alert")).toContainText("generation.caps.sweep"); + await policy.getByRole("textbox", { name: "cap sweep" }).fill("4"); + await policy.getByRole("button", { name: "Save caps" }).click(); + await expect(policy.getByRole("status")).toHaveText("saved caps"); + expect(stubAsked("settings").at(-1)).toMatchObject({ patch: { generation: { caps: { sweep: 4, max: 10 } } } }); + for (const r of stubAsked("settings")) expect(JSON.stringify(r)).not.toContain("apiKeyFile"); + await policy.getByRole("textbox", { name: "cap sweep" }).fill("5"); + await policy.getByRole("button", { name: "Save caps" }).click(); + await expect(policy.getByRole("textbox", { name: "cap sweep" })).toHaveValue("5"); + + await policy.getByRole("button", { name: "balanced" }).click(); + await expect(policy).toHaveAttribute("data-policy-preset", "balanced"); +}); + +test("a new article: question, channels, the local pipeline — its first iteration runs, and the page is its iterations", async ({ page }) => { + await page.goto("/articles/new"); + const form = page.getByRole("form", { name: "new article" }); + await form.getByRole("textbox", { name: "question" }).fill("What did the channel say about the vote?"); + await form.getByRole("textbox", { name: "find a channel" }).fill("site"); + await form.getByRole("button", { name: /^Site Channel/ }).click(); + await expect(form.locator("[data-picked='sitechan']")).toBeVisible(); + + // An id that is taken is named before anything is sent. + await form.getByRole("textbox", { name: "article id" }).fill("delta"); + await expect(form).toContainText("an article by that id exists"); + await form.getByRole("textbox", { name: "article id" }).fill(ARTICLE); + + // The agent's cap is the policy's per-sweep default, editable only down. + await form.getByRole("textbox", { name: "cap" }).fill("9"); + await form.getByRole("button", { name: "Start" }).click(); + await expect(form.getByRole("alert")).toContainText("at most the policy's $5"); + + await form.getByRole("radio", { name: /pipeline/ }).check(); + await expect(form.getByRole("combobox", { name: "model" })).toHaveValue("qwen3:8b"); + await form.getByRole("button", { name: "Start" }).click(); + + await expect(page).toHaveURL(new RegExp(`/articles/${ARTICLE}\\?tab=iterations$`)); + const asked = stubAsked("report-draft").at(-1)!; + expect(asked).toMatchObject({ task: "sweep", article: ARTICLE, question: "What did the channel say about the vote?", channels: ["sitechan"], model: "qwen3:8b" }); + expect(asked).not.toHaveProperty("maxUsd"); + + const first = page.locator("[data-iteration='1']"); + await expect(first).toHaveAttribute("data-kind", "sweep"); + await expect(first).toHaveAttribute("data-status", "done", { timeout: 20_000 }); + + await page.goto("/articles"); + await expect(page.locator(`[data-pending-article='${ARTICLE}']`)).toHaveAttribute("data-status", "done"); +});