@riddledc/riddle-proof 0.7.214 → 0.7.215

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -17078,10 +17078,24 @@ function profileHasOfflineAudioMetricsReceipt(receipts) {
17078
17078
  "peak",
17079
17079
  "rms"
17080
17080
  ];
17081
- return receipts.some((receipt) => metricFields.some((name) => {
17082
- const value = cliFiniteNumber(setupReturnSummaryValue(receipt, [name]));
17083
- return value !== void 0 && value > 0;
17084
- }));
17081
+ const metricFieldNames = new Set(metricFields.map((name) => name.toLowerCase()));
17082
+ const positiveMetricValue = (value) => {
17083
+ const number = cliFiniteNumber(value);
17084
+ return number !== void 0 && number > 0;
17085
+ };
17086
+ const metricSummaryItem = (item) => {
17087
+ const label = (cliString(item.label) || "").toLowerCase();
17088
+ const path7 = (cliString(item.path) || "").toLowerCase();
17089
+ const tail = (path7.split(".").filter(Boolean).pop() || label).toLowerCase();
17090
+ const normalizedLabel = label.replace(/[^a-z0-9]+/g, "");
17091
+ const normalizedTail = tail.replace(/[^a-z0-9]+/g, "");
17092
+ return metricFieldNames.has(normalizedLabel) || metricFieldNames.has(normalizedTail) || /(^|\.)(mixhealth|monitormetrics|instrumentmetrics)\.(peak|rms)$/.test(path7);
17093
+ };
17094
+ return receipts.some((receipt) => {
17095
+ if (metricFields.some((name) => positiveMetricValue(setupReturnSummaryValue(receipt, [name])))) return true;
17096
+ const summaries = Array.isArray(receipt.return_summary) ? receipt.return_summary.map(cliRecord).filter((item) => Boolean(item)) : [];
17097
+ return summaries.some((item) => metricSummaryItem(item) && positiveMetricValue(item.value));
17098
+ });
17085
17099
  }
17086
17100
  function profileHasActiveRouteLocalProofReceipt(receipts) {
17087
17101
  return receipts.some((receipt) => {
package/dist/cli.js CHANGED
@@ -838,10 +838,24 @@ function profileHasOfflineAudioMetricsReceipt(receipts) {
838
838
  "peak",
839
839
  "rms"
840
840
  ];
841
- return receipts.some((receipt) => metricFields.some((name) => {
842
- const value = cliFiniteNumber(setupReturnSummaryValue(receipt, [name]));
843
- return value !== void 0 && value > 0;
844
- }));
841
+ const metricFieldNames = new Set(metricFields.map((name) => name.toLowerCase()));
842
+ const positiveMetricValue = (value) => {
843
+ const number = cliFiniteNumber(value);
844
+ return number !== void 0 && number > 0;
845
+ };
846
+ const metricSummaryItem = (item) => {
847
+ const label = (cliString(item.label) || "").toLowerCase();
848
+ const path2 = (cliString(item.path) || "").toLowerCase();
849
+ const tail = (path2.split(".").filter(Boolean).pop() || label).toLowerCase();
850
+ const normalizedLabel = label.replace(/[^a-z0-9]+/g, "");
851
+ const normalizedTail = tail.replace(/[^a-z0-9]+/g, "");
852
+ return metricFieldNames.has(normalizedLabel) || metricFieldNames.has(normalizedTail) || /(^|\.)(mixhealth|monitormetrics|instrumentmetrics)\.(peak|rms)$/.test(path2);
853
+ };
854
+ return receipts.some((receipt) => {
855
+ if (metricFields.some((name) => positiveMetricValue(setupReturnSummaryValue(receipt, [name])))) return true;
856
+ const summaries = Array.isArray(receipt.return_summary) ? receipt.return_summary.map(cliRecord).filter((item) => Boolean(item)) : [];
857
+ return summaries.some((item) => metricSummaryItem(item) && positiveMetricValue(item.value));
858
+ });
845
859
  }
846
860
  function profileHasActiveRouteLocalProofReceipt(receipts) {
847
861
  return receipts.some((receipt) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.7.214",
3
+ "version": "0.7.215",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",