commit 9179e365c0df6c8929e19f215b87014956d76e49
parent 5e07e4df807607f42f7bfc54c94ad45e04913260
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 14 Oct 2026 19:20:10 -0400
e2e: R6.1 — a partial triage tick in triage-first.spec (the stub's "partial"), reset-triage over ops in ops-api.spec
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
3 files changed, 51 insertions(+), 7 deletions(-)
diff --git a/common/testing/schedule/opsStub.ts b/common/testing/schedule/opsStub.ts
@@ -21,7 +21,9 @@
// start is the triage's tiers)
// triage (R6) a real triage run in reports/.triage/<id>/<k>/ —
// "quiet" in the terms or question → candidates, no flag
-// (below the threshold); else a strong flag and a weak one
+// (below the threshold); "partial" → the same, tier 0
+// partial (a channel not reached: the tick is partial,
+// R6.1); else a strong flag and a weak one
// on sitechan/sv1 and sv2, an invented line dismissed as
// not verbatim, a window not relevant; $0 (local)
@@ -32,7 +34,7 @@ import { sanitizeGeneration } from "../../lib/generationSettings";
import { createIteration, updateIteration, writeIterationFile } from "../../lib/report/iterations";
import { claimTick } from "../../controller/reportSchedule";
import { createTriageRun, writeTriageFile } from "../../lib/report/draft/triage/store";
-import { DEFAULT_TRIAGE_THRESHOLD, TRIAGE_FORMAT, TRIAGE_VERSION, escalationOf, triageLine, type TriageFile, type TriageFlag } from "../../lib/report/draft/triage/types";
+import { DEFAULT_TRIAGE_THRESHOLD, TRIAGE_FORMAT, TRIAGE_VERSION, escalationOf, partialWords, triageLine, type TriageFile, type TriageFlag } from "../../lib/report/draft/triage/types";
import { writeFile } from "node:fs/promises";
import { iterationFile } from "../../lib/report/iterations";
import { runTick, type TickDeps, type TickSteps } from "../../controller/reportTick";
@@ -152,7 +154,9 @@ const steps: TickSteps = {
},
triage: async (input, ctx) => {
const s = input.schedule;
- const quiet = /quiet/.test(words(s));
+ // "partial" (R6.1): tier 0 hit a cap — a channel not reached — and nothing flagged.
+ const partial = /partial/.test(words(s));
+ const quiet = partial || /quiet/.test(words(s));
const at = (nowIso ? new Date(nowIso) : new Date()).toISOString();
const threshold = s.triage?.threshold ?? { strong: generation.triage.strong ?? DEFAULT_TRIAGE_THRESHOLD.strong, weak: generation.triage.weak ?? DEFAULT_TRIAGE_THRESHOLD.weak };
const run = await createTriageRun(
@@ -181,10 +185,11 @@ const steps: TickSteps = {
scanned: 16,
newCount: 4,
cut: [],
- partial: false,
- unreached: [],
- perQuery: [{ query: "(any recording)", n: 16, partial: false }],
+ partial,
+ unreached: partial ? ["Site Other (stopped at page 2 of 5)"] : [],
+ perQuery: [{ query: "(every recording, listed)", n: 16, partial }],
newBy: "id",
+ listedBy: "manifests",
},
tier1: {
model: generation.models.local,
@@ -207,7 +212,8 @@ const steps: TickSteps = {
paths,
s.id,
);
- const f = { ...run, summary: `${triageLine(run)} — ${run.escalation!.escalate ? "escalate" : "below the threshold"}: ${run.escalation!.why}` };
+ const part = partialWords(run.tier0);
+ const f = { ...run, summary: `${part ? `partial (${part}) · ` : ""}${triageLine(run)} — ${run.escalation!.escalate ? "escalate" : "below the threshold"}: ${run.escalation!.why}` };
await writeTriageFile(f, paths);
ctx.log(`triage ${s.id}/${f.k} (stub): ${f.summary}`);
return { status: "done", file: f, jobId: `${jobId}-triage` };
diff --git a/editor/e2e/ops-api.spec.ts b/editor/e2e/ops-api.spec.ts
@@ -1036,4 +1036,17 @@ test("report-schedule: a watch — its plan names the triage; a tick with no bui
expect(run.error).toMatch(/no composed build/);
const del = await ops(request, "report-schedule", { action: "delete", id: "r6-ops" });
expect((del.body as { plan?: { removes: string; keeps: string[] } }).plan).toMatchObject({ removes: expect.stringContaining("the watch r6-ops"), keeps: [expect.stringContaining("its triage runs (reports/.triage/r6-ops/)")] });
+ // R6.1: reset-triage — the plan names the run, writes nothing; confirm discards it.
+ const reset = await ops(request, "report-schedule", { action: "reset-triage", id: "r6-ops" });
+ expect(reset.status, reset.body.error).toBe(200);
+ expect(reset.body).toMatchObject({ confirmed: false, plan: { runs: [1], refused: null } });
+ expect((reset.body as { plan: { removes: string[] } }).plan.removes[0]).toMatch(/^1 triage run \(#1\) in \.triage\/r6-ops\//);
+ expect(await pathExists(`${testPaths().transcriptsDir}/reports/.triage/r6-ops/1/triage.json`)).toBe(true);
+ const done = await ops(request, "report-schedule", { action: "reset-triage", id: "r6-ops", confirm: true });
+ expect(done.status, done.body.error).toBe(200);
+ expect(done.body).toMatchObject({ confirmed: true, reset: { runs: [1] } });
+ expect(await pathExists(`${testPaths().transcriptsDir}/reports/.triage/r6-ops/1`)).toBe(false);
+ const again = await ops(request, "report-schedule", { action: "reset-triage", id: "r6-ops", confirm: true });
+ expect(again.status).toBe(400);
+ expect(again.body.error).toMatch(/has no triage state to discard/);
});
diff --git a/umtool/e2e/triage-first.spec.ts b/umtool/e2e/triage-first.spec.ts
@@ -130,6 +130,31 @@ test("a quiet watch: the triage is below the threshold — no article, $0, the t
await expect(page.locator("[data-flag]")).toHaveCount(0);
});
+test("R6.1: a partial triage is never quiet — the tick is partial (Your call: See what was missed), the series page and the triage page name what it did not reach", async ({ page }) => {
+ test.setTimeout(90_000);
+ await page.goto("/");
+ await api(page, { action: "create", shape: "watch", id: "r6-partial", topic: "R6 partial", channels: ["sitechan"], cadence: "weekly mon 06:00", terms: "partial" });
+ await api(page, { action: "tick-now", id: "r6-partial" });
+ const t = series("r6-partial").ticks.at(-1);
+ expect(t).toMatchObject({ status: "partial", usd: 0, triage: { k: 1, flagged: 0, escalated: false, partial: "not reached: Site Other (stopped at page 2 of 5)" } });
+ expect(t.reason).toMatch(/^partial — not reached: Site Other \(stopped at page 2 of 5\); nothing flagged in what was read/);
+ await page.goto(urls.seriesHref("r6-partial"));
+ await expect(page.locator("tr[data-tick-status='partial']")).toContainText("partial — not reached: Site Other");
+ const run = page.locator("[data-series-triage] [data-triage-run='1']");
+ await expect(run).toHaveAttribute("data-triage-partial", "");
+ await expect(run).toContainText("not reached: Site Other (stopped at page 2 of 5)");
+ await run.getByRole("link").click();
+ await page.waitForURL(/\/series\/r6-partial\/triage\/1$/);
+ await expect(page.locator("[data-tier0-partial]")).toContainText("partial — not reached: Site Other (stopped at page 2 of 5)");
+ await shoot(page, "triage-partial");
+ await page.goto("/");
+ const card = page.locator("[data-group=your-call] [data-lit-line][data-piece='s:r6-partial'][data-card='tick-partial']");
+ await expect(card).toBeVisible();
+ await expect(card).toContainText("not reached: Site Other");
+ await expect(card.locator("[data-action-link]")).toHaveText("See what was missed");
+ await expect(card.locator("[data-action-link]")).toHaveAttribute("href", urls.seriesHref("r6-partial"));
+});
+
test("an escalating tick: the flagged ids swept as r6-watch-<date>; the tiers on the triage page (each flag and dismissal with its reason) and on the run page", async ({ page }) => {
test.setTimeout(90_000);
await page.goto(urls.seriesHref("r6-watch"));