@riddledc/riddle-proof 0.7.107 → 0.7.109

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
@@ -167,7 +167,8 @@ or as a stronger proof base before a change loop.
167
167
  { "type": "text_visible", "text": "Start building" },
168
168
  { "type": "text_visible", "text": "Compare plans", "viewports": ["desktop"] },
169
169
  { "type": "no_mobile_horizontal_overflow" },
170
- { "type": "no_fatal_console_errors" }
170
+ { "type": "no_fatal_console_errors" },
171
+ { "type": "no_console_warnings" }
171
172
  ],
172
173
  "artifacts": ["screenshot", "console", "dom_summary", "proof_json"],
173
174
  "failure_policy": {
@@ -377,6 +378,11 @@ match both the console text and the event location URL, which is useful for
377
378
  expected resource probes where the browser message is generic but the URL is
378
379
  specific.
379
380
 
381
+ Use `no_console_warnings` when warning hygiene is part of the contract, such as
382
+ a docs or evidence page that should not accumulate preload or image warnings.
383
+ It supports the same `allowed_console_patterns` and `allowed_console_texts`
384
+ fields, but only unallowed `warning` console events fail the check.
385
+
380
386
  Use `selector_absent` when a forbidden element must not render, and
381
387
  `selector_count_equals` / `selector_count_equal` / `selector_count_eq` when a
382
388
  profile needs an exact DOM count rather than a lower bound:
@@ -520,8 +526,13 @@ artifact links should fail the profile:
520
526
  ```
521
527
 
522
528
  The check defaults to `a[href]`, deduplicates URLs, probes up to 100 selected
523
- URLs, and treats HTTP `2xx` / `3xx` responses as healthy. Use
524
- `allowed_statuses` or `expected_status` when a narrower status contract is
529
+ URLs, and treats HTTP `2xx` / `3xx` responses as healthy. `expected_count` and
530
+ `min_count` apply to the probed URL set after same-origin filtering, URL
531
+ deduplication, and the `max_links` limit. The run summary also reports
532
+ `discovered_count` when it differs, which helps explain cases where a page has
533
+ two DOM nodes pointing at the same artifact URL. Use `dedupe: false` when the
534
+ contract should count duplicate DOM candidates instead of unique artifact URLs.
535
+ Use `allowed_statuses` or `expected_status` when a narrower status contract is
525
536
  intentional, `min_count` for lower-bound audits, `min_bytes` when a one-byte
526
537
  range response is too weak, `allowed_content_types` for MIME checks, and
527
538
  `max_links` when the selected set is intentionally larger than 100.
@@ -35,7 +35,8 @@ var RIDDLE_PROOF_PROFILE_CHECK_TYPES = [
35
35
  "route_inventory",
36
36
  "no_horizontal_overflow",
37
37
  "no_mobile_horizontal_overflow",
38
- "no_fatal_console_errors"
38
+ "no_fatal_console_errors",
39
+ "no_console_warnings"
39
40
  ];
40
41
  var RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES = [
41
42
  "click",
@@ -1866,6 +1867,26 @@ function assessCheckFromEvidence(check, evidence) {
1866
1867
  message: fatalCount ? `${fatalCount} fatal browser error(s) were captured.` : void 0
1867
1868
  };
1868
1869
  }
1870
+ if (check.type === "no_console_warnings") {
1871
+ const warningConsoleEvents = (evidence.console?.events || []).filter((event) => event.type === "warning" || event.type === "warn");
1872
+ const allowedConsoleEvents = warningConsoleEvents.filter((event) => matchesAllowedMessage(event, check.allowed_console_texts, check.allowed_console_patterns));
1873
+ const unallowedConsoleEvents = warningConsoleEvents.filter((event) => !matchesAllowedMessage(event, check.allowed_console_texts, check.allowed_console_patterns));
1874
+ return {
1875
+ type: check.type,
1876
+ label: checkLabel(check),
1877
+ status: unallowedConsoleEvents.length ? "failed" : "passed",
1878
+ evidence: {
1879
+ console_warning_count: unallowedConsoleEvents.length,
1880
+ total_console_warning_count: warningConsoleEvents.length,
1881
+ allowed_console_warning_count: allowedConsoleEvents.length,
1882
+ allowed_console_texts: check.allowed_console_texts || [],
1883
+ allowed_console_patterns: check.allowed_console_patterns || [],
1884
+ unallowed_console_warning_samples: unallowedConsoleEvents.slice(0, 5).map((event) => allowedMessageSample(event)),
1885
+ allowed_console_warning_samples: allowedConsoleEvents.slice(0, 5).map((event) => allowedMessageSample(event))
1886
+ },
1887
+ message: unallowedConsoleEvents.length ? `${unallowedConsoleEvents.length} console warning(s) were captured.` : void 0
1888
+ };
1889
+ }
1869
1890
  return {
1870
1891
  type: check.type,
1871
1892
  label: checkLabel(check),
@@ -3456,6 +3477,27 @@ function assessProfile(profile, evidence) {
3456
3477
  });
3457
3478
  continue;
3458
3479
  }
3480
+ if (check.type === "no_console_warnings") {
3481
+ const warningConsoleEvents = ((evidence.console && evidence.console.events) || []).filter((event) => event && (event.type === "warning" || event.type === "warn"));
3482
+ const allowedConsoleEvents = warningConsoleEvents.filter((event) => matchesAllowedMessage(event, check.allowed_console_texts, check.allowed_console_patterns));
3483
+ const unallowedConsoleEvents = warningConsoleEvents.filter((event) => !matchesAllowedMessage(event, check.allowed_console_texts, check.allowed_console_patterns));
3484
+ checks.push({
3485
+ type: check.type,
3486
+ label: check.label || check.type,
3487
+ status: unallowedConsoleEvents.length ? "failed" : "passed",
3488
+ evidence: {
3489
+ console_warning_count: unallowedConsoleEvents.length,
3490
+ total_console_warning_count: warningConsoleEvents.length,
3491
+ allowed_console_warning_count: allowedConsoleEvents.length,
3492
+ allowed_console_texts: check.allowed_console_texts || [],
3493
+ allowed_console_patterns: check.allowed_console_patterns || [],
3494
+ unallowed_console_warning_samples: unallowedConsoleEvents.slice(0, 5).map((event) => allowedMessageSample(event)),
3495
+ allowed_console_warning_samples: allowedConsoleEvents.slice(0, 5).map((event) => allowedMessageSample(event)),
3496
+ },
3497
+ message: unallowedConsoleEvents.length ? String(unallowedConsoleEvents.length) + " console warning(s) were captured." : undefined,
3498
+ });
3499
+ continue;
3500
+ }
3459
3501
  checks.push({ type: check.type, label: check.label || check.type, status: "needs_human_review", evidence: {}, message: "Unsupported check type." });
3460
3502
  }
3461
3503
  let status = "passed";
package/dist/cli.cjs CHANGED
@@ -6928,7 +6928,8 @@ var RIDDLE_PROOF_PROFILE_CHECK_TYPES = [
6928
6928
  "route_inventory",
6929
6929
  "no_horizontal_overflow",
6930
6930
  "no_mobile_horizontal_overflow",
6931
- "no_fatal_console_errors"
6931
+ "no_fatal_console_errors",
6932
+ "no_console_warnings"
6932
6933
  ];
6933
6934
  var RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES = [
6934
6935
  "click",
@@ -8759,6 +8760,26 @@ function assessCheckFromEvidence(check, evidence) {
8759
8760
  message: fatalCount ? `${fatalCount} fatal browser error(s) were captured.` : void 0
8760
8761
  };
8761
8762
  }
8763
+ if (check.type === "no_console_warnings") {
8764
+ const warningConsoleEvents = (evidence.console?.events || []).filter((event) => event.type === "warning" || event.type === "warn");
8765
+ const allowedConsoleEvents = warningConsoleEvents.filter((event) => matchesAllowedMessage(event, check.allowed_console_texts, check.allowed_console_patterns));
8766
+ const unallowedConsoleEvents = warningConsoleEvents.filter((event) => !matchesAllowedMessage(event, check.allowed_console_texts, check.allowed_console_patterns));
8767
+ return {
8768
+ type: check.type,
8769
+ label: checkLabel(check),
8770
+ status: unallowedConsoleEvents.length ? "failed" : "passed",
8771
+ evidence: {
8772
+ console_warning_count: unallowedConsoleEvents.length,
8773
+ total_console_warning_count: warningConsoleEvents.length,
8774
+ allowed_console_warning_count: allowedConsoleEvents.length,
8775
+ allowed_console_texts: check.allowed_console_texts || [],
8776
+ allowed_console_patterns: check.allowed_console_patterns || [],
8777
+ unallowed_console_warning_samples: unallowedConsoleEvents.slice(0, 5).map((event) => allowedMessageSample(event)),
8778
+ allowed_console_warning_samples: allowedConsoleEvents.slice(0, 5).map((event) => allowedMessageSample(event))
8779
+ },
8780
+ message: unallowedConsoleEvents.length ? `${unallowedConsoleEvents.length} console warning(s) were captured.` : void 0
8781
+ };
8782
+ }
8762
8783
  return {
8763
8784
  type: check.type,
8764
8785
  label: checkLabel(check),
@@ -10333,6 +10354,27 @@ function assessProfile(profile, evidence) {
10333
10354
  });
10334
10355
  continue;
10335
10356
  }
10357
+ if (check.type === "no_console_warnings") {
10358
+ const warningConsoleEvents = ((evidence.console && evidence.console.events) || []).filter((event) => event && (event.type === "warning" || event.type === "warn"));
10359
+ const allowedConsoleEvents = warningConsoleEvents.filter((event) => matchesAllowedMessage(event, check.allowed_console_texts, check.allowed_console_patterns));
10360
+ const unallowedConsoleEvents = warningConsoleEvents.filter((event) => !matchesAllowedMessage(event, check.allowed_console_texts, check.allowed_console_patterns));
10361
+ checks.push({
10362
+ type: check.type,
10363
+ label: check.label || check.type,
10364
+ status: unallowedConsoleEvents.length ? "failed" : "passed",
10365
+ evidence: {
10366
+ console_warning_count: unallowedConsoleEvents.length,
10367
+ total_console_warning_count: warningConsoleEvents.length,
10368
+ allowed_console_warning_count: allowedConsoleEvents.length,
10369
+ allowed_console_texts: check.allowed_console_texts || [],
10370
+ allowed_console_patterns: check.allowed_console_patterns || [],
10371
+ unallowed_console_warning_samples: unallowedConsoleEvents.slice(0, 5).map((event) => allowedMessageSample(event)),
10372
+ allowed_console_warning_samples: allowedConsoleEvents.slice(0, 5).map((event) => allowedMessageSample(event)),
10373
+ },
10374
+ message: unallowedConsoleEvents.length ? String(unallowedConsoleEvents.length) + " console warning(s) were captured." : undefined,
10375
+ });
10376
+ continue;
10377
+ }
10336
10378
  checks.push({ type: check.type, label: check.label || check.type, status: "needs_human_review", evidence: {}, message: "Unsupported check type." });
10337
10379
  }
10338
10380
  let status = "passed";
@@ -12869,8 +12911,8 @@ function profileCheckMarkdownTarget(check) {
12869
12911
  const minCount = cliFiniteNumber(evidence.min_count);
12870
12912
  const minBytes = cliFiniteNumber(evidence.min_bytes);
12871
12913
  const parts = [];
12872
- if (expectedCount !== void 0) parts.push(`links = ${expectedCount}`);
12873
- else if (minCount !== void 0) parts.push(`links >= ${minCount}`);
12914
+ if (expectedCount !== void 0) parts.push(`probed links = ${expectedCount}`);
12915
+ else if (minCount !== void 0) parts.push(`probed links >= ${minCount}`);
12874
12916
  if (minBytes !== void 0) parts.push(`bytes >= ${minBytes}`);
12875
12917
  if (selector && parts.length) return `${markdownInlineCode(selector)} ${parts.join(", ")}`;
12876
12918
  return selector ? markdownInlineCode(selector) : parts.join(", ") || void 0;
@@ -12882,6 +12924,10 @@ function profileCheckMarkdownTarget(check) {
12882
12924
  if (check.type === "no_fatal_console_errors") {
12883
12925
  return "0 unallowed fatal errors";
12884
12926
  }
12927
+ if (check.type === "no_console_warnings") {
12928
+ const warningCount = cliFiniteNumber(evidence.console_warning_count) ?? 0;
12929
+ return `${warningCount} unallowed warning${warningCount === 1 ? "" : "s"}`;
12930
+ }
12885
12931
  return void 0;
12886
12932
  }
12887
12933
  function profileCheckMarkdownLabel(check) {
@@ -13078,6 +13124,7 @@ function profileLinkStatusSummaryMarkdown(result) {
13078
13124
  const selector = cliString(evidence.selector);
13079
13125
  const viewports = Array.isArray(evidence.viewports) ? evidence.viewports.map(cliRecord).filter((viewport) => Boolean(viewport)) : [];
13080
13126
  const totals = viewports.map((viewport) => cliFiniteNumber(viewport.total_count)).filter((count) => count !== void 0);
13127
+ const discoveredTotals = viewports.map((viewport) => cliFiniteNumber(viewport.discovered_count)).filter((count) => count !== void 0);
13081
13128
  const okTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.ok_count) || 0), 0);
13082
13129
  const failedTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.failed_count) || 0), 0);
13083
13130
  const truncatedTotal = viewports.filter((viewport) => viewport.truncated === true).length;
@@ -13085,8 +13132,9 @@ function profileLinkStatusSummaryMarkdown(result) {
13085
13132
  const minBytes = cliFiniteNumber(evidence.min_bytes);
13086
13133
  const allowedContentTypes = Array.isArray(evidence.allowed_content_types) ? evidence.allowed_content_types.map(cliString).filter((value) => Boolean(value)) : [];
13087
13134
  const countText = totals.length ? totals.join("/") : "unknown";
13135
+ const discoveredText = discoveredTotals.length && discoveredTotals.some((count, index) => count !== totals[index]) ? `, discovered ${discoveredTotals.join("/")}` : "";
13088
13136
  lines.push(
13089
- `- ${label}${selector ? ` ${markdownInlineCode(selector)}` : ""}: links ${countText}, ok ${okTotal}, failures ${failedTotal}${omittedTotal ? `, compacted ${omittedTotal} result row(s)` : ""}${truncatedTotal ? `, truncated viewports ${truncatedTotal}` : ""}${minBytes !== void 0 ? `, min bytes ${minBytes}` : ""}${allowedContentTypes.length ? `, content types ${allowedContentTypes.map((value) => markdownInlineCode(value)).join(", ")}` : ""}`
13137
+ `- ${label}${selector ? ` ${markdownInlineCode(selector)}` : ""}: probed links ${countText}${discoveredText}, ok ${okTotal}, failures ${failedTotal}${omittedTotal ? `, compacted ${omittedTotal} result row(s)` : ""}${truncatedTotal ? `, truncated viewports ${truncatedTotal}` : ""}${minBytes !== void 0 ? `, min bytes ${minBytes}` : ""}${allowedContentTypes.length ? `, content types ${allowedContentTypes.map((value) => markdownInlineCode(value)).join(", ")}` : ""}`
13090
13138
  );
13091
13139
  }
13092
13140
  return lines;
package/dist/cli.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  profileStatusExitCode,
11
11
  resolveRiddleProofProfileTargetUrl,
12
12
  resolveRiddleProofProfileTimeoutSec
13
- } from "./chunk-BZ3XERXC.js";
13
+ } from "./chunk-NPNALRHV.js";
14
14
  import {
15
15
  createRiddleApiClient,
16
16
  parseRiddleViewport
@@ -438,8 +438,8 @@ function profileCheckMarkdownTarget(check) {
438
438
  const minCount = cliFiniteNumber(evidence.min_count);
439
439
  const minBytes = cliFiniteNumber(evidence.min_bytes);
440
440
  const parts = [];
441
- if (expectedCount !== void 0) parts.push(`links = ${expectedCount}`);
442
- else if (minCount !== void 0) parts.push(`links >= ${minCount}`);
441
+ if (expectedCount !== void 0) parts.push(`probed links = ${expectedCount}`);
442
+ else if (minCount !== void 0) parts.push(`probed links >= ${minCount}`);
443
443
  if (minBytes !== void 0) parts.push(`bytes >= ${minBytes}`);
444
444
  if (selector && parts.length) return `${markdownInlineCode(selector)} ${parts.join(", ")}`;
445
445
  return selector ? markdownInlineCode(selector) : parts.join(", ") || void 0;
@@ -451,6 +451,10 @@ function profileCheckMarkdownTarget(check) {
451
451
  if (check.type === "no_fatal_console_errors") {
452
452
  return "0 unallowed fatal errors";
453
453
  }
454
+ if (check.type === "no_console_warnings") {
455
+ const warningCount = cliFiniteNumber(evidence.console_warning_count) ?? 0;
456
+ return `${warningCount} unallowed warning${warningCount === 1 ? "" : "s"}`;
457
+ }
454
458
  return void 0;
455
459
  }
456
460
  function profileCheckMarkdownLabel(check) {
@@ -647,6 +651,7 @@ function profileLinkStatusSummaryMarkdown(result) {
647
651
  const selector = cliString(evidence.selector);
648
652
  const viewports = Array.isArray(evidence.viewports) ? evidence.viewports.map(cliRecord).filter((viewport) => Boolean(viewport)) : [];
649
653
  const totals = viewports.map((viewport) => cliFiniteNumber(viewport.total_count)).filter((count) => count !== void 0);
654
+ const discoveredTotals = viewports.map((viewport) => cliFiniteNumber(viewport.discovered_count)).filter((count) => count !== void 0);
650
655
  const okTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.ok_count) || 0), 0);
651
656
  const failedTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.failed_count) || 0), 0);
652
657
  const truncatedTotal = viewports.filter((viewport) => viewport.truncated === true).length;
@@ -654,8 +659,9 @@ function profileLinkStatusSummaryMarkdown(result) {
654
659
  const minBytes = cliFiniteNumber(evidence.min_bytes);
655
660
  const allowedContentTypes = Array.isArray(evidence.allowed_content_types) ? evidence.allowed_content_types.map(cliString).filter((value) => Boolean(value)) : [];
656
661
  const countText = totals.length ? totals.join("/") : "unknown";
662
+ const discoveredText = discoveredTotals.length && discoveredTotals.some((count, index) => count !== totals[index]) ? `, discovered ${discoveredTotals.join("/")}` : "";
657
663
  lines.push(
658
- `- ${label}${selector ? ` ${markdownInlineCode(selector)}` : ""}: links ${countText}, ok ${okTotal}, failures ${failedTotal}${omittedTotal ? `, compacted ${omittedTotal} result row(s)` : ""}${truncatedTotal ? `, truncated viewports ${truncatedTotal}` : ""}${minBytes !== void 0 ? `, min bytes ${minBytes}` : ""}${allowedContentTypes.length ? `, content types ${allowedContentTypes.map((value) => markdownInlineCode(value)).join(", ")}` : ""}`
664
+ `- ${label}${selector ? ` ${markdownInlineCode(selector)}` : ""}: probed links ${countText}${discoveredText}, ok ${okTotal}, failures ${failedTotal}${omittedTotal ? `, compacted ${omittedTotal} result row(s)` : ""}${truncatedTotal ? `, truncated viewports ${truncatedTotal}` : ""}${minBytes !== void 0 ? `, min bytes ${minBytes}` : ""}${allowedContentTypes.length ? `, content types ${allowedContentTypes.map((value) => markdownInlineCode(value)).join(", ")}` : ""}`
659
665
  );
660
666
  }
661
667
  return lines;
package/dist/index.cjs CHANGED
@@ -8764,7 +8764,8 @@ var RIDDLE_PROOF_PROFILE_CHECK_TYPES = [
8764
8764
  "route_inventory",
8765
8765
  "no_horizontal_overflow",
8766
8766
  "no_mobile_horizontal_overflow",
8767
- "no_fatal_console_errors"
8767
+ "no_fatal_console_errors",
8768
+ "no_console_warnings"
8768
8769
  ];
8769
8770
  var RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES = [
8770
8771
  "click",
@@ -10595,6 +10596,26 @@ function assessCheckFromEvidence(check, evidence) {
10595
10596
  message: fatalCount ? `${fatalCount} fatal browser error(s) were captured.` : void 0
10596
10597
  };
10597
10598
  }
10599
+ if (check.type === "no_console_warnings") {
10600
+ const warningConsoleEvents = (evidence.console?.events || []).filter((event) => event.type === "warning" || event.type === "warn");
10601
+ const allowedConsoleEvents = warningConsoleEvents.filter((event) => matchesAllowedMessage(event, check.allowed_console_texts, check.allowed_console_patterns));
10602
+ const unallowedConsoleEvents = warningConsoleEvents.filter((event) => !matchesAllowedMessage(event, check.allowed_console_texts, check.allowed_console_patterns));
10603
+ return {
10604
+ type: check.type,
10605
+ label: checkLabel(check),
10606
+ status: unallowedConsoleEvents.length ? "failed" : "passed",
10607
+ evidence: {
10608
+ console_warning_count: unallowedConsoleEvents.length,
10609
+ total_console_warning_count: warningConsoleEvents.length,
10610
+ allowed_console_warning_count: allowedConsoleEvents.length,
10611
+ allowed_console_texts: check.allowed_console_texts || [],
10612
+ allowed_console_patterns: check.allowed_console_patterns || [],
10613
+ unallowed_console_warning_samples: unallowedConsoleEvents.slice(0, 5).map((event) => allowedMessageSample(event)),
10614
+ allowed_console_warning_samples: allowedConsoleEvents.slice(0, 5).map((event) => allowedMessageSample(event))
10615
+ },
10616
+ message: unallowedConsoleEvents.length ? `${unallowedConsoleEvents.length} console warning(s) were captured.` : void 0
10617
+ };
10618
+ }
10598
10619
  return {
10599
10620
  type: check.type,
10600
10621
  label: checkLabel(check),
@@ -12185,6 +12206,27 @@ function assessProfile(profile, evidence) {
12185
12206
  });
12186
12207
  continue;
12187
12208
  }
12209
+ if (check.type === "no_console_warnings") {
12210
+ const warningConsoleEvents = ((evidence.console && evidence.console.events) || []).filter((event) => event && (event.type === "warning" || event.type === "warn"));
12211
+ const allowedConsoleEvents = warningConsoleEvents.filter((event) => matchesAllowedMessage(event, check.allowed_console_texts, check.allowed_console_patterns));
12212
+ const unallowedConsoleEvents = warningConsoleEvents.filter((event) => !matchesAllowedMessage(event, check.allowed_console_texts, check.allowed_console_patterns));
12213
+ checks.push({
12214
+ type: check.type,
12215
+ label: check.label || check.type,
12216
+ status: unallowedConsoleEvents.length ? "failed" : "passed",
12217
+ evidence: {
12218
+ console_warning_count: unallowedConsoleEvents.length,
12219
+ total_console_warning_count: warningConsoleEvents.length,
12220
+ allowed_console_warning_count: allowedConsoleEvents.length,
12221
+ allowed_console_texts: check.allowed_console_texts || [],
12222
+ allowed_console_patterns: check.allowed_console_patterns || [],
12223
+ unallowed_console_warning_samples: unallowedConsoleEvents.slice(0, 5).map((event) => allowedMessageSample(event)),
12224
+ allowed_console_warning_samples: allowedConsoleEvents.slice(0, 5).map((event) => allowedMessageSample(event)),
12225
+ },
12226
+ message: unallowedConsoleEvents.length ? String(unallowedConsoleEvents.length) + " console warning(s) were captured." : undefined,
12227
+ });
12228
+ continue;
12229
+ }
12188
12230
  checks.push({ type: check.type, label: check.label || check.type, status: "needs_human_review", evidence: {}, message: "Unsupported check type." });
12189
12231
  }
12190
12232
  let status = "passed";
package/dist/index.js CHANGED
@@ -58,7 +58,7 @@ import {
58
58
  resolveRiddleProofProfileTimeoutSec,
59
59
  slugifyRiddleProofProfileName,
60
60
  summarizeRiddleProofProfileResult
61
- } from "./chunk-BZ3XERXC.js";
61
+ } from "./chunk-NPNALRHV.js";
62
62
  import {
63
63
  DEFAULT_RIDDLE_API_BASE_URL,
64
64
  DEFAULT_RIDDLE_API_KEY_FILE,
package/dist/profile.cjs CHANGED
@@ -78,7 +78,8 @@ var RIDDLE_PROOF_PROFILE_CHECK_TYPES = [
78
78
  "route_inventory",
79
79
  "no_horizontal_overflow",
80
80
  "no_mobile_horizontal_overflow",
81
- "no_fatal_console_errors"
81
+ "no_fatal_console_errors",
82
+ "no_console_warnings"
82
83
  ];
83
84
  var RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES = [
84
85
  "click",
@@ -1909,6 +1910,26 @@ function assessCheckFromEvidence(check, evidence) {
1909
1910
  message: fatalCount ? `${fatalCount} fatal browser error(s) were captured.` : void 0
1910
1911
  };
1911
1912
  }
1913
+ if (check.type === "no_console_warnings") {
1914
+ const warningConsoleEvents = (evidence.console?.events || []).filter((event) => event.type === "warning" || event.type === "warn");
1915
+ const allowedConsoleEvents = warningConsoleEvents.filter((event) => matchesAllowedMessage(event, check.allowed_console_texts, check.allowed_console_patterns));
1916
+ const unallowedConsoleEvents = warningConsoleEvents.filter((event) => !matchesAllowedMessage(event, check.allowed_console_texts, check.allowed_console_patterns));
1917
+ return {
1918
+ type: check.type,
1919
+ label: checkLabel(check),
1920
+ status: unallowedConsoleEvents.length ? "failed" : "passed",
1921
+ evidence: {
1922
+ console_warning_count: unallowedConsoleEvents.length,
1923
+ total_console_warning_count: warningConsoleEvents.length,
1924
+ allowed_console_warning_count: allowedConsoleEvents.length,
1925
+ allowed_console_texts: check.allowed_console_texts || [],
1926
+ allowed_console_patterns: check.allowed_console_patterns || [],
1927
+ unallowed_console_warning_samples: unallowedConsoleEvents.slice(0, 5).map((event) => allowedMessageSample(event)),
1928
+ allowed_console_warning_samples: allowedConsoleEvents.slice(0, 5).map((event) => allowedMessageSample(event))
1929
+ },
1930
+ message: unallowedConsoleEvents.length ? `${unallowedConsoleEvents.length} console warning(s) were captured.` : void 0
1931
+ };
1932
+ }
1912
1933
  return {
1913
1934
  type: check.type,
1914
1935
  label: checkLabel(check),
@@ -3499,6 +3520,27 @@ function assessProfile(profile, evidence) {
3499
3520
  });
3500
3521
  continue;
3501
3522
  }
3523
+ if (check.type === "no_console_warnings") {
3524
+ const warningConsoleEvents = ((evidence.console && evidence.console.events) || []).filter((event) => event && (event.type === "warning" || event.type === "warn"));
3525
+ const allowedConsoleEvents = warningConsoleEvents.filter((event) => matchesAllowedMessage(event, check.allowed_console_texts, check.allowed_console_patterns));
3526
+ const unallowedConsoleEvents = warningConsoleEvents.filter((event) => !matchesAllowedMessage(event, check.allowed_console_texts, check.allowed_console_patterns));
3527
+ checks.push({
3528
+ type: check.type,
3529
+ label: check.label || check.type,
3530
+ status: unallowedConsoleEvents.length ? "failed" : "passed",
3531
+ evidence: {
3532
+ console_warning_count: unallowedConsoleEvents.length,
3533
+ total_console_warning_count: warningConsoleEvents.length,
3534
+ allowed_console_warning_count: allowedConsoleEvents.length,
3535
+ allowed_console_texts: check.allowed_console_texts || [],
3536
+ allowed_console_patterns: check.allowed_console_patterns || [],
3537
+ unallowed_console_warning_samples: unallowedConsoleEvents.slice(0, 5).map((event) => allowedMessageSample(event)),
3538
+ allowed_console_warning_samples: allowedConsoleEvents.slice(0, 5).map((event) => allowedMessageSample(event)),
3539
+ },
3540
+ message: unallowedConsoleEvents.length ? String(unallowedConsoleEvents.length) + " console warning(s) were captured." : undefined,
3541
+ });
3542
+ continue;
3543
+ }
3502
3544
  checks.push({ type: check.type, label: check.label || check.type, status: "needs_human_review", evidence: {}, message: "Unsupported check type." });
3503
3545
  }
3504
3546
  let status = "passed";
@@ -4,7 +4,7 @@ declare const RIDDLE_PROOF_PROFILE_VERSION: "riddle-proof.profile.v1";
4
4
  declare const RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION: "riddle-proof.profile-evidence.v1";
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
- 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_visible", "selector_text_absent", "selector_text_order", "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"];
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_visible", "selector_text_absent", "selector_text_order", "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
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", "dialog_response", "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];
package/dist/profile.d.ts CHANGED
@@ -4,7 +4,7 @@ declare const RIDDLE_PROOF_PROFILE_VERSION: "riddle-proof.profile.v1";
4
4
  declare const RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION: "riddle-proof.profile-evidence.v1";
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
- 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_visible", "selector_text_absent", "selector_text_order", "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"];
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_visible", "selector_text_absent", "selector_text_order", "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
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", "dialog_response", "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];
package/dist/profile.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  resolveRiddleProofProfileTimeoutSec,
20
20
  slugifyRiddleProofProfileName,
21
21
  summarizeRiddleProofProfileResult
22
- } from "./chunk-BZ3XERXC.js";
22
+ } from "./chunk-NPNALRHV.js";
23
23
  export {
24
24
  RIDDLE_PROOF_PROFILE_CHECK_TYPES,
25
25
  RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.7.107",
3
+ "version": "0.7.109",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",