@riddledc/riddle-proof 0.7.143 → 0.7.145

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.
@@ -2030,11 +2030,17 @@ function summarizeRouteInventory(viewport, inventory) {
2030
2030
  const clickthroughs = Array.isArray(inventory.clickthroughs) ? inventory.clickthroughs : [];
2031
2031
  const sourceLinkCount = numberValue(inventory.source_link_count) ?? numberValue(inventory.home_game_link_count) ?? null;
2032
2032
  const sourceUniqueLinkCount = numberValue(inventory.source_unique_link_count) ?? numberValue(inventory.home_unique_game_link_count) ?? null;
2033
+ const sourceCandidateCount = numberValue(inventory.source_candidate_count);
2034
+ const sourceCandidateUniqueLinkCount = numberValue(inventory.source_candidate_unique_link_count);
2035
+ const sourceLinkScope = stringValue(inventory.source_link_scope);
2033
2036
  const duplicateSourceLinks = Array.isArray(inventory.duplicate_source_link_paths) ? inventory.duplicate_source_link_paths.map((path) => String(path)) : [];
2034
2037
  const duplicateSourceLinkCount = numberValue(inventory.duplicate_source_link_count) ?? (sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null);
2035
2038
  const failures = Array.isArray(inventory.failures) ? inventory.failures : [];
2036
2039
  return {
2037
2040
  viewport,
2041
+ source_link_scope: sourceLinkScope ?? null,
2042
+ source_candidate_count: sourceCandidateCount ?? sourceLinkCount,
2043
+ source_candidate_unique_link_count: sourceCandidateUniqueLinkCount ?? sourceUniqueLinkCount,
2038
2044
  source_link_count: sourceLinkCount,
2039
2045
  source_unique_link_count: sourceUniqueLinkCount,
2040
2046
  duplicate_source_link_count: duplicateSourceLinkCount,
@@ -2044,6 +2050,20 @@ function summarizeRouteInventory(viewport, inventory) {
2044
2050
  failure_count: failures.length
2045
2051
  };
2046
2052
  }
2053
+ function routeInventoryExpectedRouteSummaries(value, fallback) {
2054
+ const rawRoutes = Array.isArray(value) ? value : Array.isArray(fallback) ? fallback : [];
2055
+ return rawRoutes.map((route) => {
2056
+ if (typeof route === "string") {
2057
+ const path2 = route.trim();
2058
+ return path2 ? { path: path2 } : void 0;
2059
+ }
2060
+ if (!isRecord(route)) return void 0;
2061
+ const path = stringValue(route.path);
2062
+ if (!path) return void 0;
2063
+ const name = stringValue(route.name);
2064
+ return name ? { name, path } : { path };
2065
+ }).filter((route) => Boolean(route));
2066
+ }
2047
2067
  function matchText(sample, check) {
2048
2068
  if (check.pattern) {
2049
2069
  try {
@@ -2645,7 +2665,10 @@ function assessCheckFromEvidence(check, evidence) {
2645
2665
  type: check.type,
2646
2666
  label: checkLabel(check),
2647
2667
  status: "failed",
2648
- evidence: { expected_count: check.expected_routes?.length || 0 },
2668
+ evidence: {
2669
+ expected_count: check.expected_routes?.length || 0,
2670
+ expected_routes: routeInventoryExpectedRouteSummaries(void 0, check.expected_routes)
2671
+ },
2649
2672
  message: "No route inventory evidence was captured."
2650
2673
  };
2651
2674
  }
@@ -2656,14 +2679,22 @@ function assessCheckFromEvidence(check, evidence) {
2656
2679
  const clickthroughs = Array.isArray(first?.clickthroughs) ? first.clickthroughs : [];
2657
2680
  const sourceLinkCount = numberValue(first?.source_link_count) ?? numberValue(first?.home_game_link_count) ?? null;
2658
2681
  const sourceUniqueLinkCount = numberValue(first?.source_unique_link_count) ?? numberValue(first?.home_unique_game_link_count) ?? null;
2682
+ const sourceCandidateCount = numberValue(first?.source_candidate_count);
2683
+ const sourceCandidateUniqueLinkCount = numberValue(first?.source_candidate_unique_link_count);
2684
+ const sourceLinkScope = stringValue(first?.source_link_scope);
2659
2685
  const duplicateSourceLinks = Array.isArray(first?.duplicate_source_link_paths) ? first.duplicate_source_link_paths.map((path) => String(path)) : [];
2660
2686
  const duplicateSourceLinkCount = numberValue(first?.duplicate_source_link_count) ?? (sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null);
2687
+ const expectedRoutes = routeInventoryExpectedRouteSummaries(first?.expected_routes, check.expected_routes);
2661
2688
  return {
2662
2689
  type: check.type,
2663
2690
  label: checkLabel(check),
2664
2691
  status: failures.length ? "failed" : "passed",
2665
2692
  evidence: {
2666
2693
  expected_count: check.expected_routes?.length || 0,
2694
+ expected_routes: expectedRoutes,
2695
+ source_link_scope: sourceLinkScope ?? null,
2696
+ source_candidate_count: sourceCandidateCount ?? sourceLinkCount,
2697
+ source_candidate_unique_link_count: sourceCandidateUniqueLinkCount ?? sourceUniqueLinkCount,
2667
2698
  source_link_count: sourceLinkCount,
2668
2699
  source_unique_link_count: sourceUniqueLinkCount,
2669
2700
  duplicate_source_link_count: duplicateSourceLinkCount,
@@ -3656,11 +3687,17 @@ function summarizeRouteInventory(viewport, inventory) {
3656
3687
  const clickthroughs = Array.isArray(inventory.clickthroughs) ? inventory.clickthroughs : [];
3657
3688
  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;
3658
3689
  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;
3690
+ const sourceCandidateCount = typeof inventory.source_candidate_count === "number" ? inventory.source_candidate_count : null;
3691
+ const sourceCandidateUniqueLinkCount = typeof inventory.source_candidate_unique_link_count === "number" ? inventory.source_candidate_unique_link_count : null;
3692
+ const sourceLinkScope = typeof inventory.source_link_scope === "string" ? inventory.source_link_scope : null;
3659
3693
  const duplicateSourceLinks = Array.isArray(inventory.duplicate_source_link_paths) ? inventory.duplicate_source_link_paths.map((path) => String(path)) : [];
3660
3694
  const duplicateSourceLinkCount = typeof inventory.duplicate_source_link_count === "number" ? inventory.duplicate_source_link_count : sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null;
3661
3695
  const failures = Array.isArray(inventory.failures) ? inventory.failures : [];
3662
3696
  return {
3663
3697
  viewport,
3698
+ source_link_scope: sourceLinkScope,
3699
+ source_candidate_count: sourceCandidateCount == null ? sourceLinkCount : sourceCandidateCount,
3700
+ source_candidate_unique_link_count: sourceCandidateUniqueLinkCount == null ? sourceUniqueLinkCount : sourceCandidateUniqueLinkCount,
3664
3701
  source_link_count: sourceLinkCount,
3665
3702
  source_unique_link_count: sourceUniqueLinkCount,
3666
3703
  duplicate_source_link_count: duplicateSourceLinkCount,
@@ -3670,6 +3707,20 @@ function summarizeRouteInventory(viewport, inventory) {
3670
3707
  failure_count: failures.length,
3671
3708
  };
3672
3709
  }
3710
+ function routeInventoryExpectedRouteSummaries(value, fallback) {
3711
+ const rawRoutes = Array.isArray(value) ? value : Array.isArray(fallback) ? fallback : [];
3712
+ return rawRoutes.map((route) => {
3713
+ if (typeof route === "string") {
3714
+ const path = route.trim();
3715
+ return path ? { path } : null;
3716
+ }
3717
+ if (!route || typeof route !== "object" || Array.isArray(route)) return null;
3718
+ const path = typeof route.path === "string" && route.path.trim() ? route.path.trim() : "";
3719
+ if (!path) return null;
3720
+ const name = typeof route.name === "string" && route.name.trim() ? route.name.trim() : "";
3721
+ return name ? { name, path } : { path };
3722
+ }).filter(Boolean);
3723
+ }
3673
3724
  function numberValue(value) {
3674
3725
  return typeof value === "number" && Number.isFinite(value) ? value : undefined;
3675
3726
  }
@@ -4497,7 +4548,10 @@ function assessProfile(profile, evidence) {
4497
4548
  type: check.type,
4498
4549
  label: check.label || check.type,
4499
4550
  status: "failed",
4500
- evidence: { expected_count: (check.expected_routes || []).length },
4551
+ evidence: {
4552
+ expected_count: (check.expected_routes || []).length,
4553
+ expected_routes: routeInventoryExpectedRouteSummaries(undefined, check.expected_routes),
4554
+ },
4501
4555
  message: "No route inventory evidence was captured.",
4502
4556
  });
4503
4557
  continue;
@@ -4514,14 +4568,22 @@ function assessProfile(profile, evidence) {
4514
4568
  const clickthroughs = Array.isArray(first.clickthroughs) ? first.clickthroughs : [];
4515
4569
  const sourceLinkCount = typeof first.source_link_count === "number" ? first.source_link_count : typeof first.home_game_link_count === "number" ? first.home_game_link_count : null;
4516
4570
  const sourceUniqueLinkCount = typeof first.source_unique_link_count === "number" ? first.source_unique_link_count : typeof first.home_unique_game_link_count === "number" ? first.home_unique_game_link_count : null;
4571
+ const sourceCandidateCount = typeof first.source_candidate_count === "number" ? first.source_candidate_count : null;
4572
+ const sourceCandidateUniqueLinkCount = typeof first.source_candidate_unique_link_count === "number" ? first.source_candidate_unique_link_count : null;
4573
+ const sourceLinkScope = typeof first.source_link_scope === "string" ? first.source_link_scope : null;
4517
4574
  const duplicateSourceLinks = Array.isArray(first.duplicate_source_link_paths) ? first.duplicate_source_link_paths.map((path) => String(path)) : [];
4518
4575
  const duplicateSourceLinkCount = typeof first.duplicate_source_link_count === "number" ? first.duplicate_source_link_count : sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null;
4576
+ const expectedRoutes = routeInventoryExpectedRouteSummaries(first.expected_routes, check.expected_routes);
4519
4577
  checks.push({
4520
4578
  type: check.type,
4521
4579
  label: check.label || check.type,
4522
4580
  status: failures.length ? "failed" : "passed",
4523
4581
  evidence: {
4524
4582
  expected_count: (check.expected_routes || []).length,
4583
+ expected_routes: expectedRoutes,
4584
+ source_link_scope: sourceLinkScope,
4585
+ source_candidate_count: sourceCandidateCount == null ? sourceLinkCount : sourceCandidateCount,
4586
+ source_candidate_unique_link_count: sourceCandidateUniqueLinkCount == null ? sourceUniqueLinkCount : sourceCandidateUniqueLinkCount,
4525
4587
  source_link_count: sourceLinkCount,
4526
4588
  source_unique_link_count: sourceUniqueLinkCount,
4527
4589
  duplicate_source_link_count: duplicateSourceLinkCount,
@@ -6693,9 +6755,15 @@ async function collectInventoryHomeLinks(check) {
6693
6755
  app_path: appPath,
6694
6756
  };
6695
6757
  });
6696
- return links.filter((link) => (
6758
+ const selectedLinks = links.filter((link) => (
6697
6759
  routePathPrefix ? link.app_path.startsWith(routePathPrefix) : expectedSet.has(link.app_path)
6698
6760
  ));
6761
+ return {
6762
+ links: selectedLinks,
6763
+ candidate_count: links.length,
6764
+ candidate_unique_link_count: Array.from(new Set(links.map((link) => link.app_path))).length,
6765
+ source_link_scope: routePathPrefix ? "route_path_prefix" : "expected_routes",
6766
+ };
6699
6767
  }, { linkSelector, expectedPaths, routePathPrefix, targetUrl });
6700
6768
  }
6701
6769
  async function waitForInventoryRouteHealth(check, expectedPath) {
@@ -6836,7 +6904,11 @@ async function collectRouteInventory(check, viewport) {
6836
6904
  const expectedPaths = expectedRoutes.map((route) => normalizeRoutePath(route.path));
6837
6905
  const expectedSet = new Set(expectedPaths);
6838
6906
  const failures = [];
6839
- const homeLinks = await collectInventoryHomeLinks(check);
6907
+ const homeLinkCapture = await collectInventoryHomeLinks(check);
6908
+ const homeLinks = Array.isArray(homeLinkCapture) ? homeLinkCapture : Array.isArray(homeLinkCapture && homeLinkCapture.links) ? homeLinkCapture.links : [];
6909
+ const sourceCandidateCount = typeof homeLinkCapture?.candidate_count === "number" ? homeLinkCapture.candidate_count : homeLinks.length;
6910
+ const sourceCandidateUniqueLinkCount = typeof homeLinkCapture?.candidate_unique_link_count === "number" ? homeLinkCapture.candidate_unique_link_count : new Set(homeLinks.map((link) => link.app_path)).size;
6911
+ const sourceLinkScope = typeof homeLinkCapture?.source_link_scope === "string" ? homeLinkCapture.source_link_scope : check.route_path_prefix ? "route_path_prefix" : "expected_routes";
6840
6912
  const homeLinkPaths = homeLinks.map((link) => link.app_path);
6841
6913
  const uniqueHomeLinkPaths = Array.from(new Set(homeLinkPaths));
6842
6914
  const duplicateHomeLinkPaths = homeLinkPaths.filter((path, index) => homeLinkPaths.indexOf(path) !== index);
@@ -6918,6 +6990,9 @@ async function collectRouteInventory(check, viewport) {
6918
6990
  expected_routes: expectedRoutes,
6919
6991
  link_selector: check.link_selector || "a[href]",
6920
6992
  source_selector: check.source_selector || null,
6993
+ source_link_scope: sourceLinkScope,
6994
+ source_candidate_count: sourceCandidateCount,
6995
+ source_candidate_unique_link_count: sourceCandidateUniqueLinkCount,
6921
6996
  source_link_count: homeLinkPaths.length,
6922
6997
  source_unique_link_count: uniqueHomeLinkPaths.length,
6923
6998
  duplicate_source_link_count: duplicateHomeLinkPaths.length,
@@ -7114,6 +7189,9 @@ async function captureViewport(viewport) {
7114
7189
  expected_routes: routeInventoryCheck.expected_routes || [],
7115
7190
  link_selector: routeInventoryCheck.link_selector || "a[href]",
7116
7191
  source_selector: routeInventoryCheck.source_selector || null,
7192
+ source_link_scope: routeInventoryCheck.route_path_prefix ? "route_path_prefix" : "expected_routes",
7193
+ source_candidate_count: 0,
7194
+ source_candidate_unique_link_count: 0,
7117
7195
  source_link_count: 0,
7118
7196
  source_unique_link_count: 0,
7119
7197
  duplicate_source_link_count: 0,
@@ -7240,6 +7318,9 @@ function buildProfileEvidence(currentViewports) {
7240
7318
  .map((viewport) => ({
7241
7319
  viewport: viewport.name,
7242
7320
  expected_count: (viewport.route_inventory.expected_routes || []).length,
7321
+ source_link_scope: viewport.route_inventory.source_link_scope,
7322
+ source_candidate_count: viewport.route_inventory.source_candidate_count,
7323
+ source_candidate_unique_link_count: viewport.route_inventory.source_candidate_unique_link_count,
7243
7324
  source_link_count: viewport.route_inventory.source_link_count == null ? viewport.route_inventory.home_game_link_count : viewport.route_inventory.source_link_count,
7244
7325
  source_unique_link_count: viewport.route_inventory.source_unique_link_count == null ? viewport.route_inventory.home_unique_game_link_count : viewport.route_inventory.source_unique_link_count,
7245
7326
  duplicate_source_link_count: viewport.route_inventory.duplicate_source_link_count,
package/dist/cli.cjs CHANGED
@@ -8967,11 +8967,17 @@ function summarizeRouteInventory(viewport, inventory) {
8967
8967
  const clickthroughs = Array.isArray(inventory.clickthroughs) ? inventory.clickthroughs : [];
8968
8968
  const sourceLinkCount = numberValue(inventory.source_link_count) ?? numberValue(inventory.home_game_link_count) ?? null;
8969
8969
  const sourceUniqueLinkCount = numberValue(inventory.source_unique_link_count) ?? numberValue(inventory.home_unique_game_link_count) ?? null;
8970
+ const sourceCandidateCount = numberValue(inventory.source_candidate_count);
8971
+ const sourceCandidateUniqueLinkCount = numberValue(inventory.source_candidate_unique_link_count);
8972
+ const sourceLinkScope = stringValue2(inventory.source_link_scope);
8970
8973
  const duplicateSourceLinks = Array.isArray(inventory.duplicate_source_link_paths) ? inventory.duplicate_source_link_paths.map((path7) => String(path7)) : [];
8971
8974
  const duplicateSourceLinkCount = numberValue(inventory.duplicate_source_link_count) ?? (sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null);
8972
8975
  const failures = Array.isArray(inventory.failures) ? inventory.failures : [];
8973
8976
  return {
8974
8977
  viewport,
8978
+ source_link_scope: sourceLinkScope ?? null,
8979
+ source_candidate_count: sourceCandidateCount ?? sourceLinkCount,
8980
+ source_candidate_unique_link_count: sourceCandidateUniqueLinkCount ?? sourceUniqueLinkCount,
8975
8981
  source_link_count: sourceLinkCount,
8976
8982
  source_unique_link_count: sourceUniqueLinkCount,
8977
8983
  duplicate_source_link_count: duplicateSourceLinkCount,
@@ -8981,6 +8987,20 @@ function summarizeRouteInventory(viewport, inventory) {
8981
8987
  failure_count: failures.length
8982
8988
  };
8983
8989
  }
8990
+ function routeInventoryExpectedRouteSummaries(value, fallback) {
8991
+ const rawRoutes = Array.isArray(value) ? value : Array.isArray(fallback) ? fallback : [];
8992
+ return rawRoutes.map((route) => {
8993
+ if (typeof route === "string") {
8994
+ const path8 = route.trim();
8995
+ return path8 ? { path: path8 } : void 0;
8996
+ }
8997
+ if (!isRecord(route)) return void 0;
8998
+ const path7 = stringValue2(route.path);
8999
+ if (!path7) return void 0;
9000
+ const name = stringValue2(route.name);
9001
+ return name ? { name, path: path7 } : { path: path7 };
9002
+ }).filter((route) => Boolean(route));
9003
+ }
8984
9004
  function matchText(sample, check) {
8985
9005
  if (check.pattern) {
8986
9006
  try {
@@ -9582,7 +9602,10 @@ function assessCheckFromEvidence(check, evidence) {
9582
9602
  type: check.type,
9583
9603
  label: checkLabel(check),
9584
9604
  status: "failed",
9585
- evidence: { expected_count: check.expected_routes?.length || 0 },
9605
+ evidence: {
9606
+ expected_count: check.expected_routes?.length || 0,
9607
+ expected_routes: routeInventoryExpectedRouteSummaries(void 0, check.expected_routes)
9608
+ },
9586
9609
  message: "No route inventory evidence was captured."
9587
9610
  };
9588
9611
  }
@@ -9593,14 +9616,22 @@ function assessCheckFromEvidence(check, evidence) {
9593
9616
  const clickthroughs = Array.isArray(first?.clickthroughs) ? first.clickthroughs : [];
9594
9617
  const sourceLinkCount = numberValue(first?.source_link_count) ?? numberValue(first?.home_game_link_count) ?? null;
9595
9618
  const sourceUniqueLinkCount = numberValue(first?.source_unique_link_count) ?? numberValue(first?.home_unique_game_link_count) ?? null;
9619
+ const sourceCandidateCount = numberValue(first?.source_candidate_count);
9620
+ const sourceCandidateUniqueLinkCount = numberValue(first?.source_candidate_unique_link_count);
9621
+ const sourceLinkScope = stringValue2(first?.source_link_scope);
9596
9622
  const duplicateSourceLinks = Array.isArray(first?.duplicate_source_link_paths) ? first.duplicate_source_link_paths.map((path7) => String(path7)) : [];
9597
9623
  const duplicateSourceLinkCount = numberValue(first?.duplicate_source_link_count) ?? (sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null);
9624
+ const expectedRoutes = routeInventoryExpectedRouteSummaries(first?.expected_routes, check.expected_routes);
9598
9625
  return {
9599
9626
  type: check.type,
9600
9627
  label: checkLabel(check),
9601
9628
  status: failures.length ? "failed" : "passed",
9602
9629
  evidence: {
9603
9630
  expected_count: check.expected_routes?.length || 0,
9631
+ expected_routes: expectedRoutes,
9632
+ source_link_scope: sourceLinkScope ?? null,
9633
+ source_candidate_count: sourceCandidateCount ?? sourceLinkCount,
9634
+ source_candidate_unique_link_count: sourceCandidateUniqueLinkCount ?? sourceUniqueLinkCount,
9604
9635
  source_link_count: sourceLinkCount,
9605
9636
  source_unique_link_count: sourceUniqueLinkCount,
9606
9637
  duplicate_source_link_count: duplicateSourceLinkCount,
@@ -10577,11 +10608,17 @@ function summarizeRouteInventory(viewport, inventory) {
10577
10608
  const clickthroughs = Array.isArray(inventory.clickthroughs) ? inventory.clickthroughs : [];
10578
10609
  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;
10579
10610
  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;
10611
+ const sourceCandidateCount = typeof inventory.source_candidate_count === "number" ? inventory.source_candidate_count : null;
10612
+ const sourceCandidateUniqueLinkCount = typeof inventory.source_candidate_unique_link_count === "number" ? inventory.source_candidate_unique_link_count : null;
10613
+ const sourceLinkScope = typeof inventory.source_link_scope === "string" ? inventory.source_link_scope : null;
10580
10614
  const duplicateSourceLinks = Array.isArray(inventory.duplicate_source_link_paths) ? inventory.duplicate_source_link_paths.map((path) => String(path)) : [];
10581
10615
  const duplicateSourceLinkCount = typeof inventory.duplicate_source_link_count === "number" ? inventory.duplicate_source_link_count : sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null;
10582
10616
  const failures = Array.isArray(inventory.failures) ? inventory.failures : [];
10583
10617
  return {
10584
10618
  viewport,
10619
+ source_link_scope: sourceLinkScope,
10620
+ source_candidate_count: sourceCandidateCount == null ? sourceLinkCount : sourceCandidateCount,
10621
+ source_candidate_unique_link_count: sourceCandidateUniqueLinkCount == null ? sourceUniqueLinkCount : sourceCandidateUniqueLinkCount,
10585
10622
  source_link_count: sourceLinkCount,
10586
10623
  source_unique_link_count: sourceUniqueLinkCount,
10587
10624
  duplicate_source_link_count: duplicateSourceLinkCount,
@@ -10591,6 +10628,20 @@ function summarizeRouteInventory(viewport, inventory) {
10591
10628
  failure_count: failures.length,
10592
10629
  };
10593
10630
  }
10631
+ function routeInventoryExpectedRouteSummaries(value, fallback) {
10632
+ const rawRoutes = Array.isArray(value) ? value : Array.isArray(fallback) ? fallback : [];
10633
+ return rawRoutes.map((route) => {
10634
+ if (typeof route === "string") {
10635
+ const path = route.trim();
10636
+ return path ? { path } : null;
10637
+ }
10638
+ if (!route || typeof route !== "object" || Array.isArray(route)) return null;
10639
+ const path = typeof route.path === "string" && route.path.trim() ? route.path.trim() : "";
10640
+ if (!path) return null;
10641
+ const name = typeof route.name === "string" && route.name.trim() ? route.name.trim() : "";
10642
+ return name ? { name, path } : { path };
10643
+ }).filter(Boolean);
10644
+ }
10594
10645
  function numberValue(value) {
10595
10646
  return typeof value === "number" && Number.isFinite(value) ? value : undefined;
10596
10647
  }
@@ -11418,7 +11469,10 @@ function assessProfile(profile, evidence) {
11418
11469
  type: check.type,
11419
11470
  label: check.label || check.type,
11420
11471
  status: "failed",
11421
- evidence: { expected_count: (check.expected_routes || []).length },
11472
+ evidence: {
11473
+ expected_count: (check.expected_routes || []).length,
11474
+ expected_routes: routeInventoryExpectedRouteSummaries(undefined, check.expected_routes),
11475
+ },
11422
11476
  message: "No route inventory evidence was captured.",
11423
11477
  });
11424
11478
  continue;
@@ -11435,14 +11489,22 @@ function assessProfile(profile, evidence) {
11435
11489
  const clickthroughs = Array.isArray(first.clickthroughs) ? first.clickthroughs : [];
11436
11490
  const sourceLinkCount = typeof first.source_link_count === "number" ? first.source_link_count : typeof first.home_game_link_count === "number" ? first.home_game_link_count : null;
11437
11491
  const sourceUniqueLinkCount = typeof first.source_unique_link_count === "number" ? first.source_unique_link_count : typeof first.home_unique_game_link_count === "number" ? first.home_unique_game_link_count : null;
11492
+ const sourceCandidateCount = typeof first.source_candidate_count === "number" ? first.source_candidate_count : null;
11493
+ const sourceCandidateUniqueLinkCount = typeof first.source_candidate_unique_link_count === "number" ? first.source_candidate_unique_link_count : null;
11494
+ const sourceLinkScope = typeof first.source_link_scope === "string" ? first.source_link_scope : null;
11438
11495
  const duplicateSourceLinks = Array.isArray(first.duplicate_source_link_paths) ? first.duplicate_source_link_paths.map((path) => String(path)) : [];
11439
11496
  const duplicateSourceLinkCount = typeof first.duplicate_source_link_count === "number" ? first.duplicate_source_link_count : sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null;
11497
+ const expectedRoutes = routeInventoryExpectedRouteSummaries(first.expected_routes, check.expected_routes);
11440
11498
  checks.push({
11441
11499
  type: check.type,
11442
11500
  label: check.label || check.type,
11443
11501
  status: failures.length ? "failed" : "passed",
11444
11502
  evidence: {
11445
11503
  expected_count: (check.expected_routes || []).length,
11504
+ expected_routes: expectedRoutes,
11505
+ source_link_scope: sourceLinkScope,
11506
+ source_candidate_count: sourceCandidateCount == null ? sourceLinkCount : sourceCandidateCount,
11507
+ source_candidate_unique_link_count: sourceCandidateUniqueLinkCount == null ? sourceUniqueLinkCount : sourceCandidateUniqueLinkCount,
11446
11508
  source_link_count: sourceLinkCount,
11447
11509
  source_unique_link_count: sourceUniqueLinkCount,
11448
11510
  duplicate_source_link_count: duplicateSourceLinkCount,
@@ -13614,9 +13676,15 @@ async function collectInventoryHomeLinks(check) {
13614
13676
  app_path: appPath,
13615
13677
  };
13616
13678
  });
13617
- return links.filter((link) => (
13679
+ const selectedLinks = links.filter((link) => (
13618
13680
  routePathPrefix ? link.app_path.startsWith(routePathPrefix) : expectedSet.has(link.app_path)
13619
13681
  ));
13682
+ return {
13683
+ links: selectedLinks,
13684
+ candidate_count: links.length,
13685
+ candidate_unique_link_count: Array.from(new Set(links.map((link) => link.app_path))).length,
13686
+ source_link_scope: routePathPrefix ? "route_path_prefix" : "expected_routes",
13687
+ };
13620
13688
  }, { linkSelector, expectedPaths, routePathPrefix, targetUrl });
13621
13689
  }
13622
13690
  async function waitForInventoryRouteHealth(check, expectedPath) {
@@ -13757,7 +13825,11 @@ async function collectRouteInventory(check, viewport) {
13757
13825
  const expectedPaths = expectedRoutes.map((route) => normalizeRoutePath(route.path));
13758
13826
  const expectedSet = new Set(expectedPaths);
13759
13827
  const failures = [];
13760
- const homeLinks = await collectInventoryHomeLinks(check);
13828
+ const homeLinkCapture = await collectInventoryHomeLinks(check);
13829
+ const homeLinks = Array.isArray(homeLinkCapture) ? homeLinkCapture : Array.isArray(homeLinkCapture && homeLinkCapture.links) ? homeLinkCapture.links : [];
13830
+ const sourceCandidateCount = typeof homeLinkCapture?.candidate_count === "number" ? homeLinkCapture.candidate_count : homeLinks.length;
13831
+ const sourceCandidateUniqueLinkCount = typeof homeLinkCapture?.candidate_unique_link_count === "number" ? homeLinkCapture.candidate_unique_link_count : new Set(homeLinks.map((link) => link.app_path)).size;
13832
+ const sourceLinkScope = typeof homeLinkCapture?.source_link_scope === "string" ? homeLinkCapture.source_link_scope : check.route_path_prefix ? "route_path_prefix" : "expected_routes";
13761
13833
  const homeLinkPaths = homeLinks.map((link) => link.app_path);
13762
13834
  const uniqueHomeLinkPaths = Array.from(new Set(homeLinkPaths));
13763
13835
  const duplicateHomeLinkPaths = homeLinkPaths.filter((path, index) => homeLinkPaths.indexOf(path) !== index);
@@ -13839,6 +13911,9 @@ async function collectRouteInventory(check, viewport) {
13839
13911
  expected_routes: expectedRoutes,
13840
13912
  link_selector: check.link_selector || "a[href]",
13841
13913
  source_selector: check.source_selector || null,
13914
+ source_link_scope: sourceLinkScope,
13915
+ source_candidate_count: sourceCandidateCount,
13916
+ source_candidate_unique_link_count: sourceCandidateUniqueLinkCount,
13842
13917
  source_link_count: homeLinkPaths.length,
13843
13918
  source_unique_link_count: uniqueHomeLinkPaths.length,
13844
13919
  duplicate_source_link_count: duplicateHomeLinkPaths.length,
@@ -14035,6 +14110,9 @@ async function captureViewport(viewport) {
14035
14110
  expected_routes: routeInventoryCheck.expected_routes || [],
14036
14111
  link_selector: routeInventoryCheck.link_selector || "a[href]",
14037
14112
  source_selector: routeInventoryCheck.source_selector || null,
14113
+ source_link_scope: routeInventoryCheck.route_path_prefix ? "route_path_prefix" : "expected_routes",
14114
+ source_candidate_count: 0,
14115
+ source_candidate_unique_link_count: 0,
14038
14116
  source_link_count: 0,
14039
14117
  source_unique_link_count: 0,
14040
14118
  duplicate_source_link_count: 0,
@@ -14161,6 +14239,9 @@ function buildProfileEvidence(currentViewports) {
14161
14239
  .map((viewport) => ({
14162
14240
  viewport: viewport.name,
14163
14241
  expected_count: (viewport.route_inventory.expected_routes || []).length,
14242
+ source_link_scope: viewport.route_inventory.source_link_scope,
14243
+ source_candidate_count: viewport.route_inventory.source_candidate_count,
14244
+ source_candidate_unique_link_count: viewport.route_inventory.source_candidate_unique_link_count,
14164
14245
  source_link_count: viewport.route_inventory.source_link_count == null ? viewport.route_inventory.home_game_link_count : viewport.route_inventory.source_link_count,
14165
14246
  source_unique_link_count: viewport.route_inventory.source_unique_link_count == null ? viewport.route_inventory.home_unique_game_link_count : viewport.route_inventory.source_unique_link_count,
14166
14247
  duplicate_source_link_count: viewport.route_inventory.duplicate_source_link_count,
@@ -14820,6 +14901,35 @@ function cliValueLabel(value) {
14820
14901
  function cliStringArray(value) {
14821
14902
  return Array.isArray(value) ? value.filter((entry) => typeof entry === "string" && Boolean(entry.trim())) : [];
14822
14903
  }
14904
+ function cliRouteInventoryRoutes(value) {
14905
+ if (!Array.isArray(value)) return [];
14906
+ return value.map((entry) => {
14907
+ if (typeof entry === "string") {
14908
+ const pathValue2 = entry.trim();
14909
+ return pathValue2 ? { path: pathValue2 } : void 0;
14910
+ }
14911
+ const route = cliRecord(entry);
14912
+ if (!route) return void 0;
14913
+ const pathValue = cliString(route.path);
14914
+ if (!pathValue) return void 0;
14915
+ const nameValue = cliString(route.name);
14916
+ return nameValue ? { name: nameValue, path: pathValue } : { path: pathValue };
14917
+ }).filter((route) => Boolean(route));
14918
+ }
14919
+ function cliRouteInventoryRouteLabel(route) {
14920
+ return route.name && route.name !== route.path ? `${route.name} (${route.path})` : route.path;
14921
+ }
14922
+ function cliRouteInventoryRouteList(routes) {
14923
+ const visible = routes.slice(0, 12).map(cliRouteInventoryRouteLabel);
14924
+ const omitted = routes.length > 12 ? `; ${routes.length - 12} more` : "";
14925
+ return `${visible.join("; ")}${omitted}`;
14926
+ }
14927
+ function cliRouteInventorySourceScopeLabel(value) {
14928
+ const scope = cliString(value);
14929
+ if (scope === "expected_routes") return "expected routes";
14930
+ if (scope === "route_path_prefix") return "route path prefix";
14931
+ return scope;
14932
+ }
14823
14933
  function profileEnvironmentBlockerMarkdown(result) {
14824
14934
  const blocker = cliRecord(result.environment_blocker);
14825
14935
  if (!blocker) return [];
@@ -15048,6 +15158,9 @@ function profileRouteInventorySummaryMarkdown(result) {
15048
15158
  const expectedCount = cliFiniteNumber(evidence.expected_count);
15049
15159
  const sourceLinkCount = cliFiniteNumber(evidence.source_link_count);
15050
15160
  const sourceUniqueLinkCount = cliFiniteNumber(evidence.source_unique_link_count);
15161
+ const sourceCandidateCount = cliFiniteNumber(evidence.source_candidate_count);
15162
+ const sourceCandidateUniqueLinkCount = cliFiniteNumber(evidence.source_candidate_unique_link_count);
15163
+ const sourceScopeLabel = cliRouteInventorySourceScopeLabel(evidence.source_link_scope);
15051
15164
  const directRouteCount = cliFiniteNumber(evidence.direct_route_count);
15052
15165
  const clickthroughCount = cliFiniteNumber(evidence.clickthrough_count);
15053
15166
  const topLevelFailures = Array.isArray(evidence.failures) ? evidence.failures.length : void 0;
@@ -15063,15 +15176,25 @@ function profileRouteInventorySummaryMarkdown(result) {
15063
15176
  const duplicateText = duplicateLinks.length ? `: ${duplicateLinks.slice(0, 8).join(", ")}${duplicateLinks.length > 8 ? `, ${duplicateLinks.length - 8} more` : ""}` : "";
15064
15177
  lines.push(`- ${label} duplicate source links: ${duplicateCount}${evidence.duplicates_allowed === true ? " allowed" : ""}${duplicateText}`);
15065
15178
  }
15179
+ const expectedRoutes = cliRouteInventoryRoutes(evidence.expected_routes);
15180
+ if (expectedRoutes.length) {
15181
+ lines.push(`- ${label} expected routes: ${cliRouteInventoryRouteList(expectedRoutes)}`);
15182
+ }
15183
+ if (sourceScopeLabel || sourceCandidateCount !== void 0) {
15184
+ const candidateText = sourceCandidateCount === void 0 ? "" : `; selector candidates ${sourceCandidateCount}${sourceCandidateUniqueLinkCount === void 0 ? "" : ` (${sourceCandidateUniqueLinkCount} unique)`}`;
15185
+ lines.push(`- ${label} source scope: ${sourceScopeLabel || "unknown"}${candidateText}`);
15186
+ }
15066
15187
  for (const viewport of viewports.slice(0, 8)) {
15067
15188
  const viewportName = cliString(viewport.viewport) || cliString(viewport.name) || "viewport";
15068
15189
  const viewportSourceLinkCount = cliFiniteNumber(viewport.source_link_count);
15069
15190
  const viewportSourceUniqueLinkCount = cliFiniteNumber(viewport.source_unique_link_count);
15191
+ const viewportSourceCandidateCount = cliFiniteNumber(viewport.source_candidate_count);
15192
+ const viewportSourceCandidateUniqueLinkCount = cliFiniteNumber(viewport.source_candidate_unique_link_count);
15070
15193
  const viewportDirectRouteCount = cliFiniteNumber(viewport.direct_route_count);
15071
15194
  const viewportClickthroughCount = cliFiniteNumber(viewport.clickthrough_count);
15072
15195
  const viewportFailureCount = cliFiniteNumber(viewport.failure_count) || 0;
15073
15196
  lines.push(
15074
- `- ${label} ${viewportName}: source ${viewportSourceLinkCount ?? "unknown"}${viewportSourceUniqueLinkCount === void 0 ? "" : ` (${viewportSourceUniqueLinkCount} unique)`}, direct ${viewportDirectRouteCount ?? "unknown"}, clickthrough ${viewportClickthroughCount ?? "unknown"}, failures ${viewportFailureCount}`
15197
+ `- ${label} ${viewportName}: source ${viewportSourceLinkCount ?? "unknown"}${viewportSourceUniqueLinkCount === void 0 ? "" : ` (${viewportSourceUniqueLinkCount} unique)`}${viewportSourceCandidateCount === void 0 ? "" : `, selector candidates ${viewportSourceCandidateCount}${viewportSourceCandidateUniqueLinkCount === void 0 ? "" : ` (${viewportSourceCandidateUniqueLinkCount} unique)`}`}, direct ${viewportDirectRouteCount ?? "unknown"}, clickthrough ${viewportClickthroughCount ?? "unknown"}, failures ${viewportFailureCount}`
15075
15198
  );
15076
15199
  }
15077
15200
  if (viewports.length > 8) lines.push(`- ${label}: ${viewports.length - 8} additional viewport(s) omitted from route inventory summary.`);
package/dist/cli.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  profileStatusExitCode,
13
13
  resolveRiddleProofProfileTargetUrl,
14
14
  resolveRiddleProofProfileTimeoutSec
15
- } from "./chunk-66RDQVFI.js";
15
+ } from "./chunk-ZC6AK3D3.js";
16
16
  import {
17
17
  createRiddleApiClient,
18
18
  parseRiddleViewport
@@ -567,6 +567,35 @@ function cliValueLabel(value) {
567
567
  function cliStringArray(value) {
568
568
  return Array.isArray(value) ? value.filter((entry) => typeof entry === "string" && Boolean(entry.trim())) : [];
569
569
  }
570
+ function cliRouteInventoryRoutes(value) {
571
+ if (!Array.isArray(value)) return [];
572
+ return value.map((entry) => {
573
+ if (typeof entry === "string") {
574
+ const pathValue2 = entry.trim();
575
+ return pathValue2 ? { path: pathValue2 } : void 0;
576
+ }
577
+ const route = cliRecord(entry);
578
+ if (!route) return void 0;
579
+ const pathValue = cliString(route.path);
580
+ if (!pathValue) return void 0;
581
+ const nameValue = cliString(route.name);
582
+ return nameValue ? { name: nameValue, path: pathValue } : { path: pathValue };
583
+ }).filter((route) => Boolean(route));
584
+ }
585
+ function cliRouteInventoryRouteLabel(route) {
586
+ return route.name && route.name !== route.path ? `${route.name} (${route.path})` : route.path;
587
+ }
588
+ function cliRouteInventoryRouteList(routes) {
589
+ const visible = routes.slice(0, 12).map(cliRouteInventoryRouteLabel);
590
+ const omitted = routes.length > 12 ? `; ${routes.length - 12} more` : "";
591
+ return `${visible.join("; ")}${omitted}`;
592
+ }
593
+ function cliRouteInventorySourceScopeLabel(value) {
594
+ const scope = cliString(value);
595
+ if (scope === "expected_routes") return "expected routes";
596
+ if (scope === "route_path_prefix") return "route path prefix";
597
+ return scope;
598
+ }
570
599
  function profileEnvironmentBlockerMarkdown(result) {
571
600
  const blocker = cliRecord(result.environment_blocker);
572
601
  if (!blocker) return [];
@@ -795,6 +824,9 @@ function profileRouteInventorySummaryMarkdown(result) {
795
824
  const expectedCount = cliFiniteNumber(evidence.expected_count);
796
825
  const sourceLinkCount = cliFiniteNumber(evidence.source_link_count);
797
826
  const sourceUniqueLinkCount = cliFiniteNumber(evidence.source_unique_link_count);
827
+ const sourceCandidateCount = cliFiniteNumber(evidence.source_candidate_count);
828
+ const sourceCandidateUniqueLinkCount = cliFiniteNumber(evidence.source_candidate_unique_link_count);
829
+ const sourceScopeLabel = cliRouteInventorySourceScopeLabel(evidence.source_link_scope);
798
830
  const directRouteCount = cliFiniteNumber(evidence.direct_route_count);
799
831
  const clickthroughCount = cliFiniteNumber(evidence.clickthrough_count);
800
832
  const topLevelFailures = Array.isArray(evidence.failures) ? evidence.failures.length : void 0;
@@ -810,15 +842,25 @@ function profileRouteInventorySummaryMarkdown(result) {
810
842
  const duplicateText = duplicateLinks.length ? `: ${duplicateLinks.slice(0, 8).join(", ")}${duplicateLinks.length > 8 ? `, ${duplicateLinks.length - 8} more` : ""}` : "";
811
843
  lines.push(`- ${label} duplicate source links: ${duplicateCount}${evidence.duplicates_allowed === true ? " allowed" : ""}${duplicateText}`);
812
844
  }
845
+ const expectedRoutes = cliRouteInventoryRoutes(evidence.expected_routes);
846
+ if (expectedRoutes.length) {
847
+ lines.push(`- ${label} expected routes: ${cliRouteInventoryRouteList(expectedRoutes)}`);
848
+ }
849
+ if (sourceScopeLabel || sourceCandidateCount !== void 0) {
850
+ const candidateText = sourceCandidateCount === void 0 ? "" : `; selector candidates ${sourceCandidateCount}${sourceCandidateUniqueLinkCount === void 0 ? "" : ` (${sourceCandidateUniqueLinkCount} unique)`}`;
851
+ lines.push(`- ${label} source scope: ${sourceScopeLabel || "unknown"}${candidateText}`);
852
+ }
813
853
  for (const viewport of viewports.slice(0, 8)) {
814
854
  const viewportName = cliString(viewport.viewport) || cliString(viewport.name) || "viewport";
815
855
  const viewportSourceLinkCount = cliFiniteNumber(viewport.source_link_count);
816
856
  const viewportSourceUniqueLinkCount = cliFiniteNumber(viewport.source_unique_link_count);
857
+ const viewportSourceCandidateCount = cliFiniteNumber(viewport.source_candidate_count);
858
+ const viewportSourceCandidateUniqueLinkCount = cliFiniteNumber(viewport.source_candidate_unique_link_count);
817
859
  const viewportDirectRouteCount = cliFiniteNumber(viewport.direct_route_count);
818
860
  const viewportClickthroughCount = cliFiniteNumber(viewport.clickthrough_count);
819
861
  const viewportFailureCount = cliFiniteNumber(viewport.failure_count) || 0;
820
862
  lines.push(
821
- `- ${label} ${viewportName}: source ${viewportSourceLinkCount ?? "unknown"}${viewportSourceUniqueLinkCount === void 0 ? "" : ` (${viewportSourceUniqueLinkCount} unique)`}, direct ${viewportDirectRouteCount ?? "unknown"}, clickthrough ${viewportClickthroughCount ?? "unknown"}, failures ${viewportFailureCount}`
863
+ `- ${label} ${viewportName}: source ${viewportSourceLinkCount ?? "unknown"}${viewportSourceUniqueLinkCount === void 0 ? "" : ` (${viewportSourceUniqueLinkCount} unique)`}${viewportSourceCandidateCount === void 0 ? "" : `, selector candidates ${viewportSourceCandidateCount}${viewportSourceCandidateUniqueLinkCount === void 0 ? "" : ` (${viewportSourceCandidateUniqueLinkCount} unique)`}`}, direct ${viewportDirectRouteCount ?? "unknown"}, clickthrough ${viewportClickthroughCount ?? "unknown"}, failures ${viewportFailureCount}`
822
864
  );
823
865
  }
824
866
  if (viewports.length > 8) lines.push(`- ${label}: ${viewports.length - 8} additional viewport(s) omitted from route inventory summary.`);
package/dist/index.cjs CHANGED
@@ -10763,11 +10763,17 @@ function summarizeRouteInventory(viewport, inventory) {
10763
10763
  const clickthroughs = Array.isArray(inventory.clickthroughs) ? inventory.clickthroughs : [];
10764
10764
  const sourceLinkCount = numberValue3(inventory.source_link_count) ?? numberValue3(inventory.home_game_link_count) ?? null;
10765
10765
  const sourceUniqueLinkCount = numberValue3(inventory.source_unique_link_count) ?? numberValue3(inventory.home_unique_game_link_count) ?? null;
10766
+ const sourceCandidateCount = numberValue3(inventory.source_candidate_count);
10767
+ const sourceCandidateUniqueLinkCount = numberValue3(inventory.source_candidate_unique_link_count);
10768
+ const sourceLinkScope = stringValue5(inventory.source_link_scope);
10766
10769
  const duplicateSourceLinks = Array.isArray(inventory.duplicate_source_link_paths) ? inventory.duplicate_source_link_paths.map((path6) => String(path6)) : [];
10767
10770
  const duplicateSourceLinkCount = numberValue3(inventory.duplicate_source_link_count) ?? (sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null);
10768
10771
  const failures = Array.isArray(inventory.failures) ? inventory.failures : [];
10769
10772
  return {
10770
10773
  viewport,
10774
+ source_link_scope: sourceLinkScope ?? null,
10775
+ source_candidate_count: sourceCandidateCount ?? sourceLinkCount,
10776
+ source_candidate_unique_link_count: sourceCandidateUniqueLinkCount ?? sourceUniqueLinkCount,
10771
10777
  source_link_count: sourceLinkCount,
10772
10778
  source_unique_link_count: sourceUniqueLinkCount,
10773
10779
  duplicate_source_link_count: duplicateSourceLinkCount,
@@ -10777,6 +10783,20 @@ function summarizeRouteInventory(viewport, inventory) {
10777
10783
  failure_count: failures.length
10778
10784
  };
10779
10785
  }
10786
+ function routeInventoryExpectedRouteSummaries(value, fallback) {
10787
+ const rawRoutes = Array.isArray(value) ? value : Array.isArray(fallback) ? fallback : [];
10788
+ return rawRoutes.map((route) => {
10789
+ if (typeof route === "string") {
10790
+ const path7 = route.trim();
10791
+ return path7 ? { path: path7 } : void 0;
10792
+ }
10793
+ if (!isRecord2(route)) return void 0;
10794
+ const path6 = stringValue5(route.path);
10795
+ if (!path6) return void 0;
10796
+ const name = stringValue5(route.name);
10797
+ return name ? { name, path: path6 } : { path: path6 };
10798
+ }).filter((route) => Boolean(route));
10799
+ }
10780
10800
  function matchText(sample, check) {
10781
10801
  if (check.pattern) {
10782
10802
  try {
@@ -11378,7 +11398,10 @@ function assessCheckFromEvidence(check, evidence) {
11378
11398
  type: check.type,
11379
11399
  label: checkLabel(check),
11380
11400
  status: "failed",
11381
- evidence: { expected_count: check.expected_routes?.length || 0 },
11401
+ evidence: {
11402
+ expected_count: check.expected_routes?.length || 0,
11403
+ expected_routes: routeInventoryExpectedRouteSummaries(void 0, check.expected_routes)
11404
+ },
11382
11405
  message: "No route inventory evidence was captured."
11383
11406
  };
11384
11407
  }
@@ -11389,14 +11412,22 @@ function assessCheckFromEvidence(check, evidence) {
11389
11412
  const clickthroughs = Array.isArray(first?.clickthroughs) ? first.clickthroughs : [];
11390
11413
  const sourceLinkCount = numberValue3(first?.source_link_count) ?? numberValue3(first?.home_game_link_count) ?? null;
11391
11414
  const sourceUniqueLinkCount = numberValue3(first?.source_unique_link_count) ?? numberValue3(first?.home_unique_game_link_count) ?? null;
11415
+ const sourceCandidateCount = numberValue3(first?.source_candidate_count);
11416
+ const sourceCandidateUniqueLinkCount = numberValue3(first?.source_candidate_unique_link_count);
11417
+ const sourceLinkScope = stringValue5(first?.source_link_scope);
11392
11418
  const duplicateSourceLinks = Array.isArray(first?.duplicate_source_link_paths) ? first.duplicate_source_link_paths.map((path6) => String(path6)) : [];
11393
11419
  const duplicateSourceLinkCount = numberValue3(first?.duplicate_source_link_count) ?? (sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null);
11420
+ const expectedRoutes = routeInventoryExpectedRouteSummaries(first?.expected_routes, check.expected_routes);
11394
11421
  return {
11395
11422
  type: check.type,
11396
11423
  label: checkLabel(check),
11397
11424
  status: failures.length ? "failed" : "passed",
11398
11425
  evidence: {
11399
11426
  expected_count: check.expected_routes?.length || 0,
11427
+ expected_routes: expectedRoutes,
11428
+ source_link_scope: sourceLinkScope ?? null,
11429
+ source_candidate_count: sourceCandidateCount ?? sourceLinkCount,
11430
+ source_candidate_unique_link_count: sourceCandidateUniqueLinkCount ?? sourceUniqueLinkCount,
11400
11431
  source_link_count: sourceLinkCount,
11401
11432
  source_unique_link_count: sourceUniqueLinkCount,
11402
11433
  duplicate_source_link_count: duplicateSourceLinkCount,
@@ -12389,11 +12420,17 @@ function summarizeRouteInventory(viewport, inventory) {
12389
12420
  const clickthroughs = Array.isArray(inventory.clickthroughs) ? inventory.clickthroughs : [];
12390
12421
  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;
12391
12422
  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;
12423
+ const sourceCandidateCount = typeof inventory.source_candidate_count === "number" ? inventory.source_candidate_count : null;
12424
+ const sourceCandidateUniqueLinkCount = typeof inventory.source_candidate_unique_link_count === "number" ? inventory.source_candidate_unique_link_count : null;
12425
+ const sourceLinkScope = typeof inventory.source_link_scope === "string" ? inventory.source_link_scope : null;
12392
12426
  const duplicateSourceLinks = Array.isArray(inventory.duplicate_source_link_paths) ? inventory.duplicate_source_link_paths.map((path) => String(path)) : [];
12393
12427
  const duplicateSourceLinkCount = typeof inventory.duplicate_source_link_count === "number" ? inventory.duplicate_source_link_count : sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null;
12394
12428
  const failures = Array.isArray(inventory.failures) ? inventory.failures : [];
12395
12429
  return {
12396
12430
  viewport,
12431
+ source_link_scope: sourceLinkScope,
12432
+ source_candidate_count: sourceCandidateCount == null ? sourceLinkCount : sourceCandidateCount,
12433
+ source_candidate_unique_link_count: sourceCandidateUniqueLinkCount == null ? sourceUniqueLinkCount : sourceCandidateUniqueLinkCount,
12397
12434
  source_link_count: sourceLinkCount,
12398
12435
  source_unique_link_count: sourceUniqueLinkCount,
12399
12436
  duplicate_source_link_count: duplicateSourceLinkCount,
@@ -12403,6 +12440,20 @@ function summarizeRouteInventory(viewport, inventory) {
12403
12440
  failure_count: failures.length,
12404
12441
  };
12405
12442
  }
12443
+ function routeInventoryExpectedRouteSummaries(value, fallback) {
12444
+ const rawRoutes = Array.isArray(value) ? value : Array.isArray(fallback) ? fallback : [];
12445
+ return rawRoutes.map((route) => {
12446
+ if (typeof route === "string") {
12447
+ const path = route.trim();
12448
+ return path ? { path } : null;
12449
+ }
12450
+ if (!route || typeof route !== "object" || Array.isArray(route)) return null;
12451
+ const path = typeof route.path === "string" && route.path.trim() ? route.path.trim() : "";
12452
+ if (!path) return null;
12453
+ const name = typeof route.name === "string" && route.name.trim() ? route.name.trim() : "";
12454
+ return name ? { name, path } : { path };
12455
+ }).filter(Boolean);
12456
+ }
12406
12457
  function numberValue(value) {
12407
12458
  return typeof value === "number" && Number.isFinite(value) ? value : undefined;
12408
12459
  }
@@ -13230,7 +13281,10 @@ function assessProfile(profile, evidence) {
13230
13281
  type: check.type,
13231
13282
  label: check.label || check.type,
13232
13283
  status: "failed",
13233
- evidence: { expected_count: (check.expected_routes || []).length },
13284
+ evidence: {
13285
+ expected_count: (check.expected_routes || []).length,
13286
+ expected_routes: routeInventoryExpectedRouteSummaries(undefined, check.expected_routes),
13287
+ },
13234
13288
  message: "No route inventory evidence was captured.",
13235
13289
  });
13236
13290
  continue;
@@ -13247,14 +13301,22 @@ function assessProfile(profile, evidence) {
13247
13301
  const clickthroughs = Array.isArray(first.clickthroughs) ? first.clickthroughs : [];
13248
13302
  const sourceLinkCount = typeof first.source_link_count === "number" ? first.source_link_count : typeof first.home_game_link_count === "number" ? first.home_game_link_count : null;
13249
13303
  const sourceUniqueLinkCount = typeof first.source_unique_link_count === "number" ? first.source_unique_link_count : typeof first.home_unique_game_link_count === "number" ? first.home_unique_game_link_count : null;
13304
+ const sourceCandidateCount = typeof first.source_candidate_count === "number" ? first.source_candidate_count : null;
13305
+ const sourceCandidateUniqueLinkCount = typeof first.source_candidate_unique_link_count === "number" ? first.source_candidate_unique_link_count : null;
13306
+ const sourceLinkScope = typeof first.source_link_scope === "string" ? first.source_link_scope : null;
13250
13307
  const duplicateSourceLinks = Array.isArray(first.duplicate_source_link_paths) ? first.duplicate_source_link_paths.map((path) => String(path)) : [];
13251
13308
  const duplicateSourceLinkCount = typeof first.duplicate_source_link_count === "number" ? first.duplicate_source_link_count : sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null;
13309
+ const expectedRoutes = routeInventoryExpectedRouteSummaries(first.expected_routes, check.expected_routes);
13252
13310
  checks.push({
13253
13311
  type: check.type,
13254
13312
  label: check.label || check.type,
13255
13313
  status: failures.length ? "failed" : "passed",
13256
13314
  evidence: {
13257
13315
  expected_count: (check.expected_routes || []).length,
13316
+ expected_routes: expectedRoutes,
13317
+ source_link_scope: sourceLinkScope,
13318
+ source_candidate_count: sourceCandidateCount == null ? sourceLinkCount : sourceCandidateCount,
13319
+ source_candidate_unique_link_count: sourceCandidateUniqueLinkCount == null ? sourceUniqueLinkCount : sourceCandidateUniqueLinkCount,
13258
13320
  source_link_count: sourceLinkCount,
13259
13321
  source_unique_link_count: sourceUniqueLinkCount,
13260
13322
  duplicate_source_link_count: duplicateSourceLinkCount,
@@ -15426,9 +15488,15 @@ async function collectInventoryHomeLinks(check) {
15426
15488
  app_path: appPath,
15427
15489
  };
15428
15490
  });
15429
- return links.filter((link) => (
15491
+ const selectedLinks = links.filter((link) => (
15430
15492
  routePathPrefix ? link.app_path.startsWith(routePathPrefix) : expectedSet.has(link.app_path)
15431
15493
  ));
15494
+ return {
15495
+ links: selectedLinks,
15496
+ candidate_count: links.length,
15497
+ candidate_unique_link_count: Array.from(new Set(links.map((link) => link.app_path))).length,
15498
+ source_link_scope: routePathPrefix ? "route_path_prefix" : "expected_routes",
15499
+ };
15432
15500
  }, { linkSelector, expectedPaths, routePathPrefix, targetUrl });
15433
15501
  }
15434
15502
  async function waitForInventoryRouteHealth(check, expectedPath) {
@@ -15569,7 +15637,11 @@ async function collectRouteInventory(check, viewport) {
15569
15637
  const expectedPaths = expectedRoutes.map((route) => normalizeRoutePath(route.path));
15570
15638
  const expectedSet = new Set(expectedPaths);
15571
15639
  const failures = [];
15572
- const homeLinks = await collectInventoryHomeLinks(check);
15640
+ const homeLinkCapture = await collectInventoryHomeLinks(check);
15641
+ const homeLinks = Array.isArray(homeLinkCapture) ? homeLinkCapture : Array.isArray(homeLinkCapture && homeLinkCapture.links) ? homeLinkCapture.links : [];
15642
+ const sourceCandidateCount = typeof homeLinkCapture?.candidate_count === "number" ? homeLinkCapture.candidate_count : homeLinks.length;
15643
+ const sourceCandidateUniqueLinkCount = typeof homeLinkCapture?.candidate_unique_link_count === "number" ? homeLinkCapture.candidate_unique_link_count : new Set(homeLinks.map((link) => link.app_path)).size;
15644
+ const sourceLinkScope = typeof homeLinkCapture?.source_link_scope === "string" ? homeLinkCapture.source_link_scope : check.route_path_prefix ? "route_path_prefix" : "expected_routes";
15573
15645
  const homeLinkPaths = homeLinks.map((link) => link.app_path);
15574
15646
  const uniqueHomeLinkPaths = Array.from(new Set(homeLinkPaths));
15575
15647
  const duplicateHomeLinkPaths = homeLinkPaths.filter((path, index) => homeLinkPaths.indexOf(path) !== index);
@@ -15651,6 +15723,9 @@ async function collectRouteInventory(check, viewport) {
15651
15723
  expected_routes: expectedRoutes,
15652
15724
  link_selector: check.link_selector || "a[href]",
15653
15725
  source_selector: check.source_selector || null,
15726
+ source_link_scope: sourceLinkScope,
15727
+ source_candidate_count: sourceCandidateCount,
15728
+ source_candidate_unique_link_count: sourceCandidateUniqueLinkCount,
15654
15729
  source_link_count: homeLinkPaths.length,
15655
15730
  source_unique_link_count: uniqueHomeLinkPaths.length,
15656
15731
  duplicate_source_link_count: duplicateHomeLinkPaths.length,
@@ -15847,6 +15922,9 @@ async function captureViewport(viewport) {
15847
15922
  expected_routes: routeInventoryCheck.expected_routes || [],
15848
15923
  link_selector: routeInventoryCheck.link_selector || "a[href]",
15849
15924
  source_selector: routeInventoryCheck.source_selector || null,
15925
+ source_link_scope: routeInventoryCheck.route_path_prefix ? "route_path_prefix" : "expected_routes",
15926
+ source_candidate_count: 0,
15927
+ source_candidate_unique_link_count: 0,
15850
15928
  source_link_count: 0,
15851
15929
  source_unique_link_count: 0,
15852
15930
  duplicate_source_link_count: 0,
@@ -15973,6 +16051,9 @@ function buildProfileEvidence(currentViewports) {
15973
16051
  .map((viewport) => ({
15974
16052
  viewport: viewport.name,
15975
16053
  expected_count: (viewport.route_inventory.expected_routes || []).length,
16054
+ source_link_scope: viewport.route_inventory.source_link_scope,
16055
+ source_candidate_count: viewport.route_inventory.source_candidate_count,
16056
+ source_candidate_unique_link_count: viewport.route_inventory.source_candidate_unique_link_count,
15976
16057
  source_link_count: viewport.route_inventory.source_link_count == null ? viewport.route_inventory.home_game_link_count : viewport.route_inventory.source_link_count,
15977
16058
  source_unique_link_count: viewport.route_inventory.source_unique_link_count == null ? viewport.route_inventory.home_unique_game_link_count : viewport.route_inventory.source_unique_link_count,
15978
16059
  duplicate_source_link_count: viewport.route_inventory.duplicate_source_link_count,
package/dist/index.js CHANGED
@@ -62,7 +62,7 @@ import {
62
62
  resolveRiddleProofProfileTimeoutSec,
63
63
  slugifyRiddleProofProfileName,
64
64
  summarizeRiddleProofProfileResult
65
- } from "./chunk-66RDQVFI.js";
65
+ } from "./chunk-ZC6AK3D3.js";
66
66
  import {
67
67
  DEFAULT_RIDDLE_API_BASE_URL,
68
68
  DEFAULT_RIDDLE_API_KEY_FILE,
package/dist/profile.cjs CHANGED
@@ -2077,11 +2077,17 @@ function summarizeRouteInventory(viewport, inventory) {
2077
2077
  const clickthroughs = Array.isArray(inventory.clickthroughs) ? inventory.clickthroughs : [];
2078
2078
  const sourceLinkCount = numberValue(inventory.source_link_count) ?? numberValue(inventory.home_game_link_count) ?? null;
2079
2079
  const sourceUniqueLinkCount = numberValue(inventory.source_unique_link_count) ?? numberValue(inventory.home_unique_game_link_count) ?? null;
2080
+ const sourceCandidateCount = numberValue(inventory.source_candidate_count);
2081
+ const sourceCandidateUniqueLinkCount = numberValue(inventory.source_candidate_unique_link_count);
2082
+ const sourceLinkScope = stringValue(inventory.source_link_scope);
2080
2083
  const duplicateSourceLinks = Array.isArray(inventory.duplicate_source_link_paths) ? inventory.duplicate_source_link_paths.map((path) => String(path)) : [];
2081
2084
  const duplicateSourceLinkCount = numberValue(inventory.duplicate_source_link_count) ?? (sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null);
2082
2085
  const failures = Array.isArray(inventory.failures) ? inventory.failures : [];
2083
2086
  return {
2084
2087
  viewport,
2088
+ source_link_scope: sourceLinkScope ?? null,
2089
+ source_candidate_count: sourceCandidateCount ?? sourceLinkCount,
2090
+ source_candidate_unique_link_count: sourceCandidateUniqueLinkCount ?? sourceUniqueLinkCount,
2085
2091
  source_link_count: sourceLinkCount,
2086
2092
  source_unique_link_count: sourceUniqueLinkCount,
2087
2093
  duplicate_source_link_count: duplicateSourceLinkCount,
@@ -2091,6 +2097,20 @@ function summarizeRouteInventory(viewport, inventory) {
2091
2097
  failure_count: failures.length
2092
2098
  };
2093
2099
  }
2100
+ function routeInventoryExpectedRouteSummaries(value, fallback) {
2101
+ const rawRoutes = Array.isArray(value) ? value : Array.isArray(fallback) ? fallback : [];
2102
+ return rawRoutes.map((route) => {
2103
+ if (typeof route === "string") {
2104
+ const path2 = route.trim();
2105
+ return path2 ? { path: path2 } : void 0;
2106
+ }
2107
+ if (!isRecord(route)) return void 0;
2108
+ const path = stringValue(route.path);
2109
+ if (!path) return void 0;
2110
+ const name = stringValue(route.name);
2111
+ return name ? { name, path } : { path };
2112
+ }).filter((route) => Boolean(route));
2113
+ }
2094
2114
  function matchText(sample, check) {
2095
2115
  if (check.pattern) {
2096
2116
  try {
@@ -2692,7 +2712,10 @@ function assessCheckFromEvidence(check, evidence) {
2692
2712
  type: check.type,
2693
2713
  label: checkLabel(check),
2694
2714
  status: "failed",
2695
- evidence: { expected_count: check.expected_routes?.length || 0 },
2715
+ evidence: {
2716
+ expected_count: check.expected_routes?.length || 0,
2717
+ expected_routes: routeInventoryExpectedRouteSummaries(void 0, check.expected_routes)
2718
+ },
2696
2719
  message: "No route inventory evidence was captured."
2697
2720
  };
2698
2721
  }
@@ -2703,14 +2726,22 @@ function assessCheckFromEvidence(check, evidence) {
2703
2726
  const clickthroughs = Array.isArray(first?.clickthroughs) ? first.clickthroughs : [];
2704
2727
  const sourceLinkCount = numberValue(first?.source_link_count) ?? numberValue(first?.home_game_link_count) ?? null;
2705
2728
  const sourceUniqueLinkCount = numberValue(first?.source_unique_link_count) ?? numberValue(first?.home_unique_game_link_count) ?? null;
2729
+ const sourceCandidateCount = numberValue(first?.source_candidate_count);
2730
+ const sourceCandidateUniqueLinkCount = numberValue(first?.source_candidate_unique_link_count);
2731
+ const sourceLinkScope = stringValue(first?.source_link_scope);
2706
2732
  const duplicateSourceLinks = Array.isArray(first?.duplicate_source_link_paths) ? first.duplicate_source_link_paths.map((path) => String(path)) : [];
2707
2733
  const duplicateSourceLinkCount = numberValue(first?.duplicate_source_link_count) ?? (sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null);
2734
+ const expectedRoutes = routeInventoryExpectedRouteSummaries(first?.expected_routes, check.expected_routes);
2708
2735
  return {
2709
2736
  type: check.type,
2710
2737
  label: checkLabel(check),
2711
2738
  status: failures.length ? "failed" : "passed",
2712
2739
  evidence: {
2713
2740
  expected_count: check.expected_routes?.length || 0,
2741
+ expected_routes: expectedRoutes,
2742
+ source_link_scope: sourceLinkScope ?? null,
2743
+ source_candidate_count: sourceCandidateCount ?? sourceLinkCount,
2744
+ source_candidate_unique_link_count: sourceCandidateUniqueLinkCount ?? sourceUniqueLinkCount,
2714
2745
  source_link_count: sourceLinkCount,
2715
2746
  source_unique_link_count: sourceUniqueLinkCount,
2716
2747
  duplicate_source_link_count: duplicateSourceLinkCount,
@@ -3703,11 +3734,17 @@ function summarizeRouteInventory(viewport, inventory) {
3703
3734
  const clickthroughs = Array.isArray(inventory.clickthroughs) ? inventory.clickthroughs : [];
3704
3735
  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;
3705
3736
  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;
3737
+ const sourceCandidateCount = typeof inventory.source_candidate_count === "number" ? inventory.source_candidate_count : null;
3738
+ const sourceCandidateUniqueLinkCount = typeof inventory.source_candidate_unique_link_count === "number" ? inventory.source_candidate_unique_link_count : null;
3739
+ const sourceLinkScope = typeof inventory.source_link_scope === "string" ? inventory.source_link_scope : null;
3706
3740
  const duplicateSourceLinks = Array.isArray(inventory.duplicate_source_link_paths) ? inventory.duplicate_source_link_paths.map((path) => String(path)) : [];
3707
3741
  const duplicateSourceLinkCount = typeof inventory.duplicate_source_link_count === "number" ? inventory.duplicate_source_link_count : sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null;
3708
3742
  const failures = Array.isArray(inventory.failures) ? inventory.failures : [];
3709
3743
  return {
3710
3744
  viewport,
3745
+ source_link_scope: sourceLinkScope,
3746
+ source_candidate_count: sourceCandidateCount == null ? sourceLinkCount : sourceCandidateCount,
3747
+ source_candidate_unique_link_count: sourceCandidateUniqueLinkCount == null ? sourceUniqueLinkCount : sourceCandidateUniqueLinkCount,
3711
3748
  source_link_count: sourceLinkCount,
3712
3749
  source_unique_link_count: sourceUniqueLinkCount,
3713
3750
  duplicate_source_link_count: duplicateSourceLinkCount,
@@ -3717,6 +3754,20 @@ function summarizeRouteInventory(viewport, inventory) {
3717
3754
  failure_count: failures.length,
3718
3755
  };
3719
3756
  }
3757
+ function routeInventoryExpectedRouteSummaries(value, fallback) {
3758
+ const rawRoutes = Array.isArray(value) ? value : Array.isArray(fallback) ? fallback : [];
3759
+ return rawRoutes.map((route) => {
3760
+ if (typeof route === "string") {
3761
+ const path = route.trim();
3762
+ return path ? { path } : null;
3763
+ }
3764
+ if (!route || typeof route !== "object" || Array.isArray(route)) return null;
3765
+ const path = typeof route.path === "string" && route.path.trim() ? route.path.trim() : "";
3766
+ if (!path) return null;
3767
+ const name = typeof route.name === "string" && route.name.trim() ? route.name.trim() : "";
3768
+ return name ? { name, path } : { path };
3769
+ }).filter(Boolean);
3770
+ }
3720
3771
  function numberValue(value) {
3721
3772
  return typeof value === "number" && Number.isFinite(value) ? value : undefined;
3722
3773
  }
@@ -4544,7 +4595,10 @@ function assessProfile(profile, evidence) {
4544
4595
  type: check.type,
4545
4596
  label: check.label || check.type,
4546
4597
  status: "failed",
4547
- evidence: { expected_count: (check.expected_routes || []).length },
4598
+ evidence: {
4599
+ expected_count: (check.expected_routes || []).length,
4600
+ expected_routes: routeInventoryExpectedRouteSummaries(undefined, check.expected_routes),
4601
+ },
4548
4602
  message: "No route inventory evidence was captured.",
4549
4603
  });
4550
4604
  continue;
@@ -4561,14 +4615,22 @@ function assessProfile(profile, evidence) {
4561
4615
  const clickthroughs = Array.isArray(first.clickthroughs) ? first.clickthroughs : [];
4562
4616
  const sourceLinkCount = typeof first.source_link_count === "number" ? first.source_link_count : typeof first.home_game_link_count === "number" ? first.home_game_link_count : null;
4563
4617
  const sourceUniqueLinkCount = typeof first.source_unique_link_count === "number" ? first.source_unique_link_count : typeof first.home_unique_game_link_count === "number" ? first.home_unique_game_link_count : null;
4618
+ const sourceCandidateCount = typeof first.source_candidate_count === "number" ? first.source_candidate_count : null;
4619
+ const sourceCandidateUniqueLinkCount = typeof first.source_candidate_unique_link_count === "number" ? first.source_candidate_unique_link_count : null;
4620
+ const sourceLinkScope = typeof first.source_link_scope === "string" ? first.source_link_scope : null;
4564
4621
  const duplicateSourceLinks = Array.isArray(first.duplicate_source_link_paths) ? first.duplicate_source_link_paths.map((path) => String(path)) : [];
4565
4622
  const duplicateSourceLinkCount = typeof first.duplicate_source_link_count === "number" ? first.duplicate_source_link_count : sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null;
4623
+ const expectedRoutes = routeInventoryExpectedRouteSummaries(first.expected_routes, check.expected_routes);
4566
4624
  checks.push({
4567
4625
  type: check.type,
4568
4626
  label: check.label || check.type,
4569
4627
  status: failures.length ? "failed" : "passed",
4570
4628
  evidence: {
4571
4629
  expected_count: (check.expected_routes || []).length,
4630
+ expected_routes: expectedRoutes,
4631
+ source_link_scope: sourceLinkScope,
4632
+ source_candidate_count: sourceCandidateCount == null ? sourceLinkCount : sourceCandidateCount,
4633
+ source_candidate_unique_link_count: sourceCandidateUniqueLinkCount == null ? sourceUniqueLinkCount : sourceCandidateUniqueLinkCount,
4572
4634
  source_link_count: sourceLinkCount,
4573
4635
  source_unique_link_count: sourceUniqueLinkCount,
4574
4636
  duplicate_source_link_count: duplicateSourceLinkCount,
@@ -6740,9 +6802,15 @@ async function collectInventoryHomeLinks(check) {
6740
6802
  app_path: appPath,
6741
6803
  };
6742
6804
  });
6743
- return links.filter((link) => (
6805
+ const selectedLinks = links.filter((link) => (
6744
6806
  routePathPrefix ? link.app_path.startsWith(routePathPrefix) : expectedSet.has(link.app_path)
6745
6807
  ));
6808
+ return {
6809
+ links: selectedLinks,
6810
+ candidate_count: links.length,
6811
+ candidate_unique_link_count: Array.from(new Set(links.map((link) => link.app_path))).length,
6812
+ source_link_scope: routePathPrefix ? "route_path_prefix" : "expected_routes",
6813
+ };
6746
6814
  }, { linkSelector, expectedPaths, routePathPrefix, targetUrl });
6747
6815
  }
6748
6816
  async function waitForInventoryRouteHealth(check, expectedPath) {
@@ -6883,7 +6951,11 @@ async function collectRouteInventory(check, viewport) {
6883
6951
  const expectedPaths = expectedRoutes.map((route) => normalizeRoutePath(route.path));
6884
6952
  const expectedSet = new Set(expectedPaths);
6885
6953
  const failures = [];
6886
- const homeLinks = await collectInventoryHomeLinks(check);
6954
+ const homeLinkCapture = await collectInventoryHomeLinks(check);
6955
+ const homeLinks = Array.isArray(homeLinkCapture) ? homeLinkCapture : Array.isArray(homeLinkCapture && homeLinkCapture.links) ? homeLinkCapture.links : [];
6956
+ const sourceCandidateCount = typeof homeLinkCapture?.candidate_count === "number" ? homeLinkCapture.candidate_count : homeLinks.length;
6957
+ const sourceCandidateUniqueLinkCount = typeof homeLinkCapture?.candidate_unique_link_count === "number" ? homeLinkCapture.candidate_unique_link_count : new Set(homeLinks.map((link) => link.app_path)).size;
6958
+ const sourceLinkScope = typeof homeLinkCapture?.source_link_scope === "string" ? homeLinkCapture.source_link_scope : check.route_path_prefix ? "route_path_prefix" : "expected_routes";
6887
6959
  const homeLinkPaths = homeLinks.map((link) => link.app_path);
6888
6960
  const uniqueHomeLinkPaths = Array.from(new Set(homeLinkPaths));
6889
6961
  const duplicateHomeLinkPaths = homeLinkPaths.filter((path, index) => homeLinkPaths.indexOf(path) !== index);
@@ -6965,6 +7037,9 @@ async function collectRouteInventory(check, viewport) {
6965
7037
  expected_routes: expectedRoutes,
6966
7038
  link_selector: check.link_selector || "a[href]",
6967
7039
  source_selector: check.source_selector || null,
7040
+ source_link_scope: sourceLinkScope,
7041
+ source_candidate_count: sourceCandidateCount,
7042
+ source_candidate_unique_link_count: sourceCandidateUniqueLinkCount,
6968
7043
  source_link_count: homeLinkPaths.length,
6969
7044
  source_unique_link_count: uniqueHomeLinkPaths.length,
6970
7045
  duplicate_source_link_count: duplicateHomeLinkPaths.length,
@@ -7161,6 +7236,9 @@ async function captureViewport(viewport) {
7161
7236
  expected_routes: routeInventoryCheck.expected_routes || [],
7162
7237
  link_selector: routeInventoryCheck.link_selector || "a[href]",
7163
7238
  source_selector: routeInventoryCheck.source_selector || null,
7239
+ source_link_scope: routeInventoryCheck.route_path_prefix ? "route_path_prefix" : "expected_routes",
7240
+ source_candidate_count: 0,
7241
+ source_candidate_unique_link_count: 0,
7164
7242
  source_link_count: 0,
7165
7243
  source_unique_link_count: 0,
7166
7244
  duplicate_source_link_count: 0,
@@ -7287,6 +7365,9 @@ function buildProfileEvidence(currentViewports) {
7287
7365
  .map((viewport) => ({
7288
7366
  viewport: viewport.name,
7289
7367
  expected_count: (viewport.route_inventory.expected_routes || []).length,
7368
+ source_link_scope: viewport.route_inventory.source_link_scope,
7369
+ source_candidate_count: viewport.route_inventory.source_candidate_count,
7370
+ source_candidate_unique_link_count: viewport.route_inventory.source_candidate_unique_link_count,
7290
7371
  source_link_count: viewport.route_inventory.source_link_count == null ? viewport.route_inventory.home_game_link_count : viewport.route_inventory.source_link_count,
7291
7372
  source_unique_link_count: viewport.route_inventory.source_unique_link_count == null ? viewport.route_inventory.home_unique_game_link_count : viewport.route_inventory.source_unique_link_count,
7292
7373
  duplicate_source_link_count: viewport.route_inventory.duplicate_source_link_count,
package/dist/profile.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  resolveRiddleProofProfileTimeoutSec,
24
24
  slugifyRiddleProofProfileName,
25
25
  summarizeRiddleProofProfileResult
26
- } from "./chunk-66RDQVFI.js";
26
+ } from "./chunk-ZC6AK3D3.js";
27
27
  export {
28
28
  RIDDLE_PROOF_PROFILE_CHECK_TYPES,
29
29
  RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
292
292
  blocking?: boolean;
293
293
  details?: Record<string, unknown>;
294
294
  ok: boolean;
295
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
295
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
296
296
  state_path: string;
297
297
  stage: any;
298
298
  summary: string;
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
382
382
  continueWithStage?: WorkflowStage | null;
383
383
  blocking?: boolean;
384
384
  details?: Record<string, unknown>;
385
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
385
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
386
386
  state_path: string;
387
387
  stage: any;
388
388
  checkpoint: string;
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
659
659
  error?: undefined;
660
660
  } | {
661
661
  ok: boolean;
662
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
662
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
663
663
  state_path: string;
664
664
  stage: any;
665
665
  summary: string;
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
292
292
  blocking?: boolean;
293
293
  details?: Record<string, unknown>;
294
294
  ok: boolean;
295
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
295
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
296
296
  state_path: string;
297
297
  stage: any;
298
298
  summary: string;
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
382
382
  continueWithStage?: WorkflowStage | null;
383
383
  blocking?: boolean;
384
384
  details?: Record<string, unknown>;
385
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
385
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
386
386
  state_path: string;
387
387
  stage: any;
388
388
  checkpoint: string;
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
659
659
  error?: undefined;
660
660
  } | {
661
661
  ok: boolean;
662
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
662
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
663
663
  state_path: string;
664
664
  stage: any;
665
665
  summary: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.7.143",
3
+ "version": "0.7.145",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",