@regressionbot/sdk 2.3.0 → 2.5.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.
- package/README.md +74 -5
- package/dist/cli.js +2 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/types.d.ts +117 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ Unlike traditional visual diffing libraries, RegressionBot is designed for moder
|
|
|
25
25
|
- **Auto-Discovery**: Scan sitemaps with glob patterns and limits.
|
|
26
26
|
- **RegressionBot Summaries**: Plain-English change descriptions for every regression, generated on-demand via the API.
|
|
27
27
|
- **Intent-Aware Verdicts**: Describe what a run is meant to change, and every regression comes back judged as intentional, a bug, or noise.
|
|
28
|
-
- **Scheduled Checks**: Run a saved project unattended,
|
|
28
|
+
- **Scheduled Checks**: Run a saved project unattended, daily or weekly — and at a set UTC hour.
|
|
29
29
|
- **Project-Based Baselines**: Save and reuse test configurations; share visual history across environments.
|
|
30
30
|
- **Auto-Approval**: Automatically promote screenshots to baselines on jobs that pass your criteria.
|
|
31
31
|
- **Zero Infrastructure**: No browser maintenance or server provisioning — RegressionBot handles it all.
|
|
@@ -74,6 +74,36 @@ the builder, intent-aware verdicts, environment gates, baseline policies, and
|
|
|
74
74
|
scheduling. `scheduleHourUtc` needs API 2.7.0 or later — on an older API the
|
|
75
75
|
field is accepted and ignored, and the schedule stays anchored to its first run.
|
|
76
76
|
|
|
77
|
+
### 2.5.0
|
|
78
|
+
|
|
79
|
+
- **`updateProject()` now returns `baselinesInvalidated`.** The API has always sent it
|
|
80
|
+
back alongside the updated project; the 2.0 unwrap kept the project and dropped it, so
|
|
81
|
+
a caller had to re-derive whether a patch invalidated baselines from which fields they
|
|
82
|
+
sent. Read it directly instead — true only when this patch discarded baselines that
|
|
83
|
+
existed, never on a create.
|
|
84
|
+
|
|
85
|
+
### 2.4.0
|
|
86
|
+
|
|
87
|
+
Needs API 2.9.0 or later. On an older API the new fields are simply absent.
|
|
88
|
+
|
|
89
|
+
- **`'hourly'` is gone from `ProjectSchedule`.** The API stopped accepting it on
|
|
90
|
+
2026-08-20 and rejects it outright, so code that sends it already fails at runtime;
|
|
91
|
+
now it fails at compile time instead. Use `'daily'` (with `scheduleHourUtc`) or
|
|
92
|
+
`'weekly'`. Kept as a minor release because no working call can depend on it.
|
|
93
|
+
- **Environment labels.** `environment` and `baseEnvironment` on a project
|
|
94
|
+
(`updateProject`, `getProject`) and on each run's status and summary, so a run reads
|
|
95
|
+
"staging vs production" instead of a bare URL. A label only: never resets baselines.
|
|
96
|
+
- **A standing `intent` on a project**, which scheduled runs are judged against.
|
|
97
|
+
- **`runSummary`** on the job summary: a short AI reading of the whole run.
|
|
98
|
+
- **`changeGroup`** on each regression (`structural`, `edited`, `metadata`,
|
|
99
|
+
`cosmetic`), the same grouping the digest email uses.
|
|
100
|
+
- **New change detail:** `attribute-edit` and `font-failed` change types, and `label`,
|
|
101
|
+
`attributes` and `valueOnly` on a change.
|
|
102
|
+
- **`project`, `origin`, `baseOrigin`, `totalUrls` and `completedCount`** on the job status.
|
|
103
|
+
- **Deprecated:** `visualMatchScore`, `overallScore`, `domAssistSkipReason`,
|
|
104
|
+
`elementsChanged` and a summary item's `verdict`. All still typed; none measure what
|
|
105
|
+
their names say under the DOM engine.
|
|
106
|
+
|
|
77
107
|
### 2.3.0
|
|
78
108
|
|
|
79
109
|
Needs API 2.9.0 or later. On an older API the verdict fields are simply absent, with
|
|
@@ -290,6 +320,16 @@ Two things to know before you rely on it:
|
|
|
290
320
|
- **`changes` absent is not "nothing changed".** It means the document comparison could not
|
|
291
321
|
run on that page — check `domAssistSkipReason`.
|
|
292
322
|
|
|
323
|
+
Each change also carries a `type` beyond the ones above — `attribute-edit` for a reader-facing
|
|
324
|
+
attribute (`href`, `alt`, `aria-label`, …; see `c.attributes`) and `font-failed` for a web font
|
|
325
|
+
that didn't load. A change with no words of its own (`style-only`, `attribute-edit`,
|
|
326
|
+
`image-change`) may carry a short `label` naming the element instead, and a date-only edit
|
|
327
|
+
("Sep 17" → "Sep 23") is reported with `valueOnly: 'date'` without counting as a change.
|
|
328
|
+
|
|
329
|
+
Every regression also carries a `changeGroup` — `structural`, `edited`, `metadata`,
|
|
330
|
+
`cosmetic`, or (on older results) `unmeasured`/`date` — the same grouping the digest email
|
|
331
|
+
uses, so you can filter a run down to one kind of change without re-deriving the rule.
|
|
332
|
+
|
|
293
333
|
`box` gives you the location in the capture, in CSS pixels from the top-left of the
|
|
294
334
|
full-page image, so it indexes straight into `currentUrl` if you want to crop:
|
|
295
335
|
|
|
@@ -477,7 +517,7 @@ combination. Live-vs-live projects store no baseline and are exempt.
|
|
|
477
517
|
// Turn on a daily unattended check
|
|
478
518
|
await rb.updateProject('marketing-site-v2', {
|
|
479
519
|
baselinePolicy: 'rolling',
|
|
480
|
-
schedule: 'daily', // '
|
|
520
|
+
schedule: 'daily', // 'daily' | 'weekly'
|
|
481
521
|
});
|
|
482
522
|
|
|
483
523
|
// Or pin it to a UTC hour — this one runs at 03:00 UTC every day
|
|
@@ -497,15 +537,44 @@ console.log(project.schedule, project.scheduleHourUtc, project.lastScheduledRunA
|
|
|
497
537
|
|
|
498
538
|
Without `scheduleHourUtc` the first run starts at the next hourly sweep and the cadence
|
|
499
539
|
anchors to it. With it, the first run waits for that hour as well. Hours only, since the
|
|
500
|
-
scheduler sweeps once an hour, and UTC only. It is rejected on
|
|
501
|
-
|
|
502
|
-
|
|
540
|
+
scheduler sweeps once an hour, and UTC only. It is rejected on a project with no schedule
|
|
541
|
+
to apply it to. Clearing the schedule clears the hour with it, and a missed slot waits
|
|
542
|
+
for the next one rather than catching up.
|
|
503
543
|
|
|
504
544
|
Setting a schedule, its hour, or a baseline policy does **not** invalidate
|
|
505
545
|
baselines — only changes that affect what a capture looks like (`testOrigin`,
|
|
506
546
|
`baseOrigin`, `sitemapUrl`, `paths`, `scans`, `devices`, `masks`, `customCss`) do that.
|
|
507
547
|
Billing is per comparison, so cost scales with frequency.
|
|
508
548
|
|
|
549
|
+
A scheduled run has no PR or commit to draw an intent from, so give the project a standing
|
|
550
|
+
`intent` instead — every scheduled run is judged against it:
|
|
551
|
+
|
|
552
|
+
```typescript
|
|
553
|
+
await rb.updateProject('marketing-site-v2', {
|
|
554
|
+
intent: 'Content is edited in the CMS daily; navigation, pricing and layout must not change.',
|
|
555
|
+
});
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
Without one, a scheduled run's `intentAssessment.decision` reads `not_judged`. Runs started
|
|
559
|
+
by a caller keep their own `runContext` and are never judged against the project's `intent`.
|
|
560
|
+
Pass `null` or an empty string to remove it. Does not invalidate baselines.
|
|
561
|
+
|
|
562
|
+
### Environment Labels
|
|
563
|
+
|
|
564
|
+
Label which environment a project's origins are — `environment` for `testOrigin`,
|
|
565
|
+
`baseEnvironment` for `baseOrigin` on a live-vs-live project — so runs, emails and the
|
|
566
|
+
dashboard read "staging vs production" instead of a bare URL:
|
|
567
|
+
|
|
568
|
+
```typescript
|
|
569
|
+
await rb.updateProject('marketing-site-v2', { environment: 'staging' });
|
|
570
|
+
|
|
571
|
+
const project = await rb.getProject('marketing-site-v2');
|
|
572
|
+
console.log(project.environment); // 'staging'
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
A label only: 1–24 letters, digits, spaces or hyphens, stored lower-case. It never resets
|
|
576
|
+
baselines and never changes a run. Pass `null` or an empty string to remove it.
|
|
577
|
+
|
|
509
578
|
### Reconnecting to an Existing Job
|
|
510
579
|
|
|
511
580
|
If you have a job ID from a previous run (e.g., stored in CI state), you can attach to it without re-running the test:
|
package/dist/cli.js
CHANGED
|
@@ -53,6 +53,8 @@ function formatSummary(items) {
|
|
|
53
53
|
}
|
|
54
54
|
function printRegression(r) {
|
|
55
55
|
console.log(`- ${r.url} [${r.variantName}] (Score: ${r.visualMatchScore.toFixed(2)})`);
|
|
56
|
+
if (r.changeGroup)
|
|
57
|
+
console.log(` Group: ${r.changeGroup}`);
|
|
56
58
|
if (r.diffUrl)
|
|
57
59
|
console.log(` Diff: ${r.diffUrl}`);
|
|
58
60
|
if (r.verdict) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { VRConfig, Viewport, Viewports, JobStatus, JobSummary, JobProgress, PageResult, ProjectConfig, ProjectPath, ProjectScan, JobAiSummary, RegionVerdict, ResultVerdict, VerdictDecision, RegressionbotSummaryItem, RunContext, IntentAssessment, BaselinePolicy, ProjectSchedule, ProjectConfigUpdate, EnvGate, SummaryStatus, ApproveResult, ApproveWhere, Change, ChangeType, StyleDelta, ChangeBox } from './types';
|
|
1
|
+
import { VRConfig, Viewport, Viewports, JobStatus, JobSummary, JobProgress, PageResult, ProjectConfig, ProjectPath, ProjectScan, JobAiSummary, RegionVerdict, ResultVerdict, VerdictDecision, RegressionbotSummaryItem, RunContext, IntentAssessment, BaselinePolicy, ProjectSchedule, ProjectConfigUpdate, ProjectUpdateResult, EnvGate, SummaryStatus, ApproveResult, ApproveWhere, Change, ChangeType, StyleDelta, ChangeBox } from './types';
|
|
2
2
|
import { sanitizeFilename, sanitizeUrlToPath } from './security';
|
|
3
3
|
export { sanitizeFilename, sanitizeUrlToPath, Viewports };
|
|
4
|
-
export type { PageResult, JobProgress, JobStatus, JobSummary, Viewport, VRConfig, ProjectConfig, ProjectPath, ProjectScan, JobAiSummary, RegionVerdict, ResultVerdict, VerdictDecision, RegressionbotSummaryItem, RunContext, IntentAssessment, BaselinePolicy, ProjectSchedule, ProjectConfigUpdate, EnvGate, SummaryStatus, ApproveResult, ApproveWhere, Change, ChangeType, StyleDelta, ChangeBox };
|
|
4
|
+
export type { PageResult, JobProgress, JobStatus, JobSummary, Viewport, VRConfig, ProjectConfig, ProjectPath, ProjectScan, JobAiSummary, RegionVerdict, ResultVerdict, VerdictDecision, RegressionbotSummaryItem, RunContext, IntentAssessment, BaselinePolicy, ProjectSchedule, ProjectConfigUpdate, ProjectUpdateResult, EnvGate, SummaryStatus, ApproveResult, ApproveWhere, Change, ChangeType, StyleDelta, ChangeBox };
|
|
5
5
|
export declare class RegressionBot {
|
|
6
6
|
private apiKey;
|
|
7
7
|
private apiUrl;
|
|
@@ -57,7 +57,7 @@ export declare class RegressionBot {
|
|
|
57
57
|
* Changing anything that decides what a capture looks like invalidates the
|
|
58
58
|
* stored baselines — see {@link ProjectConfigUpdate}.
|
|
59
59
|
*/
|
|
60
|
-
updateProject(projectName: string, config: ProjectConfigUpdate): Promise<
|
|
60
|
+
updateProject(projectName: string, config: ProjectConfigUpdate): Promise<ProjectUpdateResult>;
|
|
61
61
|
_request<T>(path: string, method?: string, body?: any): Promise<T>;
|
|
62
62
|
}
|
|
63
63
|
export declare class JobBuilder {
|
package/dist/index.js
CHANGED
|
@@ -64,9 +64,9 @@ class RegressionBot {
|
|
|
64
64
|
* stored baselines — see {@link ProjectConfigUpdate}.
|
|
65
65
|
*/
|
|
66
66
|
async updateProject(projectName, config) {
|
|
67
|
-
// The API wraps the updated project in { message, project }.
|
|
67
|
+
// The API wraps the updated project in { message, baselinesInvalidated, project }.
|
|
68
68
|
const res = await this._request(`/project/${encodeURIComponent(projectName)}`, 'PUT', config);
|
|
69
|
-
return res.project;
|
|
69
|
+
return { ...res.project, baselinesInvalidated: res.baselinesInvalidated };
|
|
70
70
|
}
|
|
71
71
|
// Internal fetch wrapper
|
|
72
72
|
async _request(path, method = 'GET', body) {
|
package/dist/types.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export interface EnvGate {
|
|
|
28
28
|
/** How a project's baseline advances between runs. Absent means `approved`. */
|
|
29
29
|
export type BaselinePolicy = 'approved' | 'rolling';
|
|
30
30
|
/** Frequency at which a project runs unattended. */
|
|
31
|
-
export type ProjectSchedule = '
|
|
31
|
+
export type ProjectSchedule = 'daily' | 'weekly';
|
|
32
32
|
/**
|
|
33
33
|
* A saved project as the API returns it.
|
|
34
34
|
*
|
|
@@ -81,6 +81,16 @@ export interface ProjectConfig {
|
|
|
81
81
|
scheduleKeyId?: string;
|
|
82
82
|
/** When the scheduler last started a run. The next run is due one interval after this. */
|
|
83
83
|
lastScheduledRunAt?: string;
|
|
84
|
+
/** The standing intent scheduled runs are judged against. Absent means scheduled runs are not judged. */
|
|
85
|
+
intent?: string;
|
|
86
|
+
/**
|
|
87
|
+
* Which environment `testOrigin` is: "production", "staging", "preview", "development",
|
|
88
|
+
* or the team's own word. A label only, shown in emails, the dashboard and MCP; never
|
|
89
|
+
* resets baselines. Absent when unset.
|
|
90
|
+
*/
|
|
91
|
+
environment?: string;
|
|
92
|
+
/** Live-vs-live projects only: which environment `baseOrigin` is. */
|
|
93
|
+
baseEnvironment?: string;
|
|
84
94
|
createdAt: string;
|
|
85
95
|
updatedAt: string;
|
|
86
96
|
lastRunAt?: string;
|
|
@@ -88,6 +98,14 @@ export interface ProjectConfig {
|
|
|
88
98
|
baselineVersion?: string;
|
|
89
99
|
baselineInvalidatedAt?: string;
|
|
90
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* What updateProject() returns: the saved config plus whether this patch
|
|
103
|
+
* discarded the stored baselines, so a caller does not have to re-derive that
|
|
104
|
+
* from which fields they sent. Never true on a create.
|
|
105
|
+
*/
|
|
106
|
+
export interface ProjectUpdateResult extends ProjectConfig {
|
|
107
|
+
baselinesInvalidated: boolean;
|
|
108
|
+
}
|
|
91
109
|
/**
|
|
92
110
|
* The fields updateProject() accepts.
|
|
93
111
|
*
|
|
@@ -136,15 +154,37 @@ export interface ProjectConfigUpdate {
|
|
|
136
154
|
* into the hour from the following day. Hours only, because the scheduler sweeps once
|
|
137
155
|
* an hour; UTC only, because RegressionBot has no timezone to convert from.
|
|
138
156
|
*
|
|
139
|
-
* Rejected
|
|
140
|
-
*
|
|
141
|
-
* same update. Clearing the schedule with
|
|
157
|
+
* Rejected if the project has no schedule to apply it to — either one already set, or
|
|
158
|
+
* one sent in the same update. Clearing the schedule with
|
|
142
159
|
* `schedule: null` clears this too, so re-enabling later cannot resurrect an hour
|
|
143
160
|
* nobody asked for on that run. Pass null to clear it on its own.
|
|
144
161
|
*
|
|
145
162
|
* A missed slot waits for the next one rather than catching up.
|
|
146
163
|
*/
|
|
147
164
|
scheduleHourUtc?: number | null;
|
|
165
|
+
/**
|
|
166
|
+
* The API key the scheduled runs are attributed to. Ignored when the request itself
|
|
167
|
+
* carries an API key — that key is recorded instead. Required, and checked against the
|
|
168
|
+
* organisation's keys, when a schedule is set by a caller holding no key (the dashboard).
|
|
169
|
+
*/
|
|
170
|
+
scheduleKeyId?: string;
|
|
171
|
+
/**
|
|
172
|
+
* A standing intent for scheduled runs, which have no PR to draw one from. Say what the
|
|
173
|
+
* pages are expected to do between checks and what must not change; every scheduled run
|
|
174
|
+
* is judged against it. Without one a scheduled run reports
|
|
175
|
+
* `intentAssessment.decision: 'not_judged'`. Runs started by a caller are never judged
|
|
176
|
+
* against it. Trimmed; pass null or an empty string to remove. Does not invalidate
|
|
177
|
+
* baselines. Max 1000 characters.
|
|
178
|
+
*/
|
|
179
|
+
intent?: string | null;
|
|
180
|
+
/**
|
|
181
|
+
* Which environment `testOrigin` is: production, staging, preview, development, or your
|
|
182
|
+
* own word (1-24 letters, digits, spaces, hyphens; stored lower-case). A label only:
|
|
183
|
+
* never resets baselines and never changes a run. Pass null or an empty string to remove.
|
|
184
|
+
*/
|
|
185
|
+
environment?: string | null;
|
|
186
|
+
/** Live-vs-live projects only, which environment `baseOrigin` is. Same rules as `environment`. */
|
|
187
|
+
baseEnvironment?: string | null;
|
|
148
188
|
}
|
|
149
189
|
export interface VRConfig {
|
|
150
190
|
apiKey?: string;
|
|
@@ -224,6 +264,10 @@ export interface ResultVerdict {
|
|
|
224
264
|
* content pushed by a change elsewhere — both are consequences, not edits.
|
|
225
265
|
*/
|
|
226
266
|
export type ChangeType = 'text-edit' | 'insert' | 'delete' | 'style-only' | 'image-change' | 'move' | 'move-with-edit' | 'sticky-reposition' | 'reflow-displacement'
|
|
267
|
+
/** A reader-facing attribute changed (a link target, alt text, an aria-label). See `Change.attributes`. */
|
|
268
|
+
| 'attribute-edit'
|
|
269
|
+
/** A web font failed to load for this capture. */
|
|
270
|
+
| 'font-failed'
|
|
227
271
|
/**
|
|
228
272
|
* The six metadata types: the page's head or its structured data changed while nothing
|
|
229
273
|
* visible moved — a title edited, a canonical rewritten, a JSON-LD block dropped. They
|
|
@@ -248,8 +292,7 @@ export interface Change {
|
|
|
248
292
|
type: ChangeType;
|
|
249
293
|
/**
|
|
250
294
|
* Tag name only, lowercase, e.g. `div` — not a CSS selector and not unique on the page.
|
|
251
|
-
* For a metadata type, the field that changed instead.
|
|
252
|
-
* with, see `PageResult.elementsChanged`.
|
|
295
|
+
* For a metadata type, the field that changed instead.
|
|
253
296
|
*/
|
|
254
297
|
element: string;
|
|
255
298
|
/**
|
|
@@ -262,8 +305,29 @@ export interface Change {
|
|
|
262
305
|
before?: string;
|
|
263
306
|
/** The text after the edit. Absent on a delete. Clipped the same way as `before`. */
|
|
264
307
|
after?: string;
|
|
308
|
+
/**
|
|
309
|
+
* On a change with no words of its own (`style-only`, `attribute-edit`, `image-change`):
|
|
310
|
+
* what a reader calls the element, its text or an image's alt text, up to 40 characters
|
|
311
|
+
* ("Apply now"). Absent on a large element such as a section, whose text would not name
|
|
312
|
+
* it, and when the page's changes left no room in the field's size budget: a label never
|
|
313
|
+
* displaces a change.
|
|
314
|
+
*/
|
|
315
|
+
label?: string;
|
|
265
316
|
/** Changed computed styles, keyed by CSS property name. */
|
|
266
317
|
style?: Record<string, StyleDelta>;
|
|
318
|
+
/**
|
|
319
|
+
* On an `attribute-edit`: each changed reader-facing attribute (href, alt, title,
|
|
320
|
+
* aria-label, placeholder, role, type, value) as name to [before, after]. A same-origin
|
|
321
|
+
* link is compared as its path, so a preview's own host is not a change.
|
|
322
|
+
*/
|
|
323
|
+
attributes?: Record<string, StyleDelta>;
|
|
324
|
+
/**
|
|
325
|
+
* Present as `"date"` when every changed word belongs to a date or time ("Sep 17" to
|
|
326
|
+
* "Sep 23", "3 hours ago"). The edit is reported but does not count toward the page
|
|
327
|
+
* having changed, so a page can list one and still read unchanged. Numbers, prices and
|
|
328
|
+
* percentages are never labelled this way.
|
|
329
|
+
*/
|
|
330
|
+
valueOnly?: 'date';
|
|
267
331
|
/**
|
|
268
332
|
* Where it sits in the current capture.
|
|
269
333
|
*
|
|
@@ -298,6 +362,7 @@ export interface RegressionbotSummaryItem {
|
|
|
298
362
|
label: string;
|
|
299
363
|
/** Single-sentence description of what changed in that region. */
|
|
300
364
|
text: string;
|
|
365
|
+
/** @deprecated Never set on current results. To be removed after 2026-10-28. */
|
|
301
366
|
verdict?: RegionVerdict;
|
|
302
367
|
}
|
|
303
368
|
/**
|
|
@@ -335,12 +400,23 @@ export interface PageResult {
|
|
|
335
400
|
* page whose baseline predates metadata capture, which is silence rather than "no".
|
|
336
401
|
*/
|
|
337
402
|
metadataChanged?: true;
|
|
403
|
+
/**
|
|
404
|
+
* Which group this page's change belongs to — `structural`, `edited`, `metadata`,
|
|
405
|
+
* `unmeasured`, `date` or `cosmetic` — so a caller can filter a run to one kind of
|
|
406
|
+
* change without re-deriving the rule. The same value the digest email groups on.
|
|
407
|
+
* Present only on a page that counts as a change. `unmeasured` and `date` occur only
|
|
408
|
+
* on results from before 2026-09-28.
|
|
409
|
+
*/
|
|
410
|
+
changeGroup?: 'structural' | 'edited' | 'metadata' | 'unmeasured' | 'date' | 'cosmetic';
|
|
338
411
|
/**
|
|
339
412
|
* Percentage of pixels that differed from the baseline. Not a change test on its own:
|
|
340
413
|
* 0 does not mean identical — see `changed`.
|
|
341
414
|
*/
|
|
342
415
|
diffPercentage: number;
|
|
343
|
-
/**
|
|
416
|
+
/**
|
|
417
|
+
* @deprecated Deprecated 2026-09-29. 100 minus `diffPercentage`; it no longer measures
|
|
418
|
+
* how alike two pictures look. Kept for existing callers. Read `changed` and `changes`.
|
|
419
|
+
*/
|
|
344
420
|
visualMatchScore: number;
|
|
345
421
|
/** True when this capture became a baseline because none existed to compare against. */
|
|
346
422
|
isNewBaseline: boolean;
|
|
@@ -374,12 +450,13 @@ export interface PageResult {
|
|
|
374
450
|
* not necessarily all of them.
|
|
375
451
|
*/
|
|
376
452
|
changes?: Change[];
|
|
377
|
-
/**
|
|
453
|
+
/** @deprecated Dropped 2026-09-28; already never set before that. Use `changes` instead. */
|
|
378
454
|
elementsChanged?: string[];
|
|
379
455
|
/**
|
|
380
|
-
*
|
|
381
|
-
*
|
|
382
|
-
*
|
|
456
|
+
* @deprecated Only on results from before 2026-09-28, when the pixel engine compared a
|
|
457
|
+
* page without its DOM. To be removed after 2026-10-28, when the last of those expire.
|
|
458
|
+
* The result is a plain pixel diff with no semantic change types, so treat its
|
|
459
|
+
* classifications as absent rather than as "nothing structural changed".
|
|
383
460
|
*/
|
|
384
461
|
domAssistSkipReason?: string;
|
|
385
462
|
/** Pre-signed URL for the stored baseline screenshot. */
|
|
@@ -405,6 +482,10 @@ export interface JobProgress {
|
|
|
405
482
|
export type SummaryStatus = 'PENDING' | 'PROCESSING' | 'COMPLETE' | 'FAILED';
|
|
406
483
|
export interface JobStatus {
|
|
407
484
|
jobId: string;
|
|
485
|
+
/** The project's environment when the run started. A label only. Absent when the project has none. */
|
|
486
|
+
environment?: string;
|
|
487
|
+
/** Live-vs-live runs only: the environment of the base origin. Absent otherwise. */
|
|
488
|
+
baseEnvironment?: string;
|
|
408
489
|
/**
|
|
409
490
|
* Terminal states are COMPLETED, APPROVED, RESOLVED and FAILED. APPROVED means every page
|
|
410
491
|
* carrying a diff was approved; RESOLVED means they were all decided and at least one was
|
|
@@ -418,24 +499,41 @@ export interface JobStatus {
|
|
|
418
499
|
summaryStatus: SummaryStatus;
|
|
419
500
|
error: string | null;
|
|
420
501
|
progress: JobProgress;
|
|
502
|
+
/** The project whose configuration this run used, when it had one. */
|
|
503
|
+
project?: string;
|
|
504
|
+
/** The origin that was captured as "current". */
|
|
505
|
+
origin?: string;
|
|
506
|
+
/** The second origin, captured as the comparison. Present only in live-vs-live mode. */
|
|
507
|
+
baseOrigin?: string;
|
|
421
508
|
executionTime: number;
|
|
422
509
|
createdAt: string;
|
|
423
510
|
/** Whether the run carried an intent. Without one no page gets a verdict. */
|
|
424
511
|
intentProvided?: boolean;
|
|
425
512
|
/** Whether this run compared two live origins or one origin against a stored baseline. */
|
|
426
513
|
comparisonMode?: 'live-vs-live' | 'managed';
|
|
514
|
+
/** Page-checks the run made, and how many finished. Mirrors `progress`. */
|
|
515
|
+
totalUrls?: number;
|
|
516
|
+
completedCount?: number;
|
|
427
517
|
/** Partial or complete results. Fills in as workers finish. */
|
|
428
518
|
results: PageResult[];
|
|
429
519
|
}
|
|
430
520
|
export interface JobSummary {
|
|
431
521
|
jobId: string;
|
|
522
|
+
/** The project's environment when the run started. A label only. Absent when the project has none. */
|
|
523
|
+
environment?: string;
|
|
524
|
+
/** Live-vs-live runs only: the environment of the base origin. Absent otherwise. */
|
|
525
|
+
baseEnvironment?: string;
|
|
432
526
|
/** getSummary() throws until the job reaches one of these. */
|
|
433
527
|
status: 'COMPLETED' | 'APPROVED' | 'RESOLVED' | 'FAILED';
|
|
434
528
|
summaryStatus: SummaryStatus;
|
|
435
529
|
error: string | null;
|
|
436
530
|
totalUrls: number;
|
|
437
531
|
completedCount: number;
|
|
438
|
-
/**
|
|
532
|
+
/**
|
|
533
|
+
* @deprecated Deprecated 2026-09-29. 100 minus the average `diffPercentage` over the
|
|
534
|
+
* job's pages, an errored page counting as 100: not a similarity score. Kept for
|
|
535
|
+
* existing callers. Read `regressionCount` and each regression's `changes`.
|
|
536
|
+
*/
|
|
439
537
|
overallScore: number;
|
|
440
538
|
executionTime: number;
|
|
441
539
|
regressionCount: number;
|
|
@@ -457,6 +555,13 @@ export interface JobSummary {
|
|
|
457
555
|
variantName: string;
|
|
458
556
|
errorMessage: string;
|
|
459
557
|
}>;
|
|
558
|
+
/**
|
|
559
|
+
* An AI summary of the whole run, two or three sentences, written once when the run
|
|
560
|
+
* finished from the exact edits in `regressions` (the same text opens the scheduled-run
|
|
561
|
+
* email). Null when nothing changed or none could be written. The changes are the
|
|
562
|
+
* record; this is a reading of them.
|
|
563
|
+
*/
|
|
564
|
+
runSummary: string | null;
|
|
460
565
|
/** Whole-job roll-up of how the changes line up with the run's stated intent. */
|
|
461
566
|
intentAssessment: IntentAssessment;
|
|
462
567
|
/** The intent this run was given, echoed back. */
|
package/package.json
CHANGED