@riddledc/riddle-proof 0.7.74 → 0.7.75

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 CHANGED
@@ -262,7 +262,8 @@ transport control, or other bounded interaction. Supported setup actions are
262
262
  `click`, `drag`, `press`, `fill`, `set_input_value`, `assert_text_visible`,
263
263
  `assert_text_absent`, `assert_selector_count`, `assert_window_value`,
264
264
  `assert_window_number`, `local_storage`, `session_storage`, `clear_storage`,
265
- `screenshot`, `wait`, `wait_for_selector`, `wait_for_text`, and `window_call`;
265
+ `clear_console`, `screenshot`, `wait`, `wait_for_selector`, `wait_for_text`,
266
+ and `window_call`;
266
267
  a failed setup action is recorded as a failed `setup_actions_succeeded` check so
267
268
  the profile cannot pass without reaching the intended state. Text-matched `click` actions prefer
268
269
  visible matching elements, which keeps responsive layouts from selecting hidden
@@ -294,10 +295,14 @@ distance, elapsed time, score, or retry counters.
294
295
  `local_storage` and `session_storage` accept a `key` plus string `value` or
295
296
  JSON `json` / `value_json`, and can reload the page with `reload: true`.
296
297
  `clear_storage` clears `local`, `session`, or `both` browser storage scopes,
297
- defaults to `both`, and can also reload with `reload: true`. Any setup action
298
- can include `repeat` / `repeat_count` / `times` from 1 to 100; each repetition
299
- is recorded with `repeat_index` and `repeat_count`, and `after_ms` runs after
300
- each repetition. Use it for bounded game proof helpers, retry controls, or other
298
+ defaults to `both`, and can also reload with `reload: true`. Use
299
+ `clear_console` after setup reaches the intended proof state when expected
300
+ bootstrap console or page errors should not count against the final
301
+ `no_fatal_console_errors` invariant. It clears recorded console events and page
302
+ errors, but keeps network mock hit evidence intact. Any setup action can include
303
+ `repeat` / `repeat_count` / `times` from 1 to 100; each repetition is recorded
304
+ with `repeat_index` and `repeat_count`, and `after_ms` runs after each
305
+ repetition. Use it for bounded game proof helpers, retry controls, or other
301
306
  workflows where one declarative action needs to advance the app several times.
302
307
  Use `screenshot` with an optional `label` to capture durable Riddle screenshots
303
308
  at important setup milestones, such as after a route switch, terminal state, or
@@ -46,6 +46,7 @@ var RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES = [
46
46
  "local_storage",
47
47
  "session_storage",
48
48
  "clear_storage",
49
+ "clear_console",
49
50
  "screenshot",
50
51
  "wait",
51
52
  "wait_for_selector",
@@ -307,7 +308,7 @@ function isSupportedCheckType(value) {
307
308
  }
308
309
  function normalizeSetupActionType(value, index) {
309
310
  const normalizedInput = String(value || "").trim().replace(/-/g, "_");
310
- const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput === "pointer_drag" || normalizedInput === "mouse_drag" || normalizedInput === "drag_to" ? "drag" : normalizedInput === "keyboard_press" || normalizedInput === "key_press" ? "press" : normalizedInput === "capture_screenshot" || normalizedInput === "save_screenshot" || normalizedInput === "setup_screenshot" ? "screenshot" : normalizedInput;
311
+ const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput === "reset_console" || normalizedInput === "clear_browser_console" || normalizedInput === "reset_browser_console" ? "clear_console" : normalizedInput === "pointer_drag" || normalizedInput === "mouse_drag" || normalizedInput === "drag_to" ? "drag" : normalizedInput === "keyboard_press" || normalizedInput === "key_press" ? "press" : normalizedInput === "capture_screenshot" || normalizedInput === "save_screenshot" || normalizedInput === "setup_screenshot" ? "screenshot" : normalizedInput;
311
312
  if (RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES.includes(normalized)) {
312
313
  return normalized;
313
314
  }
@@ -2859,6 +2860,13 @@ async function executeSetupAction(action, ordinal, viewport) {
2859
2860
  await saveScreenshot(label);
2860
2861
  return { ...base, ok: true, label: rawLabel, screenshot_label: label };
2861
2862
  }
2863
+ if (type === "clear_console") {
2864
+ const cleared_console_event_count = consoleEvents.length;
2865
+ const cleared_page_error_count = pageErrors.length;
2866
+ consoleEvents.length = 0;
2867
+ pageErrors.length = 0;
2868
+ return { ...base, ok: true, cleared_console_event_count, cleared_page_error_count };
2869
+ }
2862
2870
  if (type === "wait_for_selector") {
2863
2871
  const scope = await setupActionScope(action, timeout);
2864
2872
  if (!scope.ok) return setupScopeFailure(base, scope);
package/dist/cli.cjs CHANGED
@@ -6919,6 +6919,7 @@ var RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES = [
6919
6919
  "local_storage",
6920
6920
  "session_storage",
6921
6921
  "clear_storage",
6922
+ "clear_console",
6922
6923
  "screenshot",
6923
6924
  "wait",
6924
6925
  "wait_for_selector",
@@ -7180,7 +7181,7 @@ function isSupportedCheckType(value) {
7180
7181
  }
7181
7182
  function normalizeSetupActionType(value, index) {
7182
7183
  const normalizedInput = String(value || "").trim().replace(/-/g, "_");
7183
- const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput === "pointer_drag" || normalizedInput === "mouse_drag" || normalizedInput === "drag_to" ? "drag" : normalizedInput === "keyboard_press" || normalizedInput === "key_press" ? "press" : normalizedInput === "capture_screenshot" || normalizedInput === "save_screenshot" || normalizedInput === "setup_screenshot" ? "screenshot" : normalizedInput;
7184
+ const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput === "reset_console" || normalizedInput === "clear_browser_console" || normalizedInput === "reset_browser_console" ? "clear_console" : normalizedInput === "pointer_drag" || normalizedInput === "mouse_drag" || normalizedInput === "drag_to" ? "drag" : normalizedInput === "keyboard_press" || normalizedInput === "key_press" ? "press" : normalizedInput === "capture_screenshot" || normalizedInput === "save_screenshot" || normalizedInput === "setup_screenshot" ? "screenshot" : normalizedInput;
7184
7185
  if (RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES.includes(normalized)) {
7185
7186
  return normalized;
7186
7187
  }
@@ -9716,6 +9717,13 @@ async function executeSetupAction(action, ordinal, viewport) {
9716
9717
  await saveScreenshot(label);
9717
9718
  return { ...base, ok: true, label: rawLabel, screenshot_label: label };
9718
9719
  }
9720
+ if (type === "clear_console") {
9721
+ const cleared_console_event_count = consoleEvents.length;
9722
+ const cleared_page_error_count = pageErrors.length;
9723
+ consoleEvents.length = 0;
9724
+ pageErrors.length = 0;
9725
+ return { ...base, ok: true, cleared_console_event_count, cleared_page_error_count };
9726
+ }
9719
9727
  if (type === "wait_for_selector") {
9720
9728
  const scope = await setupActionScope(action, timeout);
9721
9729
  if (!scope.ok) return setupScopeFailure(base, scope);
package/dist/cli.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  profileStatusExitCode,
11
11
  resolveRiddleProofProfileTargetUrl,
12
12
  resolveRiddleProofProfileTimeoutSec
13
- } from "./chunk-HXYLTNZT.js";
13
+ } from "./chunk-ILB4HKPH.js";
14
14
  import {
15
15
  createRiddleApiClient,
16
16
  parseRiddleViewport
package/dist/index.cjs CHANGED
@@ -8760,6 +8760,7 @@ var RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES = [
8760
8760
  "local_storage",
8761
8761
  "session_storage",
8762
8762
  "clear_storage",
8763
+ "clear_console",
8763
8764
  "screenshot",
8764
8765
  "wait",
8765
8766
  "wait_for_selector",
@@ -9021,7 +9022,7 @@ function isSupportedCheckType(value) {
9021
9022
  }
9022
9023
  function normalizeSetupActionType(value, index) {
9023
9024
  const normalizedInput = String(value || "").trim().replace(/-/g, "_");
9024
- const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput === "pointer_drag" || normalizedInput === "mouse_drag" || normalizedInput === "drag_to" ? "drag" : normalizedInput === "keyboard_press" || normalizedInput === "key_press" ? "press" : normalizedInput === "capture_screenshot" || normalizedInput === "save_screenshot" || normalizedInput === "setup_screenshot" ? "screenshot" : normalizedInput;
9025
+ const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput === "reset_console" || normalizedInput === "clear_browser_console" || normalizedInput === "reset_browser_console" ? "clear_console" : normalizedInput === "pointer_drag" || normalizedInput === "mouse_drag" || normalizedInput === "drag_to" ? "drag" : normalizedInput === "keyboard_press" || normalizedInput === "key_press" ? "press" : normalizedInput === "capture_screenshot" || normalizedInput === "save_screenshot" || normalizedInput === "setup_screenshot" ? "screenshot" : normalizedInput;
9025
9026
  if (RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES.includes(normalized)) {
9026
9027
  return normalized;
9027
9028
  }
@@ -11573,6 +11574,13 @@ async function executeSetupAction(action, ordinal, viewport) {
11573
11574
  await saveScreenshot(label);
11574
11575
  return { ...base, ok: true, label: rawLabel, screenshot_label: label };
11575
11576
  }
11577
+ if (type === "clear_console") {
11578
+ const cleared_console_event_count = consoleEvents.length;
11579
+ const cleared_page_error_count = pageErrors.length;
11580
+ consoleEvents.length = 0;
11581
+ pageErrors.length = 0;
11582
+ return { ...base, ok: true, cleared_console_event_count, cleared_page_error_count };
11583
+ }
11576
11584
  if (type === "wait_for_selector") {
11577
11585
  const scope = await setupActionScope(action, timeout);
11578
11586
  if (!scope.ok) return setupScopeFailure(base, scope);
package/dist/index.js CHANGED
@@ -58,7 +58,7 @@ import {
58
58
  resolveRiddleProofProfileTimeoutSec,
59
59
  slugifyRiddleProofProfileName,
60
60
  summarizeRiddleProofProfileResult
61
- } from "./chunk-HXYLTNZT.js";
61
+ } from "./chunk-ILB4HKPH.js";
62
62
  import {
63
63
  DEFAULT_RIDDLE_API_BASE_URL,
64
64
  DEFAULT_RIDDLE_API_KEY_FILE,
package/dist/profile.cjs CHANGED
@@ -89,6 +89,7 @@ var RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES = [
89
89
  "local_storage",
90
90
  "session_storage",
91
91
  "clear_storage",
92
+ "clear_console",
92
93
  "screenshot",
93
94
  "wait",
94
95
  "wait_for_selector",
@@ -350,7 +351,7 @@ function isSupportedCheckType(value) {
350
351
  }
351
352
  function normalizeSetupActionType(value, index) {
352
353
  const normalizedInput = String(value || "").trim().replace(/-/g, "_");
353
- const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput === "pointer_drag" || normalizedInput === "mouse_drag" || normalizedInput === "drag_to" ? "drag" : normalizedInput === "keyboard_press" || normalizedInput === "key_press" ? "press" : normalizedInput === "capture_screenshot" || normalizedInput === "save_screenshot" || normalizedInput === "setup_screenshot" ? "screenshot" : normalizedInput;
354
+ const normalized = normalizedInput === "clear_browser_storage" ? "clear_storage" : normalizedInput === "reset_console" || normalizedInput === "clear_browser_console" || normalizedInput === "reset_browser_console" ? "clear_console" : normalizedInput === "pointer_drag" || normalizedInput === "mouse_drag" || normalizedInput === "drag_to" ? "drag" : normalizedInput === "keyboard_press" || normalizedInput === "key_press" ? "press" : normalizedInput === "capture_screenshot" || normalizedInput === "save_screenshot" || normalizedInput === "setup_screenshot" ? "screenshot" : normalizedInput;
354
355
  if (RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES.includes(normalized)) {
355
356
  return normalized;
356
357
  }
@@ -2902,6 +2903,13 @@ async function executeSetupAction(action, ordinal, viewport) {
2902
2903
  await saveScreenshot(label);
2903
2904
  return { ...base, ok: true, label: rawLabel, screenshot_label: label };
2904
2905
  }
2906
+ if (type === "clear_console") {
2907
+ const cleared_console_event_count = consoleEvents.length;
2908
+ const cleared_page_error_count = pageErrors.length;
2909
+ consoleEvents.length = 0;
2910
+ pageErrors.length = 0;
2911
+ return { ...base, ok: true, cleared_console_event_count, cleared_page_error_count };
2912
+ }
2905
2913
  if (type === "wait_for_selector") {
2906
2914
  const scope = await setupActionScope(action, timeout);
2907
2915
  if (!scope.ok) return setupScopeFailure(base, scope);
@@ -5,7 +5,7 @@ declare const RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION: "riddle-proof.profile-evide
5
5
  declare const RIDDLE_PROOF_PROFILE_RESULT_VERSION: "riddle-proof.profile-result.v1";
6
6
  declare const RIDDLE_PROOF_PROFILE_STATUSES: readonly ["passed", "product_regression", "proof_insufficient", "environment_blocked", "configuration_error", "needs_human_review"];
7
7
  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", "selector_text_order", "frame_text_visible", "frame_url_equals", "frame_url_matches", "frame_no_horizontal_overflow", "text_visible", "text_absent", "route_inventory", "no_horizontal_overflow", "no_mobile_horizontal_overflow", "no_fatal_console_errors"];
8
- declare const RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES: readonly ["click", "drag", "press", "fill", "set_input_value", "assert_text_visible", "assert_text_absent", "assert_selector_count", "assert_window_value", "assert_window_number", "local_storage", "session_storage", "clear_storage", "screenshot", "wait", "wait_for_selector", "wait_for_text", "window_call"];
8
+ declare const RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES: readonly ["click", "drag", "press", "fill", "set_input_value", "assert_text_visible", "assert_text_absent", "assert_selector_count", "assert_window_value", "assert_window_number", "local_storage", "session_storage", "clear_storage", "clear_console", "screenshot", "wait", "wait_for_selector", "wait_for_text", "window_call"];
9
9
  type RiddleProofProfileStatus = typeof RIDDLE_PROOF_PROFILE_STATUSES[number];
10
10
  type RiddleProofProfileCheckType = typeof RIDDLE_PROOF_PROFILE_CHECK_TYPES[number];
11
11
  type RiddleProofProfileSetupActionType = typeof RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES[number];
package/dist/profile.d.ts CHANGED
@@ -5,7 +5,7 @@ declare const RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION: "riddle-proof.profile-evide
5
5
  declare const RIDDLE_PROOF_PROFILE_RESULT_VERSION: "riddle-proof.profile-result.v1";
6
6
  declare const RIDDLE_PROOF_PROFILE_STATUSES: readonly ["passed", "product_regression", "proof_insufficient", "environment_blocked", "configuration_error", "needs_human_review"];
7
7
  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", "selector_text_order", "frame_text_visible", "frame_url_equals", "frame_url_matches", "frame_no_horizontal_overflow", "text_visible", "text_absent", "route_inventory", "no_horizontal_overflow", "no_mobile_horizontal_overflow", "no_fatal_console_errors"];
8
- declare const RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES: readonly ["click", "drag", "press", "fill", "set_input_value", "assert_text_visible", "assert_text_absent", "assert_selector_count", "assert_window_value", "assert_window_number", "local_storage", "session_storage", "clear_storage", "screenshot", "wait", "wait_for_selector", "wait_for_text", "window_call"];
8
+ declare const RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES: readonly ["click", "drag", "press", "fill", "set_input_value", "assert_text_visible", "assert_text_absent", "assert_selector_count", "assert_window_value", "assert_window_number", "local_storage", "session_storage", "clear_storage", "clear_console", "screenshot", "wait", "wait_for_selector", "wait_for_text", "window_call"];
9
9
  type RiddleProofProfileStatus = typeof RIDDLE_PROOF_PROFILE_STATUSES[number];
10
10
  type RiddleProofProfileCheckType = typeof RIDDLE_PROOF_PROFILE_CHECK_TYPES[number];
11
11
  type RiddleProofProfileSetupActionType = typeof RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES[number];
package/dist/profile.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  resolveRiddleProofProfileTimeoutSec,
20
20
  slugifyRiddleProofProfileName,
21
21
  summarizeRiddleProofProfileResult
22
- } from "./chunk-HXYLTNZT.js";
22
+ } from "./chunk-ILB4HKPH.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: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
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: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
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: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
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: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
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: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
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: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
662
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
663
663
  state_path: string;
664
664
  stage: any;
665
665
  summary: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.7.74",
3
+ "version": "0.7.75",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",