@jive-sh/workflow-platform 0.6.3 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/README.md +182 -42
  2. package/dist/budget-states.js +1 -1
  3. package/dist/budget-states.js.map +1 -1
  4. package/dist/dashboard/dashboard.css +42 -28
  5. package/dist/dashboard/drilldown.js +35 -4
  6. package/dist/dashboard/drilldown.js.map +1 -1
  7. package/dist/dashboard/run-doing-words.js +29 -0
  8. package/dist/dashboard/run-doing-words.js.map +1 -0
  9. package/dist/dashboard/setting-words.js +18 -0
  10. package/dist/dashboard/setting-words.js.map +1 -0
  11. package/dist/dashboard/spending-words.js +2 -10
  12. package/dist/dashboard/spending-words.js.map +1 -1
  13. package/dist/index.js +76 -13
  14. package/dist/index.js.map +1 -1
  15. package/dist/keep-running.js +4 -2
  16. package/dist/keep-running.js.map +1 -1
  17. package/dist/pick-wakes.js +2 -2
  18. package/dist/retention.js +59 -0
  19. package/dist/retention.js.map +1 -0
  20. package/dist/settings.js +88 -0
  21. package/dist/settings.js.map +1 -0
  22. package/dist/spending-limit.js +15 -21
  23. package/dist/spending-limit.js.map +1 -1
  24. package/dist/step-times.js +114 -0
  25. package/dist/step-times.js.map +1 -0
  26. package/dist/steps.js +399 -114
  27. package/dist/steps.js.map +1 -1
  28. package/dist/storage/agent-claims.js +3 -0
  29. package/dist/storage/agent-claims.js.map +1 -0
  30. package/dist/storage/budgets.js +40 -4
  31. package/dist/storage/budgets.js.map +1 -1
  32. package/dist/storage/engine-records.js +26 -10
  33. package/dist/storage/engine-records.js.map +1 -1
  34. package/dist/storage/sqlite-store.js +198 -20
  35. package/dist/storage/sqlite-store.js.map +1 -1
  36. package/dist/storage/task-store.js +11 -5
  37. package/dist/storage/task-store.js.map +1 -1
  38. package/dist/system-workflows.js +54 -0
  39. package/dist/system-workflows.js.map +1 -0
  40. package/dist/tasks.js +49 -24
  41. package/dist/tasks.js.map +1 -1
  42. package/dist/views/runs-now.js +80 -38
  43. package/dist/views/runs-now.js.map +1 -1
  44. package/dist/views/step-graph.js +6 -1
  45. package/dist/views/step-graph.js.map +1 -1
  46. package/dist/views/workflows-view.js +29 -23
  47. package/dist/views/workflows-view.js.map +1 -1
  48. package/package.json +1 -1
  49. package/src/budget-states.ts +2 -3
  50. package/src/dashboard/dashboard.css +42 -28
  51. package/src/dashboard/drilldown.ts +32 -5
  52. package/src/dashboard/index.tsx +1 -1
  53. package/src/dashboard/limits-and-runs.tsx +191 -0
  54. package/src/dashboard/queue-bar.tsx +30 -11
  55. package/src/dashboard/queue-chart.tsx +1 -2
  56. package/src/dashboard/run-doing-words.ts +41 -0
  57. package/src/dashboard/setting-words.ts +30 -0
  58. package/src/dashboard/spending-limit-control.tsx +5 -8
  59. package/src/dashboard/spending-words.ts +5 -23
  60. package/src/dashboard/time-distribution.tsx +61 -0
  61. package/src/dashboard/workflow-dag.tsx +247 -129
  62. package/src/dashboard/workflow-drilldown.tsx +13 -71
  63. package/src/dashboard/workflows-dashboard.tsx +345 -227
  64. package/src/index.ts +86 -16
  65. package/src/keep-running.ts +6 -4
  66. package/src/pick-wakes.ts +2 -2
  67. package/src/project.ts +12 -0
  68. package/src/retention.ts +90 -0
  69. package/src/settings.ts +171 -0
  70. package/src/spending-limit.ts +25 -42
  71. package/src/step-times.ts +151 -0
  72. package/src/steps.ts +512 -135
  73. package/src/storage/agent-claims.ts +63 -0
  74. package/src/storage/budgets.ts +43 -4
  75. package/src/storage/engine-records.ts +28 -11
  76. package/src/storage/sqlite-store.ts +225 -32
  77. package/src/storage/step-records.ts +59 -7
  78. package/src/storage/task-store.ts +29 -29
  79. package/src/system-workflows.ts +70 -0
  80. package/src/tasks.ts +49 -24
  81. package/src/views/runs-now.ts +119 -51
  82. package/src/views/step-graph.ts +11 -2
  83. package/src/views/workflows-view.ts +80 -39
  84. package/src/workflow-dag.test.tsx +89 -0
  85. package/src/workflow-page.test.tsx +170 -0
  86. package/dist/views/workflow-flows.js +0 -53
  87. package/dist/views/workflow-flows.js.map +0 -1
  88. package/src/dashboard/step-graph.tsx +0 -106
  89. package/src/views/workflow-flows.ts +0 -97
@@ -1,17 +1,17 @@
1
1
  /**
2
- * THE RUNS GOING NOW, by phase, workflow and step: each unfinished run counted once, on the step its newest record names.
3
- * Pure, so it is tested alone; its inputs are the engine's unfinished runs (`EngineRecords.unfinishedRuns`) and their newest
4
- * step records (`StepRecords.newestStepRecords`).
2
+ * THE RUNS GOING NOW, by workflow and step: each unfinished run counted once, on the step its newest record names.
3
+ * Pure, so it is tested alone; its inputs are the engine's unfinished runs (`EngineRecords.unfinishedRuns`), their newest
4
+ * step records (`StepRecords.newestStepRecords`) and the agent claims that count now (`steps.ts` `agentClaimsNow`).
5
5
  *
6
6
  * Alex, 2026-11-06: "showing current run counts for each phase and workflow and step, and then this implies a certain
7
- * number of agents running based on how many of the running steps involve agentic work". So a run is on an agent only
8
- * while the step it is in is an agent step and that step's record is still open; between steps it waits after the step
9
- * it last ended, and uses no agent.
7
+ * number of agents running". A run holds its agents from its first agent step to its end (`steps.ts` `claimAgentsOrEnd`; Alex, 2026-11-22:
8
+ * "decompile is down one agent"), so a run holding a claim, or in a sub-workflow step whose run holds one, is holding an
9
+ * agent whatever step it is in. What was a phase is a workflow made of workflows, counted like any other.
10
10
  */
11
- import { isSpendingLimitWait } from '../spending-limit';
11
+ import type { AgentClaim } from '../storage/agent-claims';
12
12
  import type { UnfinishedRun } from '../storage/engine-records';
13
13
  import type { NewestStepRecord } from '../storage/step-records';
14
- import type { StepDeclaration } from '../steps';
14
+ import { isMadeOfWorkflows, type StepDeclaration } from '../steps';
15
15
 
16
16
  export interface StepRunsNow {
17
17
  readonly step: string;
@@ -24,15 +24,39 @@ export interface StepRunsNow {
24
24
  readonly waitingSince: number | null;
25
25
  /** What a run in it waits on, in the step's own words (a Pick with nothing it can claim); none while each works. */
26
26
  readonly waitingOn: string | null;
27
- /** Runs in it that the spending limit holds before their agent call (`spending-limit.ts`). */
28
- readonly heldBySpendingLimit: number;
27
+ }
28
+
29
+ /**
30
+ * What one going run is doing now: holding an agent where it, or the run its open sub-workflow step started, at any depth,
31
+ * holds a claim; otherwise read from its newest record, and where that is an open sub-workflow step, from the newest record
32
+ * of the run it started. Alex, 2026-11-21, on Decompile's "4 runs going · 1 on agents", its 4 runs all inside its
33
+ * sub-workflow step: "how can it be possible that we've been at 4 concurrent non agentic runs going on for hours".
34
+ */
35
+ export type RunDoing =
36
+ /** It, or the run under it, holds an agent claim: in an agent step or not. */
37
+ | { readonly kind: 'holding an agent' }
38
+ /** Any other open record that waits on nothing, by its step's name. */
39
+ | { readonly kind: 'in a step'; readonly step: string }
40
+ /** Any other open record that says what it waits on (a Pick with nothing it can claim), by its step's name. */
41
+ | { readonly kind: 'waiting at a step'; readonly step: string }
42
+ /** Its newest record ended, and no next step started. */
43
+ | { readonly kind: 'between steps' }
44
+ /** No record yet. */
45
+ | { readonly kind: 'not started' };
46
+
47
+ /** How many going runs do one thing now. */
48
+ export interface RunsDoing {
49
+ readonly doing: RunDoing;
50
+ readonly runs: number;
29
51
  }
30
52
 
31
53
  export interface WorkflowRunsNow {
32
54
  readonly workflow: string;
33
55
  /** Every unfinished run: its steps' `inStep` and `waitingAfter`, and `notStarted`. */
34
56
  readonly runs: number;
35
- /** Runs an agent is working for now: those in an agent step that wait on nothing (a run waiting there for a free agent is on none). */
57
+ /** What its going runs are doing, each counted once, adding up to `runs`, most engaged first (`RUN_DOING_ORDER`). */
58
+ readonly doing: ReadonlyArray<RunsDoing>;
59
+ /** The agents its runs hold now: what the claims of `doing`'s runs holding an agent claim. */
36
60
  readonly onAgents: number;
37
61
  /** Runs with no step record yet. */
38
62
  readonly notStarted: number;
@@ -40,32 +64,56 @@ export interface WorkflowRunsNow {
40
64
  readonly steps: ReadonlyArray<StepRunsNow>;
41
65
  }
42
66
 
43
- export interface PhaseRunsNow<Phase extends string = string> {
44
- readonly phase: Phase;
45
- readonly runs: number;
46
- readonly onAgents: number;
47
- readonly workflows: ReadonlyArray<WorkflowRunsNow>;
48
- }
49
-
50
- type Declared<Phase extends string> = { readonly name: string; readonly phase: Phase; readonly steps: () => ReadonlyArray<Pick<StepDeclaration, 'name' | 'runs' | 'workflow'>> };
67
+ type Declared = { readonly name: string; readonly steps: () => ReadonlyArray<Pick<StepDeclaration, 'name' | 'runs' | 'workflow' | 'runsOnItsOwnTrigger'>> };
51
68
 
52
69
  const sum = <T>(xs: ReadonlyArray<T>, f: (x: T) => number) => xs.reduce((a, x) => a + f(x), 0);
53
70
 
54
- const workflowRunsNow = <Phase extends string>(d: Declared<Phase>, runs: ReadonlyArray<string>, newest: ReadonlyMap<string, NewestStepRecord>): WorkflowRunsNow => {
71
+ /** The order `doing` lists its kinds in: runs holding an agent first, then other steps, then no step. */
72
+ export const RUN_DOING_ORDER: ReadonlyArray<RunDoing['kind']> = ['holding an agent', 'in a step', 'waiting at a step', 'between steps', 'not started'];
73
+
74
+ /**
75
+ * The agents a run holds: its own claim, the claims of the runs under it (each names the run at its top, which reaches a run
76
+ * whose sub-workflow step's record a restart closed while it waited), or the run its open sub-workflow step started, at any
77
+ * depth; 0 for none.
78
+ */
79
+ const agentsHeld = (run: string, newest: ReadonlyMap<string, NewestStepRecord>, claimed: ReadonlyMap<string, number>, depth = 0): number => {
80
+ const own = claimed.get(run);
81
+ if (own !== undefined) return own;
82
+ const r = newest.get(run);
83
+ return r === undefined || r.ended !== null || r.childRun === undefined || r.childRun === null || depth > 8 ? 0 : agentsHeld(r.childRun, newest, claimed, depth + 1);
84
+ };
85
+
86
+ /**
87
+ * What a run whose newest record is `r` is doing (`RunDoing`), once it holds no agent. A sub-workflow step's record is read
88
+ * through to the run it started: a run inside a sub-workflow's step read as in that step, on the page of the workflow above.
89
+ */
90
+ const doingOf = (r: NewestStepRecord, newest: ReadonlyMap<string, NewestStepRecord>, depth = 0): RunDoing => {
91
+ if (r.ended !== null) return { kind: 'between steps' };
92
+ const under = r.childRun === undefined || r.childRun === null || depth > 8 ? undefined : newest.get(r.childRun);
93
+ if (under !== undefined) return doingOf(under, newest, depth + 1);
94
+ return r.waiting === null ? { kind: 'in a step', step: r.step } : { kind: 'waiting at a step', step: r.step };
95
+ };
96
+
97
+ /** Counts that do the same thing added together, in `RUN_DOING_ORDER`, a kind's steps in the order first counted. */
98
+ const addUpDoing = (counts: ReadonlyArray<RunsDoing>): ReadonlyArray<RunsDoing> => {
99
+ const keyOf = (d: RunDoing) => ('step' in d ? `${d.kind}\u0000${d.step}` : d.kind);
100
+ const added = new Map<string, RunsDoing>();
101
+ for (const c of counts) added.set(keyOf(c.doing), { doing: c.doing, runs: (added.get(keyOf(c.doing))?.runs ?? 0) + c.runs });
102
+ return [...added.values()].filter((c) => c.runs > 0).sort((a, b) => RUN_DOING_ORDER.indexOf(a.doing.kind) - RUN_DOING_ORDER.indexOf(b.doing.kind));
103
+ };
104
+
105
+ const workflowRunsNow = (d: Declared, runs: ReadonlyArray<string>, newest: ReadonlyMap<string, NewestStepRecord>, claimed: ReadonlyMap<string, number>): WorkflowRunsNow => {
55
106
  const records = runs.flatMap((run) => {
56
107
  const r = newest.get(run);
57
108
  return r === undefined ? [] : [r];
58
109
  });
59
- /**
60
- * Whether a run is on an agent now: its open step is an agent's and waits on none, or it is a sub-workflow step whose own
61
- * run is. A run inside a sub-workflow's agent step read as on no agent, on the page of the workflow above (2026-11-19).
62
- */
63
- const onAnAgent = (r: NewestStepRecord, depth = 0): boolean => {
64
- if (r.ended !== null) return false;
65
- if (r.agent === 1) return r.waiting === null;
66
- const under = r.childRun === undefined || r.childRun === null || depth > 8 ? undefined : newest.get(r.childRun);
67
- return under !== undefined && onAnAgent(under, depth + 1);
68
- };
110
+ const held = runs.map((run) => agentsHeld(run, newest, claimed));
111
+ const doing = addUpDoing([
112
+ ...runs.map((run, i): RunsDoing => {
113
+ const r = newest.get(run);
114
+ return { doing: held[i]! > 0 ? { kind: 'holding an agent' } : r === undefined ? { kind: 'not started' } : doingOf(r, newest), runs: 1 };
115
+ }),
116
+ ]);
69
117
  const declared = d.steps().map((s) => ({ name: s.name, agent: s.runs === 'agentic' }));
70
118
  const undeclared = [...new Set(records.map((r) => r.step))].filter((name) => !declared.some((s) => s.name === name))
71
119
  .map((name) => ({ name, agent: records.some((r) => r.step === name && r.agent === 1) }));
@@ -78,43 +126,63 @@ const workflowRunsNow = <Phase extends string>(d: Declared<Phase>, runs: Readonl
78
126
  waitingAfter: waiting.length,
79
127
  waitingSince: waiting.length === 0 ? null : Math.min(...waiting),
80
128
  waitingOn: on.find((r) => r.ended === null && r.waiting !== null)?.waiting ?? null,
81
- heldBySpendingLimit: on.filter((r) => r.ended === null && r.waiting !== null && isSpendingLimitWait(r.waiting)).length,
82
129
  };
83
130
  });
84
131
  return {
85
132
  workflow: d.name,
86
133
  runs: runs.length,
87
- // A run waiting at an agent step for a free agent (its record says what it waits on) is on no agent.
88
- onAgents: records.filter((r) => onAnAgent(r)).length,
134
+ doing,
135
+ onAgents: sum(held, (n) => n),
89
136
  notStarted: runs.length - records.length,
90
137
  steps,
91
138
  };
92
139
  };
93
140
 
94
141
  /**
95
- * Every phase in the project's order, each with every workflow that declares it, running or not. A run of a workflow no file
96
- * defines now still counts, under `undefinedPhase`.
142
+ * Every workflow, in the order declared, running or not, then each workflow no file defines now that a run is of: each run
143
+ * counted once, on its own workflow. One made of workflows has no runs of its own (`steps.ts` `isMadeOfWorkflows`): its runs
144
+ * and agents are its steps', added up, at every depth, and each of its step's rows is that workflow's runs.
97
145
  */
98
- export const runsNow = <Phase extends string>(input: {
99
- readonly phases: ReadonlyArray<Phase>;
100
- readonly undefinedPhase: Phase;
101
- readonly declared: ReadonlyArray<Declared<Phase>>;
146
+ export const runsNow = (input: {
147
+ readonly declared: ReadonlyArray<Declared>;
102
148
  readonly unfinished: ReadonlyArray<UnfinishedRun>;
103
149
  readonly newest: ReadonlyArray<NewestStepRecord>;
104
- }): ReadonlyArray<PhaseRunsNow<Phase>> => {
150
+ readonly claims: ReadonlyArray<Pick<AgentClaim, 'run' | 'agents'> & { readonly top?: { readonly run: string } }>;
151
+ }): ReadonlyArray<WorkflowRunsNow> => {
105
152
  const newest = new Map(input.newest.map((r) => [r.run, r]));
153
+ // Each claim counts for its own run and for the run at its top, which holds it for the work below it.
154
+ const claimed = new Map<string, number>();
155
+ for (const c of input.claims) {
156
+ claimed.set(c.run, (claimed.get(c.run) ?? 0) + c.agents);
157
+ if (c.top !== undefined && c.top.run !== c.run) claimed.set(c.top.run, (claimed.get(c.top.run) ?? 0) + c.agents);
158
+ }
106
159
  const names = new Set(input.declared.map((d) => d.name));
107
- const asAStep = new Set(input.declared.flatMap((d) => d.steps().flatMap((s) => (s.workflow === undefined ? [] : [s.workflow]))));
108
- const all: ReadonlyArray<Declared<Phase>> = [
160
+ const all: ReadonlyArray<Declared> = [
109
161
  ...input.declared,
110
- ...[...new Set(input.unfinished.map((u) => u.workflow))].filter((w) => !names.has(w)).map((name): Declared<Phase> => ({ name, phase: input.undefinedPhase, steps: () => [] })),
162
+ ...[...new Set(input.unfinished.map((u) => u.workflow))].filter((w) => !names.has(w)).map((name): Declared => ({ name, steps: () => [] })),
111
163
  ];
112
- return input.phases.map((phase): PhaseRunsNow<Phase> => {
113
- const workflows = all.filter((d) => d.phase === phase)
114
- .map((d) => workflowRunsNow(d, input.unfinished.filter((u) => u.workflow === d.name).map((u) => u.run), newest));
115
- // A phase's runs and agents are those of its workflows that start by themselves: a sub-workflow's run is part of the run
116
- // above it, which already counts once.
117
- const own = workflows.filter((w) => !asAStep.has(w.workflow));
118
- return { phase, runs: sum(own, (w) => w.runs), onAgents: sum(own, (w) => w.onAgents), workflows };
119
- });
164
+ const byName = new Map(all.map((d) => [d.name, d]));
165
+ const counted = new Map<string, WorkflowRunsNow>();
166
+ const runsOf = (d: Declared, depth = 0): WorkflowRunsNow => {
167
+ const known = counted.get(d.name);
168
+ if (known !== undefined) return known;
169
+ if (!isMadeOfWorkflows(d) || depth > 8) {
170
+ const own = workflowRunsNow(d, input.unfinished.filter((u) => u.workflow === d.name).map((u) => u.run), newest, claimed);
171
+ counted.set(d.name, own);
172
+ return own;
173
+ }
174
+ const under = d.steps().map((s) => ({ step: s.name, runs: s.workflow === undefined || byName.get(s.workflow) === undefined ? null : runsOf(byName.get(s.workflow)!, depth + 1) }));
175
+ const doing = addUpDoing(under.flatMap((u) => u.runs?.doing ?? []));
176
+ const made: WorkflowRunsNow = {
177
+ workflow: d.name,
178
+ runs: sum(under, (u) => u.runs?.runs ?? 0),
179
+ doing,
180
+ onAgents: sum(under, (u) => u.runs?.onAgents ?? 0),
181
+ notStarted: 0,
182
+ steps: under.map((u): StepRunsNow => ({ step: u.step, agent: false, inStep: u.runs?.runs ?? 0, waitingAfter: 0, waitingSince: null, waitingOn: null })),
183
+ };
184
+ counted.set(d.name, made);
185
+ return made;
186
+ };
187
+ return all.map((d) => runsOf(d));
120
188
  };
@@ -18,7 +18,10 @@ export interface GraphEdge {
18
18
  /** A workflow's declared graph with the window's runs on it, and the moves it does not declare. */
19
19
  export interface WorkflowGraph {
20
20
  readonly workflow: string;
21
- /** False until the workflow declares its graph: then `edges` is empty and a page says so. */
21
+ /**
22
+ * Whether the workflow declares its graph. One that declares none still has one: its steps in the order it declares
23
+ * them, from the run's start to its end (`inOrder`), each such edge with no condition of its own.
24
+ */
22
25
  readonly declared: boolean;
23
26
  readonly steps: ReadonlyArray<{ readonly name: string; readonly runs: StepRuns | null; readonly description: string; readonly workflow: string | null }>;
24
27
  readonly edges: ReadonlyArray<GraphEdge>;
@@ -32,6 +35,12 @@ interface Declared {
32
35
  readonly graph?: (() => ReadonlyArray<StepEdge>) | undefined;
33
36
  }
34
37
 
38
+ /** The graph of a workflow that declares none: the run's start, each step in the order declared, the run's end. Pure. */
39
+ export const inOrder = (steps: ReadonlyArray<{ readonly name: string }>): ReadonlyArray<StepEdge> => {
40
+ const names = [RUN_STARTS, ...steps.map((s) => s.name), RUN_ENDS];
41
+ return names.slice(1).map((to, i) => ({ from: names[i]!, to, when: '' }));
42
+ };
43
+
35
44
  export const workflowGraphs = (input: {
36
45
  readonly declared: ReadonlyArray<Declared>;
37
46
  readonly taken: ReadonlyArray<StepEdgeTaken>;
@@ -40,7 +49,7 @@ export const workflowGraphs = (input: {
40
49
  readonly going: ReadonlySet<string>;
41
50
  }): ReadonlyArray<WorkflowGraph> =>
42
51
  input.declared.map((d) => {
43
- const graph = d.graph?.() ?? [];
52
+ const graph = d.graph?.() ?? inOrder(d.steps());
44
53
  const runs = new Map(graph.map((e) => [`${e.from}\u0000${e.to}`, 0]));
45
54
  const undeclared = new Map<string, { from: string; to: string; runs: number }>();
46
55
  const count = (from: string, failed: boolean, to: string, n: number) => {
@@ -11,8 +11,16 @@
11
11
  * Built from the declarations and the stores alone, so any project's workflows read the same; a project adds its own
12
12
  * panels beside it. Where its runs are now (`runs-now.ts`) is read at each request too.
13
13
  */
14
- import { stepKindOf, stepUsesAnAgent, type SourceRef, type StepDeclaration, type StepKind, type StepRuns, type WorkflowDeclaration } from '../steps';
15
- import { pipelinePlaces, workflowFlows, type PipelinePlace, type WorkflowFlow } from './workflow-flows';
14
+ import { isMadeOfWorkflows, startedAsSteps, stepKindOf, stepUsesAnAgent, tasksAreRuns, type SourceRef, type StepDeclaration, type StepKind, type StepRuns, type WorkflowDeclaration } from '../steps';
15
+ import { appSetting, stepSetting, storedAt, workflowSetting, type Effective, type InheritedSettings, type SettingLevel, type SettingName, type SettingsTree, type SettingValues, type StoredSetting } from '../settings';
16
+
17
+ /** How long records are kept and the fewest runs kept however old, each with where it is set (`settings.ts`). */
18
+ export interface RetentionSettings {
19
+ readonly days: Effective<number>;
20
+ readonly atLeastRuns: Effective<number>;
21
+ /** Whether a value of each is set at this level while the app runs, so a page can put it back to the code's. */
22
+ readonly storedHere: { readonly days: boolean; readonly atLeastRuns: boolean };
23
+ }
16
24
 
17
25
  /** A definition's link: its file and text, and the line that text is on now; none when the text is no longer in the file. */
18
26
  export interface SourceLink extends SourceRef {
@@ -38,7 +46,13 @@ export type StartsOn =
38
46
  | { readonly kind: 'inputs'; readonly says: string }
39
47
  | { readonly kind: 'timer or request' }
40
48
  /** It runs only as a step of the workflows named (`defineSubWorkflow`). */
41
- | { readonly kind: 'a step'; readonly of: ReadonlyArray<string> };
49
+ | { readonly kind: 'a step'; readonly of: ReadonlyArray<string> }
50
+ /** Its steps are workflows on their own triggers (`steps.ts` `isMadeOfWorkflows`): it has no runs of its own. */
51
+ | {
52
+ readonly kind: 'its steps';
53
+ /** The workflow of the step that does its main work (`WorkflowDeclaration.mainStep`), whose tasks its box shows; none where it names none. */
54
+ readonly mainStep: string | null;
55
+ };
42
56
 
43
57
  /** How long the queues' history reaches back. */
44
58
  export const QUEUE_HISTORY_DAYS = 7;
@@ -161,11 +175,15 @@ export interface StepSummary {
161
175
  readonly description: string;
162
176
  /** For a sub-workflow: the workflow it runs, by name; none for any other kind. */
163
177
  readonly workflow: string | null;
178
+ /** How many days its records are kept, and where that is set (`settings.ts`); for a sub-workflow, its workflow's. */
179
+ readonly retention: RetentionSettings;
180
+ /** The model it runs on, and where that is set; for a sub-workflow, its workflow's; none for a step that uses no agent. */
181
+ readonly model: Effective<string | null> | null;
164
182
  }
165
183
 
166
184
  /**
167
- * THE TOP OF A PROJECT IS ONE WORKFLOW (Alex, 2026-11-19: "decompiling an entire game is in itself a workflow"): what a page
168
- * enters at. Its steps are sub-workflows, and each opens that workflow's own view.
185
+ * THE TOP OF A PROJECT IS ONE WORKFLOW, declared like any other (Alex, 2026-11-19: "decompiling an entire game is in itself
186
+ * a workflow"): what a page enters at. Its steps are workflows, and each opens that workflow's own view.
169
187
  */
170
188
  export interface TopWorkflowView {
171
189
  readonly name: string;
@@ -178,7 +196,6 @@ export interface WorkflowView {
178
196
  readonly name: string;
179
197
  /** Its own steps, in order, each with its kind. */
180
198
  readonly steps: ReadonlyArray<StepSummary>;
181
- readonly phase: string;
182
199
  readonly description: string;
183
200
  readonly source: SourceLink;
184
201
  /** Its word for one item, none where it works on no single item. */
@@ -190,18 +207,20 @@ export interface WorkflowView {
190
207
  * and, for a workflow its budget keeps going, how many of its runs may be in an agent step at once (`agents`, none for
191
208
  * any other). None where no store is read.
192
209
  */
193
- readonly limits: { readonly agents: number | null; readonly runs: number | null; readonly runsSet: boolean } | null;
194
- /** Its tasks by status, as last counted (`queue-counts.ts`); none for a workflow with no item. */
210
+ readonly limits: { readonly agents: number | null; readonly runs: number | null; readonly runsSet: boolean; readonly agentsSet: boolean } | null;
211
+ /** Its tasks by status, as last counted (`queue-counts.ts`); none for a workflow with no item whose tasks are not its runs (`steps.ts` `tasksAreRuns`). */
195
212
  readonly queue: Readonly<Record<TaskStatus, number>> | null;
196
213
  /**
197
214
  * How many of its queued tasks are marked as needing an agent, as last counted (`queue-counts.ts`, `QUEUED_NEEDING_AN_AGENT`);
198
215
  * none for a workflow with no item or no agent step, where no task can be marked.
199
216
  */
200
217
  readonly queuedNeedingAnAgent: number | null;
201
- /** Its place among the project's workflows: what the map lays it out by (`workflow-flows.ts`). */
202
- readonly place: PipelinePlace;
203
218
  /** What starts its runs. */
204
219
  readonly startsOn: StartsOn;
220
+ /** Whether it is one of the platform's own workflows (`system-workflows.ts`): its settings are the app's, its steps the platform's. */
221
+ readonly system: boolean;
222
+ /** Its own retention settings, as every step under it that sets none inherits them. */
223
+ readonly retention: RetentionSettings;
205
224
  }
206
225
 
207
226
  /** Every workflow, read at the request: nothing here is stored for the page. */
@@ -209,13 +228,18 @@ export interface WorkflowsView {
209
228
  /** When it was read, unix seconds. */
210
229
  readonly at: number;
211
230
  readonly top: TopWorkflowView;
212
- readonly groups: ReadonlyArray<{ readonly phase: string; readonly workflows: ReadonlyArray<WorkflowView> }>;
231
+ /** The app's other workflows no workflow has as a step, by name: each is a top of its own, beside the project's. */
232
+ readonly outermost: ReadonlyArray<string>;
233
+ /** The platform's own workflows, by name (`system-workflows.ts`): each a top of its own, shown apart from the app's. */
234
+ readonly system: ReadonlyArray<string>;
235
+ /** Every workflow, in the order defined: the top's steps and theirs, at every depth, each one view. */
236
+ readonly workflows: ReadonlyArray<WorkflowView>;
213
237
  /** Each queue's counts by status over the last `QUEUE_HISTORY_DAYS` (`historyByStatus`), a row where one changed, oldest first. */
214
238
  readonly queueHistory: ReadonlyArray<QueueCount>;
215
- /** Where work goes between the top workflow's steps: the map's arrows (`workflow-flows.ts`). */
216
- readonly flows: ReadonlyArray<WorkflowFlow>;
217
239
  /** The spending limit against the newest reading of the week (`spending-limit.ts`); none for a project that reads no week. */
218
240
  readonly spending: SpendingLimitState | null;
241
+ /** The app's retention settings, above every workflow (`settings.ts`). */
242
+ readonly appRetention: RetentionSettings;
219
243
  }
220
244
 
221
245
  /** One workflow's figures over a window, read from its own records when it is opened. */
@@ -241,6 +265,12 @@ export interface WorkflowFigures {
241
265
  * Pick passes over them now because no agent can be had, with why in words; none while one can.
242
266
  */
243
267
  readonly needingAnAgent: { readonly reasons: ReadonlyArray<BlockedReason>; readonly passedOverBecause: string | null };
268
+ /**
269
+ * FOR A WORKFLOW A RUN OF ANOTHER STARTS AS A STEP (`defineSubWorkflow`), THE TASKS OF EACH SUCH WORKFLOW PASSING THROUGH
270
+ * IT: that workflow's calls of the step in the window, from its own step records, each on its item (`StepCost`); none where
271
+ * the step was not called. Its tasks are those, counted once, under their own workflow. Empty for any other workflow.
272
+ */
273
+ readonly passingThrough: ReadonlyArray<{ readonly workflow: string; readonly step: string; readonly cost: StepCost | null }>;
244
274
  }
245
275
 
246
276
  const NO_COST: StepCost = { calls: 0, failed: 0, open: 0, seconds: 0, inputTokens: 0, outputTokens: 0, cpuSeconds: 0, compiles: 0, items: 0 };
@@ -265,7 +295,7 @@ export const costOf = (rows: ReadonlyArray<StepRunRow>): StepCost | null =>
265
295
  items: new Set(rows.flatMap((r) => (r.subject === null ? [] : [r.subject.toLowerCase()]))).size,
266
296
  };
267
297
 
268
- type Declared = Pick<WorkflowDeclaration<string, unknown>, 'name' | 'phase' | 'description' | 'source' | 'item' | 'finishedWord' | 'graph' | 'fedBy' | 'pending' | 'items' | 'inputs'> & {
298
+ type Declared = Pick<WorkflowDeclaration<unknown>, 'name' | 'description' | 'source' | 'item' | 'finishedWord' | 'graph' | 'fedBy' | 'mainStep' | 'pending' | 'items' | 'inputs' | 'retentionDays' | 'model' | 'system'> & {
269
299
  readonly steps: () => ReadonlyArray<StepDeclaration>;
270
300
  };
271
301
 
@@ -332,53 +362,61 @@ export const queuesNow = (history: ReadonlyArray<QueueCount>): ReadonlyMap<strin
332
362
  */
333
363
  export const buildWorkflowsView = (input: {
334
364
  readonly declared: ReadonlyArray<Declared>;
335
- /** The project's phases, in the order its page shows them; a workflow of another phase follows them. */
336
- readonly phases: ReadonlyArray<string>;
365
+ /** What the app sets above every workflow (`WorkflowProject.settings`). */
366
+ readonly app: InheritedSettings;
367
+ /** The retention settings set while the app runs (`LimitStore.storedSettings`). */
368
+ readonly stored: ReadonlyArray<StoredSetting>;
337
369
  readonly now: number;
338
370
  /** The queues' history, from the task store. */
339
- readonly taskStore: Pick<TaskStore, 'queueCountsSince' | 'returnedBetween' | 'listedWaits'>;
371
+ readonly taskStore: Pick<TaskStore, 'queueCountsSince'>;
340
372
  /** The line a definition's text is on now. */
341
373
  readonly locate: (source: SourceRef) => number | null;
342
374
  readonly limitsOf: (workflow: string) => WorkflowView['limits'];
343
- /** The project's top workflow, in its own words, until it declares one. */
344
- readonly top: { readonly name: string; readonly description: string };
375
+ /** The project's top workflow, by name: the workflow a page enters at. */
376
+ readonly top: string;
345
377
  readonly spending: SpendingLimitState | null;
346
378
  }): Effect.Effect<WorkflowsView, StorageError> => Effect.gen(function* () {
347
- const stepSummary = (s: StepDeclaration): StepSummary => ({ name: s.name, kind: stepKindOf(s), runs: s.runs, description: s.description, workflow: s.workflow ?? null });
348
- // Until the project declares its top workflow, its steps are every workflow no other workflow uses as a step.
349
- const usedAsAStep = new Set(input.declared.flatMap((d) => d.steps().flatMap((s) => (s.workflow === undefined ? [] : [s.workflow]))));
350
- const phases = [...input.phases, ...[...new Set(input.declared.map((d) => d.phase))].filter((p) => !input.phases.includes(p))];
379
+ // A step's settings as its workflow `of` holds it; a sub-workflow's are what its workflow's own steps inherit.
380
+ const tree: SettingsTree = { declared: input.declared, app: input.app, stored: input.stored };
381
+ const storedHere = (level: SettingLevel): RetentionSettings['storedHere'] => ({ days: storedAt(input.stored, level, 'retentionDays') !== null, atLeastRuns: storedAt(input.stored, level, 'keepAtLeastRuns') !== null });
382
+ const settingOf = <N extends SettingName>(of: string, s: StepDeclaration, name: N): Effective<SettingValues[N]> =>
383
+ (s.workflow === undefined ? stepSetting(tree, { workflow: of, step: s.name, name }) : workflowSetting(tree, { workflow: s.workflow, name }));
384
+ const stepSummary = (of: string) => (s: StepDeclaration): StepSummary => ({
385
+ name: s.name, kind: stepKindOf(s), runs: s.runs, description: s.description, workflow: s.workflow ?? null,
386
+ retention: { days: settingOf(of, s, 'retentionDays'), atLeastRuns: settingOf(of, s, 'keepAtLeastRuns'), storedHere: storedHere({ kind: 'step', workflow: of, step: s.name }) },
387
+ model: stepUsesAnAgent(s) ? settingOf(of, s, 'model') : null,
388
+ });
389
+ // A workflow a run of another starts as a step has no runs or limits of its own; one on its own trigger has both.
390
+ const usedAsAStep = startedAsSteps(input.declared);
391
+ const anyStep = new Set(input.declared.flatMap((d) => d.steps().flatMap((s) => (s.workflow === undefined ? [] : [s.workflow]))));
351
392
  const recordedCounts = yield* input.taskStore.queueCountsSince(input.now - QUEUE_HISTORY_DAYS * 86_400);
352
393
  const queueHistory = historyByStatus(recordedCounts);
353
394
  const queues = queuesNow(queueHistory);
354
395
  const needingAnAgent = queuedNeedingAnAgentNow(recordedCounts);
355
- // The map is of the top workflow's steps: a workflow used as a step of another is drawn inside that one, not here.
356
- const onTheMap = input.declared.filter((d) => !usedAsAStep.has(d.name));
357
- const flows = workflowFlows({ declared: onTheMap, returned: yield* input.taskStore.returnedBetween(), waits: yield* input.taskStore.listedWaits() });
358
- const places = new Map(pipelinePlaces({ workflows: input.declared.map((d) => ({ name: d.name, stage: d.phase })), stages: phases, flows }).map((p) => [p.workflow, p]));
359
396
  const workflowView = (d: Declared): WorkflowView => ({
360
- name: d.name, steps: d.steps().map(stepSummary),
361
- phase: d.phase, description: d.description, source: { ...d.source, line: input.locate(d.source) }, item: d.item, finishedWord: d.finishedWord,
397
+ name: d.name, steps: d.steps().map(stepSummary(d.name)),
398
+ description: d.description, source: { ...d.source, line: input.locate(d.source) }, item: d.item, finishedWord: d.finishedWord,
362
399
  usesAgents: d.steps().some(stepUsesAnAgent),
363
400
  // A workflow used as a step has no limit of its own to show: its starts are its parent's steps (`defineSubWorkflow`).
364
- limits: usedAsAStep.has(d.name) ? null : input.limitsOf(d.name),
365
- place: places.get(d.name)!,
366
- queue: d.item === null ? null : queues.get(d.name) ?? noTasks(),
401
+ limits: usedAsAStep.has(d.name) || isMadeOfWorkflows(d) ? null : input.limitsOf(d.name),
402
+ // A workflow with no item has tasks where they are its runs (`steps.ts` `tasksAreRuns`): counted from its first run on.
403
+ queue: d.item === null && !tasksAreRuns(d, input.declared) ? null : queues.get(d.name) ?? noTasks(),
367
404
  queuedNeedingAnAgent: d.item === null || !d.steps().some(stepUsesAnAgent) ? null : needingAnAgent.get(d.name) ?? 0,
368
405
  startsOn: usedAsAStep.has(d.name) ? { kind: 'a step', of: input.declared.filter((p) => p.steps().some((s) => s.workflow === d.name)).map((p) => p.name) }
406
+ : isMadeOfWorkflows(d) ? { kind: 'its steps', mainStep: d.steps().find((s) => s.name === d.mainStep)?.workflow ?? null }
369
407
  : d.pending !== undefined || d.items !== undefined ? { kind: 'queue' } : d.inputs !== undefined ? { kind: 'inputs', says: d.inputs.says } : { kind: 'timer or request' },
408
+ system: d.system === true,
409
+ retention: { days: workflowSetting(tree, { workflow: d.name, name: 'retentionDays' }), atLeastRuns: workflowSetting(tree, { workflow: d.name, name: 'keepAtLeastRuns' }), storedHere: storedHere({ kind: 'workflow', workflow: d.name }) },
370
410
  });
371
- const inPageOrder = phases.flatMap((phase) => input.declared.filter((d) => d.phase === phase));
372
411
  return {
373
412
  at: input.now,
374
- top: {
375
- ...input.top,
376
- steps: inPageOrder.filter((d) => !usedAsAStep.has(d.name)).map((d): StepSummary => ({ name: d.name, kind: 'sub-workflow', runs: null, description: d.description, workflow: d.name })),
377
- },
378
- groups: phases.map((phase) => ({ phase, workflows: input.declared.filter((d) => d.phase === phase).map(workflowView) })).filter((g) => g.workflows.length > 0),
413
+ top: ((top) => ({ name: input.top, description: top?.description ?? `${input.top} is not declared`, steps: top?.steps().map(stepSummary(input.top)) ?? [] }))(input.declared.find((d) => d.name === input.top)),
414
+ outermost: input.declared.filter((d) => d.name !== input.top && !anyStep.has(d.name) && d.system !== true).map((d) => d.name),
415
+ system: input.declared.filter((d) => d.system === true).map((d) => d.name),
416
+ workflows: input.declared.map(workflowView),
379
417
  queueHistory,
380
- flows,
381
418
  spending: input.spending,
419
+ appRetention: { days: appSetting(tree, 'retentionDays'), atLeastRuns: appSetting(tree, 'keepAtLeastRuns'), storedHere: storedHere({ kind: 'app' }) },
382
420
  };
383
421
  });
384
422
 
@@ -397,6 +435,8 @@ export const buildWorkflowFigures = (input: {
397
435
  readonly reasons: Effect.Effect<Pick<WorkflowFigures, 'blocked' | 'needingAnAgent'>, StorageError>;
398
436
  /** The line a definition's text is on now. */
399
437
  readonly locate: (source: SourceRef) => number | null;
438
+ /** The workflows whose runs start it as a step, and that step's name in each (`WorkflowFigures.passingThrough`). */
439
+ readonly asAStepOf?: ReadonlyArray<{ readonly workflow: string; readonly step: string }>;
400
440
  }): Effect.Effect<WorkflowFigures, StorageError> => Effect.gen(function* () {
401
441
  const d = input.declaration;
402
442
  const since = input.now - input.hours * 3600;
@@ -432,6 +472,7 @@ export const buildWorkflowFigures = (input: {
432
472
  funnel,
433
473
  runCosts: runCostsOf(runCosts),
434
474
  ...(yield* input.reasons),
475
+ passingThrough: yield* Effect.forEach(input.asAStepOf ?? [], (p) => Effect.map(input.records.stepRunsSince(since, p.workflow), (rows) => ({ ...p, cost: costOf(rows.filter((r) => r.step === p.step)) }))),
435
476
  yields: {
436
477
  now: yieldOf({ runs: funnel.runs, finished: finished(finishedNow), tokens: costNow.inputTokens + costNow.outputTokens, compiles: costNow.compiles }),
437
478
  before: yieldOf({
@@ -0,0 +1,89 @@
1
+ /**
2
+ * STEPS THAT FEED NO OTHER STEP ARE DRAWN IN A GRID, their lines said once in words. Upkeep's 28 steps, 26 of them on their
3
+ * own trigger, were one row 6,146 px wide with 54 lines that all said "on its own trigger" or "what it finishes leaves
4
+ * here" (decided as the default in effect, 2026-11-24, while Alex had not yet answered the choice between a grid and one row).
5
+ *
6
+ * 1. Two or more such steps whose lines read the same go in a grid; the steps that feed each other keep their lines.
7
+ * 2. A step on its own, and steps whose lines read differently, keep their lines.
8
+ * 3. The page draws the grid with the sentence and every grid step's box, and lays out only what is left.
9
+ */
10
+ import { expect, test } from 'bun:test';
11
+ import { renderToStaticMarkup } from 'react-dom/server';
12
+ import { RUN_ENDS, RUN_STARTS } from './graph';
13
+ import { layOut, standAloneSteps, standAloneWords, WorkflowDag } from './dashboard/workflow-dag';
14
+ import type { WorkflowGraph } from './views/step-graph';
15
+
16
+ const step = (name: string) => ({ name, runs: null, description: '', workflow: null });
17
+ const edge = (from: string, to: string, when: string, runs = 0) => ({ from, to, when, runs });
18
+ const onItsOwn = (name: string) => [edge(RUN_STARTS, name, 'on its own trigger'), edge(name, RUN_ENDS, 'what it finishes leaves here')];
19
+ const graphOf = (input: { readonly steps: ReadonlyArray<string>; readonly edges: WorkflowGraph['edges'] }): WorkflowGraph =>
20
+ ({ workflow: 'Upkeep', declared: true, steps: input.steps.map(step), edges: input.edges, undeclared: [] });
21
+
22
+ /** Upkeep's shape: Full byte check feeds Compiler host, and every other step is on its own trigger. */
23
+ const upkeep = graphOf({
24
+ steps: ['Closability', 'Full byte check', 'Compiler host', 'Prune logs', 'Reaper'],
25
+ edges: [
26
+ edge(RUN_STARTS, 'Closability', 'on its own trigger'), edge(RUN_STARTS, 'Full byte check', 'on its own trigger'),
27
+ edge(RUN_STARTS, 'Prune logs', 'on its own trigger'), edge(RUN_STARTS, 'Reaper', 'on its own trigger'),
28
+ edge('Full byte check', 'Compiler host', "its results become Compiler host's tasks"),
29
+ edge('Closability', RUN_ENDS, 'what it finishes leaves here'), edge('Compiler host', RUN_ENDS, 'what it finishes leaves here'),
30
+ edge('Prune logs', RUN_ENDS, 'what it finishes leaves here'), edge('Reaper', RUN_ENDS, 'what it finishes leaves here'),
31
+ ],
32
+ });
33
+
34
+ test('1. steps on their own trigger go in one grid; the two that feed each other keep their three lines', () => {
35
+ const { grids, drawn } = standAloneSteps(upkeep);
36
+ expect({
37
+ grids: grids.map((g) => g.steps),
38
+ drawnSteps: drawn.steps.map((s) => s.name),
39
+ drawnEdges: drawn.edges.map((e) => `${e.from} > ${e.to}`),
40
+ words: grids.map(standAloneWords),
41
+ }).toEqual({
42
+ grids: [['Closability', 'Prune logs', 'Reaper']],
43
+ drawnSteps: ['Full byte check', 'Compiler host'],
44
+ drawnEdges: [`${RUN_STARTS} > Full byte check`, 'Full byte check > Compiler host', `Compiler host > ${RUN_ENDS}`],
45
+ words: ["These 3 steps feed no other step and no step feeds them, so they are drawn without lines. Into each from the run's start: on its own trigger. Out of each to the run's end: what it finishes leaves here."],
46
+ });
47
+ });
48
+
49
+ test.each([
50
+ { name: 'a workflow of one step, in its declared order', graph: graphOf({ steps: ['Pick a page'], edges: [edge(RUN_STARTS, 'Pick a page', ''), edge('Pick a page', RUN_ENDS, '')] }) },
51
+ {
52
+ name: "two steps each with its own condition (Repair names')",
53
+ graph: graphOf({
54
+ steps: ['Rename', 'Book names'],
55
+ edges: [
56
+ edge(RUN_STARTS, 'Rename', 'a failed proof waits for the repair'), edge(RUN_STARTS, 'Book names', 'no failed proof waits', 73),
57
+ edge('Rename', RUN_ENDS, 'always'), edge('Book names', RUN_ENDS, 'always', 73),
58
+ ],
59
+ }),
60
+ },
61
+ {
62
+ name: 'two steps with the same condition but different runs taken',
63
+ graph: graphOf({ steps: ['A', 'B'], edges: [edge(RUN_STARTS, 'A', 'always', 2), edge(RUN_STARTS, 'B', 'always'), edge('A', RUN_ENDS, 'always', 2), edge('B', RUN_ENDS, 'always')] }),
64
+ },
65
+ { name: 'a chain', graph: graphOf({ steps: ['A', 'B'], edges: [edge(RUN_STARTS, 'A', ''), edge('A', 'B', ''), edge('B', RUN_ENDS, '')] }) },
66
+ ])('2. $name keeps every line', ({ graph }) => {
67
+ const { grids, drawn } = standAloneSteps(graph);
68
+ expect({ grids: grids.length, drawn }).toEqual({ grids: 0, drawn: { steps: graph.steps, edges: graph.edges } });
69
+ });
70
+
71
+ test('3. the page draws every grid step\'s box under the sentence, and lays out only the rest', async () => {
72
+ const box = (name: string) => ({ href: `/Upkeep/${name}`, title: name, body: <p>{`body of ${name}`}</p> });
73
+ const html = renderToStaticMarkup(<WorkflowDag graph={upkeep} box={box} />);
74
+ const grid = html.slice(html.indexOf('data-stand-alone-steps'));
75
+ expect({
76
+ sentence: grid.includes('These 3 steps feed no other step'),
77
+ inGrid: [...grid.matchAll(/data-step="([^"]*)"/g)].map((m) => m[1]),
78
+ bodies: ['Closability', 'Prune logs', 'Reaper'].every((n) => grid.includes(`body of ${n}`) && grid.includes(`href="/Upkeep/${n}"`)),
79
+ }).toEqual({ sentence: true, inGrid: ['Closability', 'Prune logs', 'Reaper'], bodies: true });
80
+ const laid = await layOut({ graph: standAloneSteps(upkeep).drawn, heightOf: () => 80 });
81
+ expect({ boxes: [...laid.boxes.keys()], lines: laid.edges.length }).toEqual({ boxes: [RUN_STARTS, 'Full byte check', 'Compiler host', RUN_ENDS], lines: 3 });
82
+ });
83
+
84
+ test('3b. a workflow whose every step is on its own trigger has only the grid, no frame and no run start or end box', () => {
85
+ const all = graphOf({ steps: ['Byte coverage', 'Decompile', 'Bank closest trials'], edges: ['Byte coverage', 'Decompile', 'Bank closest trials'].flatMap(onItsOwn) });
86
+ const html = renderToStaticMarkup(<WorkflowDag graph={all} box={(name) => ({ href: null, title: name, body: null })} />);
87
+ expect({ frame: html.includes('wp-dag-scroll'), ends: html.includes(RUN_STARTS) || html.includes(RUN_ENDS), steps: [...html.matchAll(/data-step="([^"]*)"/g)].map((m) => m[1]) })
88
+ .toEqual({ frame: false, ends: false, steps: ['Byte coverage', 'Decompile', 'Bank closest trials'] });
89
+ });