@riddledc/riddle-proof 0.7.183 → 0.7.185
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-X24EJSIU.js → chunk-Z42O55GB.js} +16 -4
- package/dist/cli.cjs +503 -7
- package/dist/cli.js +488 -4
- package/dist/index.cjs +16 -4
- package/dist/index.js +1 -1
- package/dist/profile.cjs +16 -4
- package/dist/profile.d.cts +1 -0
- package/dist/profile.d.ts +1 -0
- package/dist/profile.js +1 -1
- package/dist/proof-run-core.d.cts +1 -1
- package/dist/proof-run-core.d.ts +1 -1
- package/dist/proof-run-engine.d.cts +3 -3
- package/dist/proof-run-engine.d.ts +3 -3
- package/examples/profiles/spa-route-exit-state-hygiene.json +76 -0
- package/package.json +1 -1
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-Z42O55GB.js";
|
|
66
66
|
import {
|
|
67
67
|
DEFAULT_RIDDLE_API_BASE_URL,
|
|
68
68
|
DEFAULT_RIDDLE_API_KEY_FILE,
|
package/dist/profile.cjs
CHANGED
|
@@ -536,8 +536,9 @@ function profileSetupWindowCallReceipts(results) {
|
|
|
536
536
|
path: result.path ?? null,
|
|
537
537
|
return_captured: result.return_captured ?? null,
|
|
538
538
|
return_stored_to: result.return_stored_to ?? null,
|
|
539
|
-
reason: result.reason ?? result.
|
|
539
|
+
reason: result.reason ?? result.store_reason ?? null
|
|
540
540
|
};
|
|
541
|
+
if (result.error !== void 0) receipt.error = result.error;
|
|
541
542
|
if (result.returned !== void 0) receipt.returned = result.returned;
|
|
542
543
|
if (result.expected_return !== void 0) receipt.expected_return = result.expected_return;
|
|
543
544
|
const returnSummary = profileSetupReturnSummary(result);
|
|
@@ -553,8 +554,9 @@ function profileSetupWindowEvalReceipts(results) {
|
|
|
553
554
|
script_length: result.script_length ?? null,
|
|
554
555
|
return_captured: result.return_captured ?? null,
|
|
555
556
|
return_stored_to: result.return_stored_to ?? null,
|
|
556
|
-
reason: result.reason ?? result.
|
|
557
|
+
reason: result.reason ?? result.store_reason ?? null
|
|
557
558
|
};
|
|
559
|
+
if (result.error !== void 0) receipt.error = result.error;
|
|
558
560
|
if (result.returned !== void 0) receipt.returned = result.returned;
|
|
559
561
|
if (result.expected_return !== void 0) receipt.expected_return = result.expected_return;
|
|
560
562
|
const returnSummary = profileSetupReturnSummary(result);
|
|
@@ -919,6 +921,7 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
|
|
|
919
921
|
selector: result.selector ?? null,
|
|
920
922
|
frame_selector: result.frame_selector ?? null,
|
|
921
923
|
reason: result.reason ?? result.error ?? null,
|
|
924
|
+
error: result.error ?? null,
|
|
922
925
|
case_insensitive_text: compactProfileSetupSummaryText(result.case_insensitive_text)
|
|
923
926
|
})),
|
|
924
927
|
optional_failed: optionalFailed.map((result) => ({
|
|
@@ -927,6 +930,7 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
|
|
|
927
930
|
selector: result.selector ?? null,
|
|
928
931
|
frame_selector: result.frame_selector ?? null,
|
|
929
932
|
reason: result.reason ?? result.error ?? null,
|
|
933
|
+
error: result.error ?? null,
|
|
930
934
|
case_insensitive_text: compactProfileSetupSummaryText(result.case_insensitive_text)
|
|
931
935
|
}))
|
|
932
936
|
};
|
|
@@ -3507,6 +3511,7 @@ function assessRiddleProofProfileEvidence(profile, evidence, options = {}) {
|
|
|
3507
3511
|
checks,
|
|
3508
3512
|
summary: summarizeRiddleProofProfileResult({ profile_name: profile.name, status, checks, viewports: evidence?.viewports || [] }),
|
|
3509
3513
|
captured_at: capturedAt,
|
|
3514
|
+
metadata: profile.metadata,
|
|
3510
3515
|
warnings: warnings.length ? warnings : void 0,
|
|
3511
3516
|
evidence,
|
|
3512
3517
|
riddle: options.riddle
|
|
@@ -3568,6 +3573,7 @@ function createRiddleProofProfileEnvironmentBlockedResult(input) {
|
|
|
3568
3573
|
checks: [],
|
|
3569
3574
|
summary: summarizeEnvironmentBlockedRunner(input.profile.name, environmentBlocker),
|
|
3570
3575
|
captured_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3576
|
+
metadata: input.profile.metadata,
|
|
3571
3577
|
warnings: warnings.length ? warnings : void 0,
|
|
3572
3578
|
riddle: input.riddle,
|
|
3573
3579
|
environment_blocker: environmentBlocker,
|
|
@@ -3644,6 +3650,7 @@ function createRiddleProofProfileInsufficientResult(input) {
|
|
|
3644
3650
|
checks: [],
|
|
3645
3651
|
summary: `${input.profile.name} did not produce enough evidence for a profile judgment.`,
|
|
3646
3652
|
captured_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3653
|
+
metadata: input.profile.metadata,
|
|
3647
3654
|
warnings: warnings.length ? warnings : void 0,
|
|
3648
3655
|
riddle: input.riddle,
|
|
3649
3656
|
error: message
|
|
@@ -4410,8 +4417,9 @@ function profileSetupWindowCallReceipts(results) {
|
|
|
4410
4417
|
path: result.path ?? null,
|
|
4411
4418
|
return_captured: result.return_captured ?? null,
|
|
4412
4419
|
return_stored_to: result.return_stored_to ?? null,
|
|
4413
|
-
reason: result.reason || result.
|
|
4420
|
+
reason: result.reason || result.store_reason || null,
|
|
4414
4421
|
};
|
|
4422
|
+
if (result.error !== undefined) receipt.error = result.error;
|
|
4415
4423
|
if (result.returned !== undefined) receipt.returned = result.returned;
|
|
4416
4424
|
if (result.expected_return !== undefined) receipt.expected_return = result.expected_return;
|
|
4417
4425
|
const returnSummary = profileSetupReturnSummary(result);
|
|
@@ -4429,8 +4437,9 @@ function profileSetupWindowEvalReceipts(results) {
|
|
|
4429
4437
|
script_length: result.script_length ?? null,
|
|
4430
4438
|
return_captured: result.return_captured ?? null,
|
|
4431
4439
|
return_stored_to: result.return_stored_to ?? null,
|
|
4432
|
-
reason: result.reason || result.
|
|
4440
|
+
reason: result.reason || result.store_reason || null,
|
|
4433
4441
|
};
|
|
4442
|
+
if (result.error !== undefined) receipt.error = result.error;
|
|
4434
4443
|
if (result.returned !== undefined) receipt.returned = result.returned;
|
|
4435
4444
|
if (result.expected_return !== undefined) receipt.expected_return = result.expected_return;
|
|
4436
4445
|
const returnSummary = profileSetupReturnSummary(result);
|
|
@@ -4840,6 +4849,7 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
|
|
|
4840
4849
|
selector: result.selector ?? null,
|
|
4841
4850
|
frame_selector: result.frame_selector ?? null,
|
|
4842
4851
|
reason: result.reason || result.error || null,
|
|
4852
|
+
error: result.error || null,
|
|
4843
4853
|
case_insensitive_text: compactProfileSetupSummaryText(result.case_insensitive_text),
|
|
4844
4854
|
})),
|
|
4845
4855
|
optional_failed: optionalFailed.map((result) => ({
|
|
@@ -4848,6 +4858,7 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
|
|
|
4848
4858
|
selector: result.selector ?? null,
|
|
4849
4859
|
frame_selector: result.frame_selector ?? null,
|
|
4850
4860
|
reason: result.reason || result.error || null,
|
|
4861
|
+
error: result.error || null,
|
|
4851
4862
|
case_insensitive_text: compactProfileSetupSummaryText(result.case_insensitive_text),
|
|
4852
4863
|
})),
|
|
4853
4864
|
};
|
|
@@ -5570,6 +5581,7 @@ function assessProfile(profile, evidence) {
|
|
|
5570
5581
|
checks,
|
|
5571
5582
|
summary,
|
|
5572
5583
|
captured_at: evidence.captured_at,
|
|
5584
|
+
metadata: profile.metadata,
|
|
5573
5585
|
warnings: profileWarnings.length ? profileWarnings : undefined,
|
|
5574
5586
|
evidence,
|
|
5575
5587
|
};
|
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-Z42O55GB.js";
|
|
27
27
|
export {
|
|
28
28
|
RIDDLE_PROOF_PROFILE_CHECK_TYPES,
|
|
29
29
|
RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
|
|
@@ -120,7 +120,7 @@ declare function buildSetupArgs(params: WorkflowParams, config: ReturnType<typeo
|
|
|
120
120
|
target_image_hash: string;
|
|
121
121
|
viewport_matrix_json: string;
|
|
122
122
|
deterministic_setup_json: string;
|
|
123
|
-
reference: "
|
|
123
|
+
reference: "before" | "prod" | "both";
|
|
124
124
|
base_branch: string;
|
|
125
125
|
before_ref: string;
|
|
126
126
|
allow_static_preview_fallback: string;
|
package/dist/proof-run-core.d.ts
CHANGED
|
@@ -120,7 +120,7 @@ declare function buildSetupArgs(params: WorkflowParams, config: ReturnType<typeo
|
|
|
120
120
|
target_image_hash: string;
|
|
121
121
|
viewport_matrix_json: string;
|
|
122
122
|
deterministic_setup_json: string;
|
|
123
|
-
reference: "
|
|
123
|
+
reference: "before" | "prod" | "both";
|
|
124
124
|
base_branch: string;
|
|
125
125
|
before_ref: string;
|
|
126
126
|
allow_static_preview_fallback: 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;
|
|
@@ -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;
|
|
@@ -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
|
+
}
|