@riddledc/riddle-proof 0.7.18 → 0.7.19
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/dist/{chunk-7T5WT2WO.js → chunk-ZGSAXSBW.js} +42 -27
- package/dist/cli.cjs +42 -27
- package/dist/cli.js +1 -1
- package/dist/index.cjs +42 -27
- package/dist/index.js +1 -1
- package/dist/profile.cjs +42 -27
- package/dist/profile.js +1 -1
- package/dist/proof-run-engine.d.cts +3 -3
- package/dist/proof-run-engine.d.ts +3 -3
- package/package.json +1 -1
|
@@ -456,11 +456,13 @@ function assessSetupActionsFromEvidence(profile, evidence) {
|
|
|
456
456
|
message: failed.length ? `Setup actions failed in ${failed.length} viewport action(s).` : void 0
|
|
457
457
|
};
|
|
458
458
|
}
|
|
459
|
-
function profileStatusFromEvidence(evidence, checks) {
|
|
459
|
+
function profileStatusFromEvidence(profile, evidence, checks) {
|
|
460
460
|
if (!evidence) return "proof_insufficient";
|
|
461
461
|
const viewports = evidence.viewports || [];
|
|
462
|
+
const expectedViewportCount = profile.target.viewports?.length || 0;
|
|
462
463
|
if (!viewports.length || !checks.length) return "proof_insufficient";
|
|
463
464
|
if (viewports.some((viewport) => viewport.navigation_error)) return "environment_blocked";
|
|
465
|
+
if (expectedViewportCount && viewports.length < expectedViewportCount) return "proof_insufficient";
|
|
464
466
|
if (checks.some((check) => check.status === "needs_human_review")) return "needs_human_review";
|
|
465
467
|
if (checks.some((check) => check.status === "failed")) return "product_regression";
|
|
466
468
|
return "passed";
|
|
@@ -471,7 +473,7 @@ function assessRiddleProofProfileEvidence(profile, evidence, options = {}) {
|
|
|
471
473
|
assessSetupActionsFromEvidence(profile, evidence),
|
|
472
474
|
...profile.checks.map((check) => assessCheckFromEvidence(check, evidence))
|
|
473
475
|
].filter((check) => Boolean(check)) : [];
|
|
474
|
-
const status = profileStatusFromEvidence(evidence, checks);
|
|
476
|
+
const status = profileStatusFromEvidence(profile, evidence, checks);
|
|
475
477
|
const firstViewport = evidence?.viewports?.[0];
|
|
476
478
|
const screenshots = (evidence?.viewports || []).map((viewport) => viewport.screenshot_label).filter((label) => Boolean(label));
|
|
477
479
|
return {
|
|
@@ -751,8 +753,10 @@ function assessProfile(profile, evidence) {
|
|
|
751
753
|
checks.push({ type: check.type, label: check.label || check.type, status: "needs_human_review", evidence: {}, message: "Unsupported check type." });
|
|
752
754
|
}
|
|
753
755
|
let status = "passed";
|
|
756
|
+
const expectedViewportCount = profile.target && Array.isArray(profile.target.viewports) ? profile.target.viewports.length : 0;
|
|
754
757
|
if (!viewports.length || !checks.length) status = "proof_insufficient";
|
|
755
758
|
else if (viewports.some((viewport) => viewport.navigation_error)) status = "environment_blocked";
|
|
759
|
+
else if (expectedViewportCount && viewports.length < expectedViewportCount) status = "proof_insufficient";
|
|
756
760
|
else if (checks.some((check) => check.status === "needs_human_review")) status = "needs_human_review";
|
|
757
761
|
else if (checks.some((check) => check.status === "failed")) status = "product_regression";
|
|
758
762
|
const screenshotLabels = viewports.map((viewport) => viewport.screenshot_label).filter(Boolean);
|
|
@@ -1021,33 +1025,44 @@ async function captureViewport(viewport) {
|
|
|
1021
1025
|
}
|
|
1022
1026
|
${runtimeScriptAssessmentSource()}
|
|
1023
1027
|
const viewports = [];
|
|
1028
|
+
function buildProfileEvidence(currentViewports) {
|
|
1029
|
+
const expectedViewportCount = (profile.target.viewports || []).length;
|
|
1030
|
+
return {
|
|
1031
|
+
version: "riddle-proof.profile-evidence.v1",
|
|
1032
|
+
profile_name: profile.name,
|
|
1033
|
+
target_url: targetUrl,
|
|
1034
|
+
baseline_policy: profile.baseline_policy || "invariant_only",
|
|
1035
|
+
captured_at: capturedAt,
|
|
1036
|
+
viewports: currentViewports.slice(),
|
|
1037
|
+
console: {
|
|
1038
|
+
events: consoleEvents,
|
|
1039
|
+
fatal_count: consoleEvents.filter((event) => event.type === "error" || event.type === "assert").length,
|
|
1040
|
+
},
|
|
1041
|
+
page_errors: pageErrors,
|
|
1042
|
+
dom_summary: {
|
|
1043
|
+
expected_viewport_count: expectedViewportCount,
|
|
1044
|
+
viewport_count: currentViewports.length,
|
|
1045
|
+
partial: expectedViewportCount > 0 && currentViewports.length < expectedViewportCount,
|
|
1046
|
+
routes: currentViewports.map((viewport) => viewport.route),
|
|
1047
|
+
titles: currentViewports.map((viewport) => viewport.title),
|
|
1048
|
+
overflow_px: currentViewports.map((viewport) => viewport.overflow_px),
|
|
1049
|
+
},
|
|
1050
|
+
};
|
|
1051
|
+
}
|
|
1052
|
+
async function saveProfileArtifacts(currentViewports) {
|
|
1053
|
+
const evidence = buildProfileEvidence(currentViewports);
|
|
1054
|
+
const result = assessProfile(profile, evidence);
|
|
1055
|
+
if (typeof saveJson === "function") {
|
|
1056
|
+
await saveJson("proof.json", result);
|
|
1057
|
+
await saveJson("console.json", { events: consoleEvents, page_errors: pageErrors });
|
|
1058
|
+
await saveJson("dom-summary.json", evidence.dom_summary);
|
|
1059
|
+
}
|
|
1060
|
+
return result;
|
|
1061
|
+
}
|
|
1062
|
+
let result = await saveProfileArtifacts(viewports);
|
|
1024
1063
|
for (const viewport of profile.target.viewports || []) {
|
|
1025
1064
|
viewports.push(await captureViewport(viewport));
|
|
1026
|
-
|
|
1027
|
-
const evidence = {
|
|
1028
|
-
version: "riddle-proof.profile-evidence.v1",
|
|
1029
|
-
profile_name: profile.name,
|
|
1030
|
-
target_url: targetUrl,
|
|
1031
|
-
baseline_policy: profile.baseline_policy || "invariant_only",
|
|
1032
|
-
captured_at: capturedAt,
|
|
1033
|
-
viewports,
|
|
1034
|
-
console: {
|
|
1035
|
-
events: consoleEvents,
|
|
1036
|
-
fatal_count: consoleEvents.filter((event) => event.type === "error" || event.type === "assert").length,
|
|
1037
|
-
},
|
|
1038
|
-
page_errors: pageErrors,
|
|
1039
|
-
dom_summary: {
|
|
1040
|
-
viewport_count: viewports.length,
|
|
1041
|
-
routes: viewports.map((viewport) => viewport.route),
|
|
1042
|
-
titles: viewports.map((viewport) => viewport.title),
|
|
1043
|
-
overflow_px: viewports.map((viewport) => viewport.overflow_px),
|
|
1044
|
-
},
|
|
1045
|
-
};
|
|
1046
|
-
const result = assessProfile(profile, evidence);
|
|
1047
|
-
if (typeof saveJson === "function") {
|
|
1048
|
-
await saveJson("proof.json", result);
|
|
1049
|
-
await saveJson("console.json", { events: consoleEvents, page_errors: pageErrors });
|
|
1050
|
-
await saveJson("dom-summary.json", evidence.dom_summary);
|
|
1065
|
+
result = await saveProfileArtifacts(viewports);
|
|
1051
1066
|
}
|
|
1052
1067
|
return result;
|
|
1053
1068
|
`.trim();
|
package/dist/cli.cjs
CHANGED
|
@@ -7236,11 +7236,13 @@ function assessSetupActionsFromEvidence(profile, evidence) {
|
|
|
7236
7236
|
message: failed.length ? `Setup actions failed in ${failed.length} viewport action(s).` : void 0
|
|
7237
7237
|
};
|
|
7238
7238
|
}
|
|
7239
|
-
function profileStatusFromEvidence(evidence, checks) {
|
|
7239
|
+
function profileStatusFromEvidence(profile, evidence, checks) {
|
|
7240
7240
|
if (!evidence) return "proof_insufficient";
|
|
7241
7241
|
const viewports = evidence.viewports || [];
|
|
7242
|
+
const expectedViewportCount = profile.target.viewports?.length || 0;
|
|
7242
7243
|
if (!viewports.length || !checks.length) return "proof_insufficient";
|
|
7243
7244
|
if (viewports.some((viewport) => viewport.navigation_error)) return "environment_blocked";
|
|
7245
|
+
if (expectedViewportCount && viewports.length < expectedViewportCount) return "proof_insufficient";
|
|
7244
7246
|
if (checks.some((check) => check.status === "needs_human_review")) return "needs_human_review";
|
|
7245
7247
|
if (checks.some((check) => check.status === "failed")) return "product_regression";
|
|
7246
7248
|
return "passed";
|
|
@@ -7251,7 +7253,7 @@ function assessRiddleProofProfileEvidence(profile, evidence, options = {}) {
|
|
|
7251
7253
|
assessSetupActionsFromEvidence(profile, evidence),
|
|
7252
7254
|
...profile.checks.map((check) => assessCheckFromEvidence(check, evidence))
|
|
7253
7255
|
].filter((check) => Boolean(check)) : [];
|
|
7254
|
-
const status = profileStatusFromEvidence(evidence, checks);
|
|
7256
|
+
const status = profileStatusFromEvidence(profile, evidence, checks);
|
|
7255
7257
|
const firstViewport = evidence?.viewports?.[0];
|
|
7256
7258
|
const screenshots = (evidence?.viewports || []).map((viewport) => viewport.screenshot_label).filter((label) => Boolean(label));
|
|
7257
7259
|
return {
|
|
@@ -7515,8 +7517,10 @@ function assessProfile(profile, evidence) {
|
|
|
7515
7517
|
checks.push({ type: check.type, label: check.label || check.type, status: "needs_human_review", evidence: {}, message: "Unsupported check type." });
|
|
7516
7518
|
}
|
|
7517
7519
|
let status = "passed";
|
|
7520
|
+
const expectedViewportCount = profile.target && Array.isArray(profile.target.viewports) ? profile.target.viewports.length : 0;
|
|
7518
7521
|
if (!viewports.length || !checks.length) status = "proof_insufficient";
|
|
7519
7522
|
else if (viewports.some((viewport) => viewport.navigation_error)) status = "environment_blocked";
|
|
7523
|
+
else if (expectedViewportCount && viewports.length < expectedViewportCount) status = "proof_insufficient";
|
|
7520
7524
|
else if (checks.some((check) => check.status === "needs_human_review")) status = "needs_human_review";
|
|
7521
7525
|
else if (checks.some((check) => check.status === "failed")) status = "product_regression";
|
|
7522
7526
|
const screenshotLabels = viewports.map((viewport) => viewport.screenshot_label).filter(Boolean);
|
|
@@ -7785,33 +7789,44 @@ async function captureViewport(viewport) {
|
|
|
7785
7789
|
}
|
|
7786
7790
|
${runtimeScriptAssessmentSource()}
|
|
7787
7791
|
const viewports = [];
|
|
7792
|
+
function buildProfileEvidence(currentViewports) {
|
|
7793
|
+
const expectedViewportCount = (profile.target.viewports || []).length;
|
|
7794
|
+
return {
|
|
7795
|
+
version: "riddle-proof.profile-evidence.v1",
|
|
7796
|
+
profile_name: profile.name,
|
|
7797
|
+
target_url: targetUrl,
|
|
7798
|
+
baseline_policy: profile.baseline_policy || "invariant_only",
|
|
7799
|
+
captured_at: capturedAt,
|
|
7800
|
+
viewports: currentViewports.slice(),
|
|
7801
|
+
console: {
|
|
7802
|
+
events: consoleEvents,
|
|
7803
|
+
fatal_count: consoleEvents.filter((event) => event.type === "error" || event.type === "assert").length,
|
|
7804
|
+
},
|
|
7805
|
+
page_errors: pageErrors,
|
|
7806
|
+
dom_summary: {
|
|
7807
|
+
expected_viewport_count: expectedViewportCount,
|
|
7808
|
+
viewport_count: currentViewports.length,
|
|
7809
|
+
partial: expectedViewportCount > 0 && currentViewports.length < expectedViewportCount,
|
|
7810
|
+
routes: currentViewports.map((viewport) => viewport.route),
|
|
7811
|
+
titles: currentViewports.map((viewport) => viewport.title),
|
|
7812
|
+
overflow_px: currentViewports.map((viewport) => viewport.overflow_px),
|
|
7813
|
+
},
|
|
7814
|
+
};
|
|
7815
|
+
}
|
|
7816
|
+
async function saveProfileArtifacts(currentViewports) {
|
|
7817
|
+
const evidence = buildProfileEvidence(currentViewports);
|
|
7818
|
+
const result = assessProfile(profile, evidence);
|
|
7819
|
+
if (typeof saveJson === "function") {
|
|
7820
|
+
await saveJson("proof.json", result);
|
|
7821
|
+
await saveJson("console.json", { events: consoleEvents, page_errors: pageErrors });
|
|
7822
|
+
await saveJson("dom-summary.json", evidence.dom_summary);
|
|
7823
|
+
}
|
|
7824
|
+
return result;
|
|
7825
|
+
}
|
|
7826
|
+
let result = await saveProfileArtifacts(viewports);
|
|
7788
7827
|
for (const viewport of profile.target.viewports || []) {
|
|
7789
7828
|
viewports.push(await captureViewport(viewport));
|
|
7790
|
-
|
|
7791
|
-
const evidence = {
|
|
7792
|
-
version: "riddle-proof.profile-evidence.v1",
|
|
7793
|
-
profile_name: profile.name,
|
|
7794
|
-
target_url: targetUrl,
|
|
7795
|
-
baseline_policy: profile.baseline_policy || "invariant_only",
|
|
7796
|
-
captured_at: capturedAt,
|
|
7797
|
-
viewports,
|
|
7798
|
-
console: {
|
|
7799
|
-
events: consoleEvents,
|
|
7800
|
-
fatal_count: consoleEvents.filter((event) => event.type === "error" || event.type === "assert").length,
|
|
7801
|
-
},
|
|
7802
|
-
page_errors: pageErrors,
|
|
7803
|
-
dom_summary: {
|
|
7804
|
-
viewport_count: viewports.length,
|
|
7805
|
-
routes: viewports.map((viewport) => viewport.route),
|
|
7806
|
-
titles: viewports.map((viewport) => viewport.title),
|
|
7807
|
-
overflow_px: viewports.map((viewport) => viewport.overflow_px),
|
|
7808
|
-
},
|
|
7809
|
-
};
|
|
7810
|
-
const result = assessProfile(profile, evidence);
|
|
7811
|
-
if (typeof saveJson === "function") {
|
|
7812
|
-
await saveJson("proof.json", result);
|
|
7813
|
-
await saveJson("console.json", { events: consoleEvents, page_errors: pageErrors });
|
|
7814
|
-
await saveJson("dom-summary.json", evidence.dom_summary);
|
|
7829
|
+
result = await saveProfileArtifacts(viewports);
|
|
7815
7830
|
}
|
|
7816
7831
|
return result;
|
|
7817
7832
|
`.trim();
|
package/dist/cli.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -9025,11 +9025,13 @@ function assessSetupActionsFromEvidence(profile, evidence) {
|
|
|
9025
9025
|
message: failed.length ? `Setup actions failed in ${failed.length} viewport action(s).` : void 0
|
|
9026
9026
|
};
|
|
9027
9027
|
}
|
|
9028
|
-
function profileStatusFromEvidence(evidence, checks) {
|
|
9028
|
+
function profileStatusFromEvidence(profile, evidence, checks) {
|
|
9029
9029
|
if (!evidence) return "proof_insufficient";
|
|
9030
9030
|
const viewports = evidence.viewports || [];
|
|
9031
|
+
const expectedViewportCount = profile.target.viewports?.length || 0;
|
|
9031
9032
|
if (!viewports.length || !checks.length) return "proof_insufficient";
|
|
9032
9033
|
if (viewports.some((viewport) => viewport.navigation_error)) return "environment_blocked";
|
|
9034
|
+
if (expectedViewportCount && viewports.length < expectedViewportCount) return "proof_insufficient";
|
|
9033
9035
|
if (checks.some((check) => check.status === "needs_human_review")) return "needs_human_review";
|
|
9034
9036
|
if (checks.some((check) => check.status === "failed")) return "product_regression";
|
|
9035
9037
|
return "passed";
|
|
@@ -9040,7 +9042,7 @@ function assessRiddleProofProfileEvidence(profile, evidence, options = {}) {
|
|
|
9040
9042
|
assessSetupActionsFromEvidence(profile, evidence),
|
|
9041
9043
|
...profile.checks.map((check) => assessCheckFromEvidence(check, evidence))
|
|
9042
9044
|
].filter((check) => Boolean(check)) : [];
|
|
9043
|
-
const status = profileStatusFromEvidence(evidence, checks);
|
|
9045
|
+
const status = profileStatusFromEvidence(profile, evidence, checks);
|
|
9044
9046
|
const firstViewport = evidence?.viewports?.[0];
|
|
9045
9047
|
const screenshots = (evidence?.viewports || []).map((viewport) => viewport.screenshot_label).filter((label) => Boolean(label));
|
|
9046
9048
|
return {
|
|
@@ -9320,8 +9322,10 @@ function assessProfile(profile, evidence) {
|
|
|
9320
9322
|
checks.push({ type: check.type, label: check.label || check.type, status: "needs_human_review", evidence: {}, message: "Unsupported check type." });
|
|
9321
9323
|
}
|
|
9322
9324
|
let status = "passed";
|
|
9325
|
+
const expectedViewportCount = profile.target && Array.isArray(profile.target.viewports) ? profile.target.viewports.length : 0;
|
|
9323
9326
|
if (!viewports.length || !checks.length) status = "proof_insufficient";
|
|
9324
9327
|
else if (viewports.some((viewport) => viewport.navigation_error)) status = "environment_blocked";
|
|
9328
|
+
else if (expectedViewportCount && viewports.length < expectedViewportCount) status = "proof_insufficient";
|
|
9325
9329
|
else if (checks.some((check) => check.status === "needs_human_review")) status = "needs_human_review";
|
|
9326
9330
|
else if (checks.some((check) => check.status === "failed")) status = "product_regression";
|
|
9327
9331
|
const screenshotLabels = viewports.map((viewport) => viewport.screenshot_label).filter(Boolean);
|
|
@@ -9590,33 +9594,44 @@ async function captureViewport(viewport) {
|
|
|
9590
9594
|
}
|
|
9591
9595
|
${runtimeScriptAssessmentSource()}
|
|
9592
9596
|
const viewports = [];
|
|
9597
|
+
function buildProfileEvidence(currentViewports) {
|
|
9598
|
+
const expectedViewportCount = (profile.target.viewports || []).length;
|
|
9599
|
+
return {
|
|
9600
|
+
version: "riddle-proof.profile-evidence.v1",
|
|
9601
|
+
profile_name: profile.name,
|
|
9602
|
+
target_url: targetUrl,
|
|
9603
|
+
baseline_policy: profile.baseline_policy || "invariant_only",
|
|
9604
|
+
captured_at: capturedAt,
|
|
9605
|
+
viewports: currentViewports.slice(),
|
|
9606
|
+
console: {
|
|
9607
|
+
events: consoleEvents,
|
|
9608
|
+
fatal_count: consoleEvents.filter((event) => event.type === "error" || event.type === "assert").length,
|
|
9609
|
+
},
|
|
9610
|
+
page_errors: pageErrors,
|
|
9611
|
+
dom_summary: {
|
|
9612
|
+
expected_viewport_count: expectedViewportCount,
|
|
9613
|
+
viewport_count: currentViewports.length,
|
|
9614
|
+
partial: expectedViewportCount > 0 && currentViewports.length < expectedViewportCount,
|
|
9615
|
+
routes: currentViewports.map((viewport) => viewport.route),
|
|
9616
|
+
titles: currentViewports.map((viewport) => viewport.title),
|
|
9617
|
+
overflow_px: currentViewports.map((viewport) => viewport.overflow_px),
|
|
9618
|
+
},
|
|
9619
|
+
};
|
|
9620
|
+
}
|
|
9621
|
+
async function saveProfileArtifacts(currentViewports) {
|
|
9622
|
+
const evidence = buildProfileEvidence(currentViewports);
|
|
9623
|
+
const result = assessProfile(profile, evidence);
|
|
9624
|
+
if (typeof saveJson === "function") {
|
|
9625
|
+
await saveJson("proof.json", result);
|
|
9626
|
+
await saveJson("console.json", { events: consoleEvents, page_errors: pageErrors });
|
|
9627
|
+
await saveJson("dom-summary.json", evidence.dom_summary);
|
|
9628
|
+
}
|
|
9629
|
+
return result;
|
|
9630
|
+
}
|
|
9631
|
+
let result = await saveProfileArtifacts(viewports);
|
|
9593
9632
|
for (const viewport of profile.target.viewports || []) {
|
|
9594
9633
|
viewports.push(await captureViewport(viewport));
|
|
9595
|
-
|
|
9596
|
-
const evidence = {
|
|
9597
|
-
version: "riddle-proof.profile-evidence.v1",
|
|
9598
|
-
profile_name: profile.name,
|
|
9599
|
-
target_url: targetUrl,
|
|
9600
|
-
baseline_policy: profile.baseline_policy || "invariant_only",
|
|
9601
|
-
captured_at: capturedAt,
|
|
9602
|
-
viewports,
|
|
9603
|
-
console: {
|
|
9604
|
-
events: consoleEvents,
|
|
9605
|
-
fatal_count: consoleEvents.filter((event) => event.type === "error" || event.type === "assert").length,
|
|
9606
|
-
},
|
|
9607
|
-
page_errors: pageErrors,
|
|
9608
|
-
dom_summary: {
|
|
9609
|
-
viewport_count: viewports.length,
|
|
9610
|
-
routes: viewports.map((viewport) => viewport.route),
|
|
9611
|
-
titles: viewports.map((viewport) => viewport.title),
|
|
9612
|
-
overflow_px: viewports.map((viewport) => viewport.overflow_px),
|
|
9613
|
-
},
|
|
9614
|
-
};
|
|
9615
|
-
const result = assessProfile(profile, evidence);
|
|
9616
|
-
if (typeof saveJson === "function") {
|
|
9617
|
-
await saveJson("proof.json", result);
|
|
9618
|
-
await saveJson("console.json", { events: consoleEvents, page_errors: pageErrors });
|
|
9619
|
-
await saveJson("dom-summary.json", evidence.dom_summary);
|
|
9634
|
+
result = await saveProfileArtifacts(viewports);
|
|
9620
9635
|
}
|
|
9621
9636
|
return result;
|
|
9622
9637
|
`.trim();
|
package/dist/index.js
CHANGED
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
resolveRiddleProofProfileTimeoutSec,
|
|
59
59
|
slugifyRiddleProofProfileName,
|
|
60
60
|
summarizeRiddleProofProfileResult
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-ZGSAXSBW.js";
|
|
62
62
|
import {
|
|
63
63
|
DEFAULT_RIDDLE_API_BASE_URL,
|
|
64
64
|
DEFAULT_RIDDLE_API_KEY_FILE,
|
package/dist/profile.cjs
CHANGED
|
@@ -499,11 +499,13 @@ function assessSetupActionsFromEvidence(profile, evidence) {
|
|
|
499
499
|
message: failed.length ? `Setup actions failed in ${failed.length} viewport action(s).` : void 0
|
|
500
500
|
};
|
|
501
501
|
}
|
|
502
|
-
function profileStatusFromEvidence(evidence, checks) {
|
|
502
|
+
function profileStatusFromEvidence(profile, evidence, checks) {
|
|
503
503
|
if (!evidence) return "proof_insufficient";
|
|
504
504
|
const viewports = evidence.viewports || [];
|
|
505
|
+
const expectedViewportCount = profile.target.viewports?.length || 0;
|
|
505
506
|
if (!viewports.length || !checks.length) return "proof_insufficient";
|
|
506
507
|
if (viewports.some((viewport) => viewport.navigation_error)) return "environment_blocked";
|
|
508
|
+
if (expectedViewportCount && viewports.length < expectedViewportCount) return "proof_insufficient";
|
|
507
509
|
if (checks.some((check) => check.status === "needs_human_review")) return "needs_human_review";
|
|
508
510
|
if (checks.some((check) => check.status === "failed")) return "product_regression";
|
|
509
511
|
return "passed";
|
|
@@ -514,7 +516,7 @@ function assessRiddleProofProfileEvidence(profile, evidence, options = {}) {
|
|
|
514
516
|
assessSetupActionsFromEvidence(profile, evidence),
|
|
515
517
|
...profile.checks.map((check) => assessCheckFromEvidence(check, evidence))
|
|
516
518
|
].filter((check) => Boolean(check)) : [];
|
|
517
|
-
const status = profileStatusFromEvidence(evidence, checks);
|
|
519
|
+
const status = profileStatusFromEvidence(profile, evidence, checks);
|
|
518
520
|
const firstViewport = evidence?.viewports?.[0];
|
|
519
521
|
const screenshots = (evidence?.viewports || []).map((viewport) => viewport.screenshot_label).filter((label) => Boolean(label));
|
|
520
522
|
return {
|
|
@@ -794,8 +796,10 @@ function assessProfile(profile, evidence) {
|
|
|
794
796
|
checks.push({ type: check.type, label: check.label || check.type, status: "needs_human_review", evidence: {}, message: "Unsupported check type." });
|
|
795
797
|
}
|
|
796
798
|
let status = "passed";
|
|
799
|
+
const expectedViewportCount = profile.target && Array.isArray(profile.target.viewports) ? profile.target.viewports.length : 0;
|
|
797
800
|
if (!viewports.length || !checks.length) status = "proof_insufficient";
|
|
798
801
|
else if (viewports.some((viewport) => viewport.navigation_error)) status = "environment_blocked";
|
|
802
|
+
else if (expectedViewportCount && viewports.length < expectedViewportCount) status = "proof_insufficient";
|
|
799
803
|
else if (checks.some((check) => check.status === "needs_human_review")) status = "needs_human_review";
|
|
800
804
|
else if (checks.some((check) => check.status === "failed")) status = "product_regression";
|
|
801
805
|
const screenshotLabels = viewports.map((viewport) => viewport.screenshot_label).filter(Boolean);
|
|
@@ -1064,33 +1068,44 @@ async function captureViewport(viewport) {
|
|
|
1064
1068
|
}
|
|
1065
1069
|
${runtimeScriptAssessmentSource()}
|
|
1066
1070
|
const viewports = [];
|
|
1071
|
+
function buildProfileEvidence(currentViewports) {
|
|
1072
|
+
const expectedViewportCount = (profile.target.viewports || []).length;
|
|
1073
|
+
return {
|
|
1074
|
+
version: "riddle-proof.profile-evidence.v1",
|
|
1075
|
+
profile_name: profile.name,
|
|
1076
|
+
target_url: targetUrl,
|
|
1077
|
+
baseline_policy: profile.baseline_policy || "invariant_only",
|
|
1078
|
+
captured_at: capturedAt,
|
|
1079
|
+
viewports: currentViewports.slice(),
|
|
1080
|
+
console: {
|
|
1081
|
+
events: consoleEvents,
|
|
1082
|
+
fatal_count: consoleEvents.filter((event) => event.type === "error" || event.type === "assert").length,
|
|
1083
|
+
},
|
|
1084
|
+
page_errors: pageErrors,
|
|
1085
|
+
dom_summary: {
|
|
1086
|
+
expected_viewport_count: expectedViewportCount,
|
|
1087
|
+
viewport_count: currentViewports.length,
|
|
1088
|
+
partial: expectedViewportCount > 0 && currentViewports.length < expectedViewportCount,
|
|
1089
|
+
routes: currentViewports.map((viewport) => viewport.route),
|
|
1090
|
+
titles: currentViewports.map((viewport) => viewport.title),
|
|
1091
|
+
overflow_px: currentViewports.map((viewport) => viewport.overflow_px),
|
|
1092
|
+
},
|
|
1093
|
+
};
|
|
1094
|
+
}
|
|
1095
|
+
async function saveProfileArtifacts(currentViewports) {
|
|
1096
|
+
const evidence = buildProfileEvidence(currentViewports);
|
|
1097
|
+
const result = assessProfile(profile, evidence);
|
|
1098
|
+
if (typeof saveJson === "function") {
|
|
1099
|
+
await saveJson("proof.json", result);
|
|
1100
|
+
await saveJson("console.json", { events: consoleEvents, page_errors: pageErrors });
|
|
1101
|
+
await saveJson("dom-summary.json", evidence.dom_summary);
|
|
1102
|
+
}
|
|
1103
|
+
return result;
|
|
1104
|
+
}
|
|
1105
|
+
let result = await saveProfileArtifacts(viewports);
|
|
1067
1106
|
for (const viewport of profile.target.viewports || []) {
|
|
1068
1107
|
viewports.push(await captureViewport(viewport));
|
|
1069
|
-
|
|
1070
|
-
const evidence = {
|
|
1071
|
-
version: "riddle-proof.profile-evidence.v1",
|
|
1072
|
-
profile_name: profile.name,
|
|
1073
|
-
target_url: targetUrl,
|
|
1074
|
-
baseline_policy: profile.baseline_policy || "invariant_only",
|
|
1075
|
-
captured_at: capturedAt,
|
|
1076
|
-
viewports,
|
|
1077
|
-
console: {
|
|
1078
|
-
events: consoleEvents,
|
|
1079
|
-
fatal_count: consoleEvents.filter((event) => event.type === "error" || event.type === "assert").length,
|
|
1080
|
-
},
|
|
1081
|
-
page_errors: pageErrors,
|
|
1082
|
-
dom_summary: {
|
|
1083
|
-
viewport_count: viewports.length,
|
|
1084
|
-
routes: viewports.map((viewport) => viewport.route),
|
|
1085
|
-
titles: viewports.map((viewport) => viewport.title),
|
|
1086
|
-
overflow_px: viewports.map((viewport) => viewport.overflow_px),
|
|
1087
|
-
},
|
|
1088
|
-
};
|
|
1089
|
-
const result = assessProfile(profile, evidence);
|
|
1090
|
-
if (typeof saveJson === "function") {
|
|
1091
|
-
await saveJson("proof.json", result);
|
|
1092
|
-
await saveJson("console.json", { events: consoleEvents, page_errors: pageErrors });
|
|
1093
|
-
await saveJson("dom-summary.json", evidence.dom_summary);
|
|
1108
|
+
result = await saveProfileArtifacts(viewports);
|
|
1094
1109
|
}
|
|
1095
1110
|
return result;
|
|
1096
1111
|
`.trim();
|
package/dist/profile.js
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
resolveRiddleProofProfileTimeoutSec,
|
|
20
20
|
slugifyRiddleProofProfileName,
|
|
21
21
|
summarizeRiddleProofProfileResult
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-ZGSAXSBW.js";
|
|
23
23
|
export {
|
|
24
24
|
RIDDLE_PROOF_PROFILE_CHECK_TYPES,
|
|
25
25
|
RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
|
|
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
292
292
|
blocking?: boolean;
|
|
293
293
|
details?: Record<string, unknown>;
|
|
294
294
|
ok: boolean;
|
|
295
|
-
action: "
|
|
295
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
|
|
296
296
|
state_path: string;
|
|
297
297
|
stage: any;
|
|
298
298
|
summary: string;
|
|
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
382
382
|
continueWithStage?: WorkflowStage | null;
|
|
383
383
|
blocking?: boolean;
|
|
384
384
|
details?: Record<string, unknown>;
|
|
385
|
-
action: "
|
|
385
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
|
|
386
386
|
state_path: string;
|
|
387
387
|
stage: any;
|
|
388
388
|
checkpoint: string;
|
|
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
659
659
|
error?: undefined;
|
|
660
660
|
} | {
|
|
661
661
|
ok: boolean;
|
|
662
|
-
action: "
|
|
662
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
|
|
663
663
|
state_path: string;
|
|
664
664
|
stage: any;
|
|
665
665
|
summary: string;
|
|
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
292
292
|
blocking?: boolean;
|
|
293
293
|
details?: Record<string, unknown>;
|
|
294
294
|
ok: boolean;
|
|
295
|
-
action: "
|
|
295
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
|
|
296
296
|
state_path: string;
|
|
297
297
|
stage: any;
|
|
298
298
|
summary: string;
|
|
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
382
382
|
continueWithStage?: WorkflowStage | null;
|
|
383
383
|
blocking?: boolean;
|
|
384
384
|
details?: Record<string, unknown>;
|
|
385
|
-
action: "
|
|
385
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
|
|
386
386
|
state_path: string;
|
|
387
387
|
stage: any;
|
|
388
388
|
checkpoint: string;
|
|
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
659
659
|
error?: undefined;
|
|
660
660
|
} | {
|
|
661
661
|
ok: boolean;
|
|
662
|
-
action: "
|
|
662
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
|
|
663
663
|
state_path: string;
|
|
664
664
|
stage: any;
|
|
665
665
|
summary: string;
|