@riddledc/riddle-proof 0.7.162 → 0.7.163

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.
@@ -571,6 +571,42 @@ function profileSetupCanvasSignatureReceipts(results) {
571
571
  reason: result.reason ?? result.error ?? null
572
572
  }));
573
573
  }
574
+ function profileSetupCanvasSignatureStableHashGroups(results) {
575
+ const groups = /* @__PURE__ */ new Map();
576
+ for (const receipt of profileSetupCanvasSignatureReceipts(results)) {
577
+ if (receipt.ok === false) continue;
578
+ const hash = stringValue(receipt.hash);
579
+ if (!hash) continue;
580
+ const selector = stringValue(receipt.selector) || "canvas";
581
+ const frameSelector = stringValue(receipt.frame_selector);
582
+ const key = `${frameSelector || ""}
583
+ ${selector}`;
584
+ const group = groups.get(key) || { selector, frame_selector: frameSelector, receipts: [] };
585
+ const ordinal = numberValue(receipt.ordinal);
586
+ const label = stringValue(receipt.label) || (ordinal === void 0 ? `capture-${group.receipts.length + 1}` : `#${ordinal}`);
587
+ group.receipts.push({ hash, label, ordinal });
588
+ groups.set(key, group);
589
+ }
590
+ const warnings = [];
591
+ for (const group of groups.values()) {
592
+ const hashes = new Set(group.receipts.map((receipt) => receipt.hash));
593
+ const labels = [...new Set(group.receipts.map((receipt) => receipt.label))];
594
+ if (group.receipts.length < 2 || labels.length < 2 || hashes.size !== 1) continue;
595
+ const visibleLabels = labels.slice(0, 8);
596
+ warnings.push({
597
+ selector: group.selector,
598
+ frame_selector: group.frame_selector ?? null,
599
+ hash: group.receipts[0].hash,
600
+ count: group.receipts.length,
601
+ label_count: labels.length,
602
+ labels: visibleLabels,
603
+ omitted_label_count: Math.max(0, labels.length - visibleLabels.length),
604
+ ordinals: group.receipts.map((receipt) => receipt.ordinal).filter((value) => value !== void 0).slice(0, 12),
605
+ reason: "stable_canvas_signature_hash"
606
+ });
607
+ }
608
+ return warnings;
609
+ }
574
610
  function sampleProfileSetupSummaryItems(items, limit) {
575
611
  if (items.length <= limit) return items;
576
612
  const firstCount = Math.floor(limit / 2);
@@ -671,6 +707,7 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
671
707
  canvas_signature_total: canvasSignatureReceipts.length,
672
708
  canvas_signature_truncated: canvasSignatureReceipts.length > sampledCanvasSignatureReceipts.length,
673
709
  canvas_signature: sampledCanvasSignatureReceipts,
710
+ canvas_signature_stable_hash_groups: profileSetupCanvasSignatureStableHashGroups(results),
674
711
  clicked,
675
712
  text_samples,
676
713
  failed: failed.map((result) => ({
package/dist/cli.cjs CHANGED
@@ -7528,6 +7528,42 @@ function profileSetupCanvasSignatureReceipts(results) {
7528
7528
  reason: result.reason ?? result.error ?? null
7529
7529
  }));
7530
7530
  }
7531
+ function profileSetupCanvasSignatureStableHashGroups(results) {
7532
+ const groups = /* @__PURE__ */ new Map();
7533
+ for (const receipt of profileSetupCanvasSignatureReceipts(results)) {
7534
+ if (receipt.ok === false) continue;
7535
+ const hash = stringValue2(receipt.hash);
7536
+ if (!hash) continue;
7537
+ const selector = stringValue2(receipt.selector) || "canvas";
7538
+ const frameSelector = stringValue2(receipt.frame_selector);
7539
+ const key = `${frameSelector || ""}
7540
+ ${selector}`;
7541
+ const group = groups.get(key) || { selector, frame_selector: frameSelector, receipts: [] };
7542
+ const ordinal = numberValue(receipt.ordinal);
7543
+ const label = stringValue2(receipt.label) || (ordinal === void 0 ? `capture-${group.receipts.length + 1}` : `#${ordinal}`);
7544
+ group.receipts.push({ hash, label, ordinal });
7545
+ groups.set(key, group);
7546
+ }
7547
+ const warnings = [];
7548
+ for (const group of groups.values()) {
7549
+ const hashes = new Set(group.receipts.map((receipt) => receipt.hash));
7550
+ const labels = [...new Set(group.receipts.map((receipt) => receipt.label))];
7551
+ if (group.receipts.length < 2 || labels.length < 2 || hashes.size !== 1) continue;
7552
+ const visibleLabels = labels.slice(0, 8);
7553
+ warnings.push({
7554
+ selector: group.selector,
7555
+ frame_selector: group.frame_selector ?? null,
7556
+ hash: group.receipts[0].hash,
7557
+ count: group.receipts.length,
7558
+ label_count: labels.length,
7559
+ labels: visibleLabels,
7560
+ omitted_label_count: Math.max(0, labels.length - visibleLabels.length),
7561
+ ordinals: group.receipts.map((receipt) => receipt.ordinal).filter((value) => value !== void 0).slice(0, 12),
7562
+ reason: "stable_canvas_signature_hash"
7563
+ });
7564
+ }
7565
+ return warnings;
7566
+ }
7531
7567
  function sampleProfileSetupSummaryItems(items, limit) {
7532
7568
  if (items.length <= limit) return items;
7533
7569
  const firstCount = Math.floor(limit / 2);
@@ -7628,6 +7664,7 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
7628
7664
  canvas_signature_total: canvasSignatureReceipts.length,
7629
7665
  canvas_signature_truncated: canvasSignatureReceipts.length > sampledCanvasSignatureReceipts.length,
7630
7666
  canvas_signature: sampledCanvasSignatureReceipts,
7667
+ canvas_signature_stable_hash_groups: profileSetupCanvasSignatureStableHashGroups(results),
7631
7668
  clicked,
7632
7669
  text_samples,
7633
7670
  failed: failed.map((result) => ({
@@ -15858,6 +15895,25 @@ function profileSetupSummaryMarkdown(result) {
15858
15895
  lines.push(`- ${name} canvas_signature: ${ok}, ${markdownInlineCode(selector)}${label ? ` ${markdownInlineCode(label, 80)}` : ""}${hash ? ` hash ${markdownInlineCode(hash, 80)}` : ""}${sizeText}${cssSizeText}${dataLength === void 0 ? "" : `, data chars ${dataLength}`}${compareTo ? `, compared ${markdownInlineCode(compareTo)}` : ""}${previousHash ? ` previous ${markdownInlineCode(previousHash, 80)}` : ""}${changed === void 0 ? "" : `, changed ${changed}`}${storedTo ? `, stored ${markdownInlineCode(storedTo)}` : ""}${reason ? `, reason ${markdownInlineCode(reason, 100)}` : ""}`);
15859
15896
  }
15860
15897
  if (canvasSignatureDetails.length > sampledCanvasSignatureDetails.length) lines.push(`- ${canvasSignatureDetails.length - sampledCanvasSignatureDetails.length} additional canvas_signature receipt(s) omitted.`);
15898
+ const canvasSignatureWarningGroups = viewports.map((viewport) => {
15899
+ const name = cliString(viewport.name) || "viewport";
15900
+ const warnings = Array.isArray(viewport.canvas_signature_stable_hash_groups) ? viewport.canvas_signature_stable_hash_groups.map(cliRecord).filter((item) => Boolean(item)) : [];
15901
+ return warnings.map((warning) => ({ name, receipt: warning }));
15902
+ });
15903
+ const canvasSignatureWarnings = canvasSignatureWarningGroups.flat();
15904
+ const sampledCanvasSignatureWarnings = balancedSetupReceiptDetails(canvasSignatureWarningGroups, 12);
15905
+ for (const { name, receipt } of sampledCanvasSignatureWarnings) {
15906
+ const selector = cliString(receipt.selector) || "canvas";
15907
+ const frameSelector = cliString(receipt.frame_selector);
15908
+ const hash = cliString(receipt.hash);
15909
+ const count = cliFiniteNumber(receipt.count);
15910
+ const labelCount = cliFiniteNumber(receipt.label_count);
15911
+ const labels = cliStringArray(receipt.labels);
15912
+ const omittedLabelCount = cliFiniteNumber(receipt.omitted_label_count) || 0;
15913
+ const labelText = labels.length ? ` across ${labels.map((label) => markdownInlineCode(label, 60)).join(", ")}${omittedLabelCount ? `, plus ${omittedLabelCount} more` : ""}` : "";
15914
+ lines.push(`- ${name} canvas_signature warning: ${markdownInlineCode(selector)}${frameSelector ? ` in frame ${markdownInlineCode(frameSelector)}` : ""} returned the same hash${hash ? ` ${markdownInlineCode(hash, 80)}` : ""} for ${count ?? labelCount ?? "multiple"} labeled capture(s)${labelText}; treat canvas signatures as diagnostic when runtime evidence or screenshots show state changes.`);
15915
+ }
15916
+ if (canvasSignatureWarnings.length > sampledCanvasSignatureWarnings.length) lines.push(`- ${canvasSignatureWarnings.length - sampledCanvasSignatureWarnings.length} additional canvas_signature warning(s) omitted.`);
15861
15917
  const rangeValueGroups = viewports.map((viewport) => {
15862
15918
  const name = cliString(viewport.name) || "viewport";
15863
15919
  const receipts = Array.isArray(viewport.set_range_value) ? viewport.set_range_value.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-ZLNPYVMJ.js";
16
+ } from "./chunk-RWBG7256.js";
17
17
  import {
18
18
  createRiddleApiClient,
19
19
  isTerminalRiddleJobStatus,
@@ -860,6 +860,25 @@ function profileSetupSummaryMarkdown(result) {
860
860
  lines.push(`- ${name} canvas_signature: ${ok}, ${markdownInlineCode(selector)}${label ? ` ${markdownInlineCode(label, 80)}` : ""}${hash ? ` hash ${markdownInlineCode(hash, 80)}` : ""}${sizeText}${cssSizeText}${dataLength === void 0 ? "" : `, data chars ${dataLength}`}${compareTo ? `, compared ${markdownInlineCode(compareTo)}` : ""}${previousHash ? ` previous ${markdownInlineCode(previousHash, 80)}` : ""}${changed === void 0 ? "" : `, changed ${changed}`}${storedTo ? `, stored ${markdownInlineCode(storedTo)}` : ""}${reason ? `, reason ${markdownInlineCode(reason, 100)}` : ""}`);
861
861
  }
862
862
  if (canvasSignatureDetails.length > sampledCanvasSignatureDetails.length) lines.push(`- ${canvasSignatureDetails.length - sampledCanvasSignatureDetails.length} additional canvas_signature receipt(s) omitted.`);
863
+ const canvasSignatureWarningGroups = viewports.map((viewport) => {
864
+ const name = cliString(viewport.name) || "viewport";
865
+ const warnings = Array.isArray(viewport.canvas_signature_stable_hash_groups) ? viewport.canvas_signature_stable_hash_groups.map(cliRecord).filter((item) => Boolean(item)) : [];
866
+ return warnings.map((warning) => ({ name, receipt: warning }));
867
+ });
868
+ const canvasSignatureWarnings = canvasSignatureWarningGroups.flat();
869
+ const sampledCanvasSignatureWarnings = balancedSetupReceiptDetails(canvasSignatureWarningGroups, 12);
870
+ for (const { name, receipt } of sampledCanvasSignatureWarnings) {
871
+ const selector = cliString(receipt.selector) || "canvas";
872
+ const frameSelector = cliString(receipt.frame_selector);
873
+ const hash = cliString(receipt.hash);
874
+ const count = cliFiniteNumber(receipt.count);
875
+ const labelCount = cliFiniteNumber(receipt.label_count);
876
+ const labels = cliStringArray(receipt.labels);
877
+ const omittedLabelCount = cliFiniteNumber(receipt.omitted_label_count) || 0;
878
+ const labelText = labels.length ? ` across ${labels.map((label) => markdownInlineCode(label, 60)).join(", ")}${omittedLabelCount ? `, plus ${omittedLabelCount} more` : ""}` : "";
879
+ lines.push(`- ${name} canvas_signature warning: ${markdownInlineCode(selector)}${frameSelector ? ` in frame ${markdownInlineCode(frameSelector)}` : ""} returned the same hash${hash ? ` ${markdownInlineCode(hash, 80)}` : ""} for ${count ?? labelCount ?? "multiple"} labeled capture(s)${labelText}; treat canvas signatures as diagnostic when runtime evidence or screenshots show state changes.`);
880
+ }
881
+ if (canvasSignatureWarnings.length > sampledCanvasSignatureWarnings.length) lines.push(`- ${canvasSignatureWarnings.length - sampledCanvasSignatureWarnings.length} additional canvas_signature warning(s) omitted.`);
863
882
  const rangeValueGroups = viewports.map((viewport) => {
864
883
  const name = cliString(viewport.name) || "viewport";
865
884
  const receipts = Array.isArray(viewport.set_range_value) ? viewport.set_range_value.map(cliRecord).filter((item) => Boolean(item)) : [];
package/dist/index.cjs CHANGED
@@ -9304,6 +9304,42 @@ function profileSetupCanvasSignatureReceipts(results) {
9304
9304
  reason: result.reason ?? result.error ?? null
9305
9305
  }));
9306
9306
  }
9307
+ function profileSetupCanvasSignatureStableHashGroups(results) {
9308
+ const groups = /* @__PURE__ */ new Map();
9309
+ for (const receipt of profileSetupCanvasSignatureReceipts(results)) {
9310
+ if (receipt.ok === false) continue;
9311
+ const hash = stringValue5(receipt.hash);
9312
+ if (!hash) continue;
9313
+ const selector = stringValue5(receipt.selector) || "canvas";
9314
+ const frameSelector = stringValue5(receipt.frame_selector);
9315
+ const key = `${frameSelector || ""}
9316
+ ${selector}`;
9317
+ const group = groups.get(key) || { selector, frame_selector: frameSelector, receipts: [] };
9318
+ const ordinal = numberValue3(receipt.ordinal);
9319
+ const label = stringValue5(receipt.label) || (ordinal === void 0 ? `capture-${group.receipts.length + 1}` : `#${ordinal}`);
9320
+ group.receipts.push({ hash, label, ordinal });
9321
+ groups.set(key, group);
9322
+ }
9323
+ const warnings = [];
9324
+ for (const group of groups.values()) {
9325
+ const hashes = new Set(group.receipts.map((receipt) => receipt.hash));
9326
+ const labels = [...new Set(group.receipts.map((receipt) => receipt.label))];
9327
+ if (group.receipts.length < 2 || labels.length < 2 || hashes.size !== 1) continue;
9328
+ const visibleLabels = labels.slice(0, 8);
9329
+ warnings.push({
9330
+ selector: group.selector,
9331
+ frame_selector: group.frame_selector ?? null,
9332
+ hash: group.receipts[0].hash,
9333
+ count: group.receipts.length,
9334
+ label_count: labels.length,
9335
+ labels: visibleLabels,
9336
+ omitted_label_count: Math.max(0, labels.length - visibleLabels.length),
9337
+ ordinals: group.receipts.map((receipt) => receipt.ordinal).filter((value) => value !== void 0).slice(0, 12),
9338
+ reason: "stable_canvas_signature_hash"
9339
+ });
9340
+ }
9341
+ return warnings;
9342
+ }
9307
9343
  function sampleProfileSetupSummaryItems(items, limit) {
9308
9344
  if (items.length <= limit) return items;
9309
9345
  const firstCount = Math.floor(limit / 2);
@@ -9404,6 +9440,7 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
9404
9440
  canvas_signature_total: canvasSignatureReceipts.length,
9405
9441
  canvas_signature_truncated: canvasSignatureReceipts.length > sampledCanvasSignatureReceipts.length,
9406
9442
  canvas_signature: sampledCanvasSignatureReceipts,
9443
+ canvas_signature_stable_hash_groups: profileSetupCanvasSignatureStableHashGroups(results),
9407
9444
  clicked,
9408
9445
  text_samples,
9409
9446
  failed: failed.map((result) => ({
package/dist/index.js CHANGED
@@ -62,7 +62,7 @@ import {
62
62
  resolveRiddleProofProfileTimeoutSec,
63
63
  slugifyRiddleProofProfileName,
64
64
  summarizeRiddleProofProfileResult
65
- } from "./chunk-ZLNPYVMJ.js";
65
+ } from "./chunk-RWBG7256.js";
66
66
  import {
67
67
  DEFAULT_RIDDLE_API_BASE_URL,
68
68
  DEFAULT_RIDDLE_API_KEY_FILE,
package/dist/profile.cjs CHANGED
@@ -618,6 +618,42 @@ function profileSetupCanvasSignatureReceipts(results) {
618
618
  reason: result.reason ?? result.error ?? null
619
619
  }));
620
620
  }
621
+ function profileSetupCanvasSignatureStableHashGroups(results) {
622
+ const groups = /* @__PURE__ */ new Map();
623
+ for (const receipt of profileSetupCanvasSignatureReceipts(results)) {
624
+ if (receipt.ok === false) continue;
625
+ const hash = stringValue(receipt.hash);
626
+ if (!hash) continue;
627
+ const selector = stringValue(receipt.selector) || "canvas";
628
+ const frameSelector = stringValue(receipt.frame_selector);
629
+ const key = `${frameSelector || ""}
630
+ ${selector}`;
631
+ const group = groups.get(key) || { selector, frame_selector: frameSelector, receipts: [] };
632
+ const ordinal = numberValue(receipt.ordinal);
633
+ const label = stringValue(receipt.label) || (ordinal === void 0 ? `capture-${group.receipts.length + 1}` : `#${ordinal}`);
634
+ group.receipts.push({ hash, label, ordinal });
635
+ groups.set(key, group);
636
+ }
637
+ const warnings = [];
638
+ for (const group of groups.values()) {
639
+ const hashes = new Set(group.receipts.map((receipt) => receipt.hash));
640
+ const labels = [...new Set(group.receipts.map((receipt) => receipt.label))];
641
+ if (group.receipts.length < 2 || labels.length < 2 || hashes.size !== 1) continue;
642
+ const visibleLabels = labels.slice(0, 8);
643
+ warnings.push({
644
+ selector: group.selector,
645
+ frame_selector: group.frame_selector ?? null,
646
+ hash: group.receipts[0].hash,
647
+ count: group.receipts.length,
648
+ label_count: labels.length,
649
+ labels: visibleLabels,
650
+ omitted_label_count: Math.max(0, labels.length - visibleLabels.length),
651
+ ordinals: group.receipts.map((receipt) => receipt.ordinal).filter((value) => value !== void 0).slice(0, 12),
652
+ reason: "stable_canvas_signature_hash"
653
+ });
654
+ }
655
+ return warnings;
656
+ }
621
657
  function sampleProfileSetupSummaryItems(items, limit) {
622
658
  if (items.length <= limit) return items;
623
659
  const firstCount = Math.floor(limit / 2);
@@ -718,6 +754,7 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
718
754
  canvas_signature_total: canvasSignatureReceipts.length,
719
755
  canvas_signature_truncated: canvasSignatureReceipts.length > sampledCanvasSignatureReceipts.length,
720
756
  canvas_signature: sampledCanvasSignatureReceipts,
757
+ canvas_signature_stable_hash_groups: profileSetupCanvasSignatureStableHashGroups(results),
721
758
  clicked,
722
759
  text_samples,
723
760
  failed: failed.map((result) => ({
package/dist/profile.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  resolveRiddleProofProfileTimeoutSec,
24
24
  slugifyRiddleProofProfileName,
25
25
  summarizeRiddleProofProfileResult
26
- } from "./chunk-ZLNPYVMJ.js";
26
+ } from "./chunk-RWBG7256.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.162",
3
+ "version": "0.7.163",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",