@riddledc/riddle-proof 0.7.123 → 0.7.124
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 +2 -0
- package/dist/cli.cjs +20 -1
- package/dist/cli.js +20 -1
- package/package.json +1 -1
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,17 @@ 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
|
+
}
|
|
13638
13649
|
function profileHttpStatusSummaryMarkdown(result) {
|
|
13639
13650
|
const httpStatusChecks = result.checks.filter((check) => check.type === "http_status");
|
|
13640
13651
|
const lines = [];
|
|
@@ -13647,8 +13658,16 @@ function profileHttpStatusSummaryMarkdown(result) {
|
|
|
13647
13658
|
const viewports = Array.isArray(evidence.viewports) ? evidence.viewports.map(cliRecord).filter((viewport) => Boolean(viewport)) : [];
|
|
13648
13659
|
const statuses = viewports.map((viewport) => cliFiniteNumber(viewport.status)).map((status) => status === void 0 ? "error" : String(status));
|
|
13649
13660
|
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);
|
|
13664
|
+
const bodyParts = [
|
|
13665
|
+
bodyContains ? `body_contains ${bodyContains.passed}/${bodyContains.total}` : "",
|
|
13666
|
+
bodyNotContains ? `body_not_contains clean ${bodyNotContains.passed}/${bodyNotContains.total}` : "",
|
|
13667
|
+
bodyNotPatterns ? `body_not_patterns clean ${bodyNotPatterns.passed}/${bodyNotPatterns.total}` : ""
|
|
13668
|
+
].filter(Boolean);
|
|
13650
13669
|
lines.push(
|
|
13651
|
-
`- ${label}: ${method}${url ? ` ${markdownInlineCode(url)}` : ""}, statuses ${statuses.length ? statuses.join("/") : "unknown"}, failures ${failedTotal}`
|
|
13670
|
+
`- ${label}: ${method}${url ? ` ${markdownInlineCode(url)}` : ""}, statuses ${statuses.length ? statuses.join("/") : "unknown"}${bodyParts.length ? `, ${bodyParts.join(", ")}` : ""}, failures ${failedTotal}`
|
|
13652
13671
|
);
|
|
13653
13672
|
}
|
|
13654
13673
|
return lines;
|
package/dist/cli.js
CHANGED
|
@@ -717,6 +717,17 @@ 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
|
+
}
|
|
720
731
|
function profileHttpStatusSummaryMarkdown(result) {
|
|
721
732
|
const httpStatusChecks = result.checks.filter((check) => check.type === "http_status");
|
|
722
733
|
const lines = [];
|
|
@@ -729,8 +740,16 @@ function profileHttpStatusSummaryMarkdown(result) {
|
|
|
729
740
|
const viewports = Array.isArray(evidence.viewports) ? evidence.viewports.map(cliRecord).filter((viewport) => Boolean(viewport)) : [];
|
|
730
741
|
const statuses = viewports.map((viewport) => cliFiniteNumber(viewport.status)).map((status) => status === void 0 ? "error" : String(status));
|
|
731
742
|
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);
|
|
746
|
+
const bodyParts = [
|
|
747
|
+
bodyContains ? `body_contains ${bodyContains.passed}/${bodyContains.total}` : "",
|
|
748
|
+
bodyNotContains ? `body_not_contains clean ${bodyNotContains.passed}/${bodyNotContains.total}` : "",
|
|
749
|
+
bodyNotPatterns ? `body_not_patterns clean ${bodyNotPatterns.passed}/${bodyNotPatterns.total}` : ""
|
|
750
|
+
].filter(Boolean);
|
|
732
751
|
lines.push(
|
|
733
|
-
`- ${label}: ${method}${url ? ` ${markdownInlineCode(url)}` : ""}, statuses ${statuses.length ? statuses.join("/") : "unknown"}, failures ${failedTotal}`
|
|
752
|
+
`- ${label}: ${method}${url ? ` ${markdownInlineCode(url)}` : ""}, statuses ${statuses.length ? statuses.join("/") : "unknown"}${bodyParts.length ? `, ${bodyParts.join(", ")}` : ""}, failures ${failedTotal}`
|
|
734
753
|
);
|
|
735
754
|
}
|
|
736
755
|
return lines;
|