@riddledc/riddle-proof 0.7.185 → 0.7.186
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
|
@@ -16384,6 +16384,28 @@ function profileFailedCleanupInventoryReason(setupViewports) {
|
|
|
16384
16384
|
}
|
|
16385
16385
|
return void 0;
|
|
16386
16386
|
}
|
|
16387
|
+
function profileHasRouteExitAffordanceReceipt(receipts) {
|
|
16388
|
+
const affordanceFields = [
|
|
16389
|
+
"navVisibleBeforeExit",
|
|
16390
|
+
"navVisible",
|
|
16391
|
+
"navigationVisible",
|
|
16392
|
+
"exitVisible",
|
|
16393
|
+
"exitControlVisible",
|
|
16394
|
+
"routeExitVisible",
|
|
16395
|
+
"homeLinkVisible"
|
|
16396
|
+
];
|
|
16397
|
+
const routeFields = ["route", "afterRoute", "nextRoute", "browserPath", "path"];
|
|
16398
|
+
return receipts.some((receipt) => {
|
|
16399
|
+
if (affordanceFields.some((name) => setupReturnSummaryValue(receipt, [name]) !== void 0)) return true;
|
|
16400
|
+
const storedTo = cliString(receipt.return_stored_to) || "";
|
|
16401
|
+
const summary = cliReturnSummaryLabel(receipt.return_summary) || "";
|
|
16402
|
+
const reason = cliString(receipt.reason) || "";
|
|
16403
|
+
const haystack = `${storedTo} ${summary} ${reason}`.toLowerCase();
|
|
16404
|
+
const mentionsRouteExit = haystack.includes("routeexit") || haystack.includes("route-exit") || haystack.includes("route exit") || haystack.includes("afterrouteexit") || haystack.includes("after route exit");
|
|
16405
|
+
if (!mentionsRouteExit) return false;
|
|
16406
|
+
return routeFields.some((name) => setupReturnSummaryValue(receipt, [name]) !== void 0) || haystack.includes("route=") || haystack.includes("browserpath=");
|
|
16407
|
+
});
|
|
16408
|
+
}
|
|
16387
16409
|
function profilePackReceiptStatus(result, metadata, receipt) {
|
|
16388
16410
|
const text = receipt.toLowerCase();
|
|
16389
16411
|
const setupSummary = profileSetupSummaryRecord(result);
|
|
@@ -16432,6 +16454,7 @@ function profilePackReceiptStatus(result, metadata, receipt) {
|
|
|
16432
16454
|
const hasTextVisibility = profileHasPassedCheck(result, ["text_visible", "selector_text_visible", "selector_visible"]);
|
|
16433
16455
|
const hasTextAbsence = profileHasPassedCheck(result, ["text_absent", "selector_text_absent"]);
|
|
16434
16456
|
const hasMeasuredStateChange = hasNaturalInput || hasCanvasChange || valueReceipts.some((item) => setupReturnSummaryValue(item, ["changed"]) === true || setupReturnSummaryValue(item, ["nonWhiteDelta", "darkDelta", "pixelDelta", "movementDelta"]) !== void 0);
|
|
16457
|
+
const hasRouteExitAffordanceReceipt = profileHasRouteExitAffordanceReceipt(valueReceipts);
|
|
16435
16458
|
const failedCleanupInventoryReason = profileFailedCleanupInventoryReason(setupViewports);
|
|
16436
16459
|
if (text.includes("artifact link") || text.includes("artifact path")) {
|
|
16437
16460
|
return profileReceiptSignalStatus(profileResultHasArtifact(result), "artifact references listed", "no artifact references found");
|
|
@@ -16470,6 +16493,13 @@ function profilePackReceiptStatus(result, metadata, receipt) {
|
|
|
16470
16493
|
if (text.includes("invalid state")) {
|
|
16471
16494
|
return profileReceiptSignalStatus(hasStateContract || hasInvalidStateReceipt, "invalid-state receipt present", "invalid-state receipt missing");
|
|
16472
16495
|
}
|
|
16496
|
+
if (text.includes("route-exit affordance") || text.includes("route exit affordance") || text.includes("navigation before cleanup") || text.includes("exit control")) {
|
|
16497
|
+
return profileReceiptSignalStatus(
|
|
16498
|
+
hasRouteExitAffordanceReceipt || hasStateContract || clickCount > 0,
|
|
16499
|
+
"route-exit affordance receipt present",
|
|
16500
|
+
"affordance receipt missing"
|
|
16501
|
+
);
|
|
16502
|
+
}
|
|
16473
16503
|
if (text.includes("retry") || text.includes("repair") || text.includes("reset") || text.includes("affordance")) {
|
|
16474
16504
|
return profileReceiptSignalStatus(hasStateContract || clickCount > 0, "affordance or transition receipt present", "affordance receipt missing");
|
|
16475
16505
|
}
|
|
@@ -16548,9 +16578,31 @@ function profilePackMetadataMarkdown(result) {
|
|
|
16548
16578
|
].filter(Boolean);
|
|
16549
16579
|
if (packParts.length) lines.push(`- pack: ${packParts.join(" - ")}`);
|
|
16550
16580
|
if (requiredReceipts.length) {
|
|
16581
|
+
const receiptStatuses = requiredReceipts.map((receipt) => ({
|
|
16582
|
+
receipt,
|
|
16583
|
+
item: profilePackReceiptStatus(result, metadata, receipt)
|
|
16584
|
+
}));
|
|
16585
|
+
const missingReceipts = receiptStatuses.filter(({ item }) => item.status === "missing").map(({ receipt }) => receipt);
|
|
16586
|
+
const failedReceipts = receiptStatuses.filter(({ item }) => item.status === "failed").map(({ receipt }) => receipt);
|
|
16587
|
+
const manualCount = receiptStatuses.filter(({ item }) => item.status === "manual").length;
|
|
16588
|
+
const presentCount = receiptStatuses.filter(({ item }) => item.status === "present").length;
|
|
16589
|
+
const completenessParts = [
|
|
16590
|
+
`${presentCount} present`,
|
|
16591
|
+
manualCount ? `${manualCount} manual` : "",
|
|
16592
|
+
missingReceipts.length ? `${missingReceipts.length} missing` : "",
|
|
16593
|
+
failedReceipts.length ? `${failedReceipts.length} failed` : ""
|
|
16594
|
+
].filter(Boolean);
|
|
16595
|
+
lines.push(`- pack completeness: ${missingReceipts.length || failedReceipts.length ? "incomplete" : "complete"} (${completenessParts.join(", ")})`);
|
|
16596
|
+
if (missingReceipts.length) {
|
|
16597
|
+
const listed = missingReceipts.slice(0, 5).map((receipt) => markdownInlineCode(receipt, 120)).join(", ");
|
|
16598
|
+
lines.push(`- missing required receipts: ${listed}${missingReceipts.length > 5 ? `, ${missingReceipts.length - 5} more` : ""}`);
|
|
16599
|
+
}
|
|
16600
|
+
if (failedReceipts.length) {
|
|
16601
|
+
const listed = failedReceipts.slice(0, 5).map((receipt) => markdownInlineCode(receipt, 120)).join(", ");
|
|
16602
|
+
lines.push(`- failed required receipts: ${listed}${failedReceipts.length > 5 ? `, ${failedReceipts.length - 5} more` : ""}`);
|
|
16603
|
+
}
|
|
16551
16604
|
lines.push(`- required receipts: ${requiredReceipts.length}`);
|
|
16552
|
-
for (const receipt of
|
|
16553
|
-
const item = profilePackReceiptStatus(result, metadata, receipt);
|
|
16605
|
+
for (const { receipt, item } of receiptStatuses.slice(0, 20)) {
|
|
16554
16606
|
lines.push(` - ${item.status}: ${receipt} (${item.reason})`);
|
|
16555
16607
|
}
|
|
16556
16608
|
if (requiredReceipts.length > 20) lines.push(` - ${requiredReceipts.length - 20} additional required receipt(s) omitted.`);
|
package/dist/cli.js
CHANGED
|
@@ -589,6 +589,28 @@ function profileFailedCleanupInventoryReason(setupViewports) {
|
|
|
589
589
|
}
|
|
590
590
|
return void 0;
|
|
591
591
|
}
|
|
592
|
+
function profileHasRouteExitAffordanceReceipt(receipts) {
|
|
593
|
+
const affordanceFields = [
|
|
594
|
+
"navVisibleBeforeExit",
|
|
595
|
+
"navVisible",
|
|
596
|
+
"navigationVisible",
|
|
597
|
+
"exitVisible",
|
|
598
|
+
"exitControlVisible",
|
|
599
|
+
"routeExitVisible",
|
|
600
|
+
"homeLinkVisible"
|
|
601
|
+
];
|
|
602
|
+
const routeFields = ["route", "afterRoute", "nextRoute", "browserPath", "path"];
|
|
603
|
+
return receipts.some((receipt) => {
|
|
604
|
+
if (affordanceFields.some((name) => setupReturnSummaryValue(receipt, [name]) !== void 0)) return true;
|
|
605
|
+
const storedTo = cliString(receipt.return_stored_to) || "";
|
|
606
|
+
const summary = cliReturnSummaryLabel(receipt.return_summary) || "";
|
|
607
|
+
const reason = cliString(receipt.reason) || "";
|
|
608
|
+
const haystack = `${storedTo} ${summary} ${reason}`.toLowerCase();
|
|
609
|
+
const mentionsRouteExit = haystack.includes("routeexit") || haystack.includes("route-exit") || haystack.includes("route exit") || haystack.includes("afterrouteexit") || haystack.includes("after route exit");
|
|
610
|
+
if (!mentionsRouteExit) return false;
|
|
611
|
+
return routeFields.some((name) => setupReturnSummaryValue(receipt, [name]) !== void 0) || haystack.includes("route=") || haystack.includes("browserpath=");
|
|
612
|
+
});
|
|
613
|
+
}
|
|
592
614
|
function profilePackReceiptStatus(result, metadata, receipt) {
|
|
593
615
|
const text = receipt.toLowerCase();
|
|
594
616
|
const setupSummary = profileSetupSummaryRecord(result);
|
|
@@ -637,6 +659,7 @@ function profilePackReceiptStatus(result, metadata, receipt) {
|
|
|
637
659
|
const hasTextVisibility = profileHasPassedCheck(result, ["text_visible", "selector_text_visible", "selector_visible"]);
|
|
638
660
|
const hasTextAbsence = profileHasPassedCheck(result, ["text_absent", "selector_text_absent"]);
|
|
639
661
|
const hasMeasuredStateChange = hasNaturalInput || hasCanvasChange || valueReceipts.some((item) => setupReturnSummaryValue(item, ["changed"]) === true || setupReturnSummaryValue(item, ["nonWhiteDelta", "darkDelta", "pixelDelta", "movementDelta"]) !== void 0);
|
|
662
|
+
const hasRouteExitAffordanceReceipt = profileHasRouteExitAffordanceReceipt(valueReceipts);
|
|
640
663
|
const failedCleanupInventoryReason = profileFailedCleanupInventoryReason(setupViewports);
|
|
641
664
|
if (text.includes("artifact link") || text.includes("artifact path")) {
|
|
642
665
|
return profileReceiptSignalStatus(profileResultHasArtifact(result), "artifact references listed", "no artifact references found");
|
|
@@ -675,6 +698,13 @@ function profilePackReceiptStatus(result, metadata, receipt) {
|
|
|
675
698
|
if (text.includes("invalid state")) {
|
|
676
699
|
return profileReceiptSignalStatus(hasStateContract || hasInvalidStateReceipt, "invalid-state receipt present", "invalid-state receipt missing");
|
|
677
700
|
}
|
|
701
|
+
if (text.includes("route-exit affordance") || text.includes("route exit affordance") || text.includes("navigation before cleanup") || text.includes("exit control")) {
|
|
702
|
+
return profileReceiptSignalStatus(
|
|
703
|
+
hasRouteExitAffordanceReceipt || hasStateContract || clickCount > 0,
|
|
704
|
+
"route-exit affordance receipt present",
|
|
705
|
+
"affordance receipt missing"
|
|
706
|
+
);
|
|
707
|
+
}
|
|
678
708
|
if (text.includes("retry") || text.includes("repair") || text.includes("reset") || text.includes("affordance")) {
|
|
679
709
|
return profileReceiptSignalStatus(hasStateContract || clickCount > 0, "affordance or transition receipt present", "affordance receipt missing");
|
|
680
710
|
}
|
|
@@ -753,9 +783,31 @@ function profilePackMetadataMarkdown(result) {
|
|
|
753
783
|
].filter(Boolean);
|
|
754
784
|
if (packParts.length) lines.push(`- pack: ${packParts.join(" - ")}`);
|
|
755
785
|
if (requiredReceipts.length) {
|
|
786
|
+
const receiptStatuses = requiredReceipts.map((receipt) => ({
|
|
787
|
+
receipt,
|
|
788
|
+
item: profilePackReceiptStatus(result, metadata, receipt)
|
|
789
|
+
}));
|
|
790
|
+
const missingReceipts = receiptStatuses.filter(({ item }) => item.status === "missing").map(({ receipt }) => receipt);
|
|
791
|
+
const failedReceipts = receiptStatuses.filter(({ item }) => item.status === "failed").map(({ receipt }) => receipt);
|
|
792
|
+
const manualCount = receiptStatuses.filter(({ item }) => item.status === "manual").length;
|
|
793
|
+
const presentCount = receiptStatuses.filter(({ item }) => item.status === "present").length;
|
|
794
|
+
const completenessParts = [
|
|
795
|
+
`${presentCount} present`,
|
|
796
|
+
manualCount ? `${manualCount} manual` : "",
|
|
797
|
+
missingReceipts.length ? `${missingReceipts.length} missing` : "",
|
|
798
|
+
failedReceipts.length ? `${failedReceipts.length} failed` : ""
|
|
799
|
+
].filter(Boolean);
|
|
800
|
+
lines.push(`- pack completeness: ${missingReceipts.length || failedReceipts.length ? "incomplete" : "complete"} (${completenessParts.join(", ")})`);
|
|
801
|
+
if (missingReceipts.length) {
|
|
802
|
+
const listed = missingReceipts.slice(0, 5).map((receipt) => markdownInlineCode(receipt, 120)).join(", ");
|
|
803
|
+
lines.push(`- missing required receipts: ${listed}${missingReceipts.length > 5 ? `, ${missingReceipts.length - 5} more` : ""}`);
|
|
804
|
+
}
|
|
805
|
+
if (failedReceipts.length) {
|
|
806
|
+
const listed = failedReceipts.slice(0, 5).map((receipt) => markdownInlineCode(receipt, 120)).join(", ");
|
|
807
|
+
lines.push(`- failed required receipts: ${listed}${failedReceipts.length > 5 ? `, ${failedReceipts.length - 5} more` : ""}`);
|
|
808
|
+
}
|
|
756
809
|
lines.push(`- required receipts: ${requiredReceipts.length}`);
|
|
757
|
-
for (const receipt of
|
|
758
|
-
const item = profilePackReceiptStatus(result, metadata, receipt);
|
|
810
|
+
for (const { receipt, item } of receiptStatuses.slice(0, 20)) {
|
|
759
811
|
lines.push(` - ${item.status}: ${receipt} (${item.reason})`);
|
|
760
812
|
}
|
|
761
813
|
if (requiredReceipts.length > 20) lines.push(` - ${requiredReceipts.length - 20} additional required receipt(s) omitted.`);
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"label": "capture-route-active-state",
|
|
22
22
|
"timeout_ms": 10000,
|
|
23
23
|
"store_return_to": "__rpRouteExit.active",
|
|
24
|
-
"script": "const proof=window.__exampleRouteProof?.read?.()||{};const watched=['__exampleRouteProof','__exampleProofLastReceipt','exampleTouchState'];const activeGlobals=watched.filter((name)=>
|
|
24
|
+
"script": "const proof=window.__exampleRouteProof?.read?.()||{};const watched=['__exampleRouteProof','__exampleProofLastReceipt','exampleTouchState'];const activeGlobals=watched.filter((name)=>window[name]!==undefined);const out={ready:proof.ready===true,route:location.pathname,activeGlobals,activeGlobalCount:activeGlobals.length,receiptId:String(proof.receiptId||''),mode:String(proof.mode||'')};out.ok=out.ready===true&&out.activeGlobalCount>0;window.__rpRouteExit={...(window.__rpRouteExit||{}),active:out};return out;",
|
|
25
25
|
"return_summary_fields": [
|
|
26
26
|
{ "path": "ok" },
|
|
27
27
|
{ "path": "ready" },
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"label": "capture-route-exit-cleanup",
|
|
40
40
|
"timeout_ms": 10000,
|
|
41
41
|
"store_return_to": "__rpRouteExit.cleanup",
|
|
42
|
-
"script": "const watched=['__exampleRouteProof','__exampleProofLastReceipt','exampleTouchState'];const staleNames=watched.filter((name)=>
|
|
42
|
+
"script": "const watched=['__exampleRouteProof','__exampleProofLastReceipt','exampleTouchState'];const staleNames=watched.filter((name)=>window[name]!==undefined);const out={ok:location.pathname==='/'&&staleNames.length===0,route:location.pathname,staleNames,staleCount:staleNames.length};window.__rpRouteExit={...(window.__rpRouteExit||{}),cleanup:out};return out;",
|
|
43
43
|
"return_summary_fields": [
|
|
44
44
|
{ "path": "ok" },
|
|
45
45
|
{ "path": "route" },
|