@riddledc/riddle-proof 0.8.76 → 0.8.78
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/advanced/index.d.cts +1 -1
- package/dist/advanced/index.d.ts +1 -1
- package/dist/advanced/proof-run-engine.d.cts +1 -1
- package/dist/advanced/proof-run-engine.d.ts +1 -1
- package/dist/change-proof.cjs +991 -7
- package/dist/change-proof.d.cts +157 -1
- package/dist/change-proof.d.ts +157 -1
- package/dist/change-proof.js +25 -3
- package/dist/{chunk-B2DP2LET.js → chunk-5IFZSUPF.js} +52 -13
- package/dist/chunk-6VFS2JFR.js +886 -0
- package/dist/{chunk-CWRIXP5H.js → chunk-7N6X54WG.js} +181 -17
- package/dist/{chunk-GG2D3MFZ.js → chunk-FCSJZBC5.js} +26 -1
- package/dist/{chunk-AK2EPEVO.js → chunk-HSGZV2NK.js} +221 -63
- package/dist/chunk-MEVVL4TI.js +258 -0
- package/dist/{chunk-UE4I7RTI.js → chunk-RQPCKRKT.js} +1 -1
- package/dist/cli/index.js +7 -6
- package/dist/cli.cjs +1678 -361
- package/dist/cli.js +7 -6
- package/dist/index.cjs +1242 -42
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +46 -10
- package/dist/pr-comment.cjs +481 -17
- package/dist/pr-comment.d.cts +6 -1
- package/dist/pr-comment.d.ts +6 -1
- package/dist/pr-comment.js +6 -1
- package/dist/profile/index.cjs +26 -1
- package/dist/profile/index.js +1 -1
- package/dist/profile-suggestions.js +2 -2
- package/dist/profile.cjs +26 -1
- package/dist/profile.d.cts +7 -0
- package/dist/profile.d.ts +7 -0
- package/dist/profile.js +1 -1
- package/dist/{proof-run-engine-MiKZt9oY.d.ts → proof-run-engine-CsQshTUX.d.ts} +3 -3
- package/dist/{proof-run-engine-Baiv6l3A.d.cts → proof-run-engine-DmUqh7Cw.d.cts} +3 -3
- package/dist/proof-run-engine.d.cts +1 -1
- package/dist/proof-run-engine.d.ts +1 -1
- package/dist/receipts.cjs +286 -0
- package/dist/receipts.d.cts +115 -0
- package/dist/receipts.d.ts +115 -0
- package/dist/receipts.js +15 -0
- package/dist/riddle-client.cjs +98 -13
- package/dist/riddle-client.d.cts +18 -5
- package/dist/riddle-client.d.ts +18 -5
- package/dist/riddle-client.js +4 -1
- package/dist/runtime/index.cjs +98 -13
- package/dist/runtime/index.d.cts +5 -1
- package/dist/runtime/index.d.ts +5 -1
- package/dist/runtime/index.js +4 -1
- package/dist/runtime/riddle-client.cjs +98 -13
- package/dist/runtime/riddle-client.d.cts +5 -1
- package/dist/runtime/riddle-client.d.ts +5 -1
- package/dist/runtime/riddle-client.js +4 -1
- package/package.json +7 -2
- package/dist/chunk-6S7DZWVC.js +0 -167
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RIDDLE_PROOF_CHANGE_RECEIPT_V1_VERSION,
|
|
3
|
+
RIDDLE_PROOF_CHANGE_RECEIPT_VERSION,
|
|
4
|
+
RIDDLE_PROOF_HANDOFF_RECEIPT_VERSION,
|
|
5
|
+
createRiddleProofHandoffReceipt,
|
|
6
|
+
parseRiddleProofChangeReceipt,
|
|
7
|
+
parseRiddleProofHandoffReceipt
|
|
8
|
+
} from "./chunk-6VFS2JFR.js";
|
|
1
9
|
import {
|
|
2
10
|
riddleProofPublicStateAllowsMergeRecommendation,
|
|
3
11
|
riddleProofPublicStateMergeRecommendation,
|
|
@@ -79,6 +87,34 @@ function collectProfileArtifacts(result) {
|
|
|
79
87
|
}
|
|
80
88
|
return artifacts;
|
|
81
89
|
}
|
|
90
|
+
function collectChangeReceiptArtifacts(result) {
|
|
91
|
+
const artifacts = [];
|
|
92
|
+
const seen = /* @__PURE__ */ new Set();
|
|
93
|
+
const collectSide = (sideName, side) => {
|
|
94
|
+
const candidates = [
|
|
95
|
+
side.canonical_screenshot,
|
|
96
|
+
...asArray(side.screenshots),
|
|
97
|
+
...asArray(side.artifacts)
|
|
98
|
+
].filter(Boolean);
|
|
99
|
+
for (const [index, item] of candidates.entries()) {
|
|
100
|
+
const artifact = asRecord(item);
|
|
101
|
+
const url = stringValue(artifact.url) || stringValue(artifact.path);
|
|
102
|
+
if (!url || seen.has(url)) continue;
|
|
103
|
+
seen.add(url);
|
|
104
|
+
const fallbackName = `${sideName}-artifact-${index + 1}`;
|
|
105
|
+
const name = `${sideName}/${artifactDisplayName(artifact.name, fallbackName)}`;
|
|
106
|
+
artifacts.push({
|
|
107
|
+
name,
|
|
108
|
+
url,
|
|
109
|
+
kind: artifactKind(name, url),
|
|
110
|
+
size_bytes: numberValue(artifact.size_bytes) ?? numberValue(artifact.size)
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
collectSide("before", asRecord(result.before));
|
|
115
|
+
collectSide("after", asRecord(result.after));
|
|
116
|
+
return artifacts;
|
|
117
|
+
}
|
|
82
118
|
function mergeArtifacts(...artifactLists) {
|
|
83
119
|
const artifacts = [];
|
|
84
120
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -134,6 +170,33 @@ function profilePageSummaries(result, counts) {
|
|
|
134
170
|
failed: counts.failed
|
|
135
171
|
}];
|
|
136
172
|
}
|
|
173
|
+
function changeReceiptCheckCounts(result) {
|
|
174
|
+
const deltas = asArray(result.deltas);
|
|
175
|
+
if (!deltas.length) return void 0;
|
|
176
|
+
let passed = 0;
|
|
177
|
+
let failed = 0;
|
|
178
|
+
for (const item of deltas) {
|
|
179
|
+
const status = stringValue(asRecord(item).status);
|
|
180
|
+
if (status === "passed") passed += 1;
|
|
181
|
+
if (status === "failed" || status === "proof_insufficient" || status === "configuration_error") failed += 1;
|
|
182
|
+
}
|
|
183
|
+
return { passed, failed };
|
|
184
|
+
}
|
|
185
|
+
function changeReceiptPageSummaries(result) {
|
|
186
|
+
const pages = [];
|
|
187
|
+
for (const sideName of ["before", "after"]) {
|
|
188
|
+
const side = asRecord(result[sideName]);
|
|
189
|
+
if (!Object.keys(side).length) continue;
|
|
190
|
+
const profileSummary = asRecord(side.profile_summary);
|
|
191
|
+
const checks = Object.keys(asRecord(side.checks)).length ? asRecord(side.checks) : asRecord(profileSummary.checks);
|
|
192
|
+
pages.push({
|
|
193
|
+
route: firstStringValue(asRecord(side.target).url, side.source, profileSummary.profile_name, side.profile_name) || sideName,
|
|
194
|
+
passed: numberValue(checks.passed) ?? 0,
|
|
195
|
+
failed: numberValue(checks.failed) ?? 0
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
return pages;
|
|
199
|
+
}
|
|
137
200
|
function summarizeExplicitChecks(value) {
|
|
138
201
|
let passed = 0;
|
|
139
202
|
let failed = 0;
|
|
@@ -189,11 +252,27 @@ function isProfileResult(result) {
|
|
|
189
252
|
const version = stringValue(result.version);
|
|
190
253
|
return version === "riddle-proof.profile-result.v1" || version === "riddle-proof.profile-compact-result.v1";
|
|
191
254
|
}
|
|
255
|
+
function isChangeReceiptResult(result) {
|
|
256
|
+
const version = stringValue(result.version);
|
|
257
|
+
return version === RIDDLE_PROOF_CHANGE_RECEIPT_V1_VERSION || version === RIDDLE_PROOF_CHANGE_RECEIPT_VERSION;
|
|
258
|
+
}
|
|
259
|
+
function isHandoffReceiptResult(result) {
|
|
260
|
+
return stringValue(result.version) === RIDDLE_PROOF_HANDOFF_RECEIPT_VERSION;
|
|
261
|
+
}
|
|
262
|
+
function isChangeResult(result) {
|
|
263
|
+
const version = stringValue(result.version);
|
|
264
|
+
return version === "riddle-proof.change-result.v1" || version === "riddle-proof.change-compact-result.v1";
|
|
265
|
+
}
|
|
192
266
|
function summarizeRiddleProofPrComment(input) {
|
|
193
267
|
const runResponse = asRecord(input.runResponse);
|
|
194
|
-
const
|
|
268
|
+
const inputResult = asRecord(input.result);
|
|
269
|
+
const handoffReceipt = isHandoffReceiptResult(inputResult) ? parseRiddleProofHandoffReceipt(inputResult) : void 0;
|
|
270
|
+
const parsedChangeReceipt = handoffReceipt?.change || (isChangeReceiptResult(inputResult) ? parseRiddleProofChangeReceipt(inputResult) : void 0);
|
|
271
|
+
const result = parsedChangeReceipt ? asRecord(parsedChangeReceipt) : inputResult;
|
|
195
272
|
const proofResult = asRecord(runResponse.proofResult);
|
|
196
273
|
const profileResult = isProfileResult(result);
|
|
274
|
+
const changeReceiptResult = Boolean(parsedChangeReceipt);
|
|
275
|
+
const changeResult = changeReceiptResult || isChangeResult(result);
|
|
197
276
|
const profileRiddle = asRecord(result.riddle);
|
|
198
277
|
const preview = asRecord(runResponse.preview);
|
|
199
278
|
const resultRunCard = asRecord(result.run_card);
|
|
@@ -202,15 +281,18 @@ function summarizeRiddleProofPrComment(input) {
|
|
|
202
281
|
const resultRaw = asRecord(result.raw);
|
|
203
282
|
const rawDetails = asRecord(resultRaw.details);
|
|
204
283
|
const profileChecks = profileResult ? profileCheckCounts(result) : void 0;
|
|
284
|
+
const changeChecks = changeResult ? changeReceiptCheckCounts(result) : void 0;
|
|
205
285
|
const artifacts = mergeArtifacts(
|
|
206
286
|
collectArtifacts(runResponse),
|
|
207
|
-
profileResult ? collectProfileArtifacts(result) : []
|
|
287
|
+
profileResult ? collectProfileArtifacts(result) : [],
|
|
288
|
+
changeReceiptResult ? collectChangeReceiptArtifacts(result) : []
|
|
208
289
|
);
|
|
209
|
-
const pages = profileResult ? profilePageSummaries(result, profileChecks) : pageSummaries(result);
|
|
290
|
+
const pages = changeReceiptResult ? changeReceiptPageSummaries(result) : profileResult ? profilePageSummaries(result, profileChecks) : pageSummaries(result);
|
|
210
291
|
const checkSource = { ...result };
|
|
211
292
|
delete checkSource.ok;
|
|
212
293
|
const nestedChecks = summarizeExplicitChecks(checkSource);
|
|
213
|
-
const
|
|
294
|
+
const resultStatus = firstStringValue(result.status, stopCondition.status);
|
|
295
|
+
const ok = changeReceiptResult ? parsedChangeReceipt?.recommendation.merge_recommended ?? false : changeResult ? resultStatus === "passed" : booleanValue(result.ok) ?? booleanValue(runResponse.ok) ?? null;
|
|
214
296
|
const checkpointSummary = checkpointSummaryFrom(
|
|
215
297
|
result.checkpoint_summary,
|
|
216
298
|
stopCondition.checkpoint_summary,
|
|
@@ -218,19 +300,19 @@ function summarizeRiddleProofPrComment(input) {
|
|
|
218
300
|
rawDetails.checkpoint_summary,
|
|
219
301
|
proofResult.checkpoint_summary
|
|
220
302
|
);
|
|
221
|
-
const publicState = summarizeRiddleProofPublicState({
|
|
303
|
+
const publicState = changeReceiptResult ? void 0 : summarizeRiddleProofPublicState({
|
|
222
304
|
...result,
|
|
223
|
-
status:
|
|
305
|
+
status: resultStatus,
|
|
224
306
|
checkpoint_summary: checkpointSummary || result.checkpoint_summary
|
|
225
307
|
});
|
|
226
|
-
const mergeRecommendation = riddleProofPublicStateMergeRecommendation(
|
|
308
|
+
const mergeRecommendation = publicState ? riddleProofPublicStateMergeRecommendation(
|
|
227
309
|
publicState,
|
|
228
310
|
firstStringValue(result.merge_recommendation, stopCondition.merge_recommendation, resultRaw.merge_recommendation)
|
|
229
|
-
);
|
|
311
|
+
) : void 0;
|
|
230
312
|
return {
|
|
231
313
|
ok,
|
|
232
314
|
status: firstStringValue(proofResult.status, profileRiddle.status),
|
|
233
|
-
result_status: publicState
|
|
315
|
+
result_status: changeResult ? resultStatus : publicState?.status,
|
|
234
316
|
job_id: firstStringValue(proofResult.job_id, profileRiddle.job_id),
|
|
235
317
|
duration_ms: numberValue(proofResult.duration_ms) ?? numberValue(profileRiddle.elapsed_ms),
|
|
236
318
|
proof_url: stringValue(runResponse.proofUrl),
|
|
@@ -238,17 +320,17 @@ function summarizeRiddleProofPrComment(input) {
|
|
|
238
320
|
preview_url: stringValue(preview.preview_url) || stringValue(preview.url),
|
|
239
321
|
preview_publish_recovered: booleanValue(preview.publish_recovered),
|
|
240
322
|
preview_publish_error: stringValue(preview.publish_error),
|
|
241
|
-
ship_held: publicState
|
|
242
|
-
shipping_disabled: publicState
|
|
243
|
-
ship_authorized: publicState
|
|
244
|
-
merge_ready: publicState
|
|
245
|
-
sync_allowed: publicState
|
|
323
|
+
ship_held: publicState?.ship_held,
|
|
324
|
+
shipping_disabled: publicState?.shipping_disabled,
|
|
325
|
+
ship_authorized: changeReceiptResult ? parsedChangeReceipt?.shipping_authorization.authorized : publicState?.ship_authorized,
|
|
326
|
+
merge_ready: publicState?.merge_ready,
|
|
327
|
+
sync_allowed: publicState?.sync_allowed,
|
|
246
328
|
proof_decision: firstStringValue(result.proof_decision, stopCondition.proof_decision, resultRaw.proof_decision),
|
|
247
|
-
merge_recommendation: mergeRecommendation,
|
|
329
|
+
merge_recommendation: changeReceiptResult ? parsedChangeReceipt?.recommendation.label : mergeRecommendation,
|
|
248
330
|
checkpoint_summary: checkpointSummary,
|
|
249
331
|
public_state: publicState,
|
|
250
|
-
passed_checks: profileChecks?.passed ?? nestedChecks.passed,
|
|
251
|
-
failed_checks: profileChecks?.failed ?? nestedChecks.failed,
|
|
332
|
+
passed_checks: changeChecks?.passed ?? profileChecks?.passed ?? nestedChecks.passed,
|
|
333
|
+
failed_checks: changeChecks?.failed ?? profileChecks?.failed ?? nestedChecks.failed,
|
|
252
334
|
pages,
|
|
253
335
|
artifacts,
|
|
254
336
|
primary_image: selectPrimaryImage(artifacts)
|
|
@@ -312,7 +394,88 @@ function checkpointSummaryLine(summary) {
|
|
|
312
394
|
summary.latest_decision ? `latest decision \`${summary.latest_decision}\`` : ""
|
|
313
395
|
].filter(Boolean).join("; ");
|
|
314
396
|
}
|
|
397
|
+
function markdownTableValue(value) {
|
|
398
|
+
return String(value ?? "").replace(/\|/g, "\\|").replace(/\r?\n/g, " ");
|
|
399
|
+
}
|
|
400
|
+
function observationArtifactTarget(artifact) {
|
|
401
|
+
return artifact?.url || artifact?.path;
|
|
402
|
+
}
|
|
403
|
+
function canonicalScreenshotCell(artifact, fallback) {
|
|
404
|
+
const target = observationArtifactTarget(artifact);
|
|
405
|
+
if (!artifact || !target) return fallback;
|
|
406
|
+
if (artifact.url) return `![${artifact.name.replace(/\]/g, "\\]")}](${artifact.url})`;
|
|
407
|
+
return markdownTableValue(artifact.path || artifact.name);
|
|
408
|
+
}
|
|
409
|
+
function shortRevision(value) {
|
|
410
|
+
return value ? value.slice(0, 12) : "not recorded";
|
|
411
|
+
}
|
|
412
|
+
function buildRiddleProofHandoffPrCommentMarkdown(handoff, input = {}) {
|
|
413
|
+
const receipt = parseRiddleProofHandoffReceipt(handoff);
|
|
414
|
+
const change = receipt.change;
|
|
415
|
+
const beforeStatus = change.before.profile_summary?.status || "not recorded";
|
|
416
|
+
const afterStatus = change.after.profile_summary?.status || "not recorded";
|
|
417
|
+
const beforeBaseline = change.groups.before.ok ? "matched baseline" : "baseline mismatch";
|
|
418
|
+
const lines = [
|
|
419
|
+
RIDDLE_PROOF_PR_COMMENT_MARKER,
|
|
420
|
+
`## ${input.title?.trim() || "Riddle Change Proof"}`,
|
|
421
|
+
"",
|
|
422
|
+
`**Result:** ${receipt.recommendation.label}`,
|
|
423
|
+
`**Evidence verdict:** \`${receipt.verdict}\``,
|
|
424
|
+
`**Shipping authorization:** ${receipt.shipping_authorization.status}`,
|
|
425
|
+
`**Contract:** ${change.contract_name}`
|
|
426
|
+
];
|
|
427
|
+
if (input.goal?.trim()) lines.push(`**Goal:** ${input.goal.trim()}`);
|
|
428
|
+
if (input.successCriteria?.trim()) lines.push(`**Success criteria:** ${input.successCriteria.trim()}`);
|
|
429
|
+
lines.push("", change.summary, "", "### Canonical Before / After", "");
|
|
430
|
+
lines.push("| Before | After |");
|
|
431
|
+
lines.push("| --- | --- |");
|
|
432
|
+
lines.push(`| ${beforeBaseline}: \`${markdownTableValue(beforeStatus)}\` | \`${markdownTableValue(afterStatus)}\` |`);
|
|
433
|
+
lines.push(`| ${canonicalScreenshotCell(receipt.canonical_pair.before, "No canonical before screenshot")} | ${canonicalScreenshotCell(receipt.canonical_pair.after, "No canonical after screenshot")} |`);
|
|
434
|
+
lines.push("", "### Source Binding", "");
|
|
435
|
+
lines.push("| Side | Target | Git revision | Binding | Preview | Digest |");
|
|
436
|
+
lines.push("| --- | --- | --- | --- | --- | --- |");
|
|
437
|
+
for (const side of ["before", "after"]) {
|
|
438
|
+
const observation = change[side];
|
|
439
|
+
const binding = change.source_bindings[side];
|
|
440
|
+
lines.push(`| ${side} | ${markdownTableValue(observation.target.url)} | \`${shortRevision(binding.observed_git_revision || observation.source.git_revision)}\` | ${binding.status} | ${markdownTableValue(binding.preview_id || observation.target.preview?.preview_id || "not required")} | \`${markdownTableValue(binding.content_digest || observation.target.preview?.content_digest || "not required")}\` |`);
|
|
441
|
+
}
|
|
442
|
+
lines.push("", "### Declared Delta", "");
|
|
443
|
+
lines.push("| Measurement | Status | Before | After |");
|
|
444
|
+
lines.push("| --- | --- | --- | --- |");
|
|
445
|
+
for (const delta of change.deltas) {
|
|
446
|
+
lines.push(`| ${markdownTableValue(delta.label)} | ${delta.status} | ${markdownTableValue(delta.before_observed)} | ${markdownTableValue(delta.after_observed)} |`);
|
|
447
|
+
}
|
|
448
|
+
if (change.proves.length) {
|
|
449
|
+
lines.push("", "### What This Proves", "");
|
|
450
|
+
for (const claim of change.proves) lines.push(`- ${claim}`);
|
|
451
|
+
}
|
|
452
|
+
if (change.does_not_prove.length) {
|
|
453
|
+
lines.push("", "### Limits", "");
|
|
454
|
+
for (const claim of change.does_not_prove) lines.push(`- ${claim}`);
|
|
455
|
+
}
|
|
456
|
+
const linkedArtifacts = [
|
|
457
|
+
...change.before.artifacts.map((artifact) => ({ side: "before", artifact })),
|
|
458
|
+
...change.after.artifacts.map((artifact) => ({ side: "after", artifact }))
|
|
459
|
+
].filter(({ artifact }) => Boolean(artifact.url));
|
|
460
|
+
if (linkedArtifacts.length) {
|
|
461
|
+
lines.push("", "### Artifacts", "");
|
|
462
|
+
for (const { side, artifact } of linkedArtifacts.slice(0, 24)) {
|
|
463
|
+
lines.push(`- ${side}: ${markdownLink(artifact.name, artifact.url || "")}`);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
lines.push("", input.source?.trim() ? `_Source: ${input.source.trim()}_` : "_Rendered from the Handoff receipt without recomputing its verdict._");
|
|
467
|
+
return `${lines.join("\n").trim()}
|
|
468
|
+
`;
|
|
469
|
+
}
|
|
315
470
|
function buildRiddleProofPrCommentMarkdown(input) {
|
|
471
|
+
const result = asRecord(input.result);
|
|
472
|
+
if (isHandoffReceiptResult(result)) {
|
|
473
|
+
return buildRiddleProofHandoffPrCommentMarkdown(parseRiddleProofHandoffReceipt(result), input);
|
|
474
|
+
}
|
|
475
|
+
if (isChangeReceiptResult(result)) {
|
|
476
|
+
const handoff = createRiddleProofHandoffReceipt(parseRiddleProofChangeReceipt(result));
|
|
477
|
+
return buildRiddleProofHandoffPrCommentMarkdown(handoff, input);
|
|
478
|
+
}
|
|
316
479
|
const summary = summarizeRiddleProofPrComment(input);
|
|
317
480
|
const title = input.title?.trim() || "Riddle Proof Evidence";
|
|
318
481
|
const lines = [
|
|
@@ -383,5 +546,6 @@ function buildRiddleProofPrCommentMarkdown(input) {
|
|
|
383
546
|
export {
|
|
384
547
|
RIDDLE_PROOF_PR_COMMENT_MARKER,
|
|
385
548
|
summarizeRiddleProofPrComment,
|
|
549
|
+
buildRiddleProofHandoffPrCommentMarkdown,
|
|
386
550
|
buildRiddleProofPrCommentMarkdown
|
|
387
551
|
};
|
|
@@ -781,6 +781,12 @@ function profileScreenshotLabels(viewports) {
|
|
|
781
781
|
}
|
|
782
782
|
return labels;
|
|
783
783
|
}
|
|
784
|
+
function profileFinalScreenshotLabels(viewports) {
|
|
785
|
+
return (viewports || []).map((viewport) => viewport.screenshot_label).filter((label) => typeof label === "string" && Boolean(label.trim()));
|
|
786
|
+
}
|
|
787
|
+
function profileAllSetupScreenshotLabels(viewports) {
|
|
788
|
+
return (viewports || []).flatMap((viewport) => profileSetupScreenshotLabels(viewport.setup_action_results || []));
|
|
789
|
+
}
|
|
784
790
|
function profileSetupSummary(viewports, actionCount, expectedActionCountByViewport, finalScreenshotFullPage) {
|
|
785
791
|
const normalizedFinalScreenshotFullPage = finalScreenshotFullPage === void 0 ? void 0 : finalScreenshotFullPage !== false;
|
|
786
792
|
const finalScreenshotCount = viewports.filter((viewport) => typeof viewport.screenshot_label === "string" && viewport.screenshot_label.trim()).length;
|
|
@@ -3631,6 +3637,8 @@ function assessRiddleProofProfileEvidence(profile, evidence, options = {}) {
|
|
|
3631
3637
|
const status = profileStatusFromEvidence(profile, evidence, checks);
|
|
3632
3638
|
const firstViewport = evidence?.viewports?.[0];
|
|
3633
3639
|
const screenshots = profileScreenshotLabels(evidence?.viewports);
|
|
3640
|
+
const canonicalScreenshots = profileFinalScreenshotLabels(evidence?.viewports);
|
|
3641
|
+
const setupScreenshots = profileAllSetupScreenshotLabels(evidence?.viewports);
|
|
3634
3642
|
const result = {
|
|
3635
3643
|
version: RIDDLE_PROOF_PROFILE_RESULT_VERSION,
|
|
3636
3644
|
profile_name: profile.name,
|
|
@@ -3640,6 +3648,8 @@ function assessRiddleProofProfileEvidence(profile, evidence, options = {}) {
|
|
|
3640
3648
|
route: routeForViewport(firstViewport, evidence?.target_url),
|
|
3641
3649
|
artifacts: {
|
|
3642
3650
|
screenshots,
|
|
3651
|
+
canonical_screenshots: canonicalScreenshots,
|
|
3652
|
+
setup_screenshots: setupScreenshots,
|
|
3643
3653
|
console: "console.json",
|
|
3644
3654
|
proof_json: "proof.json",
|
|
3645
3655
|
dom_summary: "dom-summary.json",
|
|
@@ -4958,6 +4968,12 @@ function profileScreenshotLabels(viewports) {
|
|
|
4958
4968
|
}
|
|
4959
4969
|
return labels;
|
|
4960
4970
|
}
|
|
4971
|
+
function profileFinalScreenshotLabels(viewports) {
|
|
4972
|
+
return (viewports || []).map((viewport) => viewport && viewport.screenshot_label).filter(Boolean);
|
|
4973
|
+
}
|
|
4974
|
+
function profileAllSetupScreenshotLabels(viewports) {
|
|
4975
|
+
return (viewports || []).flatMap((viewport) => profileSetupScreenshotLabels(viewport && viewport.setup_action_results || []));
|
|
4976
|
+
}
|
|
4961
4977
|
function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewport, finalScreenshotFullPage) {
|
|
4962
4978
|
const normalizedFinalScreenshotFullPage = finalScreenshotFullPage === undefined
|
|
4963
4979
|
? undefined
|
|
@@ -5826,6 +5842,8 @@ function assessProfile(profile, evidence) {
|
|
|
5826
5842
|
else if (checks.some((check) => check.status === "needs_human_review")) status = "needs_human_review";
|
|
5827
5843
|
else if (checks.some((check) => check.status === "failed")) status = "product_regression";
|
|
5828
5844
|
const screenshotLabels = profileScreenshotLabels(viewports);
|
|
5845
|
+
const canonicalScreenshotLabels = profileFinalScreenshotLabels(viewports);
|
|
5846
|
+
const setupScreenshotLabels = profileAllSetupScreenshotLabels(viewports);
|
|
5829
5847
|
const route = viewports[0] && viewports[0].route ? viewports[0].route : { requested: evidence.target_url, observed: "", matched: false, error: "missing viewport evidence" };
|
|
5830
5848
|
const passedChecks = checks.filter((check) => check.status === "passed").length;
|
|
5831
5849
|
const failedChecks = checks.filter((check) => check.status === "failed").length;
|
|
@@ -5842,7 +5860,14 @@ function assessProfile(profile, evidence) {
|
|
|
5842
5860
|
status,
|
|
5843
5861
|
baseline_policy: profile.baseline_policy || "invariant_only",
|
|
5844
5862
|
route,
|
|
5845
|
-
artifacts: {
|
|
5863
|
+
artifacts: {
|
|
5864
|
+
screenshots: screenshotLabels,
|
|
5865
|
+
canonical_screenshots: canonicalScreenshotLabels,
|
|
5866
|
+
setup_screenshots: setupScreenshotLabels,
|
|
5867
|
+
console: "console.json",
|
|
5868
|
+
proof_json: "proof.json",
|
|
5869
|
+
dom_summary: "dom-summary.json"
|
|
5870
|
+
},
|
|
5846
5871
|
checks,
|
|
5847
5872
|
summary,
|
|
5848
5873
|
captured_at: evidence.captured_at,
|