Public: anyone can read this; the crew can change it.

The maintenance board shows each worker's last run time and result as one row #13313

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/13302-the-maintenance-board-shows-each-worker → main 4 commits fork 2 threads · 2 unresolved

  • Merged. scout/13302-the-maintenance-board-shows-each-worker was merged into main as 4b2ff8d.

Review

Sign in to review this change.
7 files changed +139 −37
docs/features/maintenance-week.md +23 −7
@@ -1,9 +1,22 @@
11 # Maintenance, last 7 days (#12436)
22
33 One line per maintenance worker: how many things it found in the last seven
4 days, how many it acted on, and when it last ran (even if that was before the
5 week). A worker that has never run is still a line, reading "not yet run". A
6 run stopped by its budget is not counted as a run.
4 days, how many it acted on, when it last ran (even if that was before the
5 week), and how that last run went. A worker that has never run is still a line,
6 reading "not yet run". A run stopped by its budget is not counted as a run, so
7 it never becomes the last result or the duration.
8
9 ## The result word
10
11 Each line ends with one of three words, and the time the last run took:
12
13 - **ok** — the last run finished without an error (`ok in 4.2 s`).
14 - **failed** — the last run ended in an error (`failed in 340 ms`).
15 - **parked** — the worker's switch is off. Parked wins: it is shown even when
16 the last run was ok or failed, and then without a duration.
17
18 The duration reads `340 ms`, `4.2 s` or `3 min`. A worker that never ran and is
19 not parked has no result and reads "not yet run".
720
821 All three doors are for a forge admin, or an agent granted `telemetry:read`.
922
@@ -11,12 +24,14 @@ All three doors are for a forge admin, or an agent granted `telemetry:read`.
1124
1225 Under **Maintenance, last 7 days**, one sentence says how many workers found
1326 something this week. Open it to see each worker's found and acted counts and
14 its last run.
27 its last run, result word and duration. The row carries `data-result`
28 (`ok`, `failed`, `parked`) for styling and tests.
1529
1630 ## In the terminal
1731
1832 Open the palette and choose **Maintenance, last 7 days**. The first line is the
19 same sentence; below it, a line per worker. `j`/`k` scroll, `esc` closes.
33 same sentence; below it, a line per worker, ending in the same result and
34 duration. `j`/`k` scroll, `esc` closes.
2035
2136 ## Over MCP
2237
@@ -24,8 +39,9 @@ same sentence; below it, a line per worker. `j`/`k` scroll, `esc` closes.
2439 { "name": "system", "arguments": { "kind": "maintenance" } }
2540 ```
2641
27 answers `{ workers: [{ name, found, acted, last }] }`, `last` an ISO time or
28 null. Anyone without the gate is refused as `forbidden`.
42 answers `{ workers: [{ name, found, acted, last, result, ms, says }] }`:
43 `last` an ISO time or null, `result` `ok`, `failed`, `parked` or null, `ms` the
44 last run's milliseconds or null, and `says` the same words the page shows. Anyone without the gate is refused as `forbidden`.

Non-blocking: this line runs past the wrapped width; break it after "page shows."

2945
3046 ## Keeping it true
3147
src/http/mcp/tools/system.ts +2 −2
@@ -13,7 +13,7 @@ import { footing, riskLines } from "../../../system/footing.ts";
1313 import { laneWords, readOffsiteLane } from "../../../snapshot/offsite_lane.ts";
1414 import { largestDirs } from "../../../system/largest_dirs.ts";
1515 import { dbSize } from "../../../system/db_size.ts";
16 import { weekRows } from "../../../maintain/week_line.ts";
16 import { resultWords, weekRows } from "../../../maintain/week_line.ts";
1717 import { duties } from "../../../maintain/registry.ts";
1818 import { maySwitch, setPlannerSwitch, SWITCH_REFUSED, utcAt, validUntil, type SwitchInput } from "../../../actions/planner_switch.ts";
1919 import { pauseSentence, pausedUntil } from "../../../core/planner_pause.ts";
@@ -72,7 +72,7 @@ export const tool: Tool = {
7272 const reader = telemetryReader(ctx.app, user);
7373 if (!reader) return badBlocked("forbidden", noTelemetryBlocked(ctx.app, user, "Reading this forge's maintenance workers takes the telemetry:read grant."));
7474 noteRead(ctx.app, user, reader, "system");
75 return good({ workers: weekRows(ctx.app.db, duties.map((d) => d.name)) });
75 return good({ workers: weekRows(ctx.app.db, duties.map((d) => d.name)).map((w) => ({ ...w, says: resultWords(w) })) });
7676 }
7777 if (args["kind"] === "footing") {
7878 if (!user.isAdmin) return bad("forbidden", "only an admin of this forge reads what it stands on");
src/maintain/week_line.ts +37 −5
@@ -2,6 +2,7 @@
22 * when it last ran. */
33
44 import type { Database } from "bun:sqlite";
5 import { errored } from "./pause.ts";
56
67 export const WEEK_MS = 7 * 24 * 60 * 60 * 1000;
78
@@ -13,14 +14,27 @@ export interface WorkerTally {
1314 readonly acted: number;
1415 /** The worker's newest real start (ISO), in the window or not; null when it never ran. */
1516 readonly last: string | null;
17 /** The newest real run's outcome and how long it took; null when it never ran. */
18 readonly outcome: string | null;
19 readonly ms: number | null;
1620 }
1721
22 /**
23 * The word a worker's last run gets: parked while its switch is off, failed when it did not come
24 * out ok.
25 */
26 export type Result = "ok" | "failed" | "parked";
27
1828 export interface WeekRow {
1929 readonly name: string;
2030 readonly found: number;
2131 readonly acted: number;
2232 /** ISO time of the last run; null reads "not yet run". */
2333 readonly last: string | null;
34 /** The last run's result word; null only for a worker that never ran and is not parked. */
35 readonly result: Result | null;
36 /** The last run's duration in milliseconds; null when it never ran. */
37 readonly ms: number | null;
2438 }
2539
2640 /** One grouped, index-served statement: every duty's sums, a budget stop not counting as a run. */
@@ -31,24 +45,42 @@ export function tallies(db: Database, now: Date): WorkerTally[] {
3145 `SELECT duty,
3246 COALESCE(SUM(CASE WHEN started >= ?1 THEN json_array_length(findings) END), 0) AS found,
3347 COALESCE(SUM(CASE WHEN started >= ?1 THEN json_array_length(actions) END), 0) AS acted,
34 MAX(started) AS last
35 FROM maintenance_run WHERE outcome NOT LIKE 'budget:%' GROUP BY duty`,
48 MAX(started) AS last,

Two correlated subqueries per duty each re-find the newest run. It is fine at this size, but one lookup of the latest id per duty joined once would be cheaper and keep the grouped statement single-pass. Optional.

49 (SELECT r.outcome FROM maintenance_run r WHERE r.duty = m.duty AND r.outcome NOT LIKE 'budget:%' ORDER BY r.id DESC LIMIT 1) AS outcome,
50 (SELECT CAST(ROUND((julianday(r.finished) - julianday(r.started)) * 86400000) AS INTEGER) FROM maintenance_run r
51 WHERE r.duty = m.duty AND r.outcome NOT LIKE 'budget:%' ORDER BY r.id DESC LIMIT 1) AS ms
52 FROM maintenance_run m WHERE outcome NOT LIKE 'budget:%' GROUP BY duty`,
3653 )
3754 .all(since) as WorkerTally[];
3855 }
3956
4057 /** Pure: a row per named worker, in the given order; a worker with no run is still a row. */
41 export function weekLine(workers: readonly string[], tally: readonly WorkerTally[]): WeekRow[] {
58 export function weekLine(workers: readonly string[], tally: readonly WorkerTally[], parked: ReadonlySet<string> = new Set()): WeekRow[] {
4259 const by = new Map(tally.map((t) => [t.duty, t]));
4360 return workers.map((name) => {
4461 const t = by.get(name);
45 return { name, found: t?.found ?? 0, acted: t?.acted ?? 0, last: t?.last ?? null };
62 const result: Result | null = parked.has(name) ? "parked" : t?.outcome == null ? null : errored(t.outcome) ? "failed" : "ok";
63 return { name, found: t?.found ?? 0, acted: t?.acted ?? 0, last: t?.last ?? null, result, ms: t?.ms ?? null };
4664 });
4765 }
4866
67 /** A duration in words that stays short: `340 ms`, `4.2 s`, `3 min`. */
68 export function took(ms: number): string {
69 if (ms < 1000) return `${String(Math.max(0, Math.round(ms)))} ms`;
70 if (ms < 60_000) return `${(ms / 1000).toFixed(1)} s`;
71 return `${String(Math.round(ms / 60_000))} min`;
72 }
73
74 /** The row's result and duration as every door says it: `ok in 4.2 s`, `parked`, `not yet run`. */
75 export function resultWords(r: WeekRow): string {
76 if (r.result === null) return "not yet run";
77 return r.result === "parked" || r.ms === null ? r.result : `${r.result} in ${took(r.ms)}`;
78 }
79
4980 /** The rows for the forge's own workers. */
5081 export function weekRows(db: Database, workers: readonly string[], now = new Date()): WeekRow[] {
51 return weekLine(workers, tallies(db, now));
82 const parked = new Set((db.query("SELECT duty FROM maintenance_duty_state WHERE paused = 1").all() as { duty: string }[]).map((r) => r.duty));
83 return weekLine(workers, tallies(db, now), parked);
5284 }
5385
5486 /** The one sentence on first view: how many workers found something this week. */
src/tui/screens/maintenanceweek.ts +3 −3
@@ -7,7 +7,7 @@
77
88 import { telemetryReader } from "../../actions/telemetry.ts";
99 import { duties } from "../../maintain/registry.ts";
10 import { weekRows, weekWords } from "../../maintain/week_line.ts";
10 import { resultWords, weekRows, weekWords } from "../../maintain/week_line.ts";
1111 import type { Ctx, Screen } from "../app/app.ts";
1212 import { binding } from "../app/keys.ts";
1313 import type { Session } from "../session.ts";
@@ -28,8 +28,8 @@ export function weekLines(session: Session, now = new Date()): string[] {
2828 "",
2929 ...rows.map((r) =>
3030 r.last === null
31 ? `${pad(r.name, width)} not yet run`
32 : `${pad(r.name, width)} found ${String(r.found)} · acted ${String(r.acted)} · last ${r.last.slice(0, 16).replace("T", " ")}Z`),
31 ? `${pad(r.name, width)} ${resultWords(r)}`
32 : `${pad(r.name, width)} found ${String(r.found)} · acted ${String(r.acted)} · last ${r.last.slice(0, 16).replace("T", " ")}Z · ${resultWords(r)}`),
3333 ];
3434 }
3535
src/web/pages/system.ts +41 −14
@@ -63,7 +63,7 @@ import { shapeWords } from "../../engine/mode.ts";
6363 import { badge, chartBox, disclosure, meter, pill, row, time } from "../ui.ts";
6464 import { LARGEST_DIRS, largestDirs, type LargestDirs } from "../../system/largest_dirs.ts";
6565 import { DB_FILE_CAP, DB_GROWTH_MAX, TOP, dbSize, dbSizeNeed, type DbSize } from "../../system/db_size.ts";
66 import { weekRows, weekWords, type WeekRow } from "../../maintain/week_line.ts";
66 import { resultWords, weekRows, weekWords, type WeekRow } from "../../maintain/week_line.ts";
6767 import { duties } from "../../maintain/registry.ts";
6868 import { childDirOf, listChildren } from "../../actions/spawn.ts";
6969 import { childrenUse, mibWords, realSelf, selfUse, shareOf, sizeWords, useWords, type ChildUseRow, type SelfUse } from "../../spawn/usage.ts";
@@ -94,7 +94,10 @@ const meterRow = (name: string, value: number | null, max: number, figure: strin
9494 const figureRow = (name: string, figure: string, data: Record<string, string> = {}): Html =>
9595 row({ title: name, trail: html`<span class="mono">${figure}</span>`, data });
9696
97 /** The five largest directories under the forge's data (#11800), measured at most once a minute, never waited on. */
97 /**
98 * The five largest directories under the forge's data (#11800), measured at most once a minute,
99 * never waited on.
100 */
98101 export function largestDirsSection(found: LargestDirs | null): Html {
99102 return html`<section class="settings-block" id="sys-largest"><h2>Largest under the forge's data</h2>
100103 ${found === null
@@ -154,13 +157,15 @@ export function maintenanceSection(rows: readonly WeekRow[]): Html {
154157 row({
155158 title: r.name,
156159 meta: html`${r.last === null ? null : html`found ${String(r.found)} · acted ${String(r.acted)}`}`,
157 trail: r.last === null ? html`<span class="muted">not yet run</span>` : time(r.last),
158 data: { worker: r.name, found: String(r.found), acted: String(r.acted) },
160 trail: r.last === null ? html`<span class="muted">${resultWords(r)}</span>` : html`${time(r.last)} · ${resultWords(r)}`,
161 data: { worker: r.name, found: String(r.found), acted: String(r.acted), result: r.result ?? "none" },
159162 }),
160163 )}</ul>`)}</section>`;
161164 }
162165
163 /** This forge's own size and use when it is a child in a cell (#10853); nothing on any other forge. */
166 /**
167 * This forge's own size and use when it is a child in a cell (#10853); nothing on any other forge.
168 */
164169 export function selfSection(self: SelfUse | null): Html {
165170 if (self === null) return html``;
166171 const { use, size } = self;
@@ -185,7 +190,10 @@ export function engineSection(choice: { mode: string; why: string } | undefined)
185190 })}</ul></section>`;
186191 }
187192
188 /** What this forge's own size section leaves to the page's `?`: who set the size and what is measured. */
193 /**
194 * What this forge's own size section leaves to the page's `?`: who set the size and what is
195 * measured.
196 */
189197 export const selfHelp = (self: SelfUse | null): Html | null =>
190198 self === null ? null : html`<p id="sys-self-help">Size is set by the forge that made this one. ${self.from === "process" ? "Memory and CPU count this process alone. " : ""}Disk is measured every 30 seconds.</p>`;
191199
@@ -234,7 +242,10 @@ export function inProcessSection(rows: readonly ChildHour[]): Html {
234242 )}</ul></section>`;
235243 }
236244
237 /** Processes grouped forge, crew, check, app, host; the client re-sorts them by CPU or memory (`system-live.ts`). */
245 /**
246 * Processes grouped forge, crew, check, app, host; the client re-sorts them by CPU or memory
247 * (`system-live.ts`).
248 */
238249 const KIND_ORDER = ["forge", "crew", "check", "app", "host"] as const;
239250 function procTable(v: SystemView): Html {
240251 const groups = KIND_ORDER.flatMap((k) => v.groups.filter((g) => g.kind === k));
@@ -291,7 +302,10 @@ export const pageCaches = (): CacheRow[] => [
291302 { name: "folders and refs", holds: "folder listings at a commit, ref names (tree_cache.ts)", capBytes: PARTS_BYTES, ...keptPartsStats() },
292303 ];
293304
294 /** `pageCaches`' rows as a table; the hit rate is hits over hits and misses since the process started. */
305 /**
306 * `pageCaches`' rows as a table; the hit rate is hits over hits and misses since the process
307 * started.
308 */
295309 export function cachesSection(rows: readonly CacheRow[]): Html {
296310 const rate = (r: CacheRow) => (r.hits + r.misses === 0 ? "—" : `${((100 * r.hits) / (r.hits + r.misses)).toFixed(1)}%`);
297311 return html`<section class="settings-block"><h2>Code page caches, since start</h2>
@@ -301,7 +315,10 @@ export function cachesSection(rows: readonly CacheRow[]): Html {
301315 </table></div></section>`;
302316 }
303317
304 /** Absorbed apps and whether production is serving (#9887); `featureHealth`'s rows. Nothing absorbed, nothing drawn. */
318 /**
319 * Absorbed apps and whether production is serving (#9887); `featureHealth`'s rows. Nothing
320 * absorbed, nothing drawn.
321 */
305322 export function featuresSection(rows: readonly FeatureHealth[]): Html {
306323 if (rows.length === 0) return html``;
307324 return html`<section class="settings-block" id="sys-features"><h2>Features from apps</h2>
@@ -371,7 +388,8 @@ export function footprintSection(f: Footprint | null): Html {
371388 * last restore drill with where it restored from. `snapshot/offsite_lane.ts`'s reading.
372389 */
373390 export function offsiteSection(l: OffsiteLane): Html {
374 // A lane that exists and is not level and sealed is red; no lane at all is a setting, said in words (first sight, #11111).
391 // A lane that exists and is not level and sealed is red; no lane at all is a setting, said in
392 // words (first sight, #11111).
375393 const tone = l.health === "ok" || l.health === "none" ? null : badge(l.health, { tone: "danger" });
376394 const d = l.drill;
377395 // First sight (#11111): the heading and one sentence stay; the rows open behind one disclosure.
@@ -483,7 +501,10 @@ export function lagSection(rows: readonly LagReading[]): Html {
483501
484502 const SLOW_TTL_MS = 5000;
485503 let slowKept: { db: object; at: number; rows: SlowPage[] } | undefined;
486 /** `slowPages`, kept a few seconds so a busy /system never repeats the query; changes show on reload. */
504 /**
505 * `slowPages`, kept a few seconds so a busy /system never repeats the query; changes show on
506 * reload.
507 */
487508 function slowPagesCached(db: Parameters<typeof slowPages>[0]): SlowPage[] {
488509 const now = Date.now();
489510 if (slowKept === undefined || slowKept.db !== db || now - slowKept.at > SLOW_TTL_MS)
@@ -491,14 +512,19 @@ function slowPagesCached(db: Parameters<typeof slowPages>[0]): SlowPage[] {
491512 return slowKept.rows;
492513 }
493514
494 /** Real visitors' pages over budget (#10536): one line each, and nothing at all when every page is fast. */
515 /**
516 * Real visitors' pages over budget (#10536): one line each, and nothing at all when every page is
517 * fast.
518 */
495519 export function slowPagesSection(rows: readonly SlowPage[]): Html {
496520 if (rows.length === 0) return html``;
497521 return html`<section class="settings-block" id="slow-pages"><h2>Pages over budget, last hour</h2>
498522 <ul class="list" aria-label="Pages over their budget for real visitors">${rows.map((p) => html`<li data-route="${p.route}" data-phase="${p.phase}">${slowPageLine(p)}</li>`)}</ul></section>`;
499523 }
500524
501 /** Who read the telemetry routes in the last 10 minutes and how fast (#9069); `readerPaces`' rows. */
525 /**
526 * Who read the telemetry routes in the last 10 minutes and how fast (#9069); `readerPaces`' rows.
527 */
502528 export function readersSection(rows: readonly ReaderPace[]): Html {
503529 const secs = (ms: number | null): string => (ms === null ? "—" : `${(ms / 1000).toFixed(1)} s`);
504530 return html`<section class="settings-block"><h2>Telemetry readers</h2>${
@@ -620,7 +646,8 @@ export async function systemPage(ctx: Ctx): Promise<Response> {
620646 const inProcess = childHours(ctx.app, Date.now(), tally.hour, openChildren(ctx.app).map((c) => c.name)).filter((r) => mine.has(r.name));
621647 const nowMono = performance.now();
622648 const worst = liveOf(ctx.app).stallBlame.worst(nowMono, HOUR_MS, WORST_STALLS);
623 // Never waits on the cluster: the last reading, or the declared rows while the first read runs behind.
649 // Never waits on the cluster: the last reading, or the declared rows while the first read runs
650 // behind.
624651 const standsOn = footing.peek() ?? declaredFooting("the cluster is being read; reload in a moment");
625652 // Never waits on the walk: the last measurement, a new one started behind it when stale.
626653 const largestUnder = largestDirs.peek(ctx.app.config.dataDir);
test/maintain-week-line.test.ts +31 −5
@@ -6,6 +6,7 @@ const now = new Date("2026-11-14T12:00:00.000Z");
66 function db(): Database {
77 const d = new Database(":memory:");
88 d.run("CREATE TABLE maintenance_run (id INTEGER PRIMARY KEY AUTOINCREMENT, duty TEXT, started TEXT, finished TEXT, findings TEXT, actions TEXT, probes TEXT, outcome TEXT)");
9 d.run("CREATE TABLE maintenance_duty_state (duty TEXT PRIMARY KEY, paused INTEGER)");
910 return d;
1011 }
1112 const add = (d: Database, duty: string, at: number, f: number, a: number, outcome = "ok") =>
@@ -21,7 +22,7 @@ test("counts at the seven-day edge: exactly seven days is in, a millisecond olde
2122 });
2223
2324 test("a worker with no run is a row, not hidden", () => {
24 expect(weekRows(db(), ["idle"], now)).toEqual([{ name: "idle", found: 0, acted: 0, last: null }]);
25 expect(weekRows(db(), ["idle"], now)).toEqual([{ name: "idle", found: 0, acted: 0, last: null, result: null, ms: null }]);
2526 });
2627
2728 test("an idle week still shows the last run; two workers are told apart; budget stops do not count", () => {
@@ -31,19 +32,44 @@ test("an idle week still shows the last run; two workers are told apart; budget
3132 add(d, "b", now.getTime() - 1000, 1, 0);
3233 add(d, "b", now.getTime(), 4, 4, "budget:runs");
3334 const rows = weekRows(d, ["a", "b"], now);
34 expect(rows[0]).toEqual({ name: "a", found: 0, acted: 0, last: new Date(old).toISOString() });
35 expect(rows[1]).toEqual({ name: "b", found: 1, acted: 0, last: new Date(now.getTime() - 1000).toISOString() });
35 expect(rows[0]).toEqual({ name: "a", found: 0, acted: 0, last: new Date(old).toISOString(), result: "ok", ms: 0 });
36 expect(rows[1]).toEqual({ name: "b", found: 1, acted: 0, last: new Date(now.getTime() - 1000).toISOString(), result: "ok", ms: 0 });
3637 });
3738
3839 test("/system draws a never-run worker as 'not yet run'", async () => {
3940 const { maintenanceSection } = await import("../src/web/pages/system.ts");
40 const out = maintenanceSection([{ name: "idle-one", found: 0, acted: 0, last: null }]).text;
41 const out = maintenanceSection([{ name: "idle-one", found: 0, acted: 0, last: null, result: null, ms: null }]).text;
4142 expect(out).toContain("idle-one");
4243 expect(out).toContain("not yet run");
4344 });
4445
4546 test("the one sentence counts the workers that found something", async () => {
4647 const { weekWords } = await import("../src/maintain/week_line.ts");
47 const row = (found: number) => ({ name: "w", found, acted: 0, last: null });
48 const row = (found: number) => ({ name: "w", found, acted: 0, last: null, result: null, ms: null });
4849 expect(weekWords([row(0), row(3), row(1)])).toBe("2 of 3 workers found something this week");
4950 });
51
52 test("each result word: ok, failed and parked, with the last run's duration; a budget stop is no run", async () => {
53 const { resultWords, took } = await import("../src/maintain/week_line.ts");
54 const d = db();
55 const t = now.getTime();
56 const run = (duty: string, ms: number, outcome: string) =>
57 d.query("INSERT INTO maintenance_run (duty, started, finished, findings, actions, probes, outcome) VALUES (?1,?2,?3,'[]','[]','[]',?4)").run(
58 duty, new Date(t - 10_000).toISOString(), new Date(t - 10_000 + ms).toISOString(), outcome);
59 run("good", 4200, "ok");
60 run("bad", 340, "error: boom");
61 run("bad2", 340, "ok");
62 run("bad2", 90_000, "timeout");
63 run("held", 100, "ok");
64 run("good", 50, "budget:runs");
65 d.query("INSERT INTO maintenance_duty_state (duty, paused) VALUES ('held', 1)").run();
66 const rows = weekRows(d, ["good", "bad", "bad2", "held", "none"], now);
67 expect(rows.map((r) => r.result)).toEqual(["ok", "failed", "failed", "parked", null]);
68 expect(rows.map(resultWords)).toEqual(["ok in 4.2 s", "failed in 340 ms", "failed in 2 min", "parked", "not yet run"]);
69 expect(took(0)).toBe("0 ms");
70 const { maintenanceSection } = await import("../src/web/pages/system.ts");
71 const out = maintenanceSection(rows).text;
72 expect(out).toContain("ok in 4.2 s");
73 expect(out).toContain('data-result="failed"');
74 expect(out).toContain("parked");
75 });
test/maintenance-week-doors.test.ts +2 −1
@@ -67,7 +67,7 @@ test("MCP maintenance answers a row per worker; a non-admin is forbidden; teleme
6767 expect(out.result.isError).not.toBe(true);
6868 const { workers } = JSON.parse(out.result.content[0].text);
6969 expect(workers.map((w: any) => w.name)).toEqual(duties.map((d) => d.name));
70 expect(workers[0]).toMatchObject({ name: first, found: 2, acted: 1 });
70 expect(workers[0]).toMatchObject({ name: first, found: 2, acted: 1, result: "ok", says: "ok in 0 ms" });
7171 expect(workers[0].last).not.toBeNull();
7272 expect(workers[1]).toMatchObject({ found: 0, acted: 0, last: null });
7373
@@ -88,6 +88,7 @@ test("the terminal screen says the sentence and lists every worker, for the same
8888 expect(lines[0]).toBe(`1 of ${String(duties.length)} workers found something this week`);
8989 expect(lines.length).toBe(duties.length + 2);
9090 expect(lines[2]).toContain("found 2 · acted 1");
91 expect(lines[2]).toContain("ok in 0 ms");
9192 expect(lines[3]).toContain("not yet run");
9293 expect(weekLines(new Session(app, identity(bob)))).toEqual([]);
9394 expect(weekLines(new Session(app, identity(undefined)))).toEqual([]);

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs