@riddledc/riddle-proof 0.7.17 → 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/basic-gameplay.cjs +50 -5
- package/dist/basic-gameplay.d.cts +21 -3
- package/dist/basic-gameplay.d.ts +21 -3
- package/dist/basic-gameplay.js +1 -1
- package/dist/{chunk-GHQR2VEI.js → chunk-6H742VFJ.js} +50 -5
- 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 +92 -32
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- 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
package/dist/basic-gameplay.cjs
CHANGED
|
@@ -440,6 +440,22 @@ function createBasicGameplayCatchRecords(assessment, evidence) {
|
|
|
440
440
|
});
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
|
+
for (const failure of responsiveSetupFailures(route)) {
|
|
444
|
+
catches.push({
|
|
445
|
+
site: run.site || null,
|
|
446
|
+
route: route.name,
|
|
447
|
+
path: route.path,
|
|
448
|
+
code: failure.code,
|
|
449
|
+
label: failure.label,
|
|
450
|
+
type: failure.action_result?.action || "responsive_setup",
|
|
451
|
+
selector: stringValue(failure.action_result?.selector),
|
|
452
|
+
reason: failure.reason || "responsive_setup_failed",
|
|
453
|
+
phase: failure.viewport?.phase || void 0,
|
|
454
|
+
viewport: failure.viewport,
|
|
455
|
+
action_result: failure.action_result,
|
|
456
|
+
summary: `${route.name || route.path || "Route"}: responsive setup failed on ${failure.viewport?.label || "viewport"} (${failure.reason || "responsive_setup_failed"})`
|
|
457
|
+
});
|
|
458
|
+
}
|
|
443
459
|
for (const check of assessBasicGameplayProgressionChecks(route).filter((item) => item.ok === false)) {
|
|
444
460
|
catches.push({
|
|
445
461
|
site: run.site || null,
|
|
@@ -576,7 +592,7 @@ function findBasicGameplayEvidence(value, seen, depth = 0) {
|
|
|
576
592
|
return null;
|
|
577
593
|
}
|
|
578
594
|
function hasRouteShape(record) {
|
|
579
|
-
return Boolean(record && (record.initial || record.after_action || record.afterAction || record.after_cleanup || record.afterCleanup || record.action_results || record.actionResults || record.continued_cleanup_action_results || record.continuedCleanupActionResults) && (record.path || record.name));
|
|
595
|
+
return Boolean(record && (record.initial || record.after_action || record.afterAction || record.after_cleanup || record.afterCleanup || record.action_results || record.actionResults || record.continued_cleanup_action_results || record.continuedCleanupActionResults || record.responsive_viewports || record.responsiveViewports) && (record.path || record.name));
|
|
580
596
|
}
|
|
581
597
|
function changed(before, after) {
|
|
582
598
|
const bodyTextChanged = Boolean(before.body_text_hash && after.body_text_hash && before.body_text_hash !== after.body_text_hash);
|
|
@@ -596,12 +612,15 @@ function canvasHashes(canvases) {
|
|
|
596
612
|
}
|
|
597
613
|
function augmentRouteAssessmentWithProgressionChecks(result, route) {
|
|
598
614
|
const progressionFailures = assessBasicGameplayProgressionChecks(route).filter((check) => check.ok === false);
|
|
599
|
-
|
|
600
|
-
|
|
615
|
+
const responsiveFailures = responsiveSetupFailures(route);
|
|
616
|
+
if (!progressionFailures.length && !responsiveFailures.length) return result;
|
|
617
|
+
const failures = new Set(result.failures);
|
|
618
|
+
if (progressionFailures.length) failures.add("progression_assertion_failed");
|
|
619
|
+
for (const failure of responsiveFailures) failures.add(failure.code);
|
|
601
620
|
return {
|
|
602
621
|
...result,
|
|
603
622
|
ok: false,
|
|
604
|
-
failures,
|
|
623
|
+
failures: [...failures],
|
|
605
624
|
suite_failures: [
|
|
606
625
|
...result.suite_failures || [],
|
|
607
626
|
...progressionFailures.map((check) => ({
|
|
@@ -612,10 +631,36 @@ function augmentRouteAssessmentWithProgressionChecks(result, route) {
|
|
|
612
631
|
state_path: check.state_path || null,
|
|
613
632
|
state_call: check.state_call || null,
|
|
614
633
|
property_path: check.property_path || null
|
|
615
|
-
}))
|
|
634
|
+
})),
|
|
635
|
+
...responsiveFailures
|
|
616
636
|
]
|
|
617
637
|
};
|
|
618
638
|
}
|
|
639
|
+
function responsiveSetupFailures(route) {
|
|
640
|
+
const failures = [];
|
|
641
|
+
for (const viewport of responsiveViewportsForRoute(route)) {
|
|
642
|
+
for (const actionResult of listValue(viewport.setup_action_results || viewport.setupActionResults)) {
|
|
643
|
+
if (!actionResult || actionResult.ok !== false) continue;
|
|
644
|
+
failures.push({
|
|
645
|
+
code: "responsive_setup_failed",
|
|
646
|
+
label: `${viewport.label || "responsive"} ${actionResult.action || "setup action"}`,
|
|
647
|
+
reason: stringValue(actionResult.reason) || "responsive_setup_failed",
|
|
648
|
+
selector: stringValue(actionResult.selector),
|
|
649
|
+
viewport: {
|
|
650
|
+
label: viewport.label || null,
|
|
651
|
+
width: numberValue(viewport.width) || null,
|
|
652
|
+
height: numberValue(viewport.height) || null,
|
|
653
|
+
phase: viewport.phase || null
|
|
654
|
+
},
|
|
655
|
+
action_result: actionResult
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
return failures;
|
|
660
|
+
}
|
|
661
|
+
function responsiveViewportsForRoute(route) {
|
|
662
|
+
return listValue(route.responsive_viewports || route.responsiveViewports).filter((item) => Boolean(recordValue(item)));
|
|
663
|
+
}
|
|
619
664
|
function progressionChecksForRoute(route) {
|
|
620
665
|
return listValue(route.progression_checks || route.progressionChecks).filter((item) => Boolean(recordValue(item)));
|
|
621
666
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION = "riddle-proof.basic-gameplay.v1";
|
|
2
2
|
declare const RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION = "riddle-proof.basic-gameplay.assessment.v1";
|
|
3
3
|
declare const RIDDLE_PROOF_BASIC_GAMEPLAY_CATCH_VERSION = "riddle-proof.basic-gameplay.catch.v1";
|
|
4
|
-
type BasicGameplayFailureCode = "route_http_error" | "fatal_page_error" | "route_blank_or_thin" | "no_game_surface" | "mobile_horizontal_overflow" | "primary_control_missing" | "primary_control_inert" | "progression_assertion_failed";
|
|
4
|
+
type BasicGameplayFailureCode = "route_http_error" | "fatal_page_error" | "route_blank_or_thin" | "no_game_surface" | "mobile_horizontal_overflow" | "primary_control_missing" | "primary_control_inert" | "progression_assertion_failed" | "responsive_setup_failed";
|
|
5
5
|
type BasicGameplayWarningCode = "canvas_inert" | "some_actions_failed" | "missing_reset_path" | "critical_console_error";
|
|
6
6
|
interface BasicGameplayCanvasState {
|
|
7
7
|
index?: number;
|
|
@@ -95,13 +95,29 @@ interface BasicGameplayProgressionCheck {
|
|
|
95
95
|
[key: string]: unknown;
|
|
96
96
|
}
|
|
97
97
|
interface BasicGameplaySuiteFailure {
|
|
98
|
-
code: "progression_assertion_failed";
|
|
98
|
+
code: "progression_assertion_failed" | "responsive_setup_failed";
|
|
99
99
|
label?: string;
|
|
100
100
|
reason?: string | null;
|
|
101
101
|
selector?: string | null;
|
|
102
102
|
state_path?: string | null;
|
|
103
103
|
state_call?: string | null;
|
|
104
104
|
property_path?: string | null;
|
|
105
|
+
viewport?: {
|
|
106
|
+
label?: string | null;
|
|
107
|
+
width?: number | null;
|
|
108
|
+
height?: number | null;
|
|
109
|
+
phase?: string | null;
|
|
110
|
+
};
|
|
111
|
+
action_result?: BasicGameplayActionResult;
|
|
112
|
+
}
|
|
113
|
+
interface BasicGameplayResponsiveViewportEvidence {
|
|
114
|
+
label?: string;
|
|
115
|
+
width?: number;
|
|
116
|
+
height?: number;
|
|
117
|
+
phase?: string;
|
|
118
|
+
setup_action_results?: BasicGameplayActionResult[];
|
|
119
|
+
setupActionResults?: BasicGameplayActionResult[];
|
|
120
|
+
[key: string]: unknown;
|
|
105
121
|
}
|
|
106
122
|
interface BasicGameplayMobileEvidence {
|
|
107
123
|
overflow_px?: number;
|
|
@@ -132,6 +148,8 @@ interface RiddleProofBasicGameplayRouteEvidence {
|
|
|
132
148
|
continuedCleanupActionResults?: BasicGameplayActionResult[];
|
|
133
149
|
restart_action_results?: BasicGameplayActionResult[];
|
|
134
150
|
restartActionResults?: BasicGameplayActionResult[];
|
|
151
|
+
responsive_viewports?: BasicGameplayResponsiveViewportEvidence[];
|
|
152
|
+
responsiveViewports?: BasicGameplayResponsiveViewportEvidence[];
|
|
135
153
|
progression_checks?: BasicGameplayProgressionCheck[];
|
|
136
154
|
progressionChecks?: BasicGameplayProgressionCheck[];
|
|
137
155
|
requires_reset?: boolean;
|
|
@@ -296,4 +314,4 @@ declare function createBasicGameplayCatchRecords(assessment: RiddleProofBasicGam
|
|
|
296
314
|
declare function createBasicGameplayCatchSummary(input: CreateBasicGameplayCatchSummaryInput, options?: AssessBasicGameplayOptions): RiddleProofBasicGameplayCatchSummary;
|
|
297
315
|
declare function extractBasicGameplayEvidence(...sources: unknown[]): RiddleProofBasicGameplayEvidence | null;
|
|
298
316
|
|
|
299
|
-
export { type AssessBasicGameplayOptions, type AttachBasicGameplayArtifactOptions, BASIC_GAMEPLAY_ACTION_TYPES, BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES, type BasicGameplayActionResult, type BasicGameplayActionType, type BasicGameplayArtifactResolution, type BasicGameplayAssessmentSummary, type BasicGameplayCanvasState, type BasicGameplayCatchRecord, type BasicGameplayChangeSummary, type BasicGameplayFailureCode, type BasicGameplayFixReference, type BasicGameplayMetric, type BasicGameplayMobileEvidence, type BasicGameplayProgressCheckType, type BasicGameplayProgressionCheck, type BasicGameplayProofArtifact, type BasicGameplayRouteReference, type BasicGameplaySnapshot, type BasicGameplaySuiteFailure, type BasicGameplayWarningCode, type CreateBasicGameplayCatchSummaryInput, RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_CATCH_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION, type RiddleProofBasicGameplayAssessment, type RiddleProofBasicGameplayCatchSummary, type RiddleProofBasicGameplayEvidence, type RiddleProofBasicGameplayRouteAssessment, type RiddleProofBasicGameplayRouteEvidence, assessBasicGameplayEvidence, assessBasicGameplayProgressionCheck, assessBasicGameplayProgressionChecks, assessBasicGameplayRoute, attachBasicGameplayArtifactScreenshotHashes, augmentBasicGameplayAssessmentWithProgressionChecks, compactBasicGameplayText, createBasicGameplayCatchRecords, createBasicGameplayCatchSummary, extractBasicGameplayEvidence, resolveBasicGameplayProgressionCheckWithArtifactScreenshots, sanitizeBasicGameplayJsonString };
|
|
317
|
+
export { type AssessBasicGameplayOptions, type AttachBasicGameplayArtifactOptions, BASIC_GAMEPLAY_ACTION_TYPES, BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES, type BasicGameplayActionResult, type BasicGameplayActionType, type BasicGameplayArtifactResolution, type BasicGameplayAssessmentSummary, type BasicGameplayCanvasState, type BasicGameplayCatchRecord, type BasicGameplayChangeSummary, type BasicGameplayFailureCode, type BasicGameplayFixReference, type BasicGameplayMetric, type BasicGameplayMobileEvidence, type BasicGameplayProgressCheckType, type BasicGameplayProgressionCheck, type BasicGameplayProofArtifact, type BasicGameplayResponsiveViewportEvidence, type BasicGameplayRouteReference, type BasicGameplaySnapshot, type BasicGameplaySuiteFailure, type BasicGameplayWarningCode, type CreateBasicGameplayCatchSummaryInput, RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_CATCH_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION, type RiddleProofBasicGameplayAssessment, type RiddleProofBasicGameplayCatchSummary, type RiddleProofBasicGameplayEvidence, type RiddleProofBasicGameplayRouteAssessment, type RiddleProofBasicGameplayRouteEvidence, assessBasicGameplayEvidence, assessBasicGameplayProgressionCheck, assessBasicGameplayProgressionChecks, assessBasicGameplayRoute, attachBasicGameplayArtifactScreenshotHashes, augmentBasicGameplayAssessmentWithProgressionChecks, compactBasicGameplayText, createBasicGameplayCatchRecords, createBasicGameplayCatchSummary, extractBasicGameplayEvidence, resolveBasicGameplayProgressionCheckWithArtifactScreenshots, sanitizeBasicGameplayJsonString };
|
package/dist/basic-gameplay.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION = "riddle-proof.basic-gameplay.v1";
|
|
2
2
|
declare const RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION = "riddle-proof.basic-gameplay.assessment.v1";
|
|
3
3
|
declare const RIDDLE_PROOF_BASIC_GAMEPLAY_CATCH_VERSION = "riddle-proof.basic-gameplay.catch.v1";
|
|
4
|
-
type BasicGameplayFailureCode = "route_http_error" | "fatal_page_error" | "route_blank_or_thin" | "no_game_surface" | "mobile_horizontal_overflow" | "primary_control_missing" | "primary_control_inert" | "progression_assertion_failed";
|
|
4
|
+
type BasicGameplayFailureCode = "route_http_error" | "fatal_page_error" | "route_blank_or_thin" | "no_game_surface" | "mobile_horizontal_overflow" | "primary_control_missing" | "primary_control_inert" | "progression_assertion_failed" | "responsive_setup_failed";
|
|
5
5
|
type BasicGameplayWarningCode = "canvas_inert" | "some_actions_failed" | "missing_reset_path" | "critical_console_error";
|
|
6
6
|
interface BasicGameplayCanvasState {
|
|
7
7
|
index?: number;
|
|
@@ -95,13 +95,29 @@ interface BasicGameplayProgressionCheck {
|
|
|
95
95
|
[key: string]: unknown;
|
|
96
96
|
}
|
|
97
97
|
interface BasicGameplaySuiteFailure {
|
|
98
|
-
code: "progression_assertion_failed";
|
|
98
|
+
code: "progression_assertion_failed" | "responsive_setup_failed";
|
|
99
99
|
label?: string;
|
|
100
100
|
reason?: string | null;
|
|
101
101
|
selector?: string | null;
|
|
102
102
|
state_path?: string | null;
|
|
103
103
|
state_call?: string | null;
|
|
104
104
|
property_path?: string | null;
|
|
105
|
+
viewport?: {
|
|
106
|
+
label?: string | null;
|
|
107
|
+
width?: number | null;
|
|
108
|
+
height?: number | null;
|
|
109
|
+
phase?: string | null;
|
|
110
|
+
};
|
|
111
|
+
action_result?: BasicGameplayActionResult;
|
|
112
|
+
}
|
|
113
|
+
interface BasicGameplayResponsiveViewportEvidence {
|
|
114
|
+
label?: string;
|
|
115
|
+
width?: number;
|
|
116
|
+
height?: number;
|
|
117
|
+
phase?: string;
|
|
118
|
+
setup_action_results?: BasicGameplayActionResult[];
|
|
119
|
+
setupActionResults?: BasicGameplayActionResult[];
|
|
120
|
+
[key: string]: unknown;
|
|
105
121
|
}
|
|
106
122
|
interface BasicGameplayMobileEvidence {
|
|
107
123
|
overflow_px?: number;
|
|
@@ -132,6 +148,8 @@ interface RiddleProofBasicGameplayRouteEvidence {
|
|
|
132
148
|
continuedCleanupActionResults?: BasicGameplayActionResult[];
|
|
133
149
|
restart_action_results?: BasicGameplayActionResult[];
|
|
134
150
|
restartActionResults?: BasicGameplayActionResult[];
|
|
151
|
+
responsive_viewports?: BasicGameplayResponsiveViewportEvidence[];
|
|
152
|
+
responsiveViewports?: BasicGameplayResponsiveViewportEvidence[];
|
|
135
153
|
progression_checks?: BasicGameplayProgressionCheck[];
|
|
136
154
|
progressionChecks?: BasicGameplayProgressionCheck[];
|
|
137
155
|
requires_reset?: boolean;
|
|
@@ -296,4 +314,4 @@ declare function createBasicGameplayCatchRecords(assessment: RiddleProofBasicGam
|
|
|
296
314
|
declare function createBasicGameplayCatchSummary(input: CreateBasicGameplayCatchSummaryInput, options?: AssessBasicGameplayOptions): RiddleProofBasicGameplayCatchSummary;
|
|
297
315
|
declare function extractBasicGameplayEvidence(...sources: unknown[]): RiddleProofBasicGameplayEvidence | null;
|
|
298
316
|
|
|
299
|
-
export { type AssessBasicGameplayOptions, type AttachBasicGameplayArtifactOptions, BASIC_GAMEPLAY_ACTION_TYPES, BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES, type BasicGameplayActionResult, type BasicGameplayActionType, type BasicGameplayArtifactResolution, type BasicGameplayAssessmentSummary, type BasicGameplayCanvasState, type BasicGameplayCatchRecord, type BasicGameplayChangeSummary, type BasicGameplayFailureCode, type BasicGameplayFixReference, type BasicGameplayMetric, type BasicGameplayMobileEvidence, type BasicGameplayProgressCheckType, type BasicGameplayProgressionCheck, type BasicGameplayProofArtifact, type BasicGameplayRouteReference, type BasicGameplaySnapshot, type BasicGameplaySuiteFailure, type BasicGameplayWarningCode, type CreateBasicGameplayCatchSummaryInput, RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_CATCH_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION, type RiddleProofBasicGameplayAssessment, type RiddleProofBasicGameplayCatchSummary, type RiddleProofBasicGameplayEvidence, type RiddleProofBasicGameplayRouteAssessment, type RiddleProofBasicGameplayRouteEvidence, assessBasicGameplayEvidence, assessBasicGameplayProgressionCheck, assessBasicGameplayProgressionChecks, assessBasicGameplayRoute, attachBasicGameplayArtifactScreenshotHashes, augmentBasicGameplayAssessmentWithProgressionChecks, compactBasicGameplayText, createBasicGameplayCatchRecords, createBasicGameplayCatchSummary, extractBasicGameplayEvidence, resolveBasicGameplayProgressionCheckWithArtifactScreenshots, sanitizeBasicGameplayJsonString };
|
|
317
|
+
export { type AssessBasicGameplayOptions, type AttachBasicGameplayArtifactOptions, BASIC_GAMEPLAY_ACTION_TYPES, BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES, type BasicGameplayActionResult, type BasicGameplayActionType, type BasicGameplayArtifactResolution, type BasicGameplayAssessmentSummary, type BasicGameplayCanvasState, type BasicGameplayCatchRecord, type BasicGameplayChangeSummary, type BasicGameplayFailureCode, type BasicGameplayFixReference, type BasicGameplayMetric, type BasicGameplayMobileEvidence, type BasicGameplayProgressCheckType, type BasicGameplayProgressionCheck, type BasicGameplayProofArtifact, type BasicGameplayResponsiveViewportEvidence, type BasicGameplayRouteReference, type BasicGameplaySnapshot, type BasicGameplaySuiteFailure, type BasicGameplayWarningCode, type CreateBasicGameplayCatchSummaryInput, RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_CATCH_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION, type RiddleProofBasicGameplayAssessment, type RiddleProofBasicGameplayCatchSummary, type RiddleProofBasicGameplayEvidence, type RiddleProofBasicGameplayRouteAssessment, type RiddleProofBasicGameplayRouteEvidence, assessBasicGameplayEvidence, assessBasicGameplayProgressionCheck, assessBasicGameplayProgressionChecks, assessBasicGameplayRoute, attachBasicGameplayArtifactScreenshotHashes, augmentBasicGameplayAssessmentWithProgressionChecks, compactBasicGameplayText, createBasicGameplayCatchRecords, createBasicGameplayCatchSummary, extractBasicGameplayEvidence, resolveBasicGameplayProgressionCheckWithArtifactScreenshots, sanitizeBasicGameplayJsonString };
|
package/dist/basic-gameplay.js
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
extractBasicGameplayEvidence,
|
|
17
17
|
resolveBasicGameplayProgressionCheckWithArtifactScreenshots,
|
|
18
18
|
sanitizeBasicGameplayJsonString
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-6H742VFJ.js";
|
|
20
20
|
export {
|
|
21
21
|
BASIC_GAMEPLAY_ACTION_TYPES,
|
|
22
22
|
BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES,
|
|
@@ -400,6 +400,22 @@ function createBasicGameplayCatchRecords(assessment, evidence) {
|
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
|
+
for (const failure of responsiveSetupFailures(route)) {
|
|
404
|
+
catches.push({
|
|
405
|
+
site: run.site || null,
|
|
406
|
+
route: route.name,
|
|
407
|
+
path: route.path,
|
|
408
|
+
code: failure.code,
|
|
409
|
+
label: failure.label,
|
|
410
|
+
type: failure.action_result?.action || "responsive_setup",
|
|
411
|
+
selector: stringValue(failure.action_result?.selector),
|
|
412
|
+
reason: failure.reason || "responsive_setup_failed",
|
|
413
|
+
phase: failure.viewport?.phase || void 0,
|
|
414
|
+
viewport: failure.viewport,
|
|
415
|
+
action_result: failure.action_result,
|
|
416
|
+
summary: `${route.name || route.path || "Route"}: responsive setup failed on ${failure.viewport?.label || "viewport"} (${failure.reason || "responsive_setup_failed"})`
|
|
417
|
+
});
|
|
418
|
+
}
|
|
403
419
|
for (const check of assessBasicGameplayProgressionChecks(route).filter((item) => item.ok === false)) {
|
|
404
420
|
catches.push({
|
|
405
421
|
site: run.site || null,
|
|
@@ -536,7 +552,7 @@ function findBasicGameplayEvidence(value, seen, depth = 0) {
|
|
|
536
552
|
return null;
|
|
537
553
|
}
|
|
538
554
|
function hasRouteShape(record) {
|
|
539
|
-
return Boolean(record && (record.initial || record.after_action || record.afterAction || record.after_cleanup || record.afterCleanup || record.action_results || record.actionResults || record.continued_cleanup_action_results || record.continuedCleanupActionResults) && (record.path || record.name));
|
|
555
|
+
return Boolean(record && (record.initial || record.after_action || record.afterAction || record.after_cleanup || record.afterCleanup || record.action_results || record.actionResults || record.continued_cleanup_action_results || record.continuedCleanupActionResults || record.responsive_viewports || record.responsiveViewports) && (record.path || record.name));
|
|
540
556
|
}
|
|
541
557
|
function changed(before, after) {
|
|
542
558
|
const bodyTextChanged = Boolean(before.body_text_hash && after.body_text_hash && before.body_text_hash !== after.body_text_hash);
|
|
@@ -556,12 +572,15 @@ function canvasHashes(canvases) {
|
|
|
556
572
|
}
|
|
557
573
|
function augmentRouteAssessmentWithProgressionChecks(result, route) {
|
|
558
574
|
const progressionFailures = assessBasicGameplayProgressionChecks(route).filter((check) => check.ok === false);
|
|
559
|
-
|
|
560
|
-
|
|
575
|
+
const responsiveFailures = responsiveSetupFailures(route);
|
|
576
|
+
if (!progressionFailures.length && !responsiveFailures.length) return result;
|
|
577
|
+
const failures = new Set(result.failures);
|
|
578
|
+
if (progressionFailures.length) failures.add("progression_assertion_failed");
|
|
579
|
+
for (const failure of responsiveFailures) failures.add(failure.code);
|
|
561
580
|
return {
|
|
562
581
|
...result,
|
|
563
582
|
ok: false,
|
|
564
|
-
failures,
|
|
583
|
+
failures: [...failures],
|
|
565
584
|
suite_failures: [
|
|
566
585
|
...result.suite_failures || [],
|
|
567
586
|
...progressionFailures.map((check) => ({
|
|
@@ -572,10 +591,36 @@ function augmentRouteAssessmentWithProgressionChecks(result, route) {
|
|
|
572
591
|
state_path: check.state_path || null,
|
|
573
592
|
state_call: check.state_call || null,
|
|
574
593
|
property_path: check.property_path || null
|
|
575
|
-
}))
|
|
594
|
+
})),
|
|
595
|
+
...responsiveFailures
|
|
576
596
|
]
|
|
577
597
|
};
|
|
578
598
|
}
|
|
599
|
+
function responsiveSetupFailures(route) {
|
|
600
|
+
const failures = [];
|
|
601
|
+
for (const viewport of responsiveViewportsForRoute(route)) {
|
|
602
|
+
for (const actionResult of listValue(viewport.setup_action_results || viewport.setupActionResults)) {
|
|
603
|
+
if (!actionResult || actionResult.ok !== false) continue;
|
|
604
|
+
failures.push({
|
|
605
|
+
code: "responsive_setup_failed",
|
|
606
|
+
label: `${viewport.label || "responsive"} ${actionResult.action || "setup action"}`,
|
|
607
|
+
reason: stringValue(actionResult.reason) || "responsive_setup_failed",
|
|
608
|
+
selector: stringValue(actionResult.selector),
|
|
609
|
+
viewport: {
|
|
610
|
+
label: viewport.label || null,
|
|
611
|
+
width: numberValue(viewport.width) || null,
|
|
612
|
+
height: numberValue(viewport.height) || null,
|
|
613
|
+
phase: viewport.phase || null
|
|
614
|
+
},
|
|
615
|
+
action_result: actionResult
|
|
616
|
+
});
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
return failures;
|
|
620
|
+
}
|
|
621
|
+
function responsiveViewportsForRoute(route) {
|
|
622
|
+
return listValue(route.responsive_viewports || route.responsiveViewports).filter((item) => Boolean(recordValue(item)));
|
|
623
|
+
}
|
|
579
624
|
function progressionChecksForRoute(route) {
|
|
580
625
|
return listValue(route.progression_checks || route.progressionChecks).filter((item) => Boolean(recordValue(item)));
|
|
581
626
|
}
|
|
@@ -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
|
@@ -8210,6 +8210,22 @@ function createBasicGameplayCatchRecords(assessment, evidence) {
|
|
|
8210
8210
|
});
|
|
8211
8211
|
}
|
|
8212
8212
|
}
|
|
8213
|
+
for (const failure of responsiveSetupFailures(route)) {
|
|
8214
|
+
catches.push({
|
|
8215
|
+
site: run.site || null,
|
|
8216
|
+
route: route.name,
|
|
8217
|
+
path: route.path,
|
|
8218
|
+
code: failure.code,
|
|
8219
|
+
label: failure.label,
|
|
8220
|
+
type: failure.action_result?.action || "responsive_setup",
|
|
8221
|
+
selector: stringValue4(failure.action_result?.selector),
|
|
8222
|
+
reason: failure.reason || "responsive_setup_failed",
|
|
8223
|
+
phase: failure.viewport?.phase || void 0,
|
|
8224
|
+
viewport: failure.viewport,
|
|
8225
|
+
action_result: failure.action_result,
|
|
8226
|
+
summary: `${route.name || route.path || "Route"}: responsive setup failed on ${failure.viewport?.label || "viewport"} (${failure.reason || "responsive_setup_failed"})`
|
|
8227
|
+
});
|
|
8228
|
+
}
|
|
8213
8229
|
for (const check of assessBasicGameplayProgressionChecks(route).filter((item) => item.ok === false)) {
|
|
8214
8230
|
catches.push({
|
|
8215
8231
|
site: run.site || null,
|
|
@@ -8346,7 +8362,7 @@ function findBasicGameplayEvidence(value, seen, depth = 0) {
|
|
|
8346
8362
|
return null;
|
|
8347
8363
|
}
|
|
8348
8364
|
function hasRouteShape(record) {
|
|
8349
|
-
return Boolean(record && (record.initial || record.after_action || record.afterAction || record.after_cleanup || record.afterCleanup || record.action_results || record.actionResults || record.continued_cleanup_action_results || record.continuedCleanupActionResults) && (record.path || record.name));
|
|
8365
|
+
return Boolean(record && (record.initial || record.after_action || record.afterAction || record.after_cleanup || record.afterCleanup || record.action_results || record.actionResults || record.continued_cleanup_action_results || record.continuedCleanupActionResults || record.responsive_viewports || record.responsiveViewports) && (record.path || record.name));
|
|
8350
8366
|
}
|
|
8351
8367
|
function changed(before, after) {
|
|
8352
8368
|
const bodyTextChanged = Boolean(before.body_text_hash && after.body_text_hash && before.body_text_hash !== after.body_text_hash);
|
|
@@ -8366,12 +8382,15 @@ function canvasHashes(canvases) {
|
|
|
8366
8382
|
}
|
|
8367
8383
|
function augmentRouteAssessmentWithProgressionChecks(result, route) {
|
|
8368
8384
|
const progressionFailures = assessBasicGameplayProgressionChecks(route).filter((check) => check.ok === false);
|
|
8369
|
-
|
|
8370
|
-
|
|
8385
|
+
const responsiveFailures = responsiveSetupFailures(route);
|
|
8386
|
+
if (!progressionFailures.length && !responsiveFailures.length) return result;
|
|
8387
|
+
const failures = new Set(result.failures);
|
|
8388
|
+
if (progressionFailures.length) failures.add("progression_assertion_failed");
|
|
8389
|
+
for (const failure of responsiveFailures) failures.add(failure.code);
|
|
8371
8390
|
return {
|
|
8372
8391
|
...result,
|
|
8373
8392
|
ok: false,
|
|
8374
|
-
failures,
|
|
8393
|
+
failures: [...failures],
|
|
8375
8394
|
suite_failures: [
|
|
8376
8395
|
...result.suite_failures || [],
|
|
8377
8396
|
...progressionFailures.map((check) => ({
|
|
@@ -8382,10 +8401,36 @@ function augmentRouteAssessmentWithProgressionChecks(result, route) {
|
|
|
8382
8401
|
state_path: check.state_path || null,
|
|
8383
8402
|
state_call: check.state_call || null,
|
|
8384
8403
|
property_path: check.property_path || null
|
|
8385
|
-
}))
|
|
8404
|
+
})),
|
|
8405
|
+
...responsiveFailures
|
|
8386
8406
|
]
|
|
8387
8407
|
};
|
|
8388
8408
|
}
|
|
8409
|
+
function responsiveSetupFailures(route) {
|
|
8410
|
+
const failures = [];
|
|
8411
|
+
for (const viewport of responsiveViewportsForRoute(route)) {
|
|
8412
|
+
for (const actionResult of listValue2(viewport.setup_action_results || viewport.setupActionResults)) {
|
|
8413
|
+
if (!actionResult || actionResult.ok !== false) continue;
|
|
8414
|
+
failures.push({
|
|
8415
|
+
code: "responsive_setup_failed",
|
|
8416
|
+
label: `${viewport.label || "responsive"} ${actionResult.action || "setup action"}`,
|
|
8417
|
+
reason: stringValue4(actionResult.reason) || "responsive_setup_failed",
|
|
8418
|
+
selector: stringValue4(actionResult.selector),
|
|
8419
|
+
viewport: {
|
|
8420
|
+
label: viewport.label || null,
|
|
8421
|
+
width: numberValue2(viewport.width) || null,
|
|
8422
|
+
height: numberValue2(viewport.height) || null,
|
|
8423
|
+
phase: viewport.phase || null
|
|
8424
|
+
},
|
|
8425
|
+
action_result: actionResult
|
|
8426
|
+
});
|
|
8427
|
+
}
|
|
8428
|
+
}
|
|
8429
|
+
return failures;
|
|
8430
|
+
}
|
|
8431
|
+
function responsiveViewportsForRoute(route) {
|
|
8432
|
+
return listValue2(route.responsive_viewports || route.responsiveViewports).filter((item) => Boolean(recordValue3(item)));
|
|
8433
|
+
}
|
|
8389
8434
|
function progressionChecksForRoute(route) {
|
|
8390
8435
|
return listValue2(route.progression_checks || route.progressionChecks).filter((item) => Boolean(recordValue3(item)));
|
|
8391
8436
|
}
|
|
@@ -8980,11 +9025,13 @@ function assessSetupActionsFromEvidence(profile, evidence) {
|
|
|
8980
9025
|
message: failed.length ? `Setup actions failed in ${failed.length} viewport action(s).` : void 0
|
|
8981
9026
|
};
|
|
8982
9027
|
}
|
|
8983
|
-
function profileStatusFromEvidence(evidence, checks) {
|
|
9028
|
+
function profileStatusFromEvidence(profile, evidence, checks) {
|
|
8984
9029
|
if (!evidence) return "proof_insufficient";
|
|
8985
9030
|
const viewports = evidence.viewports || [];
|
|
9031
|
+
const expectedViewportCount = profile.target.viewports?.length || 0;
|
|
8986
9032
|
if (!viewports.length || !checks.length) return "proof_insufficient";
|
|
8987
9033
|
if (viewports.some((viewport) => viewport.navigation_error)) return "environment_blocked";
|
|
9034
|
+
if (expectedViewportCount && viewports.length < expectedViewportCount) return "proof_insufficient";
|
|
8988
9035
|
if (checks.some((check) => check.status === "needs_human_review")) return "needs_human_review";
|
|
8989
9036
|
if (checks.some((check) => check.status === "failed")) return "product_regression";
|
|
8990
9037
|
return "passed";
|
|
@@ -8995,7 +9042,7 @@ function assessRiddleProofProfileEvidence(profile, evidence, options = {}) {
|
|
|
8995
9042
|
assessSetupActionsFromEvidence(profile, evidence),
|
|
8996
9043
|
...profile.checks.map((check) => assessCheckFromEvidence(check, evidence))
|
|
8997
9044
|
].filter((check) => Boolean(check)) : [];
|
|
8998
|
-
const status = profileStatusFromEvidence(evidence, checks);
|
|
9045
|
+
const status = profileStatusFromEvidence(profile, evidence, checks);
|
|
8999
9046
|
const firstViewport = evidence?.viewports?.[0];
|
|
9000
9047
|
const screenshots = (evidence?.viewports || []).map((viewport) => viewport.screenshot_label).filter((label) => Boolean(label));
|
|
9001
9048
|
return {
|
|
@@ -9275,8 +9322,10 @@ function assessProfile(profile, evidence) {
|
|
|
9275
9322
|
checks.push({ type: check.type, label: check.label || check.type, status: "needs_human_review", evidence: {}, message: "Unsupported check type." });
|
|
9276
9323
|
}
|
|
9277
9324
|
let status = "passed";
|
|
9325
|
+
const expectedViewportCount = profile.target && Array.isArray(profile.target.viewports) ? profile.target.viewports.length : 0;
|
|
9278
9326
|
if (!viewports.length || !checks.length) status = "proof_insufficient";
|
|
9279
9327
|
else if (viewports.some((viewport) => viewport.navigation_error)) status = "environment_blocked";
|
|
9328
|
+
else if (expectedViewportCount && viewports.length < expectedViewportCount) status = "proof_insufficient";
|
|
9280
9329
|
else if (checks.some((check) => check.status === "needs_human_review")) status = "needs_human_review";
|
|
9281
9330
|
else if (checks.some((check) => check.status === "failed")) status = "product_regression";
|
|
9282
9331
|
const screenshotLabels = viewports.map((viewport) => viewport.screenshot_label).filter(Boolean);
|
|
@@ -9545,33 +9594,44 @@ async function captureViewport(viewport) {
|
|
|
9545
9594
|
}
|
|
9546
9595
|
${runtimeScriptAssessmentSource()}
|
|
9547
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);
|
|
9548
9632
|
for (const viewport of profile.target.viewports || []) {
|
|
9549
9633
|
viewports.push(await captureViewport(viewport));
|
|
9550
|
-
|
|
9551
|
-
const evidence = {
|
|
9552
|
-
version: "riddle-proof.profile-evidence.v1",
|
|
9553
|
-
profile_name: profile.name,
|
|
9554
|
-
target_url: targetUrl,
|
|
9555
|
-
baseline_policy: profile.baseline_policy || "invariant_only",
|
|
9556
|
-
captured_at: capturedAt,
|
|
9557
|
-
viewports,
|
|
9558
|
-
console: {
|
|
9559
|
-
events: consoleEvents,
|
|
9560
|
-
fatal_count: consoleEvents.filter((event) => event.type === "error" || event.type === "assert").length,
|
|
9561
|
-
},
|
|
9562
|
-
page_errors: pageErrors,
|
|
9563
|
-
dom_summary: {
|
|
9564
|
-
viewport_count: viewports.length,
|
|
9565
|
-
routes: viewports.map((viewport) => viewport.route),
|
|
9566
|
-
titles: viewports.map((viewport) => viewport.title),
|
|
9567
|
-
overflow_px: viewports.map((viewport) => viewport.overflow_px),
|
|
9568
|
-
},
|
|
9569
|
-
};
|
|
9570
|
-
const result = assessProfile(profile, evidence);
|
|
9571
|
-
if (typeof saveJson === "function") {
|
|
9572
|
-
await saveJson("proof.json", result);
|
|
9573
|
-
await saveJson("console.json", { events: consoleEvents, page_errors: pageErrors });
|
|
9574
|
-
await saveJson("dom-summary.json", evidence.dom_summary);
|
|
9634
|
+
result = await saveProfileArtifacts(viewports);
|
|
9575
9635
|
}
|
|
9576
9636
|
return result;
|
|
9577
9637
|
`.trim();
|
package/dist/index.d.cts
CHANGED
|
@@ -9,6 +9,6 @@ export { CodexExecAgentConfig, CodexJsonRequest, CodexJsonResult, CodexJsonRunne
|
|
|
9
9
|
export { CreateCaptureDiagnosticInput, DEFAULT_DIAGNOSTIC_ARRAY_LIMIT, DEFAULT_DIAGNOSTIC_HISTORY_LIMIT, DEFAULT_DIAGNOSTIC_STRING_LIMIT, RIDDLE_PROOF_CAPTURE_DIAGNOSTIC_VERSION, RiddleProofArtifactSummary, RiddleProofCaptureArtifactSummary, RiddleProofCaptureDiagnostic, RiddleProofDiagnosticRedactionOptions, appendCaptureDiagnostic, createCaptureDiagnostic, redactForProofDiagnostics, summarizeCaptureArtifacts } from './diagnostics.cjs';
|
|
10
10
|
export { BuildVisualProofSessionInput, RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION, RIDDLE_PROOF_VISUAL_SESSION_VERSION, VisualProofSessionMismatch, buildVisualProofSession, compareVisualProofSessionFingerprint, parseVisualProofSession, visualSessionFingerprint, visualSessionFingerprintBasis } from './proof-session.cjs';
|
|
11
11
|
export { AssessPlayabilityOptions, RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION, RIDDLE_PROOF_PLAYABILITY_VERSION, RiddleProofPlayabilityAssessment, RiddleProofPlayabilityEvidence, assessPlayabilityEvidence, extractPlayabilityEvidence, isRiddleProofPlayabilityMode } from './playability.cjs';
|
|
12
|
-
export { AssessBasicGameplayOptions, AttachBasicGameplayArtifactOptions, BASIC_GAMEPLAY_ACTION_TYPES, BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES, BasicGameplayActionResult, BasicGameplayActionType, BasicGameplayArtifactResolution, BasicGameplayAssessmentSummary, BasicGameplayCanvasState, BasicGameplayCatchRecord, BasicGameplayChangeSummary, BasicGameplayFailureCode, BasicGameplayFixReference, BasicGameplayMetric, BasicGameplayMobileEvidence, BasicGameplayProgressCheckType, BasicGameplayProgressionCheck, BasicGameplayProofArtifact, BasicGameplayRouteReference, BasicGameplaySnapshot, BasicGameplaySuiteFailure, BasicGameplayWarningCode, CreateBasicGameplayCatchSummaryInput, RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_CATCH_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION, RiddleProofBasicGameplayAssessment, RiddleProofBasicGameplayCatchSummary, RiddleProofBasicGameplayEvidence, RiddleProofBasicGameplayRouteAssessment, RiddleProofBasicGameplayRouteEvidence, assessBasicGameplayEvidence, assessBasicGameplayProgressionCheck, assessBasicGameplayProgressionChecks, assessBasicGameplayRoute, attachBasicGameplayArtifactScreenshotHashes, augmentBasicGameplayAssessmentWithProgressionChecks, compactBasicGameplayText, createBasicGameplayCatchRecords, createBasicGameplayCatchSummary, extractBasicGameplayEvidence, resolveBasicGameplayProgressionCheckWithArtifactScreenshots, sanitizeBasicGameplayJsonString } from './basic-gameplay.cjs';
|
|
12
|
+
export { AssessBasicGameplayOptions, AttachBasicGameplayArtifactOptions, BASIC_GAMEPLAY_ACTION_TYPES, BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES, BasicGameplayActionResult, BasicGameplayActionType, BasicGameplayArtifactResolution, BasicGameplayAssessmentSummary, BasicGameplayCanvasState, BasicGameplayCatchRecord, BasicGameplayChangeSummary, BasicGameplayFailureCode, BasicGameplayFixReference, BasicGameplayMetric, BasicGameplayMobileEvidence, BasicGameplayProgressCheckType, BasicGameplayProgressionCheck, BasicGameplayProofArtifact, BasicGameplayResponsiveViewportEvidence, BasicGameplayRouteReference, BasicGameplaySnapshot, BasicGameplaySuiteFailure, BasicGameplayWarningCode, CreateBasicGameplayCatchSummaryInput, RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_CATCH_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION, RiddleProofBasicGameplayAssessment, RiddleProofBasicGameplayCatchSummary, RiddleProofBasicGameplayEvidence, RiddleProofBasicGameplayRouteAssessment, RiddleProofBasicGameplayRouteEvidence, assessBasicGameplayEvidence, assessBasicGameplayProgressionCheck, assessBasicGameplayProgressionChecks, assessBasicGameplayRoute, attachBasicGameplayArtifactScreenshotHashes, augmentBasicGameplayAssessmentWithProgressionChecks, compactBasicGameplayText, createBasicGameplayCatchRecords, createBasicGameplayCatchSummary, extractBasicGameplayEvidence, resolveBasicGameplayProgressionCheckWithArtifactScreenshots, sanitizeBasicGameplayJsonString } from './basic-gameplay.cjs';
|
|
13
13
|
export { NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, RiddleProofProfile, RiddleProofProfileArtifactRef, RiddleProofProfileBaselinePolicy, RiddleProofProfileCheck, RiddleProofProfileCheckResult, RiddleProofProfileCheckType, RiddleProofProfileEvidence, RiddleProofProfileFailureAction, RiddleProofProfileResult, RiddleProofProfileRouteEvidence, RiddleProofProfileRunner, RiddleProofProfileSetupAction, RiddleProofProfileSetupActionType, RiddleProofProfileStatus, RiddleProofProfileTarget, RiddleProofProfileViewport, RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, extractRiddleProofProfileResult, normalizeRiddleProofProfile, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult } from './profile.cjs';
|
|
14
14
|
export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleClientConfig, RiddleFetch, RiddlePollJobResult, RiddlePreviewDeployResult, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, createRiddleApiClient, deployRiddleStaticPreview, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from './riddle-client.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,6 @@ export { CodexExecAgentConfig, CodexJsonRequest, CodexJsonResult, CodexJsonRunne
|
|
|
9
9
|
export { CreateCaptureDiagnosticInput, DEFAULT_DIAGNOSTIC_ARRAY_LIMIT, DEFAULT_DIAGNOSTIC_HISTORY_LIMIT, DEFAULT_DIAGNOSTIC_STRING_LIMIT, RIDDLE_PROOF_CAPTURE_DIAGNOSTIC_VERSION, RiddleProofArtifactSummary, RiddleProofCaptureArtifactSummary, RiddleProofCaptureDiagnostic, RiddleProofDiagnosticRedactionOptions, appendCaptureDiagnostic, createCaptureDiagnostic, redactForProofDiagnostics, summarizeCaptureArtifacts } from './diagnostics.js';
|
|
10
10
|
export { BuildVisualProofSessionInput, RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION, RIDDLE_PROOF_VISUAL_SESSION_VERSION, VisualProofSessionMismatch, buildVisualProofSession, compareVisualProofSessionFingerprint, parseVisualProofSession, visualSessionFingerprint, visualSessionFingerprintBasis } from './proof-session.js';
|
|
11
11
|
export { AssessPlayabilityOptions, RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION, RIDDLE_PROOF_PLAYABILITY_VERSION, RiddleProofPlayabilityAssessment, RiddleProofPlayabilityEvidence, assessPlayabilityEvidence, extractPlayabilityEvidence, isRiddleProofPlayabilityMode } from './playability.js';
|
|
12
|
-
export { AssessBasicGameplayOptions, AttachBasicGameplayArtifactOptions, BASIC_GAMEPLAY_ACTION_TYPES, BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES, BasicGameplayActionResult, BasicGameplayActionType, BasicGameplayArtifactResolution, BasicGameplayAssessmentSummary, BasicGameplayCanvasState, BasicGameplayCatchRecord, BasicGameplayChangeSummary, BasicGameplayFailureCode, BasicGameplayFixReference, BasicGameplayMetric, BasicGameplayMobileEvidence, BasicGameplayProgressCheckType, BasicGameplayProgressionCheck, BasicGameplayProofArtifact, BasicGameplayRouteReference, BasicGameplaySnapshot, BasicGameplaySuiteFailure, BasicGameplayWarningCode, CreateBasicGameplayCatchSummaryInput, RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_CATCH_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION, RiddleProofBasicGameplayAssessment, RiddleProofBasicGameplayCatchSummary, RiddleProofBasicGameplayEvidence, RiddleProofBasicGameplayRouteAssessment, RiddleProofBasicGameplayRouteEvidence, assessBasicGameplayEvidence, assessBasicGameplayProgressionCheck, assessBasicGameplayProgressionChecks, assessBasicGameplayRoute, attachBasicGameplayArtifactScreenshotHashes, augmentBasicGameplayAssessmentWithProgressionChecks, compactBasicGameplayText, createBasicGameplayCatchRecords, createBasicGameplayCatchSummary, extractBasicGameplayEvidence, resolveBasicGameplayProgressionCheckWithArtifactScreenshots, sanitizeBasicGameplayJsonString } from './basic-gameplay.js';
|
|
12
|
+
export { AssessBasicGameplayOptions, AttachBasicGameplayArtifactOptions, BASIC_GAMEPLAY_ACTION_TYPES, BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES, BasicGameplayActionResult, BasicGameplayActionType, BasicGameplayArtifactResolution, BasicGameplayAssessmentSummary, BasicGameplayCanvasState, BasicGameplayCatchRecord, BasicGameplayChangeSummary, BasicGameplayFailureCode, BasicGameplayFixReference, BasicGameplayMetric, BasicGameplayMobileEvidence, BasicGameplayProgressCheckType, BasicGameplayProgressionCheck, BasicGameplayProofArtifact, BasicGameplayResponsiveViewportEvidence, BasicGameplayRouteReference, BasicGameplaySnapshot, BasicGameplaySuiteFailure, BasicGameplayWarningCode, CreateBasicGameplayCatchSummaryInput, RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_CATCH_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION, RiddleProofBasicGameplayAssessment, RiddleProofBasicGameplayCatchSummary, RiddleProofBasicGameplayEvidence, RiddleProofBasicGameplayRouteAssessment, RiddleProofBasicGameplayRouteEvidence, assessBasicGameplayEvidence, assessBasicGameplayProgressionCheck, assessBasicGameplayProgressionChecks, assessBasicGameplayRoute, attachBasicGameplayArtifactScreenshotHashes, augmentBasicGameplayAssessmentWithProgressionChecks, compactBasicGameplayText, createBasicGameplayCatchRecords, createBasicGameplayCatchSummary, extractBasicGameplayEvidence, resolveBasicGameplayProgressionCheckWithArtifactScreenshots, sanitizeBasicGameplayJsonString } from './basic-gameplay.js';
|
|
13
13
|
export { NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, RiddleProofProfile, RiddleProofProfileArtifactRef, RiddleProofProfileBaselinePolicy, RiddleProofProfileCheck, RiddleProofProfileCheckResult, RiddleProofProfileCheckType, RiddleProofProfileEvidence, RiddleProofProfileFailureAction, RiddleProofProfileResult, RiddleProofProfileRouteEvidence, RiddleProofProfileRunner, RiddleProofProfileSetupAction, RiddleProofProfileSetupActionType, RiddleProofProfileStatus, RiddleProofProfileTarget, RiddleProofProfileViewport, RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, extractRiddleProofProfileResult, normalizeRiddleProofProfile, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult } from './profile.js';
|
|
14
14
|
export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleClientConfig, RiddleFetch, RiddlePollJobResult, RiddlePreviewDeployResult, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, createRiddleApiClient, deployRiddleStaticPreview, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from './riddle-client.js';
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
extractBasicGameplayEvidence,
|
|
37
37
|
resolveBasicGameplayProgressionCheckWithArtifactScreenshots,
|
|
38
38
|
sanitizeBasicGameplayJsonString
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-6H742VFJ.js";
|
|
40
40
|
import {
|
|
41
41
|
RIDDLE_PROOF_PROFILE_CHECK_TYPES,
|
|
42
42
|
RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
|
|
@@ -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;
|