@riddledc/riddle-proof 0.7.106 → 0.7.108

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:
@@ -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",
@@ -1556,13 +1557,16 @@ function assessCheckFromEvidence(check, evidence) {
1556
1557
  const results = viewports.map((viewport) => {
1557
1558
  const texts = textSequenceForCheck(viewport, check);
1558
1559
  const matches = texts.filter((text) => matchText(text, check));
1560
+ const matched = matches.length > 0;
1561
+ const failedAgainstExpectation = matched !== expectedVisible;
1562
+ const sampleTexts = matches.length ? matches : failedAgainstExpectation ? texts : [];
1559
1563
  return {
1560
1564
  viewport: viewport.name,
1561
1565
  selector_count: viewport.selectors?.[key]?.count || 0,
1562
1566
  visible_count: viewport.selectors?.[key]?.visible_count || 0,
1563
1567
  matched_count: matches.length,
1564
- matched: matches.length > 0,
1565
- samples: matches.slice(0, 3).map((text) => text.slice(0, 240))
1568
+ matched,
1569
+ samples: sampleTexts.slice(0, 3).map((text) => text.slice(0, 240))
1566
1570
  };
1567
1571
  });
1568
1572
  const failed = results.filter((result) => result.matched !== expectedVisible).length;
@@ -1863,6 +1867,26 @@ function assessCheckFromEvidence(check, evidence) {
1863
1867
  message: fatalCount ? `${fatalCount} fatal browser error(s) were captured.` : void 0
1864
1868
  };
1865
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
+ }
1866
1890
  return {
1867
1891
  type: check.type,
1868
1892
  label: checkLabel(check),
@@ -3136,13 +3160,16 @@ function assessProfile(profile, evidence) {
3136
3160
  const results = checkViewports.map((viewport) => {
3137
3161
  const texts = textSequenceForCheck(viewport, check);
3138
3162
  const matches = texts.filter((text) => textMatches(text, check));
3163
+ const matched = matches.length > 0;
3164
+ const failedAgainstExpectation = matched !== expectedVisible;
3165
+ const sampleTexts = matches.length ? matches : failedAgainstExpectation ? texts : [];
3139
3166
  return {
3140
3167
  viewport: viewport.name,
3141
3168
  selector_count: viewport.selectors && viewport.selectors[selector] ? viewport.selectors[selector].count : 0,
3142
3169
  visible_count: viewport.selectors && viewport.selectors[selector] ? viewport.selectors[selector].visible_count : 0,
3143
3170
  matched_count: matches.length,
3144
- matched: matches.length > 0,
3145
- samples: matches.slice(0, 3).map((text) => text.slice(0, 240)),
3171
+ matched,
3172
+ samples: sampleTexts.slice(0, 3).map((text) => text.slice(0, 240)),
3146
3173
  };
3147
3174
  });
3148
3175
  const failed = results.filter((result) => result.matched !== expectedVisible).length;
@@ -3450,6 +3477,27 @@ function assessProfile(profile, evidence) {
3450
3477
  });
3451
3478
  continue;
3452
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
+ }
3453
3501
  checks.push({ type: check.type, label: check.label || check.type, status: "needs_human_review", evidence: {}, message: "Unsupported check type." });
3454
3502
  }
3455
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",
@@ -8449,13 +8450,16 @@ function assessCheckFromEvidence(check, evidence) {
8449
8450
  const results = viewports.map((viewport) => {
8450
8451
  const texts = textSequenceForCheck(viewport, check);
8451
8452
  const matches = texts.filter((text) => matchText(text, check));
8453
+ const matched = matches.length > 0;
8454
+ const failedAgainstExpectation = matched !== expectedVisible;
8455
+ const sampleTexts = matches.length ? matches : failedAgainstExpectation ? texts : [];
8452
8456
  return {
8453
8457
  viewport: viewport.name,
8454
8458
  selector_count: viewport.selectors?.[key]?.count || 0,
8455
8459
  visible_count: viewport.selectors?.[key]?.visible_count || 0,
8456
8460
  matched_count: matches.length,
8457
- matched: matches.length > 0,
8458
- samples: matches.slice(0, 3).map((text) => text.slice(0, 240))
8461
+ matched,
8462
+ samples: sampleTexts.slice(0, 3).map((text) => text.slice(0, 240))
8459
8463
  };
8460
8464
  });
8461
8465
  const failed = results.filter((result) => result.matched !== expectedVisible).length;
@@ -8756,6 +8760,26 @@ function assessCheckFromEvidence(check, evidence) {
8756
8760
  message: fatalCount ? `${fatalCount} fatal browser error(s) were captured.` : void 0
8757
8761
  };
8758
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
+ }
8759
8783
  return {
8760
8784
  type: check.type,
8761
8785
  label: checkLabel(check),
@@ -10013,13 +10037,16 @@ function assessProfile(profile, evidence) {
10013
10037
  const results = checkViewports.map((viewport) => {
10014
10038
  const texts = textSequenceForCheck(viewport, check);
10015
10039
  const matches = texts.filter((text) => textMatches(text, check));
10040
+ const matched = matches.length > 0;
10041
+ const failedAgainstExpectation = matched !== expectedVisible;
10042
+ const sampleTexts = matches.length ? matches : failedAgainstExpectation ? texts : [];
10016
10043
  return {
10017
10044
  viewport: viewport.name,
10018
10045
  selector_count: viewport.selectors && viewport.selectors[selector] ? viewport.selectors[selector].count : 0,
10019
10046
  visible_count: viewport.selectors && viewport.selectors[selector] ? viewport.selectors[selector].visible_count : 0,
10020
10047
  matched_count: matches.length,
10021
- matched: matches.length > 0,
10022
- samples: matches.slice(0, 3).map((text) => text.slice(0, 240)),
10048
+ matched,
10049
+ samples: sampleTexts.slice(0, 3).map((text) => text.slice(0, 240)),
10023
10050
  };
10024
10051
  });
10025
10052
  const failed = results.filter((result) => result.matched !== expectedVisible).length;
@@ -10327,6 +10354,27 @@ function assessProfile(profile, evidence) {
10327
10354
  });
10328
10355
  continue;
10329
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
+ }
10330
10378
  checks.push({ type: check.type, label: check.label || check.type, status: "needs_human_review", evidence: {}, message: "Unsupported check type." });
10331
10379
  }
10332
10380
  let status = "passed";
@@ -12876,6 +12924,10 @@ function profileCheckMarkdownTarget(check) {
12876
12924
  if (check.type === "no_fatal_console_errors") {
12877
12925
  return "0 unallowed fatal errors";
12878
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
+ }
12879
12931
  return void 0;
12880
12932
  }
12881
12933
  function profileCheckMarkdownLabel(check) {
package/dist/cli.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  profileStatusExitCode,
11
11
  resolveRiddleProofProfileTargetUrl,
12
12
  resolveRiddleProofProfileTimeoutSec
13
- } from "./chunk-7JB3XKEE.js";
13
+ } from "./chunk-NPNALRHV.js";
14
14
  import {
15
15
  createRiddleApiClient,
16
16
  parseRiddleViewport
@@ -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) {
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",
@@ -10285,13 +10286,16 @@ function assessCheckFromEvidence(check, evidence) {
10285
10286
  const results = viewports.map((viewport) => {
10286
10287
  const texts = textSequenceForCheck(viewport, check);
10287
10288
  const matches = texts.filter((text) => matchText(text, check));
10289
+ const matched = matches.length > 0;
10290
+ const failedAgainstExpectation = matched !== expectedVisible;
10291
+ const sampleTexts = matches.length ? matches : failedAgainstExpectation ? texts : [];
10288
10292
  return {
10289
10293
  viewport: viewport.name,
10290
10294
  selector_count: viewport.selectors?.[key]?.count || 0,
10291
10295
  visible_count: viewport.selectors?.[key]?.visible_count || 0,
10292
10296
  matched_count: matches.length,
10293
- matched: matches.length > 0,
10294
- samples: matches.slice(0, 3).map((text) => text.slice(0, 240))
10297
+ matched,
10298
+ samples: sampleTexts.slice(0, 3).map((text) => text.slice(0, 240))
10295
10299
  };
10296
10300
  });
10297
10301
  const failed = results.filter((result) => result.matched !== expectedVisible).length;
@@ -10592,6 +10596,26 @@ function assessCheckFromEvidence(check, evidence) {
10592
10596
  message: fatalCount ? `${fatalCount} fatal browser error(s) were captured.` : void 0
10593
10597
  };
10594
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
+ }
10595
10619
  return {
10596
10620
  type: check.type,
10597
10621
  label: checkLabel(check),
@@ -11865,13 +11889,16 @@ function assessProfile(profile, evidence) {
11865
11889
  const results = checkViewports.map((viewport) => {
11866
11890
  const texts = textSequenceForCheck(viewport, check);
11867
11891
  const matches = texts.filter((text) => textMatches(text, check));
11892
+ const matched = matches.length > 0;
11893
+ const failedAgainstExpectation = matched !== expectedVisible;
11894
+ const sampleTexts = matches.length ? matches : failedAgainstExpectation ? texts : [];
11868
11895
  return {
11869
11896
  viewport: viewport.name,
11870
11897
  selector_count: viewport.selectors && viewport.selectors[selector] ? viewport.selectors[selector].count : 0,
11871
11898
  visible_count: viewport.selectors && viewport.selectors[selector] ? viewport.selectors[selector].visible_count : 0,
11872
11899
  matched_count: matches.length,
11873
- matched: matches.length > 0,
11874
- samples: matches.slice(0, 3).map((text) => text.slice(0, 240)),
11900
+ matched,
11901
+ samples: sampleTexts.slice(0, 3).map((text) => text.slice(0, 240)),
11875
11902
  };
11876
11903
  });
11877
11904
  const failed = results.filter((result) => result.matched !== expectedVisible).length;
@@ -12179,6 +12206,27 @@ function assessProfile(profile, evidence) {
12179
12206
  });
12180
12207
  continue;
12181
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
+ }
12182
12230
  checks.push({ type: check.type, label: check.label || check.type, status: "needs_human_review", evidence: {}, message: "Unsupported check type." });
12183
12231
  }
12184
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-7JB3XKEE.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",
@@ -1599,13 +1600,16 @@ function assessCheckFromEvidence(check, evidence) {
1599
1600
  const results = viewports.map((viewport) => {
1600
1601
  const texts = textSequenceForCheck(viewport, check);
1601
1602
  const matches = texts.filter((text) => matchText(text, check));
1603
+ const matched = matches.length > 0;
1604
+ const failedAgainstExpectation = matched !== expectedVisible;
1605
+ const sampleTexts = matches.length ? matches : failedAgainstExpectation ? texts : [];
1602
1606
  return {
1603
1607
  viewport: viewport.name,
1604
1608
  selector_count: viewport.selectors?.[key]?.count || 0,
1605
1609
  visible_count: viewport.selectors?.[key]?.visible_count || 0,
1606
1610
  matched_count: matches.length,
1607
- matched: matches.length > 0,
1608
- samples: matches.slice(0, 3).map((text) => text.slice(0, 240))
1611
+ matched,
1612
+ samples: sampleTexts.slice(0, 3).map((text) => text.slice(0, 240))
1609
1613
  };
1610
1614
  });
1611
1615
  const failed = results.filter((result) => result.matched !== expectedVisible).length;
@@ -1906,6 +1910,26 @@ function assessCheckFromEvidence(check, evidence) {
1906
1910
  message: fatalCount ? `${fatalCount} fatal browser error(s) were captured.` : void 0
1907
1911
  };
1908
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
+ }
1909
1933
  return {
1910
1934
  type: check.type,
1911
1935
  label: checkLabel(check),
@@ -3179,13 +3203,16 @@ function assessProfile(profile, evidence) {
3179
3203
  const results = checkViewports.map((viewport) => {
3180
3204
  const texts = textSequenceForCheck(viewport, check);
3181
3205
  const matches = texts.filter((text) => textMatches(text, check));
3206
+ const matched = matches.length > 0;
3207
+ const failedAgainstExpectation = matched !== expectedVisible;
3208
+ const sampleTexts = matches.length ? matches : failedAgainstExpectation ? texts : [];
3182
3209
  return {
3183
3210
  viewport: viewport.name,
3184
3211
  selector_count: viewport.selectors && viewport.selectors[selector] ? viewport.selectors[selector].count : 0,
3185
3212
  visible_count: viewport.selectors && viewport.selectors[selector] ? viewport.selectors[selector].visible_count : 0,
3186
3213
  matched_count: matches.length,
3187
- matched: matches.length > 0,
3188
- samples: matches.slice(0, 3).map((text) => text.slice(0, 240)),
3214
+ matched,
3215
+ samples: sampleTexts.slice(0, 3).map((text) => text.slice(0, 240)),
3189
3216
  };
3190
3217
  });
3191
3218
  const failed = results.filter((result) => result.matched !== expectedVisible).length;
@@ -3493,6 +3520,27 @@ function assessProfile(profile, evidence) {
3493
3520
  });
3494
3521
  continue;
3495
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
+ }
3496
3544
  checks.push({ type: check.type, label: check.label || check.type, status: "needs_human_review", evidence: {}, message: "Unsupported check type." });
3497
3545
  }
3498
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-7JB3XKEE.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.106",
3
+ "version": "0.7.108",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",