@riddledc/riddle-proof 0.7.175 → 0.7.177

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.
@@ -611,6 +611,16 @@ function profileSetupTapReceipts(results) {
611
611
  reason: result.reason ?? result.error ?? null
612
612
  }));
613
613
  }
614
+ function profileSetupPressReceipts(results) {
615
+ return results.filter((result) => profileSetupResultAction(result) === "press").map((result) => ({
616
+ ordinal: result.ordinal ?? null,
617
+ ok: result.ok !== false,
618
+ selector: result.selector ?? null,
619
+ frame_selector: result.frame_selector ?? null,
620
+ key: result.key ?? null,
621
+ reason: result.reason ?? result.error ?? null
622
+ }));
623
+ }
614
624
  function profileSetupCanvasSignatureReceipts(results) {
615
625
  return results.filter((result) => profileSetupResultAction(result) === "canvas_signature").map((result) => ({
616
626
  ordinal: result.ordinal ?? null,
@@ -774,6 +784,8 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
774
784
  const sampledDragReceipts = sampleProfileSetupSummaryItems(dragReceipts, 8);
775
785
  const tapReceipts = profileSetupTapReceipts(results);
776
786
  const sampledTapReceipts = sampleProfileSetupSummaryItems(tapReceipts, 8);
787
+ const pressReceipts = profileSetupPressReceipts(results);
788
+ const sampledPressReceipts = sampleProfileSetupSummaryItems(pressReceipts, 8);
777
789
  const canvasSignatureReceipts = profileSetupCanvasSignatureReceipts(results);
778
790
  const sampledCanvasSignatureReceipts = sampleProfileSetupSummaryItems(canvasSignatureReceipts, 8);
779
791
  const clickedItems = results.filter((result) => profileSetupResultAction(result) === "click" && result.ok !== false).map((result) => {
@@ -841,6 +853,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
841
853
  tap_total: tapReceipts.length,
842
854
  tap_truncated: tapReceipts.length > sampledTapReceipts.length,
843
855
  tap: sampledTapReceipts,
856
+ press_total: pressReceipts.length,
857
+ press_truncated: pressReceipts.length > sampledPressReceipts.length,
858
+ press: sampledPressReceipts,
844
859
  canvas_signature_total: canvasSignatureReceipts.length,
845
860
  canvas_signature_truncated: canvasSignatureReceipts.length > sampledCanvasSignatureReceipts.length,
846
861
  canvas_signature: sampledCanvasSignatureReceipts,
@@ -2637,6 +2652,27 @@ function successfulRoute(route, targetUrl) {
2637
2652
  const matched = route.matched || routePathMatches(route.observed, route.expected_path, targetUrl);
2638
2653
  return matched && !route.error && (route.http_status === null || route.http_status === void 0 || route.http_status < 400);
2639
2654
  }
2655
+ function routeReadinessFailed(route, targetUrl) {
2656
+ const matched = route.matched || routePathMatches(route.observed, route.expected_path, targetUrl);
2657
+ const httpOk = route.http_status === null || route.http_status === void 0 || route.http_status < 400;
2658
+ return matched && httpOk && Boolean(route.error);
2659
+ }
2660
+ function compactRouteError(error) {
2661
+ const text = typeof error === "string" ? error.replace(/\s+/g, " ").trim() : "";
2662
+ return text ? text.slice(0, 240) : void 0;
2663
+ }
2664
+ function routeLoadedFailureMessage(failedRoutes, expectedPath, targetUrl) {
2665
+ const readinessFailures = failedRoutes.filter((route) => routeReadinessFailed(route, targetUrl));
2666
+ if (readinessFailures.length === failedRoutes.length && readinessFailures.length) {
2667
+ const sample = compactRouteError(readinessFailures.find((route) => route.error)?.error);
2668
+ return `Route matched ${expectedPath}, but readiness failed in ${readinessFailures.length} viewport(s)${sample ? `: ${sample}` : "."}`;
2669
+ }
2670
+ if (readinessFailures.length) {
2671
+ const sample = compactRouteError(readinessFailures.find((route) => route.error)?.error);
2672
+ return `Route did not become ready as ${expectedPath} in ${failedRoutes.length} viewport(s); ${readinessFailures.length} matched path and HTTP but failed readiness${sample ? `: ${sample}` : "."}`;
2673
+ }
2674
+ return `Route did not load as ${expectedPath} in ${failedRoutes.length} viewport(s).`;
2675
+ }
2640
2676
  function parseEvidenceUrl(value, targetUrl) {
2641
2677
  if (!value) return void 0;
2642
2678
  try {
@@ -2706,11 +2742,12 @@ function assessCheckFromEvidence(check, evidence) {
2706
2742
  }
2707
2743
  if (check.type === "route_loaded") {
2708
2744
  const expectedPath = check.expected_path || new URL(evidence.target_url).pathname || "/";
2709
- const failed = viewports.filter((viewport) => !successfulRoute({
2745
+ const routes = viewports.map((viewport) => ({
2710
2746
  ...viewport.route,
2711
2747
  expected_path: expectedPath,
2712
2748
  matched: routePathMatches(viewport.route.observed, expectedPath, evidence.target_url) || viewport.route.matched
2713
- }, evidence.target_url));
2749
+ }));
2750
+ const failed = routes.filter((route) => !successfulRoute(route, evidence.target_url));
2714
2751
  return {
2715
2752
  type: check.type,
2716
2753
  label: checkLabel(check),
@@ -2718,9 +2755,10 @@ function assessCheckFromEvidence(check, evidence) {
2718
2755
  evidence: {
2719
2756
  expected_path: expectedPath,
2720
2757
  observed_paths: viewports.map((viewport) => viewport.route.observed),
2721
- http_statuses: viewports.map((viewport) => viewport.route.http_status ?? null)
2758
+ http_statuses: viewports.map((viewport) => viewport.route.http_status ?? null),
2759
+ route_errors: viewports.map((viewport) => viewport.route.error ?? null)
2722
2760
  },
2723
- message: failed.length ? `Route did not load as ${expectedPath} in ${failed.length} viewport(s).` : void 0
2761
+ message: failed.length ? routeLoadedFailureMessage(failed, expectedPath, evidence.target_url) : void 0
2724
2762
  };
2725
2763
  }
2726
2764
  if (check.type === "url_search_param_equals") {
@@ -3588,6 +3626,29 @@ function routePathMatches(observed, expected, targetUrl) {
3588
3626
  function routeOk(route, targetUrl) {
3589
3627
  return Boolean(route && (route.matched || routePathMatches(route.observed, route.expected_path, targetUrl)) && !route.error && (route.http_status == null || route.http_status < 400));
3590
3628
  }
3629
+ function routeReadinessFailed(route, targetUrl) {
3630
+ const matched = route && (route.matched || routePathMatches(route.observed, route.expected_path, targetUrl));
3631
+ const httpOk = route && (route.http_status == null || route.http_status < 400);
3632
+ return Boolean(matched && httpOk && route.error);
3633
+ }
3634
+ function compactRouteError(error) {
3635
+ const text = typeof error === "string" ? error.replace(/\s+/g, " ").trim() : "";
3636
+ return text ? text.slice(0, 240) : undefined;
3637
+ }
3638
+ function routeLoadedFailureMessage(failedRoutes, expectedPath, targetUrl) {
3639
+ const readinessFailures = failedRoutes.filter((route) => routeReadinessFailed(route, targetUrl));
3640
+ if (readinessFailures.length === failedRoutes.length && readinessFailures.length) {
3641
+ const sampleRoute = readinessFailures.find((route) => route && route.error);
3642
+ const sample = compactRouteError(sampleRoute && sampleRoute.error);
3643
+ return "Route matched " + expectedPath + ", but readiness failed in " + readinessFailures.length + " viewport(s)" + (sample ? ": " + sample : ".");
3644
+ }
3645
+ if (readinessFailures.length) {
3646
+ const sampleRoute = readinessFailures.find((route) => route && route.error);
3647
+ const sample = compactRouteError(sampleRoute && sampleRoute.error);
3648
+ return "Route did not become ready as " + expectedPath + " in " + failedRoutes.length + " viewport(s); " + readinessFailures.length + " matched path and HTTP but failed readiness" + (sample ? ": " + sample : ".");
3649
+ }
3650
+ return "Route did not load as " + expectedPath + " in " + failedRoutes.length + " viewport(s).";
3651
+ }
3591
3652
  function parseEvidenceUrl(value, targetUrl) {
3592
3653
  if (!value) return null;
3593
3654
  try { return targetUrl ? new URL(value, targetUrl) : new URL(value); } catch {}
@@ -4426,6 +4487,18 @@ function profileSetupTapReceipts(results) {
4426
4487
  reason: result.reason || result.error || null,
4427
4488
  }));
4428
4489
  }
4490
+ function profileSetupPressReceipts(results) {
4491
+ return (results || [])
4492
+ .filter((result) => result && profileSetupResultAction(result) === "press")
4493
+ .map((result) => ({
4494
+ ordinal: result.ordinal ?? null,
4495
+ ok: result.ok !== false,
4496
+ selector: result.selector ?? null,
4497
+ frame_selector: result.frame_selector ?? null,
4498
+ key: result.key ?? null,
4499
+ reason: result.reason || result.error || null,
4500
+ }));
4501
+ }
4429
4502
  function profileSetupCanvasSignatureReceipts(results) {
4430
4503
  return (results || [])
4431
4504
  .filter((result) => result && profileSetupResultAction(result) === "canvas_signature")
@@ -4614,6 +4687,8 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
4614
4687
  const sampledDragReceipts = sampleProfileSetupSummaryItems(dragReceipts, 8);
4615
4688
  const tapReceipts = profileSetupTapReceipts(results);
4616
4689
  const sampledTapReceipts = sampleProfileSetupSummaryItems(tapReceipts, 8);
4690
+ const pressReceipts = profileSetupPressReceipts(results);
4691
+ const sampledPressReceipts = sampleProfileSetupSummaryItems(pressReceipts, 8);
4617
4692
  const canvasSignatureReceipts = profileSetupCanvasSignatureReceipts(results);
4618
4693
  const sampledCanvasSignatureReceipts = sampleProfileSetupSummaryItems(canvasSignatureReceipts, 8);
4619
4694
  const clickedItems = results
@@ -4691,6 +4766,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
4691
4766
  tap_total: tapReceipts.length,
4692
4767
  tap_truncated: tapReceipts.length > sampledTapReceipts.length,
4693
4768
  tap: sampledTapReceipts,
4769
+ press_total: pressReceipts.length,
4770
+ press_truncated: pressReceipts.length > sampledPressReceipts.length,
4771
+ press: sampledPressReceipts,
4694
4772
  canvas_signature_total: canvasSignatureReceipts.length,
4695
4773
  canvas_signature_truncated: canvasSignatureReceipts.length > sampledCanvasSignatureReceipts.length,
4696
4774
  canvas_signature: sampledCanvasSignatureReceipts,
@@ -4889,11 +4967,12 @@ function assessProfile(profile, evidence) {
4889
4967
  }
4890
4968
  if (check.type === "route_loaded") {
4891
4969
  const expectedPath = check.expected_path || new URL(evidence.target_url).pathname || "/";
4892
- const failed = checkViewports.filter((viewport) => {
4970
+ const routes = checkViewports.map((viewport) => {
4893
4971
  const route = { ...(viewport.route || {}), expected_path: expectedPath };
4894
4972
  route.matched = routePathMatches(route.observed, expectedPath, evidence.target_url) || route.matched;
4895
- return !routeOk(route, evidence.target_url);
4973
+ return route;
4896
4974
  });
4975
+ const failed = routes.filter((route) => !routeOk(route, evidence.target_url));
4897
4976
  checks.push({
4898
4977
  type: check.type,
4899
4978
  label: check.label || check.type,
@@ -4902,8 +4981,9 @@ function assessProfile(profile, evidence) {
4902
4981
  expected_path: expectedPath,
4903
4982
  observed_paths: checkViewports.map((viewport) => viewport.route && viewport.route.observed),
4904
4983
  http_statuses: checkViewports.map((viewport) => viewport.route ? viewport.route.http_status ?? null : null),
4984
+ route_errors: checkViewports.map((viewport) => viewport.route ? viewport.route.error ?? null : null),
4905
4985
  },
4906
- message: failed.length ? "Route did not load as " + expectedPath + " in " + failed.length + " viewport(s)." : undefined,
4986
+ message: failed.length ? routeLoadedFailureMessage(failed, expectedPath, evidence.target_url) : undefined,
4907
4987
  });
4908
4988
  continue;
4909
4989
  }
package/dist/cli.cjs CHANGED
@@ -7568,6 +7568,16 @@ function profileSetupTapReceipts(results) {
7568
7568
  reason: result.reason ?? result.error ?? null
7569
7569
  }));
7570
7570
  }
7571
+ function profileSetupPressReceipts(results) {
7572
+ return results.filter((result) => profileSetupResultAction(result) === "press").map((result) => ({
7573
+ ordinal: result.ordinal ?? null,
7574
+ ok: result.ok !== false,
7575
+ selector: result.selector ?? null,
7576
+ frame_selector: result.frame_selector ?? null,
7577
+ key: result.key ?? null,
7578
+ reason: result.reason ?? result.error ?? null
7579
+ }));
7580
+ }
7571
7581
  function profileSetupCanvasSignatureReceipts(results) {
7572
7582
  return results.filter((result) => profileSetupResultAction(result) === "canvas_signature").map((result) => ({
7573
7583
  ordinal: result.ordinal ?? null,
@@ -7731,6 +7741,8 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
7731
7741
  const sampledDragReceipts = sampleProfileSetupSummaryItems(dragReceipts, 8);
7732
7742
  const tapReceipts = profileSetupTapReceipts(results);
7733
7743
  const sampledTapReceipts = sampleProfileSetupSummaryItems(tapReceipts, 8);
7744
+ const pressReceipts = profileSetupPressReceipts(results);
7745
+ const sampledPressReceipts = sampleProfileSetupSummaryItems(pressReceipts, 8);
7734
7746
  const canvasSignatureReceipts = profileSetupCanvasSignatureReceipts(results);
7735
7747
  const sampledCanvasSignatureReceipts = sampleProfileSetupSummaryItems(canvasSignatureReceipts, 8);
7736
7748
  const clickedItems = results.filter((result) => profileSetupResultAction(result) === "click" && result.ok !== false).map((result) => {
@@ -7798,6 +7810,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
7798
7810
  tap_total: tapReceipts.length,
7799
7811
  tap_truncated: tapReceipts.length > sampledTapReceipts.length,
7800
7812
  tap: sampledTapReceipts,
7813
+ press_total: pressReceipts.length,
7814
+ press_truncated: pressReceipts.length > sampledPressReceipts.length,
7815
+ press: sampledPressReceipts,
7801
7816
  canvas_signature_total: canvasSignatureReceipts.length,
7802
7817
  canvas_signature_truncated: canvasSignatureReceipts.length > sampledCanvasSignatureReceipts.length,
7803
7818
  canvas_signature: sampledCanvasSignatureReceipts,
@@ -9594,6 +9609,27 @@ function successfulRoute(route, targetUrl) {
9594
9609
  const matched = route.matched || routePathMatches(route.observed, route.expected_path, targetUrl);
9595
9610
  return matched && !route.error && (route.http_status === null || route.http_status === void 0 || route.http_status < 400);
9596
9611
  }
9612
+ function routeReadinessFailed(route, targetUrl) {
9613
+ const matched = route.matched || routePathMatches(route.observed, route.expected_path, targetUrl);
9614
+ const httpOk = route.http_status === null || route.http_status === void 0 || route.http_status < 400;
9615
+ return matched && httpOk && Boolean(route.error);
9616
+ }
9617
+ function compactRouteError(error) {
9618
+ const text = typeof error === "string" ? error.replace(/\s+/g, " ").trim() : "";
9619
+ return text ? text.slice(0, 240) : void 0;
9620
+ }
9621
+ function routeLoadedFailureMessage(failedRoutes, expectedPath, targetUrl) {
9622
+ const readinessFailures = failedRoutes.filter((route) => routeReadinessFailed(route, targetUrl));
9623
+ if (readinessFailures.length === failedRoutes.length && readinessFailures.length) {
9624
+ const sample = compactRouteError(readinessFailures.find((route) => route.error)?.error);
9625
+ return `Route matched ${expectedPath}, but readiness failed in ${readinessFailures.length} viewport(s)${sample ? `: ${sample}` : "."}`;
9626
+ }
9627
+ if (readinessFailures.length) {
9628
+ const sample = compactRouteError(readinessFailures.find((route) => route.error)?.error);
9629
+ return `Route did not become ready as ${expectedPath} in ${failedRoutes.length} viewport(s); ${readinessFailures.length} matched path and HTTP but failed readiness${sample ? `: ${sample}` : "."}`;
9630
+ }
9631
+ return `Route did not load as ${expectedPath} in ${failedRoutes.length} viewport(s).`;
9632
+ }
9597
9633
  function parseEvidenceUrl(value, targetUrl) {
9598
9634
  if (!value) return void 0;
9599
9635
  try {
@@ -9663,11 +9699,12 @@ function assessCheckFromEvidence(check, evidence) {
9663
9699
  }
9664
9700
  if (check.type === "route_loaded") {
9665
9701
  const expectedPath = check.expected_path || new URL(evidence.target_url).pathname || "/";
9666
- const failed = viewports.filter((viewport) => !successfulRoute({
9702
+ const routes = viewports.map((viewport) => ({
9667
9703
  ...viewport.route,
9668
9704
  expected_path: expectedPath,
9669
9705
  matched: routePathMatches(viewport.route.observed, expectedPath, evidence.target_url) || viewport.route.matched
9670
- }, evidence.target_url));
9706
+ }));
9707
+ const failed = routes.filter((route) => !successfulRoute(route, evidence.target_url));
9671
9708
  return {
9672
9709
  type: check.type,
9673
9710
  label: checkLabel(check),
@@ -9675,9 +9712,10 @@ function assessCheckFromEvidence(check, evidence) {
9675
9712
  evidence: {
9676
9713
  expected_path: expectedPath,
9677
9714
  observed_paths: viewports.map((viewport) => viewport.route.observed),
9678
- http_statuses: viewports.map((viewport) => viewport.route.http_status ?? null)
9715
+ http_statuses: viewports.map((viewport) => viewport.route.http_status ?? null),
9716
+ route_errors: viewports.map((viewport) => viewport.route.error ?? null)
9679
9717
  },
9680
- message: failed.length ? `Route did not load as ${expectedPath} in ${failed.length} viewport(s).` : void 0
9718
+ message: failed.length ? routeLoadedFailureMessage(failed, expectedPath, evidence.target_url) : void 0
9681
9719
  };
9682
9720
  }
9683
9721
  if (check.type === "url_search_param_equals") {
@@ -10529,6 +10567,29 @@ function routePathMatches(observed, expected, targetUrl) {
10529
10567
  function routeOk(route, targetUrl) {
10530
10568
  return Boolean(route && (route.matched || routePathMatches(route.observed, route.expected_path, targetUrl)) && !route.error && (route.http_status == null || route.http_status < 400));
10531
10569
  }
10570
+ function routeReadinessFailed(route, targetUrl) {
10571
+ const matched = route && (route.matched || routePathMatches(route.observed, route.expected_path, targetUrl));
10572
+ const httpOk = route && (route.http_status == null || route.http_status < 400);
10573
+ return Boolean(matched && httpOk && route.error);
10574
+ }
10575
+ function compactRouteError(error) {
10576
+ const text = typeof error === "string" ? error.replace(/\s+/g, " ").trim() : "";
10577
+ return text ? text.slice(0, 240) : undefined;
10578
+ }
10579
+ function routeLoadedFailureMessage(failedRoutes, expectedPath, targetUrl) {
10580
+ const readinessFailures = failedRoutes.filter((route) => routeReadinessFailed(route, targetUrl));
10581
+ if (readinessFailures.length === failedRoutes.length && readinessFailures.length) {
10582
+ const sampleRoute = readinessFailures.find((route) => route && route.error);
10583
+ const sample = compactRouteError(sampleRoute && sampleRoute.error);
10584
+ return "Route matched " + expectedPath + ", but readiness failed in " + readinessFailures.length + " viewport(s)" + (sample ? ": " + sample : ".");
10585
+ }
10586
+ if (readinessFailures.length) {
10587
+ const sampleRoute = readinessFailures.find((route) => route && route.error);
10588
+ const sample = compactRouteError(sampleRoute && sampleRoute.error);
10589
+ return "Route did not become ready as " + expectedPath + " in " + failedRoutes.length + " viewport(s); " + readinessFailures.length + " matched path and HTTP but failed readiness" + (sample ? ": " + sample : ".");
10590
+ }
10591
+ return "Route did not load as " + expectedPath + " in " + failedRoutes.length + " viewport(s).";
10592
+ }
10532
10593
  function parseEvidenceUrl(value, targetUrl) {
10533
10594
  if (!value) return null;
10534
10595
  try { return targetUrl ? new URL(value, targetUrl) : new URL(value); } catch {}
@@ -11367,6 +11428,18 @@ function profileSetupTapReceipts(results) {
11367
11428
  reason: result.reason || result.error || null,
11368
11429
  }));
11369
11430
  }
11431
+ function profileSetupPressReceipts(results) {
11432
+ return (results || [])
11433
+ .filter((result) => result && profileSetupResultAction(result) === "press")
11434
+ .map((result) => ({
11435
+ ordinal: result.ordinal ?? null,
11436
+ ok: result.ok !== false,
11437
+ selector: result.selector ?? null,
11438
+ frame_selector: result.frame_selector ?? null,
11439
+ key: result.key ?? null,
11440
+ reason: result.reason || result.error || null,
11441
+ }));
11442
+ }
11370
11443
  function profileSetupCanvasSignatureReceipts(results) {
11371
11444
  return (results || [])
11372
11445
  .filter((result) => result && profileSetupResultAction(result) === "canvas_signature")
@@ -11555,6 +11628,8 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
11555
11628
  const sampledDragReceipts = sampleProfileSetupSummaryItems(dragReceipts, 8);
11556
11629
  const tapReceipts = profileSetupTapReceipts(results);
11557
11630
  const sampledTapReceipts = sampleProfileSetupSummaryItems(tapReceipts, 8);
11631
+ const pressReceipts = profileSetupPressReceipts(results);
11632
+ const sampledPressReceipts = sampleProfileSetupSummaryItems(pressReceipts, 8);
11558
11633
  const canvasSignatureReceipts = profileSetupCanvasSignatureReceipts(results);
11559
11634
  const sampledCanvasSignatureReceipts = sampleProfileSetupSummaryItems(canvasSignatureReceipts, 8);
11560
11635
  const clickedItems = results
@@ -11632,6 +11707,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
11632
11707
  tap_total: tapReceipts.length,
11633
11708
  tap_truncated: tapReceipts.length > sampledTapReceipts.length,
11634
11709
  tap: sampledTapReceipts,
11710
+ press_total: pressReceipts.length,
11711
+ press_truncated: pressReceipts.length > sampledPressReceipts.length,
11712
+ press: sampledPressReceipts,
11635
11713
  canvas_signature_total: canvasSignatureReceipts.length,
11636
11714
  canvas_signature_truncated: canvasSignatureReceipts.length > sampledCanvasSignatureReceipts.length,
11637
11715
  canvas_signature: sampledCanvasSignatureReceipts,
@@ -11830,11 +11908,12 @@ function assessProfile(profile, evidence) {
11830
11908
  }
11831
11909
  if (check.type === "route_loaded") {
11832
11910
  const expectedPath = check.expected_path || new URL(evidence.target_url).pathname || "/";
11833
- const failed = checkViewports.filter((viewport) => {
11911
+ const routes = checkViewports.map((viewport) => {
11834
11912
  const route = { ...(viewport.route || {}), expected_path: expectedPath };
11835
11913
  route.matched = routePathMatches(route.observed, expectedPath, evidence.target_url) || route.matched;
11836
- return !routeOk(route, evidence.target_url);
11914
+ return route;
11837
11915
  });
11916
+ const failed = routes.filter((route) => !routeOk(route, evidence.target_url));
11838
11917
  checks.push({
11839
11918
  type: check.type,
11840
11919
  label: check.label || check.type,
@@ -11843,8 +11922,9 @@ function assessProfile(profile, evidence) {
11843
11922
  expected_path: expectedPath,
11844
11923
  observed_paths: checkViewports.map((viewport) => viewport.route && viewport.route.observed),
11845
11924
  http_statuses: checkViewports.map((viewport) => viewport.route ? viewport.route.http_status ?? null : null),
11925
+ route_errors: checkViewports.map((viewport) => viewport.route ? viewport.route.error ?? null : null),
11846
11926
  },
11847
- message: failed.length ? "Route did not load as " + expectedPath + " in " + failed.length + " viewport(s)." : undefined,
11927
+ message: failed.length ? routeLoadedFailureMessage(failed, expectedPath, evidence.target_url) : undefined,
11848
11928
  });
11849
11929
  continue;
11850
11930
  }
@@ -16428,6 +16508,7 @@ function profileSetupSummaryMarkdown(result) {
16428
16508
  const rangeValueTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.set_range_value_total) || 0), 0);
16429
16509
  const dragTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.drag_total) || 0), 0);
16430
16510
  const tapTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.tap_total) || 0), 0);
16511
+ const pressTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.press_total) || 0), 0);
16431
16512
  const canvasSignatureTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.canvas_signature_total) || 0), 0);
16432
16513
  const failedTotal = viewports.reduce((sum, viewport) => sum + (Array.isArray(viewport.failed) ? viewport.failed.length : 0), 0);
16433
16514
  const lines = [
@@ -16463,6 +16544,9 @@ function profileSetupSummaryMarkdown(result) {
16463
16544
  if (tapTotal) {
16464
16545
  lines.push(`- tap: ${tapTotal} action(s)`);
16465
16546
  }
16547
+ if (pressTotal) {
16548
+ lines.push(`- press: ${pressTotal} action(s)`);
16549
+ }
16466
16550
  if (canvasSignatureTotal) {
16467
16551
  lines.push(`- canvas_signature: ${canvasSignatureTotal} action(s)`);
16468
16552
  }
@@ -16486,9 +16570,10 @@ function profileSetupSummaryMarkdown(result) {
16486
16570
  const rangeValueActions = cliFiniteNumber(viewport.set_range_value_total) || 0;
16487
16571
  const dragActions = cliFiniteNumber(viewport.drag_total) || 0;
16488
16572
  const tapActions = cliFiniteNumber(viewport.tap_total) || 0;
16573
+ const pressActions = cliFiniteNumber(viewport.press_total) || 0;
16489
16574
  const canvasSignatureActions = cliFiniteNumber(viewport.canvas_signature_total) || 0;
16490
16575
  const observedPath = cliString(viewport.observed_path);
16491
- lines.push(`- ${name}: ${ok}, ${resultCount} result(s), ${screenshotCount} setup screenshot(s), ${clicked} click(s)${clickSequenceCount ? `, ${clickSequenceCount} click sequence(s)` : ""}${clickCountActions ? `, ${clickCountActions} click_count action(s)` : ""}${rangeValueActions ? `, ${rangeValueActions} set_range_value action(s)` : ""}${dragActions ? `, ${dragActions} drag action(s)` : ""}${tapActions ? `, ${tapActions} tap action(s)` : ""}${canvasSignatureActions ? `, ${canvasSignatureActions} canvas_signature action(s)` : ""}${deterministicRuntimeActions ? `, ${deterministicRuntimeActions} deterministic_runtime action(s)` : ""}${windowCallActions ? `, ${windowCallActions} window_call action(s), ${windowCallStored} stored return(s), ${windowCallCaptured} captured return(s)` : ""}${windowEvalActions ? `, ${windowEvalActions} window_eval action(s), ${windowEvalStored} stored return(s), ${windowEvalCaptured} captured return(s)` : ""}${windowCallUntilActions ? `, ${windowCallUntilActions} window_call_until action(s), ${windowCallUntilCalls} call(s)` : ""}${observedPath ? `, path ${observedPath}` : ""}`);
16576
+ lines.push(`- ${name}: ${ok}, ${resultCount} result(s), ${screenshotCount} setup screenshot(s), ${clicked} click(s)${clickSequenceCount ? `, ${clickSequenceCount} click sequence(s)` : ""}${clickCountActions ? `, ${clickCountActions} click_count action(s)` : ""}${rangeValueActions ? `, ${rangeValueActions} set_range_value action(s)` : ""}${dragActions ? `, ${dragActions} drag action(s)` : ""}${tapActions ? `, ${tapActions} tap action(s)` : ""}${pressActions ? `, ${pressActions} press action(s)` : ""}${canvasSignatureActions ? `, ${canvasSignatureActions} canvas_signature action(s)` : ""}${deterministicRuntimeActions ? `, ${deterministicRuntimeActions} deterministic_runtime action(s)` : ""}${windowCallActions ? `, ${windowCallActions} window_call action(s), ${windowCallStored} stored return(s), ${windowCallCaptured} captured return(s)` : ""}${windowEvalActions ? `, ${windowEvalActions} window_eval action(s), ${windowEvalStored} stored return(s), ${windowEvalCaptured} captured return(s)` : ""}${windowCallUntilActions ? `, ${windowCallUntilActions} window_call_until action(s), ${windowCallUntilCalls} call(s)` : ""}${observedPath ? `, path ${observedPath}` : ""}`);
16492
16577
  }
16493
16578
  const clickSequenceGroups = viewports.map((viewport) => {
16494
16579
  const name = cliString(viewport.name) || "viewport";
@@ -16555,6 +16640,22 @@ function profileSetupSummaryMarkdown(result) {
16555
16640
  lines.push(`- ${name} tap: ${ok}, ${markdownInlineCode(selector)}${pointerType ? ` ${markdownInlineCode(pointerType)}` : ""}${inputDispatch ? ` via ${markdownInlineCode(inputDispatch)}` : ""}${coordinateText}${durationMs === void 0 ? "" : `, duration ${durationMs}ms`}${reason ? `, reason ${markdownInlineCode(reason, 100)}` : ""}`);
16556
16641
  }
16557
16642
  if (tapDetails.length > sampledTapDetails.length) lines.push(`- ${tapDetails.length - sampledTapDetails.length} additional tap receipt(s) omitted.`);
16643
+ const pressGroups = viewports.map((viewport) => {
16644
+ const name = cliString(viewport.name) || "viewport";
16645
+ const receipts = Array.isArray(viewport.press) ? viewport.press.map(cliRecord).filter((item) => Boolean(item)) : [];
16646
+ return receipts.map((receipt) => ({ name, receipt }));
16647
+ });
16648
+ const pressDetails = pressGroups.flat();
16649
+ const sampledPressDetails = balancedSetupReceiptDetails(pressGroups, 12);
16650
+ for (const { name, receipt } of sampledPressDetails) {
16651
+ const key = cliString(receipt.key) || "key";
16652
+ const selector = cliString(receipt.selector);
16653
+ const frameSelector = cliString(receipt.frame_selector);
16654
+ const ok = receipt.ok === false ? "failed" : "ok";
16655
+ const reason = cliString(receipt.reason);
16656
+ lines.push(`- ${name} press: ${ok}, ${markdownInlineCode(key)}${selector ? ` on ${markdownInlineCode(selector)}` : ""}${frameSelector ? ` in frame ${markdownInlineCode(frameSelector)}` : ""}${reason ? `, reason ${markdownInlineCode(reason, 100)}` : ""}`);
16657
+ }
16658
+ if (pressDetails.length > sampledPressDetails.length) lines.push(`- ${pressDetails.length - sampledPressDetails.length} additional press receipt(s) omitted.`);
16558
16659
  const canvasSignatureGroups = viewports.map((viewport) => {
16559
16660
  const name = cliString(viewport.name) || "viewport";
16560
16661
  const receipts = Array.isArray(viewport.canvas_signature) ? viewport.canvas_signature.map(cliRecord).filter((item) => Boolean(item)) : [];
package/dist/cli.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  profileStatusExitCode,
14
14
  resolveRiddleProofProfileTargetUrl,
15
15
  resolveRiddleProofProfileTimeoutSec
16
- } from "./chunk-RAEZDEAU.js";
16
+ } from "./chunk-62JD4MJA.js";
17
17
  import {
18
18
  createRiddleApiClient,
19
19
  isTerminalRiddleJobStatus,
@@ -791,6 +791,7 @@ function profileSetupSummaryMarkdown(result) {
791
791
  const rangeValueTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.set_range_value_total) || 0), 0);
792
792
  const dragTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.drag_total) || 0), 0);
793
793
  const tapTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.tap_total) || 0), 0);
794
+ const pressTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.press_total) || 0), 0);
794
795
  const canvasSignatureTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.canvas_signature_total) || 0), 0);
795
796
  const failedTotal = viewports.reduce((sum, viewport) => sum + (Array.isArray(viewport.failed) ? viewport.failed.length : 0), 0);
796
797
  const lines = [
@@ -826,6 +827,9 @@ function profileSetupSummaryMarkdown(result) {
826
827
  if (tapTotal) {
827
828
  lines.push(`- tap: ${tapTotal} action(s)`);
828
829
  }
830
+ if (pressTotal) {
831
+ lines.push(`- press: ${pressTotal} action(s)`);
832
+ }
829
833
  if (canvasSignatureTotal) {
830
834
  lines.push(`- canvas_signature: ${canvasSignatureTotal} action(s)`);
831
835
  }
@@ -849,9 +853,10 @@ function profileSetupSummaryMarkdown(result) {
849
853
  const rangeValueActions = cliFiniteNumber(viewport.set_range_value_total) || 0;
850
854
  const dragActions = cliFiniteNumber(viewport.drag_total) || 0;
851
855
  const tapActions = cliFiniteNumber(viewport.tap_total) || 0;
856
+ const pressActions = cliFiniteNumber(viewport.press_total) || 0;
852
857
  const canvasSignatureActions = cliFiniteNumber(viewport.canvas_signature_total) || 0;
853
858
  const observedPath = cliString(viewport.observed_path);
854
- lines.push(`- ${name}: ${ok}, ${resultCount} result(s), ${screenshotCount} setup screenshot(s), ${clicked} click(s)${clickSequenceCount ? `, ${clickSequenceCount} click sequence(s)` : ""}${clickCountActions ? `, ${clickCountActions} click_count action(s)` : ""}${rangeValueActions ? `, ${rangeValueActions} set_range_value action(s)` : ""}${dragActions ? `, ${dragActions} drag action(s)` : ""}${tapActions ? `, ${tapActions} tap action(s)` : ""}${canvasSignatureActions ? `, ${canvasSignatureActions} canvas_signature action(s)` : ""}${deterministicRuntimeActions ? `, ${deterministicRuntimeActions} deterministic_runtime action(s)` : ""}${windowCallActions ? `, ${windowCallActions} window_call action(s), ${windowCallStored} stored return(s), ${windowCallCaptured} captured return(s)` : ""}${windowEvalActions ? `, ${windowEvalActions} window_eval action(s), ${windowEvalStored} stored return(s), ${windowEvalCaptured} captured return(s)` : ""}${windowCallUntilActions ? `, ${windowCallUntilActions} window_call_until action(s), ${windowCallUntilCalls} call(s)` : ""}${observedPath ? `, path ${observedPath}` : ""}`);
859
+ lines.push(`- ${name}: ${ok}, ${resultCount} result(s), ${screenshotCount} setup screenshot(s), ${clicked} click(s)${clickSequenceCount ? `, ${clickSequenceCount} click sequence(s)` : ""}${clickCountActions ? `, ${clickCountActions} click_count action(s)` : ""}${rangeValueActions ? `, ${rangeValueActions} set_range_value action(s)` : ""}${dragActions ? `, ${dragActions} drag action(s)` : ""}${tapActions ? `, ${tapActions} tap action(s)` : ""}${pressActions ? `, ${pressActions} press action(s)` : ""}${canvasSignatureActions ? `, ${canvasSignatureActions} canvas_signature action(s)` : ""}${deterministicRuntimeActions ? `, ${deterministicRuntimeActions} deterministic_runtime action(s)` : ""}${windowCallActions ? `, ${windowCallActions} window_call action(s), ${windowCallStored} stored return(s), ${windowCallCaptured} captured return(s)` : ""}${windowEvalActions ? `, ${windowEvalActions} window_eval action(s), ${windowEvalStored} stored return(s), ${windowEvalCaptured} captured return(s)` : ""}${windowCallUntilActions ? `, ${windowCallUntilActions} window_call_until action(s), ${windowCallUntilCalls} call(s)` : ""}${observedPath ? `, path ${observedPath}` : ""}`);
855
860
  }
856
861
  const clickSequenceGroups = viewports.map((viewport) => {
857
862
  const name = cliString(viewport.name) || "viewport";
@@ -918,6 +923,22 @@ function profileSetupSummaryMarkdown(result) {
918
923
  lines.push(`- ${name} tap: ${ok}, ${markdownInlineCode(selector)}${pointerType ? ` ${markdownInlineCode(pointerType)}` : ""}${inputDispatch ? ` via ${markdownInlineCode(inputDispatch)}` : ""}${coordinateText}${durationMs === void 0 ? "" : `, duration ${durationMs}ms`}${reason ? `, reason ${markdownInlineCode(reason, 100)}` : ""}`);
919
924
  }
920
925
  if (tapDetails.length > sampledTapDetails.length) lines.push(`- ${tapDetails.length - sampledTapDetails.length} additional tap receipt(s) omitted.`);
926
+ const pressGroups = viewports.map((viewport) => {
927
+ const name = cliString(viewport.name) || "viewport";
928
+ const receipts = Array.isArray(viewport.press) ? viewport.press.map(cliRecord).filter((item) => Boolean(item)) : [];
929
+ return receipts.map((receipt) => ({ name, receipt }));
930
+ });
931
+ const pressDetails = pressGroups.flat();
932
+ const sampledPressDetails = balancedSetupReceiptDetails(pressGroups, 12);
933
+ for (const { name, receipt } of sampledPressDetails) {
934
+ const key = cliString(receipt.key) || "key";
935
+ const selector = cliString(receipt.selector);
936
+ const frameSelector = cliString(receipt.frame_selector);
937
+ const ok = receipt.ok === false ? "failed" : "ok";
938
+ const reason = cliString(receipt.reason);
939
+ lines.push(`- ${name} press: ${ok}, ${markdownInlineCode(key)}${selector ? ` on ${markdownInlineCode(selector)}` : ""}${frameSelector ? ` in frame ${markdownInlineCode(frameSelector)}` : ""}${reason ? `, reason ${markdownInlineCode(reason, 100)}` : ""}`);
940
+ }
941
+ if (pressDetails.length > sampledPressDetails.length) lines.push(`- ${pressDetails.length - sampledPressDetails.length} additional press receipt(s) omitted.`);
921
942
  const canvasSignatureGroups = viewports.map((viewport) => {
922
943
  const name = cliString(viewport.name) || "viewport";
923
944
  const receipts = Array.isArray(viewport.canvas_signature) ? viewport.canvas_signature.map(cliRecord).filter((item) => Boolean(item)) : [];
package/dist/index.cjs CHANGED
@@ -9344,6 +9344,16 @@ function profileSetupTapReceipts(results) {
9344
9344
  reason: result.reason ?? result.error ?? null
9345
9345
  }));
9346
9346
  }
9347
+ function profileSetupPressReceipts(results) {
9348
+ return results.filter((result) => profileSetupResultAction(result) === "press").map((result) => ({
9349
+ ordinal: result.ordinal ?? null,
9350
+ ok: result.ok !== false,
9351
+ selector: result.selector ?? null,
9352
+ frame_selector: result.frame_selector ?? null,
9353
+ key: result.key ?? null,
9354
+ reason: result.reason ?? result.error ?? null
9355
+ }));
9356
+ }
9347
9357
  function profileSetupCanvasSignatureReceipts(results) {
9348
9358
  return results.filter((result) => profileSetupResultAction(result) === "canvas_signature").map((result) => ({
9349
9359
  ordinal: result.ordinal ?? null,
@@ -9507,6 +9517,8 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
9507
9517
  const sampledDragReceipts = sampleProfileSetupSummaryItems(dragReceipts, 8);
9508
9518
  const tapReceipts = profileSetupTapReceipts(results);
9509
9519
  const sampledTapReceipts = sampleProfileSetupSummaryItems(tapReceipts, 8);
9520
+ const pressReceipts = profileSetupPressReceipts(results);
9521
+ const sampledPressReceipts = sampleProfileSetupSummaryItems(pressReceipts, 8);
9510
9522
  const canvasSignatureReceipts = profileSetupCanvasSignatureReceipts(results);
9511
9523
  const sampledCanvasSignatureReceipts = sampleProfileSetupSummaryItems(canvasSignatureReceipts, 8);
9512
9524
  const clickedItems = results.filter((result) => profileSetupResultAction(result) === "click" && result.ok !== false).map((result) => {
@@ -9574,6 +9586,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
9574
9586
  tap_total: tapReceipts.length,
9575
9587
  tap_truncated: tapReceipts.length > sampledTapReceipts.length,
9576
9588
  tap: sampledTapReceipts,
9589
+ press_total: pressReceipts.length,
9590
+ press_truncated: pressReceipts.length > sampledPressReceipts.length,
9591
+ press: sampledPressReceipts,
9577
9592
  canvas_signature_total: canvasSignatureReceipts.length,
9578
9593
  canvas_signature_truncated: canvasSignatureReceipts.length > sampledCanvasSignatureReceipts.length,
9579
9594
  canvas_signature: sampledCanvasSignatureReceipts,
@@ -11370,6 +11385,27 @@ function successfulRoute(route, targetUrl) {
11370
11385
  const matched = route.matched || routePathMatches(route.observed, route.expected_path, targetUrl);
11371
11386
  return matched && !route.error && (route.http_status === null || route.http_status === void 0 || route.http_status < 400);
11372
11387
  }
11388
+ function routeReadinessFailed(route, targetUrl) {
11389
+ const matched = route.matched || routePathMatches(route.observed, route.expected_path, targetUrl);
11390
+ const httpOk = route.http_status === null || route.http_status === void 0 || route.http_status < 400;
11391
+ return matched && httpOk && Boolean(route.error);
11392
+ }
11393
+ function compactRouteError(error) {
11394
+ const text = typeof error === "string" ? error.replace(/\s+/g, " ").trim() : "";
11395
+ return text ? text.slice(0, 240) : void 0;
11396
+ }
11397
+ function routeLoadedFailureMessage(failedRoutes, expectedPath, targetUrl) {
11398
+ const readinessFailures = failedRoutes.filter((route) => routeReadinessFailed(route, targetUrl));
11399
+ if (readinessFailures.length === failedRoutes.length && readinessFailures.length) {
11400
+ const sample = compactRouteError(readinessFailures.find((route) => route.error)?.error);
11401
+ return `Route matched ${expectedPath}, but readiness failed in ${readinessFailures.length} viewport(s)${sample ? `: ${sample}` : "."}`;
11402
+ }
11403
+ if (readinessFailures.length) {
11404
+ const sample = compactRouteError(readinessFailures.find((route) => route.error)?.error);
11405
+ return `Route did not become ready as ${expectedPath} in ${failedRoutes.length} viewport(s); ${readinessFailures.length} matched path and HTTP but failed readiness${sample ? `: ${sample}` : "."}`;
11406
+ }
11407
+ return `Route did not load as ${expectedPath} in ${failedRoutes.length} viewport(s).`;
11408
+ }
11373
11409
  function parseEvidenceUrl(value, targetUrl) {
11374
11410
  if (!value) return void 0;
11375
11411
  try {
@@ -11439,11 +11475,12 @@ function assessCheckFromEvidence(check, evidence) {
11439
11475
  }
11440
11476
  if (check.type === "route_loaded") {
11441
11477
  const expectedPath = check.expected_path || new URL(evidence.target_url).pathname || "/";
11442
- const failed = viewports.filter((viewport) => !successfulRoute({
11478
+ const routes = viewports.map((viewport) => ({
11443
11479
  ...viewport.route,
11444
11480
  expected_path: expectedPath,
11445
11481
  matched: routePathMatches(viewport.route.observed, expectedPath, evidence.target_url) || viewport.route.matched
11446
- }, evidence.target_url));
11482
+ }));
11483
+ const failed = routes.filter((route) => !successfulRoute(route, evidence.target_url));
11447
11484
  return {
11448
11485
  type: check.type,
11449
11486
  label: checkLabel(check),
@@ -11451,9 +11488,10 @@ function assessCheckFromEvidence(check, evidence) {
11451
11488
  evidence: {
11452
11489
  expected_path: expectedPath,
11453
11490
  observed_paths: viewports.map((viewport) => viewport.route.observed),
11454
- http_statuses: viewports.map((viewport) => viewport.route.http_status ?? null)
11491
+ http_statuses: viewports.map((viewport) => viewport.route.http_status ?? null),
11492
+ route_errors: viewports.map((viewport) => viewport.route.error ?? null)
11455
11493
  },
11456
- message: failed.length ? `Route did not load as ${expectedPath} in ${failed.length} viewport(s).` : void 0
11494
+ message: failed.length ? routeLoadedFailureMessage(failed, expectedPath, evidence.target_url) : void 0
11457
11495
  };
11458
11496
  }
11459
11497
  if (check.type === "url_search_param_equals") {
@@ -12321,6 +12359,29 @@ function routePathMatches(observed, expected, targetUrl) {
12321
12359
  function routeOk(route, targetUrl) {
12322
12360
  return Boolean(route && (route.matched || routePathMatches(route.observed, route.expected_path, targetUrl)) && !route.error && (route.http_status == null || route.http_status < 400));
12323
12361
  }
12362
+ function routeReadinessFailed(route, targetUrl) {
12363
+ const matched = route && (route.matched || routePathMatches(route.observed, route.expected_path, targetUrl));
12364
+ const httpOk = route && (route.http_status == null || route.http_status < 400);
12365
+ return Boolean(matched && httpOk && route.error);
12366
+ }
12367
+ function compactRouteError(error) {
12368
+ const text = typeof error === "string" ? error.replace(/\s+/g, " ").trim() : "";
12369
+ return text ? text.slice(0, 240) : undefined;
12370
+ }
12371
+ function routeLoadedFailureMessage(failedRoutes, expectedPath, targetUrl) {
12372
+ const readinessFailures = failedRoutes.filter((route) => routeReadinessFailed(route, targetUrl));
12373
+ if (readinessFailures.length === failedRoutes.length && readinessFailures.length) {
12374
+ const sampleRoute = readinessFailures.find((route) => route && route.error);
12375
+ const sample = compactRouteError(sampleRoute && sampleRoute.error);
12376
+ return "Route matched " + expectedPath + ", but readiness failed in " + readinessFailures.length + " viewport(s)" + (sample ? ": " + sample : ".");
12377
+ }
12378
+ if (readinessFailures.length) {
12379
+ const sampleRoute = readinessFailures.find((route) => route && route.error);
12380
+ const sample = compactRouteError(sampleRoute && sampleRoute.error);
12381
+ return "Route did not become ready as " + expectedPath + " in " + failedRoutes.length + " viewport(s); " + readinessFailures.length + " matched path and HTTP but failed readiness" + (sample ? ": " + sample : ".");
12382
+ }
12383
+ return "Route did not load as " + expectedPath + " in " + failedRoutes.length + " viewport(s).";
12384
+ }
12324
12385
  function parseEvidenceUrl(value, targetUrl) {
12325
12386
  if (!value) return null;
12326
12387
  try { return targetUrl ? new URL(value, targetUrl) : new URL(value); } catch {}
@@ -13159,6 +13220,18 @@ function profileSetupTapReceipts(results) {
13159
13220
  reason: result.reason || result.error || null,
13160
13221
  }));
13161
13222
  }
13223
+ function profileSetupPressReceipts(results) {
13224
+ return (results || [])
13225
+ .filter((result) => result && profileSetupResultAction(result) === "press")
13226
+ .map((result) => ({
13227
+ ordinal: result.ordinal ?? null,
13228
+ ok: result.ok !== false,
13229
+ selector: result.selector ?? null,
13230
+ frame_selector: result.frame_selector ?? null,
13231
+ key: result.key ?? null,
13232
+ reason: result.reason || result.error || null,
13233
+ }));
13234
+ }
13162
13235
  function profileSetupCanvasSignatureReceipts(results) {
13163
13236
  return (results || [])
13164
13237
  .filter((result) => result && profileSetupResultAction(result) === "canvas_signature")
@@ -13347,6 +13420,8 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
13347
13420
  const sampledDragReceipts = sampleProfileSetupSummaryItems(dragReceipts, 8);
13348
13421
  const tapReceipts = profileSetupTapReceipts(results);
13349
13422
  const sampledTapReceipts = sampleProfileSetupSummaryItems(tapReceipts, 8);
13423
+ const pressReceipts = profileSetupPressReceipts(results);
13424
+ const sampledPressReceipts = sampleProfileSetupSummaryItems(pressReceipts, 8);
13350
13425
  const canvasSignatureReceipts = profileSetupCanvasSignatureReceipts(results);
13351
13426
  const sampledCanvasSignatureReceipts = sampleProfileSetupSummaryItems(canvasSignatureReceipts, 8);
13352
13427
  const clickedItems = results
@@ -13424,6 +13499,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
13424
13499
  tap_total: tapReceipts.length,
13425
13500
  tap_truncated: tapReceipts.length > sampledTapReceipts.length,
13426
13501
  tap: sampledTapReceipts,
13502
+ press_total: pressReceipts.length,
13503
+ press_truncated: pressReceipts.length > sampledPressReceipts.length,
13504
+ press: sampledPressReceipts,
13427
13505
  canvas_signature_total: canvasSignatureReceipts.length,
13428
13506
  canvas_signature_truncated: canvasSignatureReceipts.length > sampledCanvasSignatureReceipts.length,
13429
13507
  canvas_signature: sampledCanvasSignatureReceipts,
@@ -13622,11 +13700,12 @@ function assessProfile(profile, evidence) {
13622
13700
  }
13623
13701
  if (check.type === "route_loaded") {
13624
13702
  const expectedPath = check.expected_path || new URL(evidence.target_url).pathname || "/";
13625
- const failed = checkViewports.filter((viewport) => {
13703
+ const routes = checkViewports.map((viewport) => {
13626
13704
  const route = { ...(viewport.route || {}), expected_path: expectedPath };
13627
13705
  route.matched = routePathMatches(route.observed, expectedPath, evidence.target_url) || route.matched;
13628
- return !routeOk(route, evidence.target_url);
13706
+ return route;
13629
13707
  });
13708
+ const failed = routes.filter((route) => !routeOk(route, evidence.target_url));
13630
13709
  checks.push({
13631
13710
  type: check.type,
13632
13711
  label: check.label || check.type,
@@ -13635,8 +13714,9 @@ function assessProfile(profile, evidence) {
13635
13714
  expected_path: expectedPath,
13636
13715
  observed_paths: checkViewports.map((viewport) => viewport.route && viewport.route.observed),
13637
13716
  http_statuses: checkViewports.map((viewport) => viewport.route ? viewport.route.http_status ?? null : null),
13717
+ route_errors: checkViewports.map((viewport) => viewport.route ? viewport.route.error ?? null : null),
13638
13718
  },
13639
- message: failed.length ? "Route did not load as " + expectedPath + " in " + failed.length + " viewport(s)." : undefined,
13719
+ message: failed.length ? routeLoadedFailureMessage(failed, expectedPath, evidence.target_url) : undefined,
13640
13720
  });
13641
13721
  continue;
13642
13722
  }
package/dist/index.js CHANGED
@@ -62,7 +62,7 @@ import {
62
62
  resolveRiddleProofProfileTimeoutSec,
63
63
  slugifyRiddleProofProfileName,
64
64
  summarizeRiddleProofProfileResult
65
- } from "./chunk-RAEZDEAU.js";
65
+ } from "./chunk-62JD4MJA.js";
66
66
  import {
67
67
  DEFAULT_RIDDLE_API_BASE_URL,
68
68
  DEFAULT_RIDDLE_API_KEY_FILE,
package/dist/profile.cjs CHANGED
@@ -658,6 +658,16 @@ function profileSetupTapReceipts(results) {
658
658
  reason: result.reason ?? result.error ?? null
659
659
  }));
660
660
  }
661
+ function profileSetupPressReceipts(results) {
662
+ return results.filter((result) => profileSetupResultAction(result) === "press").map((result) => ({
663
+ ordinal: result.ordinal ?? null,
664
+ ok: result.ok !== false,
665
+ selector: result.selector ?? null,
666
+ frame_selector: result.frame_selector ?? null,
667
+ key: result.key ?? null,
668
+ reason: result.reason ?? result.error ?? null
669
+ }));
670
+ }
661
671
  function profileSetupCanvasSignatureReceipts(results) {
662
672
  return results.filter((result) => profileSetupResultAction(result) === "canvas_signature").map((result) => ({
663
673
  ordinal: result.ordinal ?? null,
@@ -821,6 +831,8 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
821
831
  const sampledDragReceipts = sampleProfileSetupSummaryItems(dragReceipts, 8);
822
832
  const tapReceipts = profileSetupTapReceipts(results);
823
833
  const sampledTapReceipts = sampleProfileSetupSummaryItems(tapReceipts, 8);
834
+ const pressReceipts = profileSetupPressReceipts(results);
835
+ const sampledPressReceipts = sampleProfileSetupSummaryItems(pressReceipts, 8);
824
836
  const canvasSignatureReceipts = profileSetupCanvasSignatureReceipts(results);
825
837
  const sampledCanvasSignatureReceipts = sampleProfileSetupSummaryItems(canvasSignatureReceipts, 8);
826
838
  const clickedItems = results.filter((result) => profileSetupResultAction(result) === "click" && result.ok !== false).map((result) => {
@@ -888,6 +900,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
888
900
  tap_total: tapReceipts.length,
889
901
  tap_truncated: tapReceipts.length > sampledTapReceipts.length,
890
902
  tap: sampledTapReceipts,
903
+ press_total: pressReceipts.length,
904
+ press_truncated: pressReceipts.length > sampledPressReceipts.length,
905
+ press: sampledPressReceipts,
891
906
  canvas_signature_total: canvasSignatureReceipts.length,
892
907
  canvas_signature_truncated: canvasSignatureReceipts.length > sampledCanvasSignatureReceipts.length,
893
908
  canvas_signature: sampledCanvasSignatureReceipts,
@@ -2684,6 +2699,27 @@ function successfulRoute(route, targetUrl) {
2684
2699
  const matched = route.matched || routePathMatches(route.observed, route.expected_path, targetUrl);
2685
2700
  return matched && !route.error && (route.http_status === null || route.http_status === void 0 || route.http_status < 400);
2686
2701
  }
2702
+ function routeReadinessFailed(route, targetUrl) {
2703
+ const matched = route.matched || routePathMatches(route.observed, route.expected_path, targetUrl);
2704
+ const httpOk = route.http_status === null || route.http_status === void 0 || route.http_status < 400;
2705
+ return matched && httpOk && Boolean(route.error);
2706
+ }
2707
+ function compactRouteError(error) {
2708
+ const text = typeof error === "string" ? error.replace(/\s+/g, " ").trim() : "";
2709
+ return text ? text.slice(0, 240) : void 0;
2710
+ }
2711
+ function routeLoadedFailureMessage(failedRoutes, expectedPath, targetUrl) {
2712
+ const readinessFailures = failedRoutes.filter((route) => routeReadinessFailed(route, targetUrl));
2713
+ if (readinessFailures.length === failedRoutes.length && readinessFailures.length) {
2714
+ const sample = compactRouteError(readinessFailures.find((route) => route.error)?.error);
2715
+ return `Route matched ${expectedPath}, but readiness failed in ${readinessFailures.length} viewport(s)${sample ? `: ${sample}` : "."}`;
2716
+ }
2717
+ if (readinessFailures.length) {
2718
+ const sample = compactRouteError(readinessFailures.find((route) => route.error)?.error);
2719
+ return `Route did not become ready as ${expectedPath} in ${failedRoutes.length} viewport(s); ${readinessFailures.length} matched path and HTTP but failed readiness${sample ? `: ${sample}` : "."}`;
2720
+ }
2721
+ return `Route did not load as ${expectedPath} in ${failedRoutes.length} viewport(s).`;
2722
+ }
2687
2723
  function parseEvidenceUrl(value, targetUrl) {
2688
2724
  if (!value) return void 0;
2689
2725
  try {
@@ -2753,11 +2789,12 @@ function assessCheckFromEvidence(check, evidence) {
2753
2789
  }
2754
2790
  if (check.type === "route_loaded") {
2755
2791
  const expectedPath = check.expected_path || new URL(evidence.target_url).pathname || "/";
2756
- const failed = viewports.filter((viewport) => !successfulRoute({
2792
+ const routes = viewports.map((viewport) => ({
2757
2793
  ...viewport.route,
2758
2794
  expected_path: expectedPath,
2759
2795
  matched: routePathMatches(viewport.route.observed, expectedPath, evidence.target_url) || viewport.route.matched
2760
- }, evidence.target_url));
2796
+ }));
2797
+ const failed = routes.filter((route) => !successfulRoute(route, evidence.target_url));
2761
2798
  return {
2762
2799
  type: check.type,
2763
2800
  label: checkLabel(check),
@@ -2765,9 +2802,10 @@ function assessCheckFromEvidence(check, evidence) {
2765
2802
  evidence: {
2766
2803
  expected_path: expectedPath,
2767
2804
  observed_paths: viewports.map((viewport) => viewport.route.observed),
2768
- http_statuses: viewports.map((viewport) => viewport.route.http_status ?? null)
2805
+ http_statuses: viewports.map((viewport) => viewport.route.http_status ?? null),
2806
+ route_errors: viewports.map((viewport) => viewport.route.error ?? null)
2769
2807
  },
2770
- message: failed.length ? `Route did not load as ${expectedPath} in ${failed.length} viewport(s).` : void 0
2808
+ message: failed.length ? routeLoadedFailureMessage(failed, expectedPath, evidence.target_url) : void 0
2771
2809
  };
2772
2810
  }
2773
2811
  if (check.type === "url_search_param_equals") {
@@ -3635,6 +3673,29 @@ function routePathMatches(observed, expected, targetUrl) {
3635
3673
  function routeOk(route, targetUrl) {
3636
3674
  return Boolean(route && (route.matched || routePathMatches(route.observed, route.expected_path, targetUrl)) && !route.error && (route.http_status == null || route.http_status < 400));
3637
3675
  }
3676
+ function routeReadinessFailed(route, targetUrl) {
3677
+ const matched = route && (route.matched || routePathMatches(route.observed, route.expected_path, targetUrl));
3678
+ const httpOk = route && (route.http_status == null || route.http_status < 400);
3679
+ return Boolean(matched && httpOk && route.error);
3680
+ }
3681
+ function compactRouteError(error) {
3682
+ const text = typeof error === "string" ? error.replace(/\s+/g, " ").trim() : "";
3683
+ return text ? text.slice(0, 240) : undefined;
3684
+ }
3685
+ function routeLoadedFailureMessage(failedRoutes, expectedPath, targetUrl) {
3686
+ const readinessFailures = failedRoutes.filter((route) => routeReadinessFailed(route, targetUrl));
3687
+ if (readinessFailures.length === failedRoutes.length && readinessFailures.length) {
3688
+ const sampleRoute = readinessFailures.find((route) => route && route.error);
3689
+ const sample = compactRouteError(sampleRoute && sampleRoute.error);
3690
+ return "Route matched " + expectedPath + ", but readiness failed in " + readinessFailures.length + " viewport(s)" + (sample ? ": " + sample : ".");
3691
+ }
3692
+ if (readinessFailures.length) {
3693
+ const sampleRoute = readinessFailures.find((route) => route && route.error);
3694
+ const sample = compactRouteError(sampleRoute && sampleRoute.error);
3695
+ return "Route did not become ready as " + expectedPath + " in " + failedRoutes.length + " viewport(s); " + readinessFailures.length + " matched path and HTTP but failed readiness" + (sample ? ": " + sample : ".");
3696
+ }
3697
+ return "Route did not load as " + expectedPath + " in " + failedRoutes.length + " viewport(s).";
3698
+ }
3638
3699
  function parseEvidenceUrl(value, targetUrl) {
3639
3700
  if (!value) return null;
3640
3701
  try { return targetUrl ? new URL(value, targetUrl) : new URL(value); } catch {}
@@ -4473,6 +4534,18 @@ function profileSetupTapReceipts(results) {
4473
4534
  reason: result.reason || result.error || null,
4474
4535
  }));
4475
4536
  }
4537
+ function profileSetupPressReceipts(results) {
4538
+ return (results || [])
4539
+ .filter((result) => result && profileSetupResultAction(result) === "press")
4540
+ .map((result) => ({
4541
+ ordinal: result.ordinal ?? null,
4542
+ ok: result.ok !== false,
4543
+ selector: result.selector ?? null,
4544
+ frame_selector: result.frame_selector ?? null,
4545
+ key: result.key ?? null,
4546
+ reason: result.reason || result.error || null,
4547
+ }));
4548
+ }
4476
4549
  function profileSetupCanvasSignatureReceipts(results) {
4477
4550
  return (results || [])
4478
4551
  .filter((result) => result && profileSetupResultAction(result) === "canvas_signature")
@@ -4661,6 +4734,8 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
4661
4734
  const sampledDragReceipts = sampleProfileSetupSummaryItems(dragReceipts, 8);
4662
4735
  const tapReceipts = profileSetupTapReceipts(results);
4663
4736
  const sampledTapReceipts = sampleProfileSetupSummaryItems(tapReceipts, 8);
4737
+ const pressReceipts = profileSetupPressReceipts(results);
4738
+ const sampledPressReceipts = sampleProfileSetupSummaryItems(pressReceipts, 8);
4664
4739
  const canvasSignatureReceipts = profileSetupCanvasSignatureReceipts(results);
4665
4740
  const sampledCanvasSignatureReceipts = sampleProfileSetupSummaryItems(canvasSignatureReceipts, 8);
4666
4741
  const clickedItems = results
@@ -4738,6 +4813,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
4738
4813
  tap_total: tapReceipts.length,
4739
4814
  tap_truncated: tapReceipts.length > sampledTapReceipts.length,
4740
4815
  tap: sampledTapReceipts,
4816
+ press_total: pressReceipts.length,
4817
+ press_truncated: pressReceipts.length > sampledPressReceipts.length,
4818
+ press: sampledPressReceipts,
4741
4819
  canvas_signature_total: canvasSignatureReceipts.length,
4742
4820
  canvas_signature_truncated: canvasSignatureReceipts.length > sampledCanvasSignatureReceipts.length,
4743
4821
  canvas_signature: sampledCanvasSignatureReceipts,
@@ -4936,11 +5014,12 @@ function assessProfile(profile, evidence) {
4936
5014
  }
4937
5015
  if (check.type === "route_loaded") {
4938
5016
  const expectedPath = check.expected_path || new URL(evidence.target_url).pathname || "/";
4939
- const failed = checkViewports.filter((viewport) => {
5017
+ const routes = checkViewports.map((viewport) => {
4940
5018
  const route = { ...(viewport.route || {}), expected_path: expectedPath };
4941
5019
  route.matched = routePathMatches(route.observed, expectedPath, evidence.target_url) || route.matched;
4942
- return !routeOk(route, evidence.target_url);
5020
+ return route;
4943
5021
  });
5022
+ const failed = routes.filter((route) => !routeOk(route, evidence.target_url));
4944
5023
  checks.push({
4945
5024
  type: check.type,
4946
5025
  label: check.label || check.type,
@@ -4949,8 +5028,9 @@ function assessProfile(profile, evidence) {
4949
5028
  expected_path: expectedPath,
4950
5029
  observed_paths: checkViewports.map((viewport) => viewport.route && viewport.route.observed),
4951
5030
  http_statuses: checkViewports.map((viewport) => viewport.route ? viewport.route.http_status ?? null : null),
5031
+ route_errors: checkViewports.map((viewport) => viewport.route ? viewport.route.error ?? null : null),
4952
5032
  },
4953
- message: failed.length ? "Route did not load as " + expectedPath + " in " + failed.length + " viewport(s)." : undefined,
5033
+ message: failed.length ? routeLoadedFailureMessage(failed, expectedPath, evidence.target_url) : undefined,
4954
5034
  });
4955
5035
  continue;
4956
5036
  }
package/dist/profile.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  resolveRiddleProofProfileTimeoutSec,
24
24
  slugifyRiddleProofProfileName,
25
25
  summarizeRiddleProofProfileResult
26
- } from "./chunk-RAEZDEAU.js";
26
+ } from "./chunk-62JD4MJA.js";
27
27
  export {
28
28
  RIDDLE_PROOF_PROFILE_CHECK_TYPES,
29
29
  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.175",
3
+ "version": "0.7.177",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",