@riddledc/riddle-proof 0.7.123 → 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/README.md CHANGED
@@ -587,6 +587,8 @@ JSON, YAML, robots, sitemap, or other machine-readable endpoint:
587
587
  text. Use `text_visible` or `selector_text_visible` when CSS transforms,
588
588
  hydration, client rendering, hidden elements, or layout-specific copy should be
589
589
  judged exactly as the browser exposes it to users.
590
+ Hosted `summary.md` includes `http_status` body assertion pass counts so a
591
+ reviewer can see raw body proof coverage without opening `proof.json`.
590
592
 
591
593
  When the profile target is a mounted Riddle static Preview such as
592
594
  `https://preview.riddledc.com/s/ps_1234abcd/docs/`, root-relative
package/dist/cli.cjs CHANGED
@@ -13635,6 +13635,30 @@ function profileLinkStatusSummaryMarkdown(result) {
13635
13635
  }
13636
13636
  return lines;
13637
13637
  }
13638
+ function profileHttpStatusAssertionCount(viewports, field, expected, passValue) {
13639
+ if (!expected.length || !viewports.length) return void 0;
13640
+ let passed = 0;
13641
+ for (const viewport of viewports) {
13642
+ const observed = cliRecord(viewport[field]);
13643
+ for (const value of expected) {
13644
+ if (observed?.[value] === passValue) passed += 1;
13645
+ }
13646
+ }
13647
+ return { passed, total: expected.length * viewports.length };
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
+ }
13638
13662
  function profileHttpStatusSummaryMarkdown(result) {
13639
13663
  const httpStatusChecks = result.checks.filter((check) => check.type === "http_status");
13640
13664
  const lines = [];
@@ -13647,8 +13671,31 @@ function profileHttpStatusSummaryMarkdown(result) {
13647
13671
  const viewports = Array.isArray(evidence.viewports) ? evidence.viewports.map(cliRecord).filter((viewport) => Boolean(viewport)) : [];
13648
13672
  const statuses = viewports.map((viewport) => cliFiniteNumber(viewport.status)).map((status) => status === void 0 ? "error" : String(status));
13649
13673
  const failedTotal = Array.isArray(evidence.failures) ? evidence.failures.length : 0;
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
+ );
13692
+ const bodyParts = [
13693
+ bodyContains ? `body_contains ${bodyContains.passed}/${bodyContains.total}` : "",
13694
+ bodyNotContains ? `body_not_contains clean ${bodyNotContains.passed}/${bodyNotContains.total}` : "",
13695
+ bodyNotPatterns ? `body_not_patterns clean ${bodyNotPatterns.passed}/${bodyNotPatterns.total}` : ""
13696
+ ].filter(Boolean);
13650
13697
  lines.push(
13651
- `- ${label}: ${method}${url ? ` ${markdownInlineCode(url)}` : ""}, statuses ${statuses.length ? statuses.join("/") : "unknown"}, failures ${failedTotal}`
13698
+ `- ${label}: ${method}${url ? ` ${markdownInlineCode(url)}` : ""}, statuses ${statuses.length ? statuses.join("/") : "unknown"}${bodyParts.length ? `, ${bodyParts.join(", ")}` : ""}, failures ${failedTotal}`
13652
13699
  );
13653
13700
  }
13654
13701
  return lines;
package/dist/cli.js CHANGED
@@ -717,6 +717,30 @@ function profileLinkStatusSummaryMarkdown(result) {
717
717
  }
718
718
  return lines;
719
719
  }
720
+ function profileHttpStatusAssertionCount(viewports, field, expected, passValue) {
721
+ if (!expected.length || !viewports.length) return void 0;
722
+ let passed = 0;
723
+ for (const viewport of viewports) {
724
+ const observed = cliRecord(viewport[field]);
725
+ for (const value of expected) {
726
+ if (observed?.[value] === passValue) passed += 1;
727
+ }
728
+ }
729
+ return { passed, total: expected.length * viewports.length };
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
+ }
720
744
  function profileHttpStatusSummaryMarkdown(result) {
721
745
  const httpStatusChecks = result.checks.filter((check) => check.type === "http_status");
722
746
  const lines = [];
@@ -729,8 +753,31 @@ function profileHttpStatusSummaryMarkdown(result) {
729
753
  const viewports = Array.isArray(evidence.viewports) ? evidence.viewports.map(cliRecord).filter((viewport) => Boolean(viewport)) : [];
730
754
  const statuses = viewports.map((viewport) => cliFiniteNumber(viewport.status)).map((status) => status === void 0 ? "error" : String(status));
731
755
  const failedTotal = Array.isArray(evidence.failures) ? evidence.failures.length : 0;
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
+ );
774
+ const bodyParts = [
775
+ bodyContains ? `body_contains ${bodyContains.passed}/${bodyContains.total}` : "",
776
+ bodyNotContains ? `body_not_contains clean ${bodyNotContains.passed}/${bodyNotContains.total}` : "",
777
+ bodyNotPatterns ? `body_not_patterns clean ${bodyNotPatterns.passed}/${bodyNotPatterns.total}` : ""
778
+ ].filter(Boolean);
732
779
  lines.push(
733
- `- ${label}: ${method}${url ? ` ${markdownInlineCode(url)}` : ""}, statuses ${statuses.length ? statuses.join("/") : "unknown"}, failures ${failedTotal}`
780
+ `- ${label}: ${method}${url ? ` ${markdownInlineCode(url)}` : ""}, statuses ${statuses.length ? statuses.join("/") : "unknown"}${bodyParts.length ? `, ${bodyParts.join(", ")}` : ""}, failures ${failedTotal}`
734
781
  );
735
782
  }
736
783
  return lines;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.7.123",
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",