@riddledc/riddle-proof 0.7.182 → 0.7.184
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/{chunk-XL7Q4M6D.js → chunk-5MBIRRA7.js} +16 -12
- package/dist/cli.cjs +493 -28
- package/dist/cli.js +478 -17
- package/dist/index.cjs +16 -12
- package/dist/index.js +1 -1
- package/dist/profile.cjs +16 -12
- package/dist/profile.d.cts +1 -0
- package/dist/profile.d.ts +1 -0
- package/dist/profile.js +1 -1
- package/examples/profiles/spa-route-exit-state-hygiene.json +76 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -9346,7 +9346,7 @@ function profileSetupTapReceipts(results) {
|
|
|
9346
9346
|
reason: result.reason ?? result.error ?? null
|
|
9347
9347
|
}));
|
|
9348
9348
|
}
|
|
9349
|
-
function
|
|
9349
|
+
function profileSetupKeyboardReceipts(results) {
|
|
9350
9350
|
return results.filter((result) => ["press", "key_down", "key_up"].includes(profileSetupResultAction(result))).map((result) => ({
|
|
9351
9351
|
action: profileSetupResultAction(result),
|
|
9352
9352
|
ordinal: result.ordinal ?? null,
|
|
@@ -9521,8 +9521,8 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
|
|
|
9521
9521
|
const sampledDragReceipts = sampleProfileSetupSummaryItems(dragReceipts, 8);
|
|
9522
9522
|
const tapReceipts = profileSetupTapReceipts(results);
|
|
9523
9523
|
const sampledTapReceipts = sampleProfileSetupSummaryItems(tapReceipts, 8);
|
|
9524
|
-
const
|
|
9525
|
-
const
|
|
9524
|
+
const keyboardReceipts = profileSetupKeyboardReceipts(results);
|
|
9525
|
+
const sampledKeyboardReceipts = sampleProfileSetupSummaryItems(keyboardReceipts, 8);
|
|
9526
9526
|
const canvasSignatureReceipts = profileSetupCanvasSignatureReceipts(results);
|
|
9527
9527
|
const sampledCanvasSignatureReceipts = sampleProfileSetupSummaryItems(canvasSignatureReceipts, 8);
|
|
9528
9528
|
const clickedItems = results.filter((result) => profileSetupResultAction(result) === "click" && result.ok !== false).map((result) => {
|
|
@@ -9590,9 +9590,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
|
|
|
9590
9590
|
tap_total: tapReceipts.length,
|
|
9591
9591
|
tap_truncated: tapReceipts.length > sampledTapReceipts.length,
|
|
9592
9592
|
tap: sampledTapReceipts,
|
|
9593
|
-
|
|
9594
|
-
|
|
9595
|
-
|
|
9593
|
+
keyboard_total: keyboardReceipts.length,
|
|
9594
|
+
keyboard_truncated: keyboardReceipts.length > sampledKeyboardReceipts.length,
|
|
9595
|
+
keyboard: sampledKeyboardReceipts,
|
|
9596
9596
|
canvas_signature_total: canvasSignatureReceipts.length,
|
|
9597
9597
|
canvas_signature_truncated: canvasSignatureReceipts.length > sampledCanvasSignatureReceipts.length,
|
|
9598
9598
|
canvas_signature: sampledCanvasSignatureReceipts,
|
|
@@ -12193,6 +12193,7 @@ function assessRiddleProofProfileEvidence(profile, evidence, options = {}) {
|
|
|
12193
12193
|
checks,
|
|
12194
12194
|
summary: summarizeRiddleProofProfileResult({ profile_name: profile.name, status, checks, viewports: evidence?.viewports || [] }),
|
|
12195
12195
|
captured_at: capturedAt,
|
|
12196
|
+
metadata: profile.metadata,
|
|
12196
12197
|
warnings: warnings.length ? warnings : void 0,
|
|
12197
12198
|
evidence,
|
|
12198
12199
|
riddle: options.riddle
|
|
@@ -12254,6 +12255,7 @@ function createRiddleProofProfileEnvironmentBlockedResult(input) {
|
|
|
12254
12255
|
checks: [],
|
|
12255
12256
|
summary: summarizeEnvironmentBlockedRunner(input.profile.name, environmentBlocker),
|
|
12256
12257
|
captured_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12258
|
+
metadata: input.profile.metadata,
|
|
12257
12259
|
warnings: warnings.length ? warnings : void 0,
|
|
12258
12260
|
riddle: input.riddle,
|
|
12259
12261
|
environment_blocker: environmentBlocker,
|
|
@@ -12330,6 +12332,7 @@ function createRiddleProofProfileInsufficientResult(input) {
|
|
|
12330
12332
|
checks: [],
|
|
12331
12333
|
summary: `${input.profile.name} did not produce enough evidence for a profile judgment.`,
|
|
12332
12334
|
captured_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12335
|
+
metadata: input.profile.metadata,
|
|
12333
12336
|
warnings: warnings.length ? warnings : void 0,
|
|
12334
12337
|
riddle: input.riddle,
|
|
12335
12338
|
error: message
|
|
@@ -13230,7 +13233,7 @@ function profileSetupTapReceipts(results) {
|
|
|
13230
13233
|
reason: result.reason || result.error || null,
|
|
13231
13234
|
}));
|
|
13232
13235
|
}
|
|
13233
|
-
function
|
|
13236
|
+
function profileSetupKeyboardReceipts(results) {
|
|
13234
13237
|
return (results || [])
|
|
13235
13238
|
.filter((result) => result && ["press", "key_down", "key_up"].includes(profileSetupResultAction(result)))
|
|
13236
13239
|
.map((result) => ({
|
|
@@ -13432,8 +13435,8 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
|
|
|
13432
13435
|
const sampledDragReceipts = sampleProfileSetupSummaryItems(dragReceipts, 8);
|
|
13433
13436
|
const tapReceipts = profileSetupTapReceipts(results);
|
|
13434
13437
|
const sampledTapReceipts = sampleProfileSetupSummaryItems(tapReceipts, 8);
|
|
13435
|
-
const
|
|
13436
|
-
const
|
|
13438
|
+
const keyboardReceipts = profileSetupKeyboardReceipts(results);
|
|
13439
|
+
const sampledKeyboardReceipts = sampleProfileSetupSummaryItems(keyboardReceipts, 8);
|
|
13437
13440
|
const canvasSignatureReceipts = profileSetupCanvasSignatureReceipts(results);
|
|
13438
13441
|
const sampledCanvasSignatureReceipts = sampleProfileSetupSummaryItems(canvasSignatureReceipts, 8);
|
|
13439
13442
|
const clickedItems = results
|
|
@@ -13511,9 +13514,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
|
|
|
13511
13514
|
tap_total: tapReceipts.length,
|
|
13512
13515
|
tap_truncated: tapReceipts.length > sampledTapReceipts.length,
|
|
13513
13516
|
tap: sampledTapReceipts,
|
|
13514
|
-
|
|
13515
|
-
|
|
13516
|
-
|
|
13517
|
+
keyboard_total: keyboardReceipts.length,
|
|
13518
|
+
keyboard_truncated: keyboardReceipts.length > sampledKeyboardReceipts.length,
|
|
13519
|
+
keyboard: sampledKeyboardReceipts,
|
|
13517
13520
|
canvas_signature_total: canvasSignatureReceipts.length,
|
|
13518
13521
|
canvas_signature_truncated: canvasSignatureReceipts.length > sampledCanvasSignatureReceipts.length,
|
|
13519
13522
|
canvas_signature: sampledCanvasSignatureReceipts,
|
|
@@ -14256,6 +14259,7 @@ function assessProfile(profile, evidence) {
|
|
|
14256
14259
|
checks,
|
|
14257
14260
|
summary,
|
|
14258
14261
|
captured_at: evidence.captured_at,
|
|
14262
|
+
metadata: profile.metadata,
|
|
14259
14263
|
warnings: profileWarnings.length ? profileWarnings : undefined,
|
|
14260
14264
|
evidence,
|
|
14261
14265
|
};
|
package/dist/index.js
CHANGED
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
resolveRiddleProofProfileTimeoutSec,
|
|
63
63
|
slugifyRiddleProofProfileName,
|
|
64
64
|
summarizeRiddleProofProfileResult
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-5MBIRRA7.js";
|
|
66
66
|
import {
|
|
67
67
|
DEFAULT_RIDDLE_API_BASE_URL,
|
|
68
68
|
DEFAULT_RIDDLE_API_KEY_FILE,
|
package/dist/profile.cjs
CHANGED
|
@@ -660,7 +660,7 @@ function profileSetupTapReceipts(results) {
|
|
|
660
660
|
reason: result.reason ?? result.error ?? null
|
|
661
661
|
}));
|
|
662
662
|
}
|
|
663
|
-
function
|
|
663
|
+
function profileSetupKeyboardReceipts(results) {
|
|
664
664
|
return results.filter((result) => ["press", "key_down", "key_up"].includes(profileSetupResultAction(result))).map((result) => ({
|
|
665
665
|
action: profileSetupResultAction(result),
|
|
666
666
|
ordinal: result.ordinal ?? null,
|
|
@@ -835,8 +835,8 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
|
|
|
835
835
|
const sampledDragReceipts = sampleProfileSetupSummaryItems(dragReceipts, 8);
|
|
836
836
|
const tapReceipts = profileSetupTapReceipts(results);
|
|
837
837
|
const sampledTapReceipts = sampleProfileSetupSummaryItems(tapReceipts, 8);
|
|
838
|
-
const
|
|
839
|
-
const
|
|
838
|
+
const keyboardReceipts = profileSetupKeyboardReceipts(results);
|
|
839
|
+
const sampledKeyboardReceipts = sampleProfileSetupSummaryItems(keyboardReceipts, 8);
|
|
840
840
|
const canvasSignatureReceipts = profileSetupCanvasSignatureReceipts(results);
|
|
841
841
|
const sampledCanvasSignatureReceipts = sampleProfileSetupSummaryItems(canvasSignatureReceipts, 8);
|
|
842
842
|
const clickedItems = results.filter((result) => profileSetupResultAction(result) === "click" && result.ok !== false).map((result) => {
|
|
@@ -904,9 +904,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
|
|
|
904
904
|
tap_total: tapReceipts.length,
|
|
905
905
|
tap_truncated: tapReceipts.length > sampledTapReceipts.length,
|
|
906
906
|
tap: sampledTapReceipts,
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
907
|
+
keyboard_total: keyboardReceipts.length,
|
|
908
|
+
keyboard_truncated: keyboardReceipts.length > sampledKeyboardReceipts.length,
|
|
909
|
+
keyboard: sampledKeyboardReceipts,
|
|
910
910
|
canvas_signature_total: canvasSignatureReceipts.length,
|
|
911
911
|
canvas_signature_truncated: canvasSignatureReceipts.length > sampledCanvasSignatureReceipts.length,
|
|
912
912
|
canvas_signature: sampledCanvasSignatureReceipts,
|
|
@@ -3507,6 +3507,7 @@ function assessRiddleProofProfileEvidence(profile, evidence, options = {}) {
|
|
|
3507
3507
|
checks,
|
|
3508
3508
|
summary: summarizeRiddleProofProfileResult({ profile_name: profile.name, status, checks, viewports: evidence?.viewports || [] }),
|
|
3509
3509
|
captured_at: capturedAt,
|
|
3510
|
+
metadata: profile.metadata,
|
|
3510
3511
|
warnings: warnings.length ? warnings : void 0,
|
|
3511
3512
|
evidence,
|
|
3512
3513
|
riddle: options.riddle
|
|
@@ -3568,6 +3569,7 @@ function createRiddleProofProfileEnvironmentBlockedResult(input) {
|
|
|
3568
3569
|
checks: [],
|
|
3569
3570
|
summary: summarizeEnvironmentBlockedRunner(input.profile.name, environmentBlocker),
|
|
3570
3571
|
captured_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3572
|
+
metadata: input.profile.metadata,
|
|
3571
3573
|
warnings: warnings.length ? warnings : void 0,
|
|
3572
3574
|
riddle: input.riddle,
|
|
3573
3575
|
environment_blocker: environmentBlocker,
|
|
@@ -3644,6 +3646,7 @@ function createRiddleProofProfileInsufficientResult(input) {
|
|
|
3644
3646
|
checks: [],
|
|
3645
3647
|
summary: `${input.profile.name} did not produce enough evidence for a profile judgment.`,
|
|
3646
3648
|
captured_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3649
|
+
metadata: input.profile.metadata,
|
|
3647
3650
|
warnings: warnings.length ? warnings : void 0,
|
|
3648
3651
|
riddle: input.riddle,
|
|
3649
3652
|
error: message
|
|
@@ -4544,7 +4547,7 @@ function profileSetupTapReceipts(results) {
|
|
|
4544
4547
|
reason: result.reason || result.error || null,
|
|
4545
4548
|
}));
|
|
4546
4549
|
}
|
|
4547
|
-
function
|
|
4550
|
+
function profileSetupKeyboardReceipts(results) {
|
|
4548
4551
|
return (results || [])
|
|
4549
4552
|
.filter((result) => result && ["press", "key_down", "key_up"].includes(profileSetupResultAction(result)))
|
|
4550
4553
|
.map((result) => ({
|
|
@@ -4746,8 +4749,8 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
|
|
|
4746
4749
|
const sampledDragReceipts = sampleProfileSetupSummaryItems(dragReceipts, 8);
|
|
4747
4750
|
const tapReceipts = profileSetupTapReceipts(results);
|
|
4748
4751
|
const sampledTapReceipts = sampleProfileSetupSummaryItems(tapReceipts, 8);
|
|
4749
|
-
const
|
|
4750
|
-
const
|
|
4752
|
+
const keyboardReceipts = profileSetupKeyboardReceipts(results);
|
|
4753
|
+
const sampledKeyboardReceipts = sampleProfileSetupSummaryItems(keyboardReceipts, 8);
|
|
4751
4754
|
const canvasSignatureReceipts = profileSetupCanvasSignatureReceipts(results);
|
|
4752
4755
|
const sampledCanvasSignatureReceipts = sampleProfileSetupSummaryItems(canvasSignatureReceipts, 8);
|
|
4753
4756
|
const clickedItems = results
|
|
@@ -4825,9 +4828,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
|
|
|
4825
4828
|
tap_total: tapReceipts.length,
|
|
4826
4829
|
tap_truncated: tapReceipts.length > sampledTapReceipts.length,
|
|
4827
4830
|
tap: sampledTapReceipts,
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
+
keyboard_total: keyboardReceipts.length,
|
|
4832
|
+
keyboard_truncated: keyboardReceipts.length > sampledKeyboardReceipts.length,
|
|
4833
|
+
keyboard: sampledKeyboardReceipts,
|
|
4831
4834
|
canvas_signature_total: canvasSignatureReceipts.length,
|
|
4832
4835
|
canvas_signature_truncated: canvasSignatureReceipts.length > sampledCanvasSignatureReceipts.length,
|
|
4833
4836
|
canvas_signature: sampledCanvasSignatureReceipts,
|
|
@@ -5570,6 +5573,7 @@ function assessProfile(profile, evidence) {
|
|
|
5570
5573
|
checks,
|
|
5571
5574
|
summary,
|
|
5572
5575
|
captured_at: evidence.captured_at,
|
|
5576
|
+
metadata: profile.metadata,
|
|
5573
5577
|
warnings: profileWarnings.length ? profileWarnings : undefined,
|
|
5574
5578
|
evidence,
|
|
5575
5579
|
};
|
package/dist/profile.d.cts
CHANGED
package/dist/profile.d.ts
CHANGED
package/dist/profile.js
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
resolveRiddleProofProfileTimeoutSec,
|
|
24
24
|
slugifyRiddleProofProfileName,
|
|
25
25
|
summarizeRiddleProofProfileResult
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-5MBIRRA7.js";
|
|
27
27
|
export {
|
|
28
28
|
RIDDLE_PROOF_PROFILE_CHECK_TYPES,
|
|
29
29
|
RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "riddle-proof.profile.v1",
|
|
3
|
+
"name": "spa-route-exit-state-hygiene",
|
|
4
|
+
"target": {
|
|
5
|
+
"route": "/games/example?proof=1",
|
|
6
|
+
"viewports": [
|
|
7
|
+
{ "name": "phone", "width": 390, "height": 844 },
|
|
8
|
+
{ "name": "ipad-mini", "width": 768, "height": 1024 },
|
|
9
|
+
{ "name": "ipad", "width": 820, "height": 1180 },
|
|
10
|
+
{ "name": "desktop", "width": 1440, "height": 1000 }
|
|
11
|
+
],
|
|
12
|
+
"timeout_sec": 300,
|
|
13
|
+
"wait_for_selector": "#game-root",
|
|
14
|
+
"screenshot_mode": "viewport",
|
|
15
|
+
"setup_actions": [
|
|
16
|
+
{ "type": "clear_storage", "storage": "both", "reload": true },
|
|
17
|
+
{ "type": "wait_for_selector", "selector": "#game-root", "timeout_ms": 20000 },
|
|
18
|
+
{ "type": "wait_for_selector", "selector": "#game-root canvas, #game-root [data-proof-ready='true']", "timeout_ms": 20000 },
|
|
19
|
+
{
|
|
20
|
+
"type": "window_eval",
|
|
21
|
+
"label": "capture-route-active-state",
|
|
22
|
+
"timeout_ms": 10000,
|
|
23
|
+
"store_return_to": "__rpRouteExit.active",
|
|
24
|
+
"script": "const proof=window.__exampleRouteProof?.read?.()||{};const watched=['__exampleRouteProof','__exampleProofLastReceipt','exampleTouchState'];const activeGlobals=watched.filter((name)=>Object.prototype.hasOwnProperty.call(window,name)&&window[name]!==undefined);const out={ready:proof.ready===true,route:location.pathname,activeGlobals,activeGlobalCount:activeGlobals.length,receiptId:String(proof.receiptId||''),mode:String(proof.mode||'')};out.ok=out.ready===true&&out.activeGlobalCount>0;window.__rpRouteExit={...(window.__rpRouteExit||{}),active:out};return out;",
|
|
25
|
+
"return_summary_fields": [
|
|
26
|
+
{ "path": "ok" },
|
|
27
|
+
{ "path": "ready" },
|
|
28
|
+
{ "path": "route" },
|
|
29
|
+
{ "path": "activeGlobalCount" },
|
|
30
|
+
{ "path": "activeGlobals" }
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{ "type": "assert_window_value", "path": "__rpRouteExit.active.ok", "expected_value": true, "timeout_ms": 10000 },
|
|
34
|
+
{ "type": "screenshot", "label": "route-active-state", "mode": "viewport" },
|
|
35
|
+
{ "type": "click", "selector": "[data-testid='nav-home'], .nav-logo, a[href='/']", "timeout_ms": 10000 },
|
|
36
|
+
{ "type": "wait_for_selector", "selector": "[data-testid='home-page'], main, [data-route='home']", "timeout_ms": 20000 },
|
|
37
|
+
{
|
|
38
|
+
"type": "window_eval",
|
|
39
|
+
"label": "capture-route-exit-cleanup",
|
|
40
|
+
"timeout_ms": 10000,
|
|
41
|
+
"store_return_to": "__rpRouteExit.cleanup",
|
|
42
|
+
"script": "const watched=['__exampleRouteProof','__exampleProofLastReceipt','exampleTouchState'];const staleNames=watched.filter((name)=>Object.prototype.hasOwnProperty.call(window,name)&&window[name]!==undefined);const out={ok:location.pathname==='/'&&staleNames.length===0,route:location.pathname,staleNames,staleCount:staleNames.length};window.__rpRouteExit={...(window.__rpRouteExit||{}),cleanup:out};return out;",
|
|
43
|
+
"return_summary_fields": [
|
|
44
|
+
{ "path": "ok" },
|
|
45
|
+
{ "path": "route" },
|
|
46
|
+
{ "path": "staleCount" },
|
|
47
|
+
{ "path": "staleNames" }
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{ "type": "assert_window_value", "path": "__rpRouteExit.cleanup.ok", "expected_value": true, "timeout_ms": 10000 },
|
|
51
|
+
{ "type": "assert_window_number", "path": "__rpRouteExit.cleanup.staleCount", "expected_value": 0, "timeout_ms": 10000 },
|
|
52
|
+
{ "type": "screenshot", "label": "home-after-route-exit-cleanup", "mode": "viewport" }
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"checks": [
|
|
56
|
+
{ "type": "route_loaded", "expected_path": "/" },
|
|
57
|
+
{ "type": "selector_visible", "selector": "[data-testid='home-page'], main, [data-route='home']" },
|
|
58
|
+
{ "type": "text_absent", "pattern": "\\bNaN\\b" },
|
|
59
|
+
{ "type": "text_absent", "pattern": "undefined", "flags": "i" },
|
|
60
|
+
{ "type": "text_absent", "pattern": "\\[object Object\\]" },
|
|
61
|
+
{ "type": "no_horizontal_overflow", "max_overflow_px": 1 },
|
|
62
|
+
{ "type": "no_mobile_horizontal_overflow", "max_overflow_px": 1 },
|
|
63
|
+
{ "type": "no_fatal_console_errors" },
|
|
64
|
+
{ "type": "no_console_warnings" }
|
|
65
|
+
],
|
|
66
|
+
"artifacts": ["screenshot", "console", "dom_summary", "proof_json"],
|
|
67
|
+
"baseline_policy": "invariant_only",
|
|
68
|
+
"failure_policy": {
|
|
69
|
+
"environment_blocked": "neutral",
|
|
70
|
+
"proof_insufficient": "fail",
|
|
71
|
+
"product_regression": "fail"
|
|
72
|
+
},
|
|
73
|
+
"metadata": {
|
|
74
|
+
"purpose": "Template for SPA route-exit hygiene profiles. Replace the example route, selectors, and watched globals with route-local proof helpers, receipts, timers, input state, or touch state that must exist while the feature route is active and must be removed after visible UI navigation returns home."
|
|
75
|
+
}
|
|
76
|
+
}
|