@riddledc/riddle-proof 0.7.35 → 0.7.36

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
@@ -240,7 +240,9 @@ source-link counts, missing/unexpected routes, direct route health, real
240
240
  clickthrough health, wrong-path failures, and stale source-surface failures. It
241
241
  runs direct/clickthrough sweeps on the first viewport by default and leaves
242
242
  ordinary profile overflow checks to cover the source page across all configured
243
- viewports. Set `run_direct_routes: false`, `run_clickthroughs: false`,
243
+ viewports. Set `run_all_viewports: true` when desktop and mobile navigation
244
+ surfaces both need direct/clickthrough inventory evidence in one profile result.
245
+ Set `run_direct_routes: false`, `run_clickthroughs: false`,
244
246
  `allow_unexpected_routes: true`, `require_unique_routes: false`, or
245
247
  `save_route_screenshots: true` when a profile needs a narrower or more
246
248
  artifact-heavy audit. `require_unique_routes: false` is useful when a navigation
@@ -350,6 +350,7 @@ function normalizeCheck(input, index) {
350
350
  timeout_ms: numberValue(input.timeout_ms) ?? numberValue(input.timeoutMs),
351
351
  run_direct_routes: input.run_direct_routes === false || input.runDirectRoutes === false ? false : true,
352
352
  run_clickthroughs: input.run_clickthroughs === false || input.runClickthroughs === false ? false : true,
353
+ run_all_viewports: input.run_all_viewports === true || input.runAllViewports === true,
353
354
  require_unique_routes: input.require_unique_routes === false || input.requireUniqueRoutes === false ? false : true,
354
355
  allow_unexpected_routes: input.allow_unexpected_routes === true || input.allowUnexpectedRoutes === true,
355
356
  save_route_screenshots: input.save_route_screenshots === true || input.saveRouteScreenshots === true
@@ -462,6 +463,25 @@ function textOrderMatch(texts, expectedTexts) {
462
463
  }
463
464
  return { matched: true, positions };
464
465
  }
466
+ function summarizeRouteInventory(viewport, inventory) {
467
+ const directRoutes = Array.isArray(inventory.direct_routes) ? inventory.direct_routes : [];
468
+ const clickthroughs = Array.isArray(inventory.clickthroughs) ? inventory.clickthroughs : [];
469
+ const sourceLinkCount = numberValue(inventory.source_link_count) ?? numberValue(inventory.home_game_link_count) ?? null;
470
+ const sourceUniqueLinkCount = numberValue(inventory.source_unique_link_count) ?? numberValue(inventory.home_unique_game_link_count) ?? null;
471
+ const duplicateSourceLinks = Array.isArray(inventory.duplicate_source_link_paths) ? inventory.duplicate_source_link_paths.map((path) => String(path)) : [];
472
+ const duplicateSourceLinkCount = numberValue(inventory.duplicate_source_link_count) ?? (sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null);
473
+ const failures = Array.isArray(inventory.failures) ? inventory.failures : [];
474
+ return {
475
+ viewport,
476
+ source_link_count: sourceLinkCount,
477
+ source_unique_link_count: sourceUniqueLinkCount,
478
+ duplicate_source_link_count: duplicateSourceLinkCount,
479
+ duplicate_source_links: duplicateSourceLinks,
480
+ direct_route_count: directRoutes.length,
481
+ clickthrough_count: clickthroughs.length,
482
+ failure_count: failures.length
483
+ };
484
+ }
465
485
  function matchText(sample, check) {
466
486
  if (check.pattern) {
467
487
  try {
@@ -638,6 +658,7 @@ function assessCheckFromEvidence(check, evidence) {
638
658
  message: "No route inventory evidence was captured."
639
659
  };
640
660
  }
661
+ const viewportSummaries = inventories.map((item) => summarizeRouteInventory(item.viewport, item.inventory));
641
662
  const failures = inventories.flatMap((item) => Array.isArray(item.inventory?.failures) ? item.inventory.failures.map((failure) => toJsonValue({ viewport: item.viewport, failure })) : []);
642
663
  const first = inventories[0]?.inventory;
643
664
  const directRoutes = Array.isArray(first?.direct_routes) ? first.direct_routes : [];
@@ -661,6 +682,8 @@ function assessCheckFromEvidence(check, evidence) {
661
682
  homepage_unique_link_count: numberValue(first?.home_unique_game_link_count) ?? sourceUniqueLinkCount,
662
683
  direct_route_count: directRoutes.length,
663
684
  clickthrough_count: clickthroughs.length,
685
+ viewport_count: inventories.length,
686
+ viewports: viewportSummaries.map((summary) => toJsonValue(summary)),
664
687
  failures
665
688
  },
666
689
  message: failures.length ? `Route inventory failed with ${failures.length} issue(s).` : void 0
@@ -979,6 +1002,25 @@ function textOrderMatch(texts, expectedTexts) {
979
1002
  }
980
1003
  return { matched: true, positions };
981
1004
  }
1005
+ function summarizeRouteInventory(viewport, inventory) {
1006
+ const directRoutes = Array.isArray(inventory.direct_routes) ? inventory.direct_routes : [];
1007
+ const clickthroughs = Array.isArray(inventory.clickthroughs) ? inventory.clickthroughs : [];
1008
+ const sourceLinkCount = typeof inventory.source_link_count === "number" ? inventory.source_link_count : typeof inventory.home_game_link_count === "number" ? inventory.home_game_link_count : null;
1009
+ const sourceUniqueLinkCount = typeof inventory.source_unique_link_count === "number" ? inventory.source_unique_link_count : typeof inventory.home_unique_game_link_count === "number" ? inventory.home_unique_game_link_count : null;
1010
+ const duplicateSourceLinks = Array.isArray(inventory.duplicate_source_link_paths) ? inventory.duplicate_source_link_paths.map((path) => String(path)) : [];
1011
+ const duplicateSourceLinkCount = typeof inventory.duplicate_source_link_count === "number" ? inventory.duplicate_source_link_count : sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null;
1012
+ const failures = Array.isArray(inventory.failures) ? inventory.failures : [];
1013
+ return {
1014
+ viewport,
1015
+ source_link_count: sourceLinkCount,
1016
+ source_unique_link_count: sourceUniqueLinkCount,
1017
+ duplicate_source_link_count: duplicateSourceLinkCount,
1018
+ duplicate_source_links: duplicateSourceLinks,
1019
+ direct_route_count: directRoutes.length,
1020
+ clickthrough_count: clickthroughs.length,
1021
+ failure_count: failures.length,
1022
+ };
1023
+ }
982
1024
  function numberValue(value) {
983
1025
  return typeof value === "number" && Number.isFinite(value) ? value : undefined;
984
1026
  }
@@ -1234,6 +1276,7 @@ function assessProfile(profile, evidence) {
1234
1276
  });
1235
1277
  continue;
1236
1278
  }
1279
+ const viewportSummaries = inventories.map((item) => summarizeRouteInventory(item.viewport, item.inventory || {}));
1237
1280
  const failures = [];
1238
1281
  for (const item of inventories) {
1239
1282
  for (const failure of Array.isArray(item.inventory.failures) ? item.inventory.failures : []) {
@@ -1262,6 +1305,8 @@ function assessProfile(profile, evidence) {
1262
1305
  homepage_unique_link_count: typeof first.home_unique_game_link_count === "number" ? first.home_unique_game_link_count : sourceUniqueLinkCount,
1263
1306
  direct_route_count: directRoutes.length,
1264
1307
  clickthrough_count: clickthroughs.length,
1308
+ viewport_count: inventories.length,
1309
+ viewports: viewportSummaries,
1265
1310
  failures,
1266
1311
  },
1267
1312
  message: failures.length ? "Route inventory failed with " + failures.length + " issue(s)." : undefined,
@@ -2020,7 +2065,7 @@ async function captureViewport(viewport) {
2020
2065
  let routeInventory;
2021
2066
  const routeInventoryCheck = (profile.checks || []).find((check) => check.type === "route_inventory");
2022
2067
  const firstViewportName = (profile.target.viewports || [])[0] && (profile.target.viewports || [])[0].name;
2023
- if (routeInventoryCheck && (!firstViewportName || viewport.name === firstViewportName)) {
2068
+ if (routeInventoryCheck && (routeInventoryCheck.run_all_viewports || !firstViewportName || viewport.name === firstViewportName)) {
2024
2069
  try {
2025
2070
  routeInventory = await collectRouteInventory(routeInventoryCheck, viewport);
2026
2071
  } catch (error) {
package/dist/cli.cjs CHANGED
@@ -7223,6 +7223,7 @@ function normalizeCheck(input, index) {
7223
7223
  timeout_ms: numberValue(input.timeout_ms) ?? numberValue(input.timeoutMs),
7224
7224
  run_direct_routes: input.run_direct_routes === false || input.runDirectRoutes === false ? false : true,
7225
7225
  run_clickthroughs: input.run_clickthroughs === false || input.runClickthroughs === false ? false : true,
7226
+ run_all_viewports: input.run_all_viewports === true || input.runAllViewports === true,
7226
7227
  require_unique_routes: input.require_unique_routes === false || input.requireUniqueRoutes === false ? false : true,
7227
7228
  allow_unexpected_routes: input.allow_unexpected_routes === true || input.allowUnexpectedRoutes === true,
7228
7229
  save_route_screenshots: input.save_route_screenshots === true || input.saveRouteScreenshots === true
@@ -7335,6 +7336,25 @@ function textOrderMatch(texts, expectedTexts) {
7335
7336
  }
7336
7337
  return { matched: true, positions };
7337
7338
  }
7339
+ function summarizeRouteInventory(viewport, inventory) {
7340
+ const directRoutes = Array.isArray(inventory.direct_routes) ? inventory.direct_routes : [];
7341
+ const clickthroughs = Array.isArray(inventory.clickthroughs) ? inventory.clickthroughs : [];
7342
+ const sourceLinkCount = numberValue(inventory.source_link_count) ?? numberValue(inventory.home_game_link_count) ?? null;
7343
+ const sourceUniqueLinkCount = numberValue(inventory.source_unique_link_count) ?? numberValue(inventory.home_unique_game_link_count) ?? null;
7344
+ const duplicateSourceLinks = Array.isArray(inventory.duplicate_source_link_paths) ? inventory.duplicate_source_link_paths.map((path7) => String(path7)) : [];
7345
+ const duplicateSourceLinkCount = numberValue(inventory.duplicate_source_link_count) ?? (sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null);
7346
+ const failures = Array.isArray(inventory.failures) ? inventory.failures : [];
7347
+ return {
7348
+ viewport,
7349
+ source_link_count: sourceLinkCount,
7350
+ source_unique_link_count: sourceUniqueLinkCount,
7351
+ duplicate_source_link_count: duplicateSourceLinkCount,
7352
+ duplicate_source_links: duplicateSourceLinks,
7353
+ direct_route_count: directRoutes.length,
7354
+ clickthrough_count: clickthroughs.length,
7355
+ failure_count: failures.length
7356
+ };
7357
+ }
7338
7358
  function matchText(sample, check) {
7339
7359
  if (check.pattern) {
7340
7360
  try {
@@ -7511,6 +7531,7 @@ function assessCheckFromEvidence(check, evidence) {
7511
7531
  message: "No route inventory evidence was captured."
7512
7532
  };
7513
7533
  }
7534
+ const viewportSummaries = inventories.map((item) => summarizeRouteInventory(item.viewport, item.inventory));
7514
7535
  const failures = inventories.flatMap((item) => Array.isArray(item.inventory?.failures) ? item.inventory.failures.map((failure) => toJsonValue({ viewport: item.viewport, failure })) : []);
7515
7536
  const first = inventories[0]?.inventory;
7516
7537
  const directRoutes = Array.isArray(first?.direct_routes) ? first.direct_routes : [];
@@ -7534,6 +7555,8 @@ function assessCheckFromEvidence(check, evidence) {
7534
7555
  homepage_unique_link_count: numberValue(first?.home_unique_game_link_count) ?? sourceUniqueLinkCount,
7535
7556
  direct_route_count: directRoutes.length,
7536
7557
  clickthrough_count: clickthroughs.length,
7558
+ viewport_count: inventories.length,
7559
+ viewports: viewportSummaries.map((summary) => toJsonValue(summary)),
7537
7560
  failures
7538
7561
  },
7539
7562
  message: failures.length ? `Route inventory failed with ${failures.length} issue(s).` : void 0
@@ -7836,6 +7859,25 @@ function textOrderMatch(texts, expectedTexts) {
7836
7859
  }
7837
7860
  return { matched: true, positions };
7838
7861
  }
7862
+ function summarizeRouteInventory(viewport, inventory) {
7863
+ const directRoutes = Array.isArray(inventory.direct_routes) ? inventory.direct_routes : [];
7864
+ const clickthroughs = Array.isArray(inventory.clickthroughs) ? inventory.clickthroughs : [];
7865
+ const sourceLinkCount = typeof inventory.source_link_count === "number" ? inventory.source_link_count : typeof inventory.home_game_link_count === "number" ? inventory.home_game_link_count : null;
7866
+ const sourceUniqueLinkCount = typeof inventory.source_unique_link_count === "number" ? inventory.source_unique_link_count : typeof inventory.home_unique_game_link_count === "number" ? inventory.home_unique_game_link_count : null;
7867
+ const duplicateSourceLinks = Array.isArray(inventory.duplicate_source_link_paths) ? inventory.duplicate_source_link_paths.map((path) => String(path)) : [];
7868
+ const duplicateSourceLinkCount = typeof inventory.duplicate_source_link_count === "number" ? inventory.duplicate_source_link_count : sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null;
7869
+ const failures = Array.isArray(inventory.failures) ? inventory.failures : [];
7870
+ return {
7871
+ viewport,
7872
+ source_link_count: sourceLinkCount,
7873
+ source_unique_link_count: sourceUniqueLinkCount,
7874
+ duplicate_source_link_count: duplicateSourceLinkCount,
7875
+ duplicate_source_links: duplicateSourceLinks,
7876
+ direct_route_count: directRoutes.length,
7877
+ clickthrough_count: clickthroughs.length,
7878
+ failure_count: failures.length,
7879
+ };
7880
+ }
7839
7881
  function numberValue(value) {
7840
7882
  return typeof value === "number" && Number.isFinite(value) ? value : undefined;
7841
7883
  }
@@ -8091,6 +8133,7 @@ function assessProfile(profile, evidence) {
8091
8133
  });
8092
8134
  continue;
8093
8135
  }
8136
+ const viewportSummaries = inventories.map((item) => summarizeRouteInventory(item.viewport, item.inventory || {}));
8094
8137
  const failures = [];
8095
8138
  for (const item of inventories) {
8096
8139
  for (const failure of Array.isArray(item.inventory.failures) ? item.inventory.failures : []) {
@@ -8119,6 +8162,8 @@ function assessProfile(profile, evidence) {
8119
8162
  homepage_unique_link_count: typeof first.home_unique_game_link_count === "number" ? first.home_unique_game_link_count : sourceUniqueLinkCount,
8120
8163
  direct_route_count: directRoutes.length,
8121
8164
  clickthrough_count: clickthroughs.length,
8165
+ viewport_count: inventories.length,
8166
+ viewports: viewportSummaries,
8122
8167
  failures,
8123
8168
  },
8124
8169
  message: failures.length ? "Route inventory failed with " + failures.length + " issue(s)." : undefined,
@@ -8877,7 +8922,7 @@ async function captureViewport(viewport) {
8877
8922
  let routeInventory;
8878
8923
  const routeInventoryCheck = (profile.checks || []).find((check) => check.type === "route_inventory");
8879
8924
  const firstViewportName = (profile.target.viewports || [])[0] && (profile.target.viewports || [])[0].name;
8880
- if (routeInventoryCheck && (!firstViewportName || viewport.name === firstViewportName)) {
8925
+ if (routeInventoryCheck && (routeInventoryCheck.run_all_viewports || !firstViewportName || viewport.name === firstViewportName)) {
8881
8926
  try {
8882
8927
  routeInventory = await collectRouteInventory(routeInventoryCheck, viewport);
8883
8928
  } catch (error) {
package/dist/cli.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  profileStatusExitCode,
11
11
  resolveRiddleProofProfileTargetUrl,
12
12
  resolveRiddleProofProfileTimeoutSec
13
- } from "./chunk-VCINQE5O.js";
13
+ } from "./chunk-VEK6QHPE.js";
14
14
  import {
15
15
  createRiddleApiClient,
16
16
  parseRiddleViewport
package/dist/index.cjs CHANGED
@@ -9064,6 +9064,7 @@ function normalizeCheck(input, index) {
9064
9064
  timeout_ms: numberValue3(input.timeout_ms) ?? numberValue3(input.timeoutMs),
9065
9065
  run_direct_routes: input.run_direct_routes === false || input.runDirectRoutes === false ? false : true,
9066
9066
  run_clickthroughs: input.run_clickthroughs === false || input.runClickthroughs === false ? false : true,
9067
+ run_all_viewports: input.run_all_viewports === true || input.runAllViewports === true,
9067
9068
  require_unique_routes: input.require_unique_routes === false || input.requireUniqueRoutes === false ? false : true,
9068
9069
  allow_unexpected_routes: input.allow_unexpected_routes === true || input.allowUnexpectedRoutes === true,
9069
9070
  save_route_screenshots: input.save_route_screenshots === true || input.saveRouteScreenshots === true
@@ -9176,6 +9177,25 @@ function textOrderMatch(texts, expectedTexts) {
9176
9177
  }
9177
9178
  return { matched: true, positions };
9178
9179
  }
9180
+ function summarizeRouteInventory(viewport, inventory) {
9181
+ const directRoutes = Array.isArray(inventory.direct_routes) ? inventory.direct_routes : [];
9182
+ const clickthroughs = Array.isArray(inventory.clickthroughs) ? inventory.clickthroughs : [];
9183
+ const sourceLinkCount = numberValue3(inventory.source_link_count) ?? numberValue3(inventory.home_game_link_count) ?? null;
9184
+ const sourceUniqueLinkCount = numberValue3(inventory.source_unique_link_count) ?? numberValue3(inventory.home_unique_game_link_count) ?? null;
9185
+ const duplicateSourceLinks = Array.isArray(inventory.duplicate_source_link_paths) ? inventory.duplicate_source_link_paths.map((path6) => String(path6)) : [];
9186
+ const duplicateSourceLinkCount = numberValue3(inventory.duplicate_source_link_count) ?? (sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null);
9187
+ const failures = Array.isArray(inventory.failures) ? inventory.failures : [];
9188
+ return {
9189
+ viewport,
9190
+ source_link_count: sourceLinkCount,
9191
+ source_unique_link_count: sourceUniqueLinkCount,
9192
+ duplicate_source_link_count: duplicateSourceLinkCount,
9193
+ duplicate_source_links: duplicateSourceLinks,
9194
+ direct_route_count: directRoutes.length,
9195
+ clickthrough_count: clickthroughs.length,
9196
+ failure_count: failures.length
9197
+ };
9198
+ }
9179
9199
  function matchText(sample, check) {
9180
9200
  if (check.pattern) {
9181
9201
  try {
@@ -9352,6 +9372,7 @@ function assessCheckFromEvidence(check, evidence) {
9352
9372
  message: "No route inventory evidence was captured."
9353
9373
  };
9354
9374
  }
9375
+ const viewportSummaries = inventories.map((item) => summarizeRouteInventory(item.viewport, item.inventory));
9355
9376
  const failures = inventories.flatMap((item) => Array.isArray(item.inventory?.failures) ? item.inventory.failures.map((failure) => toJsonValue({ viewport: item.viewport, failure })) : []);
9356
9377
  const first = inventories[0]?.inventory;
9357
9378
  const directRoutes = Array.isArray(first?.direct_routes) ? first.direct_routes : [];
@@ -9375,6 +9396,8 @@ function assessCheckFromEvidence(check, evidence) {
9375
9396
  homepage_unique_link_count: numberValue3(first?.home_unique_game_link_count) ?? sourceUniqueLinkCount,
9376
9397
  direct_route_count: directRoutes.length,
9377
9398
  clickthrough_count: clickthroughs.length,
9399
+ viewport_count: inventories.length,
9400
+ viewports: viewportSummaries.map((summary) => toJsonValue(summary)),
9378
9401
  failures
9379
9402
  },
9380
9403
  message: failures.length ? `Route inventory failed with ${failures.length} issue(s).` : void 0
@@ -9693,6 +9716,25 @@ function textOrderMatch(texts, expectedTexts) {
9693
9716
  }
9694
9717
  return { matched: true, positions };
9695
9718
  }
9719
+ function summarizeRouteInventory(viewport, inventory) {
9720
+ const directRoutes = Array.isArray(inventory.direct_routes) ? inventory.direct_routes : [];
9721
+ const clickthroughs = Array.isArray(inventory.clickthroughs) ? inventory.clickthroughs : [];
9722
+ const sourceLinkCount = typeof inventory.source_link_count === "number" ? inventory.source_link_count : typeof inventory.home_game_link_count === "number" ? inventory.home_game_link_count : null;
9723
+ const sourceUniqueLinkCount = typeof inventory.source_unique_link_count === "number" ? inventory.source_unique_link_count : typeof inventory.home_unique_game_link_count === "number" ? inventory.home_unique_game_link_count : null;
9724
+ const duplicateSourceLinks = Array.isArray(inventory.duplicate_source_link_paths) ? inventory.duplicate_source_link_paths.map((path) => String(path)) : [];
9725
+ const duplicateSourceLinkCount = typeof inventory.duplicate_source_link_count === "number" ? inventory.duplicate_source_link_count : sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null;
9726
+ const failures = Array.isArray(inventory.failures) ? inventory.failures : [];
9727
+ return {
9728
+ viewport,
9729
+ source_link_count: sourceLinkCount,
9730
+ source_unique_link_count: sourceUniqueLinkCount,
9731
+ duplicate_source_link_count: duplicateSourceLinkCount,
9732
+ duplicate_source_links: duplicateSourceLinks,
9733
+ direct_route_count: directRoutes.length,
9734
+ clickthrough_count: clickthroughs.length,
9735
+ failure_count: failures.length,
9736
+ };
9737
+ }
9696
9738
  function numberValue(value) {
9697
9739
  return typeof value === "number" && Number.isFinite(value) ? value : undefined;
9698
9740
  }
@@ -9948,6 +9990,7 @@ function assessProfile(profile, evidence) {
9948
9990
  });
9949
9991
  continue;
9950
9992
  }
9993
+ const viewportSummaries = inventories.map((item) => summarizeRouteInventory(item.viewport, item.inventory || {}));
9951
9994
  const failures = [];
9952
9995
  for (const item of inventories) {
9953
9996
  for (const failure of Array.isArray(item.inventory.failures) ? item.inventory.failures : []) {
@@ -9976,6 +10019,8 @@ function assessProfile(profile, evidence) {
9976
10019
  homepage_unique_link_count: typeof first.home_unique_game_link_count === "number" ? first.home_unique_game_link_count : sourceUniqueLinkCount,
9977
10020
  direct_route_count: directRoutes.length,
9978
10021
  clickthrough_count: clickthroughs.length,
10022
+ viewport_count: inventories.length,
10023
+ viewports: viewportSummaries,
9979
10024
  failures,
9980
10025
  },
9981
10026
  message: failures.length ? "Route inventory failed with " + failures.length + " issue(s)." : undefined,
@@ -10734,7 +10779,7 @@ async function captureViewport(viewport) {
10734
10779
  let routeInventory;
10735
10780
  const routeInventoryCheck = (profile.checks || []).find((check) => check.type === "route_inventory");
10736
10781
  const firstViewportName = (profile.target.viewports || [])[0] && (profile.target.viewports || [])[0].name;
10737
- if (routeInventoryCheck && (!firstViewportName || viewport.name === firstViewportName)) {
10782
+ if (routeInventoryCheck && (routeInventoryCheck.run_all_viewports || !firstViewportName || viewport.name === firstViewportName)) {
10738
10783
  try {
10739
10784
  routeInventory = await collectRouteInventory(routeInventoryCheck, viewport);
10740
10785
  } catch (error) {
package/dist/index.js CHANGED
@@ -58,7 +58,7 @@ import {
58
58
  resolveRiddleProofProfileTimeoutSec,
59
59
  slugifyRiddleProofProfileName,
60
60
  summarizeRiddleProofProfileResult
61
- } from "./chunk-VCINQE5O.js";
61
+ } from "./chunk-VEK6QHPE.js";
62
62
  import {
63
63
  DEFAULT_RIDDLE_API_BASE_URL,
64
64
  DEFAULT_RIDDLE_API_KEY_FILE,
package/dist/profile.cjs CHANGED
@@ -393,6 +393,7 @@ function normalizeCheck(input, index) {
393
393
  timeout_ms: numberValue(input.timeout_ms) ?? numberValue(input.timeoutMs),
394
394
  run_direct_routes: input.run_direct_routes === false || input.runDirectRoutes === false ? false : true,
395
395
  run_clickthroughs: input.run_clickthroughs === false || input.runClickthroughs === false ? false : true,
396
+ run_all_viewports: input.run_all_viewports === true || input.runAllViewports === true,
396
397
  require_unique_routes: input.require_unique_routes === false || input.requireUniqueRoutes === false ? false : true,
397
398
  allow_unexpected_routes: input.allow_unexpected_routes === true || input.allowUnexpectedRoutes === true,
398
399
  save_route_screenshots: input.save_route_screenshots === true || input.saveRouteScreenshots === true
@@ -505,6 +506,25 @@ function textOrderMatch(texts, expectedTexts) {
505
506
  }
506
507
  return { matched: true, positions };
507
508
  }
509
+ function summarizeRouteInventory(viewport, inventory) {
510
+ const directRoutes = Array.isArray(inventory.direct_routes) ? inventory.direct_routes : [];
511
+ const clickthroughs = Array.isArray(inventory.clickthroughs) ? inventory.clickthroughs : [];
512
+ const sourceLinkCount = numberValue(inventory.source_link_count) ?? numberValue(inventory.home_game_link_count) ?? null;
513
+ const sourceUniqueLinkCount = numberValue(inventory.source_unique_link_count) ?? numberValue(inventory.home_unique_game_link_count) ?? null;
514
+ const duplicateSourceLinks = Array.isArray(inventory.duplicate_source_link_paths) ? inventory.duplicate_source_link_paths.map((path) => String(path)) : [];
515
+ const duplicateSourceLinkCount = numberValue(inventory.duplicate_source_link_count) ?? (sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null);
516
+ const failures = Array.isArray(inventory.failures) ? inventory.failures : [];
517
+ return {
518
+ viewport,
519
+ source_link_count: sourceLinkCount,
520
+ source_unique_link_count: sourceUniqueLinkCount,
521
+ duplicate_source_link_count: duplicateSourceLinkCount,
522
+ duplicate_source_links: duplicateSourceLinks,
523
+ direct_route_count: directRoutes.length,
524
+ clickthrough_count: clickthroughs.length,
525
+ failure_count: failures.length
526
+ };
527
+ }
508
528
  function matchText(sample, check) {
509
529
  if (check.pattern) {
510
530
  try {
@@ -681,6 +701,7 @@ function assessCheckFromEvidence(check, evidence) {
681
701
  message: "No route inventory evidence was captured."
682
702
  };
683
703
  }
704
+ const viewportSummaries = inventories.map((item) => summarizeRouteInventory(item.viewport, item.inventory));
684
705
  const failures = inventories.flatMap((item) => Array.isArray(item.inventory?.failures) ? item.inventory.failures.map((failure) => toJsonValue({ viewport: item.viewport, failure })) : []);
685
706
  const first = inventories[0]?.inventory;
686
707
  const directRoutes = Array.isArray(first?.direct_routes) ? first.direct_routes : [];
@@ -704,6 +725,8 @@ function assessCheckFromEvidence(check, evidence) {
704
725
  homepage_unique_link_count: numberValue(first?.home_unique_game_link_count) ?? sourceUniqueLinkCount,
705
726
  direct_route_count: directRoutes.length,
706
727
  clickthrough_count: clickthroughs.length,
728
+ viewport_count: inventories.length,
729
+ viewports: viewportSummaries.map((summary) => toJsonValue(summary)),
707
730
  failures
708
731
  },
709
732
  message: failures.length ? `Route inventory failed with ${failures.length} issue(s).` : void 0
@@ -1022,6 +1045,25 @@ function textOrderMatch(texts, expectedTexts) {
1022
1045
  }
1023
1046
  return { matched: true, positions };
1024
1047
  }
1048
+ function summarizeRouteInventory(viewport, inventory) {
1049
+ const directRoutes = Array.isArray(inventory.direct_routes) ? inventory.direct_routes : [];
1050
+ const clickthroughs = Array.isArray(inventory.clickthroughs) ? inventory.clickthroughs : [];
1051
+ const sourceLinkCount = typeof inventory.source_link_count === "number" ? inventory.source_link_count : typeof inventory.home_game_link_count === "number" ? inventory.home_game_link_count : null;
1052
+ const sourceUniqueLinkCount = typeof inventory.source_unique_link_count === "number" ? inventory.source_unique_link_count : typeof inventory.home_unique_game_link_count === "number" ? inventory.home_unique_game_link_count : null;
1053
+ const duplicateSourceLinks = Array.isArray(inventory.duplicate_source_link_paths) ? inventory.duplicate_source_link_paths.map((path) => String(path)) : [];
1054
+ const duplicateSourceLinkCount = typeof inventory.duplicate_source_link_count === "number" ? inventory.duplicate_source_link_count : sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null;
1055
+ const failures = Array.isArray(inventory.failures) ? inventory.failures : [];
1056
+ return {
1057
+ viewport,
1058
+ source_link_count: sourceLinkCount,
1059
+ source_unique_link_count: sourceUniqueLinkCount,
1060
+ duplicate_source_link_count: duplicateSourceLinkCount,
1061
+ duplicate_source_links: duplicateSourceLinks,
1062
+ direct_route_count: directRoutes.length,
1063
+ clickthrough_count: clickthroughs.length,
1064
+ failure_count: failures.length,
1065
+ };
1066
+ }
1025
1067
  function numberValue(value) {
1026
1068
  return typeof value === "number" && Number.isFinite(value) ? value : undefined;
1027
1069
  }
@@ -1277,6 +1319,7 @@ function assessProfile(profile, evidence) {
1277
1319
  });
1278
1320
  continue;
1279
1321
  }
1322
+ const viewportSummaries = inventories.map((item) => summarizeRouteInventory(item.viewport, item.inventory || {}));
1280
1323
  const failures = [];
1281
1324
  for (const item of inventories) {
1282
1325
  for (const failure of Array.isArray(item.inventory.failures) ? item.inventory.failures : []) {
@@ -1305,6 +1348,8 @@ function assessProfile(profile, evidence) {
1305
1348
  homepage_unique_link_count: typeof first.home_unique_game_link_count === "number" ? first.home_unique_game_link_count : sourceUniqueLinkCount,
1306
1349
  direct_route_count: directRoutes.length,
1307
1350
  clickthrough_count: clickthroughs.length,
1351
+ viewport_count: inventories.length,
1352
+ viewports: viewportSummaries,
1308
1353
  failures,
1309
1354
  },
1310
1355
  message: failures.length ? "Route inventory failed with " + failures.length + " issue(s)." : undefined,
@@ -2063,7 +2108,7 @@ async function captureViewport(viewport) {
2063
2108
  let routeInventory;
2064
2109
  const routeInventoryCheck = (profile.checks || []).find((check) => check.type === "route_inventory");
2065
2110
  const firstViewportName = (profile.target.viewports || [])[0] && (profile.target.viewports || [])[0].name;
2066
- if (routeInventoryCheck && (!firstViewportName || viewport.name === firstViewportName)) {
2111
+ if (routeInventoryCheck && (routeInventoryCheck.run_all_viewports || !firstViewportName || viewport.name === firstViewportName)) {
2067
2112
  try {
2068
2113
  routeInventory = await collectRouteInventory(routeInventoryCheck, viewport);
2069
2114
  } catch (error) {
@@ -82,6 +82,7 @@ interface RiddleProofProfileCheck {
82
82
  timeout_ms?: number;
83
83
  run_direct_routes?: boolean;
84
84
  run_clickthroughs?: boolean;
85
+ run_all_viewports?: boolean;
85
86
  require_unique_routes?: boolean;
86
87
  allow_unexpected_routes?: boolean;
87
88
  save_route_screenshots?: boolean;
package/dist/profile.d.ts CHANGED
@@ -82,6 +82,7 @@ interface RiddleProofProfileCheck {
82
82
  timeout_ms?: number;
83
83
  run_direct_routes?: boolean;
84
84
  run_clickthroughs?: boolean;
85
+ run_all_viewports?: boolean;
85
86
  require_unique_routes?: boolean;
86
87
  allow_unexpected_routes?: boolean;
87
88
  save_route_screenshots?: boolean;
package/dist/profile.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  resolveRiddleProofProfileTimeoutSec,
20
20
  slugifyRiddleProofProfileName,
21
21
  summarizeRiddleProofProfileResult
22
- } from "./chunk-VCINQE5O.js";
22
+ } from "./chunk-VEK6QHPE.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.35",
3
+ "version": "0.7.36",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",