@riddledc/riddle-proof 0.8.79 → 0.8.81

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/profile.d.ts CHANGED
@@ -5,7 +5,7 @@ declare const RIDDLE_PROOF_PROFILE_VERSION: "riddle-proof.profile.v1";
5
5
  declare const RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION: "riddle-proof.profile-evidence.v1";
6
6
  declare const RIDDLE_PROOF_PROFILE_RESULT_VERSION: "riddle-proof.profile-result.v1";
7
7
  declare const RIDDLE_PROOF_PROFILE_STATUSES: readonly ["passed", "product_regression", "proof_insufficient", "environment_blocked", "configuration_error", "needs_human_review"];
8
- declare const RIDDLE_PROOF_PROFILE_CHECK_TYPES: readonly ["route_loaded", "url_search_param_equals", "url_search_param_absent", "selector_visible", "selector_absent", "selector_count_at_least", "selector_count_equals", "selector_count_equal", "selector_count_eq", "dialog_count_equals", "dialog_accept_count_equals", "dialog_dismiss_count_equals", "selector_text_visible", "selector_text_absent", "selector_text_order", "observe_within", "frame_text_visible", "frame_url_equals", "frame_url_matches", "frame_no_horizontal_overflow", "text_visible", "text_absent", "http_status", "link_status", "artifact_link_status", "route_inventory", "no_horizontal_overflow", "no_mobile_horizontal_overflow", "no_fatal_console_errors", "no_console_warnings"];
8
+ declare const RIDDLE_PROOF_PROFILE_CHECK_TYPES: readonly ["route_loaded", "url_search_param_equals", "url_search_param_absent", "selector_visible", "selector_absent", "selector_count_at_least", "selector_count_equals", "selector_count_equal", "selector_count_eq", "dialog_count_equals", "dialog_accept_count_equals", "dialog_dismiss_count_equals", "selector_text_visible", "selector_text_absent", "selector_text_order", "ordered_trace", "observe_within", "frame_text_visible", "frame_url_equals", "frame_url_matches", "frame_no_horizontal_overflow", "text_visible", "text_absent", "http_status", "link_status", "artifact_link_status", "route_inventory", "no_horizontal_overflow", "no_mobile_horizontal_overflow", "no_fatal_console_errors", "no_console_warnings"];
9
9
  declare const RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES: readonly ["click", "tap", "tap_until", "drag", "press", "key_down", "key_up", "fill", "set_input_value", "set_range_value", "deterministic_runtime", "canvas_signature", "assert_text_visible", "assert_text_absent", "assert_selector_count", "assert_window_value", "assert_window_number", "local_storage", "session_storage", "clear_storage", "clear_console", "dialog_response", "screenshot", "wait", "wait_for_selector", "wait_for_text", "window_eval", "window_call", "window_call_until"];
10
10
  type RiddleProofProfileStatus = typeof RIDDLE_PROOF_PROFILE_STATUSES[number];
11
11
  type RiddleProofProfileCheckType = typeof RIDDLE_PROOF_PROFILE_CHECK_TYPES[number];
@@ -40,6 +40,36 @@ interface RiddleProofProfileHttpStatusPreflightFetchResponse {
40
40
  }
41
41
  type RiddleProofProfileHttpStatusPreflightFetch = (url: string, init?: Record<string, unknown>) => Promise<RiddleProofProfileHttpStatusPreflightFetchResponse>;
42
42
  type RiddleProofProfileJsonValueType = "array" | "boolean" | "null" | "number" | "object" | "string";
43
+ declare const RIDDLE_PROOF_ORDERED_TRACE_OPERATORS: readonly ["exists", "equals", "not_equals", "truthy", "falsy", "gt", "gte", "lt", "lte", "abs_gt", "abs_gte", "abs_lt", "abs_lte"];
44
+ type RiddleProofOrderedTraceOperator = typeof RIDDLE_PROOF_ORDERED_TRACE_OPERATORS[number];
45
+ interface RiddleProofOrderedTracePredicate {
46
+ path: string;
47
+ op: RiddleProofOrderedTraceOperator;
48
+ value?: JsonValue;
49
+ }
50
+ interface RiddleProofOrderedTraceEvent {
51
+ label: string;
52
+ predicates: RiddleProofOrderedTracePredicate[];
53
+ }
54
+ interface RiddleProofOrderedTraceWitness {
55
+ label: string;
56
+ index: number;
57
+ observations: Array<{
58
+ path: string;
59
+ op: RiddleProofOrderedTraceOperator;
60
+ expected?: JsonValue;
61
+ observed: JsonValue;
62
+ }>;
63
+ }
64
+ interface RiddleProofOrderedTraceAssessment {
65
+ version: "riddle-proof.ordered-trace-assessment.v1";
66
+ status: "passed" | "failed" | "proof_insufficient";
67
+ trace_length: number;
68
+ witnesses: RiddleProofOrderedTraceWitness[];
69
+ missing_event?: string;
70
+ missing_paths?: string[];
71
+ reason?: string;
72
+ }
43
73
  interface RiddleProofProfileHttpStatusBodyJsonAssertion {
44
74
  label?: string;
45
75
  path: string;
@@ -107,6 +137,8 @@ interface RiddleProofProfileViewport {
107
137
  name: string;
108
138
  width: number;
109
139
  height: number;
140
+ hasTouch?: boolean;
141
+ isMobile?: boolean;
110
142
  }
111
143
  interface RiddleProofProfileSetupAction {
112
144
  type: RiddleProofProfileSetupActionType;
@@ -246,6 +278,9 @@ interface RiddleProofProfileCheck {
246
278
  body_not_patterns?: string[];
247
279
  body_json_assertions?: RiddleProofProfileHttpStatusBodyJsonAssertion[];
248
280
  expected_texts?: string[];
281
+ setup_action_label?: string;
282
+ trace_path?: string;
283
+ events?: RiddleProofOrderedTraceEvent[];
249
284
  link_selector?: string;
250
285
  source_selector?: string;
251
286
  route_path_prefix?: string;
@@ -372,7 +407,7 @@ interface RiddleProofProfileEvidence {
372
407
  interface RiddleProofProfileCheckResult {
373
408
  type: RiddleProofProfileCheckType | (string & {});
374
409
  label?: string;
375
- status: "passed" | "failed" | "skipped" | "needs_human_review";
410
+ status: "passed" | "failed" | "skipped" | "proof_insufficient" | "needs_human_review";
376
411
  evidence: Record<string, JsonValue>;
377
412
  message?: string;
378
413
  }
@@ -454,6 +489,8 @@ interface NormalizeRiddleProofProfileOptions {
454
489
  route?: string;
455
490
  viewports?: RiddleProofProfileViewport[];
456
491
  }
492
+ declare function assessRiddleProofOrderedTrace(trace: unknown, events: RiddleProofOrderedTraceEvent[]): RiddleProofOrderedTraceAssessment;
493
+ declare function assessRiddleProofOrderedTraceSetupResults(results: unknown, setupActionLabel: string, tracePath: string, events: RiddleProofOrderedTraceEvent[]): RiddleProofOrderedTraceAssessment;
457
494
  declare function slugifyRiddleProofProfileName(value: string): string;
458
495
  declare function collectRiddleProofProfileWarnings(profile: RiddleProofProfile): string[];
459
496
  declare function normalizeRiddleProofProfile(input: unknown, options?: NormalizeRiddleProofProfileOptions): RiddleProofProfile;
@@ -514,4 +551,4 @@ declare function buildRiddleProofProfileScript(profile: RiddleProofProfile): str
514
551
  declare function collectRiddleProfileArtifactRefs(input: unknown): RiddleProofProfileArtifactRef[];
515
552
  declare function extractRiddleProofProfileResult(input: unknown): RiddleProofProfileResult | undefined;
516
553
 
517
- export { type NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_HOSTED_PROFILE_ARTIFACTS, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, type RiddleProofArtifactBodyAssertionInput, type RiddleProofArtifactBodyAssertionResult, type RiddleProofProfile, type RiddleProofProfileArtifactCompleteness, type RiddleProofProfileArtifactRef, type RiddleProofProfileBaselinePolicy, type RiddleProofProfileBoundsOffender, type RiddleProofProfileCheck, type RiddleProofProfileCheckResult, type RiddleProofProfileCheckType, type RiddleProofProfileEvidence, type RiddleProofProfileFailureAction, type RiddleProofProfileHttpStatusBodyJsonAssertion, type RiddleProofProfileHttpStatusBodyJsonAssertionResult, type RiddleProofProfileHttpStatusPreflightCheckResult, type RiddleProofProfileHttpStatusPreflightFetch, type RiddleProofProfileHttpStatusPreflightFetchResponse, type RiddleProofProfileHttpStatusPreflightOptions, type RiddleProofProfileHttpStatusPreflightResult, type RiddleProofProfileJsonValueType, type RiddleProofProfileNetworkAbortErrorCode, type RiddleProofProfileNetworkMock, type RiddleProofProfileNetworkMockResponse, type RiddleProofProfileResult, type RiddleProofProfileReturnSummaryField, type RiddleProofProfileRouteEvidence, type RiddleProofProfileRouteInventoryRoute, type RiddleProofProfileRunner, type RiddleProofProfileRunnerArtifactPreflight, type RiddleProofProfileSetupAction, type RiddleProofProfileSetupActionType, type RiddleProofProfileStatus, type RiddleProofProfileTarget, type RiddleProofProfileViewport, type RiddleProofProfileViewportEvidence, applyRiddleProofProfileArtifactCompleteness, assessRiddleProofProfileArtifactCompleteness, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, preflightRiddleProofProfileHttpStatusChecks, preflightRiddleProofProfileRunnerArtifacts, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult };
554
+ export { type NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_HOSTED_PROFILE_ARTIFACTS, RIDDLE_PROOF_ORDERED_TRACE_OPERATORS, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, type RiddleProofArtifactBodyAssertionInput, type RiddleProofArtifactBodyAssertionResult, type RiddleProofOrderedTraceAssessment, type RiddleProofOrderedTraceEvent, type RiddleProofOrderedTraceOperator, type RiddleProofOrderedTracePredicate, type RiddleProofOrderedTraceWitness, type RiddleProofProfile, type RiddleProofProfileArtifactCompleteness, type RiddleProofProfileArtifactRef, type RiddleProofProfileBaselinePolicy, type RiddleProofProfileBoundsOffender, type RiddleProofProfileCheck, type RiddleProofProfileCheckResult, type RiddleProofProfileCheckType, type RiddleProofProfileEvidence, type RiddleProofProfileFailureAction, type RiddleProofProfileHttpStatusBodyJsonAssertion, type RiddleProofProfileHttpStatusBodyJsonAssertionResult, type RiddleProofProfileHttpStatusPreflightCheckResult, type RiddleProofProfileHttpStatusPreflightFetch, type RiddleProofProfileHttpStatusPreflightFetchResponse, type RiddleProofProfileHttpStatusPreflightOptions, type RiddleProofProfileHttpStatusPreflightResult, type RiddleProofProfileJsonValueType, type RiddleProofProfileNetworkAbortErrorCode, type RiddleProofProfileNetworkMock, type RiddleProofProfileNetworkMockResponse, type RiddleProofProfileResult, type RiddleProofProfileReturnSummaryField, type RiddleProofProfileRouteEvidence, type RiddleProofProfileRouteInventoryRoute, type RiddleProofProfileRunner, type RiddleProofProfileRunnerArtifactPreflight, type RiddleProofProfileSetupAction, type RiddleProofProfileSetupActionType, type RiddleProofProfileStatus, type RiddleProofProfileTarget, type RiddleProofProfileViewport, type RiddleProofProfileViewportEvidence, applyRiddleProofProfileArtifactCompleteness, assessRiddleProofOrderedTrace, assessRiddleProofOrderedTraceSetupResults, assessRiddleProofProfileArtifactCompleteness, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, preflightRiddleProofProfileHttpStatusChecks, preflightRiddleProofProfileRunnerArtifacts, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult };
package/dist/profile.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  RIDDLE_PROOF_HOSTED_PROFILE_ARTIFACTS,
3
+ RIDDLE_PROOF_ORDERED_TRACE_OPERATORS,
3
4
  RIDDLE_PROOF_PROFILE_CHECK_TYPES,
4
5
  RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
5
6
  RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES,
@@ -8,6 +9,8 @@ import {
8
9
  RIDDLE_PROOF_PROFILE_STATUSES,
9
10
  RIDDLE_PROOF_PROFILE_VERSION,
10
11
  applyRiddleProofProfileArtifactCompleteness,
12
+ assessRiddleProofOrderedTrace,
13
+ assessRiddleProofOrderedTraceSetupResults,
11
14
  assessRiddleProofProfileArtifactCompleteness,
12
15
  assessRiddleProofProfileEvidence,
13
16
  buildRiddleProofProfileScript,
@@ -27,10 +30,11 @@ import {
27
30
  resolveRiddleProofProfileTimeoutSec,
28
31
  slugifyRiddleProofProfileName,
29
32
  summarizeRiddleProofProfileResult
30
- } from "./chunk-FCSJZBC5.js";
33
+ } from "./chunk-2K3DIK7A.js";
31
34
  import "./chunk-MLKGABMK.js";
32
35
  export {
33
36
  RIDDLE_PROOF_HOSTED_PROFILE_ARTIFACTS,
37
+ RIDDLE_PROOF_ORDERED_TRACE_OPERATORS,
34
38
  RIDDLE_PROOF_PROFILE_CHECK_TYPES,
35
39
  RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
36
40
  RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES,
@@ -39,6 +43,8 @@ export {
39
43
  RIDDLE_PROOF_PROFILE_STATUSES,
40
44
  RIDDLE_PROOF_PROFILE_VERSION,
41
45
  applyRiddleProofProfileArtifactCompleteness,
46
+ assessRiddleProofOrderedTrace,
47
+ assessRiddleProofOrderedTraceSetupResults,
42
48
  assessRiddleProofProfileArtifactCompleteness,
43
49
  assessRiddleProofProfileEvidence,
44
50
  buildRiddleProofProfileScript,
@@ -0,0 +1,58 @@
1
+ {
2
+ "version": "riddle-proof.profile.v1",
3
+ "name": "ordered-interaction-trace",
4
+ "target": {
5
+ "route": "/",
6
+ "viewports": [
7
+ { "name": "tablet", "width": 768, "height": 1024 }
8
+ ],
9
+ "setup_actions": [
10
+ {
11
+ "type": "window_eval",
12
+ "label": "capture interaction trace",
13
+ "script": "return { trace: Array.isArray(window.__RIDDLE_PROOF_TRACE__) ? window.__RIDDLE_PROOF_TRACE__ : [] };"
14
+ }
15
+ ]
16
+ },
17
+ "checks": [
18
+ { "type": "route_loaded", "expected_path": "/" },
19
+ {
20
+ "type": "ordered_trace",
21
+ "label": "input to release",
22
+ "setup_action_label": "capture interaction trace",
23
+ "trace_path": "trace",
24
+ "events": [
25
+ {
26
+ "label": "input",
27
+ "predicates": [
28
+ { "path": "active", "op": "equals", "value": true },
29
+ { "path": "target", "op": "abs_gte", "value": 0.8 }
30
+ ]
31
+ },
32
+ {
33
+ "label": "response",
34
+ "predicates": [
35
+ { "path": "applied", "op": "abs_gte", "value": 0.1 }
36
+ ]
37
+ },
38
+ {
39
+ "label": "release",
40
+ "predicates": [
41
+ { "path": "active", "op": "equals", "value": false },
42
+ { "path": "applied", "op": "abs_gte", "value": 0.05 }
43
+ ]
44
+ },
45
+ {
46
+ "label": "idle",
47
+ "predicates": [
48
+ { "path": "active", "op": "equals", "value": false },
49
+ { "path": "applied", "op": "equals", "value": 0 }
50
+ ]
51
+ }
52
+ ]
53
+ },
54
+ { "type": "no_fatal_console_errors" }
55
+ ],
56
+ "artifacts": ["screenshot", "console", "dom_summary", "proof_json"],
57
+ "baseline_policy": "invariant_only"
58
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.8.79",
3
+ "version": "0.8.81",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",