@riddledc/riddle-proof 0.7.124 → 0.7.125

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
@@ -13646,6 +13646,19 @@ function profileHttpStatusAssertionCount(viewports, field, expected, passValue)
13646
13646
  }
13647
13647
  return { passed, total: expected.length * viewports.length };
13648
13648
  }
13649
+ function profileHttpStatusAssertionKeys(evidence, viewports, field) {
13650
+ const explicit = cliStringArray(evidence[field]);
13651
+ if (explicit.length) return explicit;
13652
+ const keys = /* @__PURE__ */ new Set();
13653
+ for (const viewport of viewports) {
13654
+ const observed = cliRecord(viewport[field]);
13655
+ if (!observed) continue;
13656
+ for (const key of Object.keys(observed)) {
13657
+ if (key) keys.add(key);
13658
+ }
13659
+ }
13660
+ return [...keys];
13661
+ }
13649
13662
  function profileHttpStatusSummaryMarkdown(result) {
13650
13663
  const httpStatusChecks = result.checks.filter((check) => check.type === "http_status");
13651
13664
  const lines = [];
@@ -13658,9 +13671,24 @@ function profileHttpStatusSummaryMarkdown(result) {
13658
13671
  const viewports = Array.isArray(evidence.viewports) ? evidence.viewports.map(cliRecord).filter((viewport) => Boolean(viewport)) : [];
13659
13672
  const statuses = viewports.map((viewport) => cliFiniteNumber(viewport.status)).map((status) => status === void 0 ? "error" : String(status));
13660
13673
  const failedTotal = Array.isArray(evidence.failures) ? evidence.failures.length : 0;
13661
- const bodyContains = profileHttpStatusAssertionCount(viewports, "body_contains", cliStringArray(evidence.body_contains), true);
13662
- const bodyNotContains = profileHttpStatusAssertionCount(viewports, "body_not_contains", cliStringArray(evidence.body_not_contains), false);
13663
- const bodyNotPatterns = profileHttpStatusAssertionCount(viewports, "body_not_patterns", cliStringArray(evidence.body_not_patterns), false);
13674
+ const bodyContains = profileHttpStatusAssertionCount(
13675
+ viewports,
13676
+ "body_contains",
13677
+ profileHttpStatusAssertionKeys(evidence, viewports, "body_contains"),
13678
+ true
13679
+ );
13680
+ const bodyNotContains = profileHttpStatusAssertionCount(
13681
+ viewports,
13682
+ "body_not_contains",
13683
+ profileHttpStatusAssertionKeys(evidence, viewports, "body_not_contains"),
13684
+ false
13685
+ );
13686
+ const bodyNotPatterns = profileHttpStatusAssertionCount(
13687
+ viewports,
13688
+ "body_not_patterns",
13689
+ profileHttpStatusAssertionKeys(evidence, viewports, "body_not_patterns"),
13690
+ false
13691
+ );
13664
13692
  const bodyParts = [
13665
13693
  bodyContains ? `body_contains ${bodyContains.passed}/${bodyContains.total}` : "",
13666
13694
  bodyNotContains ? `body_not_contains clean ${bodyNotContains.passed}/${bodyNotContains.total}` : "",
package/dist/cli.js CHANGED
@@ -728,6 +728,19 @@ function profileHttpStatusAssertionCount(viewports, field, expected, passValue)
728
728
  }
729
729
  return { passed, total: expected.length * viewports.length };
730
730
  }
731
+ function profileHttpStatusAssertionKeys(evidence, viewports, field) {
732
+ const explicit = cliStringArray(evidence[field]);
733
+ if (explicit.length) return explicit;
734
+ const keys = /* @__PURE__ */ new Set();
735
+ for (const viewport of viewports) {
736
+ const observed = cliRecord(viewport[field]);
737
+ if (!observed) continue;
738
+ for (const key of Object.keys(observed)) {
739
+ if (key) keys.add(key);
740
+ }
741
+ }
742
+ return [...keys];
743
+ }
731
744
  function profileHttpStatusSummaryMarkdown(result) {
732
745
  const httpStatusChecks = result.checks.filter((check) => check.type === "http_status");
733
746
  const lines = [];
@@ -740,9 +753,24 @@ function profileHttpStatusSummaryMarkdown(result) {
740
753
  const viewports = Array.isArray(evidence.viewports) ? evidence.viewports.map(cliRecord).filter((viewport) => Boolean(viewport)) : [];
741
754
  const statuses = viewports.map((viewport) => cliFiniteNumber(viewport.status)).map((status) => status === void 0 ? "error" : String(status));
742
755
  const failedTotal = Array.isArray(evidence.failures) ? evidence.failures.length : 0;
743
- const bodyContains = profileHttpStatusAssertionCount(viewports, "body_contains", cliStringArray(evidence.body_contains), true);
744
- const bodyNotContains = profileHttpStatusAssertionCount(viewports, "body_not_contains", cliStringArray(evidence.body_not_contains), false);
745
- const bodyNotPatterns = profileHttpStatusAssertionCount(viewports, "body_not_patterns", cliStringArray(evidence.body_not_patterns), false);
756
+ const bodyContains = profileHttpStatusAssertionCount(
757
+ viewports,
758
+ "body_contains",
759
+ profileHttpStatusAssertionKeys(evidence, viewports, "body_contains"),
760
+ true
761
+ );
762
+ const bodyNotContains = profileHttpStatusAssertionCount(
763
+ viewports,
764
+ "body_not_contains",
765
+ profileHttpStatusAssertionKeys(evidence, viewports, "body_not_contains"),
766
+ false
767
+ );
768
+ const bodyNotPatterns = profileHttpStatusAssertionCount(
769
+ viewports,
770
+ "body_not_patterns",
771
+ profileHttpStatusAssertionKeys(evidence, viewports, "body_not_patterns"),
772
+ false
773
+ );
746
774
  const bodyParts = [
747
775
  bodyContains ? `body_contains ${bodyContains.passed}/${bodyContains.total}` : "",
748
776
  bodyNotContains ? `body_not_contains clean ${bodyNotContains.passed}/${bodyNotContains.total}` : "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.7.124",
3
+ "version": "0.7.125",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",