@riddledc/riddle-proof 0.8.59 → 0.8.61
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/adapters/codex-exec-agent.d.cts +1 -0
- package/dist/adapters/codex-exec-agent.d.ts +1 -0
- package/dist/adapters/codex-exec-agent.js +3 -2
- package/dist/adapters/codex.d.cts +1 -0
- package/dist/adapters/codex.d.ts +1 -0
- package/dist/adapters/codex.js +3 -2
- package/dist/adapters/local-agent.d.cts +1 -0
- package/dist/adapters/local-agent.d.ts +1 -0
- package/dist/adapters/local-agent.js +3 -2
- package/dist/adapters/openclaw.d.cts +1 -0
- package/dist/adapters/openclaw.d.ts +1 -0
- package/dist/adapters/openclaw.js +6 -5
- package/dist/advanced/engine-harness.cjs +299 -43
- package/dist/advanced/engine-harness.d.cts +1 -0
- package/dist/advanced/engine-harness.d.ts +1 -0
- package/dist/advanced/engine-harness.js +6 -5
- package/dist/advanced/index.cjs +299 -43
- package/dist/advanced/index.d.cts +1 -0
- package/dist/advanced/index.d.ts +1 -0
- package/dist/advanced/index.js +7 -6
- package/dist/advanced/runner.cjs +202 -4
- package/dist/advanced/runner.d.cts +1 -0
- package/dist/advanced/runner.d.ts +1 -0
- package/dist/advanced/runner.js +6 -5
- package/dist/checkpoint.d.cts +1 -0
- package/dist/checkpoint.d.ts +1 -0
- package/dist/checkpoint.js +3 -2
- package/dist/{chunk-TTB3ZAVX.js → chunk-3FK5HZHK.js} +2 -2
- package/dist/{chunk-MOTQNIZX.js → chunk-FX2CB4MG.js} +1 -1
- package/dist/{chunk-GHBNDHG7.js → chunk-HD46EEUV.js} +50 -4
- package/dist/{chunk-2PKBTYOA.js → chunk-K6VYKOIM.js} +9 -4
- package/dist/{chunk-XSNMMAPJ.js → chunk-NQ5HPAZD.js} +4 -4
- package/dist/{chunk-KNPCWWF3.js → chunk-NXEAFQYZ.js} +16 -10
- package/dist/{chunk-CUBYSWZT.js → chunk-QGMSN34W.js} +51 -4
- package/dist/{chunk-RS4HJLJQ.js → chunk-QPKY767W.js} +1 -1
- package/dist/{chunk-UZIX7M7D.js → chunk-UEY5SJG5.js} +13 -9
- package/dist/{chunk-KG64Y5MC.js → chunk-WKIIJX3O.js} +12 -0
- package/dist/{chunk-JLOZTVXU.js → chunk-XKNJ5OE4.js} +2 -2
- package/dist/cli/index.js +9 -9
- package/dist/cli.cjs +512 -405
- package/dist/cli.js +9 -9
- package/dist/codex-exec-agent.d.cts +1 -0
- package/dist/codex-exec-agent.d.ts +1 -0
- package/dist/codex-exec-agent.js +3 -2
- package/dist/diagnostics.d.cts +1 -0
- package/dist/diagnostics.d.ts +1 -0
- package/dist/engine-harness.cjs +299 -43
- package/dist/engine-harness.d.cts +1 -0
- package/dist/engine-harness.d.ts +1 -0
- package/dist/engine-harness.js +6 -5
- package/dist/index.cjs +287 -170
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +21 -11
- package/dist/local-agent.d.cts +1 -0
- package/dist/local-agent.d.ts +1 -0
- package/dist/local-agent.js +3 -2
- package/dist/openclaw.d.cts +1 -0
- package/dist/openclaw.d.ts +1 -0
- package/dist/openclaw.js +6 -5
- package/dist/pr-comment.cjs +15 -3
- package/dist/pr-comment.js +2 -2
- package/dist/profile/index.d.cts +1 -0
- package/dist/profile/index.d.ts +1 -0
- package/dist/profile.d.cts +1 -0
- package/dist/profile.d.ts +1 -0
- package/dist/proof-session.d.cts +1 -0
- package/dist/proof-session.d.ts +1 -0
- package/dist/public-state.cjs +15 -0
- package/dist/public-state.d.cts +4 -1
- package/dist/public-state.d.ts +4 -1
- package/dist/public-state.js +7 -1
- package/dist/result.cjs +211 -4
- package/dist/result.d.cts +12 -1
- package/dist/result.d.ts +12 -1
- package/dist/result.js +6 -1
- package/dist/run-card.cjs +198 -40
- package/dist/run-card.d.cts +1 -0
- package/dist/run-card.d.ts +1 -0
- package/dist/run-card.js +4 -3
- package/dist/runner.cjs +202 -4
- package/dist/runner.d.cts +1 -0
- package/dist/runner.d.ts +1 -0
- package/dist/runner.js +6 -5
- package/dist/spec/checkpoint.d.cts +1 -0
- package/dist/spec/checkpoint.d.ts +1 -0
- package/dist/spec/checkpoint.js +3 -2
- package/dist/spec/index.cjs +235 -167
- package/dist/spec/index.d.cts +2 -2
- package/dist/spec/index.d.ts +2 -2
- package/dist/spec/index.js +17 -7
- package/dist/spec/public-state.cjs +15 -0
- package/dist/spec/public-state.d.cts +1 -1
- package/dist/spec/public-state.d.ts +1 -1
- package/dist/spec/public-state.js +7 -1
- package/dist/spec/result.cjs +209 -4
- package/dist/spec/result.d.cts +2 -1
- package/dist/spec/result.d.ts +2 -1
- package/dist/spec/result.js +6 -1
- package/dist/spec/run-card.cjs +198 -40
- package/dist/spec/run-card.d.cts +1 -0
- package/dist/spec/run-card.d.ts +1 -0
- package/dist/spec/run-card.js +4 -3
- package/dist/spec/state.cjs +207 -45
- package/dist/spec/state.d.cts +1 -0
- package/dist/spec/state.d.ts +1 -0
- package/dist/spec/state.js +5 -4
- package/dist/spec/types.d.cts +1 -0
- package/dist/spec/types.d.ts +1 -0
- package/dist/state.cjs +207 -45
- package/dist/state.d.cts +1 -0
- package/dist/state.d.ts +1 -0
- package/dist/state.js +5 -4
- package/dist/types.d.cts +14 -0
- package/dist/types.d.ts +14 -0
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -1609,7 +1609,7 @@ function normalizeStageRequest(state, requestedAdvanceStage) {
|
|
|
1609
1609
|
if (!state?.recon_results || ["needs_agent_decision", "needs_supervisor_judgment"].includes(state?.recon_status || "")) return "recon";
|
|
1610
1610
|
return null;
|
|
1611
1611
|
}
|
|
1612
|
-
function
|
|
1612
|
+
function stringValue2(value) {
|
|
1613
1613
|
return typeof value === "string" && value.trim() ? value.trim() : "";
|
|
1614
1614
|
}
|
|
1615
1615
|
function commandResult(command, args, cwd, timeout = 6e4) {
|
|
@@ -1632,7 +1632,7 @@ function repoDirForSync(state) {
|
|
|
1632
1632
|
state?.repo_dir,
|
|
1633
1633
|
state?.after_worktree,
|
|
1634
1634
|
state?.before_worktree
|
|
1635
|
-
].map(
|
|
1635
|
+
].map(stringValue2).filter(Boolean);
|
|
1636
1636
|
return candidates.find((candidate) => (0, import_node_fs2.existsSync)(import_node_path2.default.join(candidate, ".git"))) || "";
|
|
1637
1637
|
}
|
|
1638
1638
|
function parseWorktreeList(output) {
|
|
@@ -1752,32 +1752,32 @@ function baseCheckoutReport(repoDir, baseBranch, updateRequested, updateAllowed)
|
|
|
1752
1752
|
return report;
|
|
1753
1753
|
}
|
|
1754
1754
|
function normalizeGhPrStatus(value) {
|
|
1755
|
-
const status =
|
|
1755
|
+
const status = stringValue2(value).toLowerCase();
|
|
1756
1756
|
if (status === "merged") return "merged";
|
|
1757
1757
|
if (status === "open") return "open";
|
|
1758
1758
|
if (status === "closed") return "closed";
|
|
1759
1759
|
return status || "unknown";
|
|
1760
1760
|
}
|
|
1761
1761
|
function prRefFromState(state) {
|
|
1762
|
-
return
|
|
1762
|
+
return stringValue2(state?.pr_number) || stringValue2(state?.pr_url);
|
|
1763
1763
|
}
|
|
1764
1764
|
function prNumberFromUrl(url) {
|
|
1765
1765
|
const match = url.match(/\/pull\/(\d+)(?:$|[?#])/);
|
|
1766
1766
|
return match?.[1] || "";
|
|
1767
1767
|
}
|
|
1768
1768
|
function normalizePrState(raw, state, checkedAt = (/* @__PURE__ */ new Date()).toISOString()) {
|
|
1769
|
-
const mergeCommit = typeof raw?.mergeCommit === "object" && raw.mergeCommit ?
|
|
1770
|
-
const url =
|
|
1769
|
+
const mergeCommit = typeof raw?.mergeCommit === "object" && raw.mergeCommit ? stringValue2(raw.mergeCommit.oid) : stringValue2(raw?.mergeCommit);
|
|
1770
|
+
const url = stringValue2(raw?.url) || stringValue2(state?.pr_url);
|
|
1771
1771
|
return {
|
|
1772
1772
|
status: normalizeGhPrStatus(raw?.state),
|
|
1773
1773
|
pr_url: url || null,
|
|
1774
1774
|
pr_number: String(raw?.number || state?.pr_number || prNumberFromUrl(url) || ""),
|
|
1775
|
-
repo:
|
|
1776
|
-
head_branch:
|
|
1777
|
-
base_branch:
|
|
1775
|
+
repo: stringValue2(state?.repo) || null,
|
|
1776
|
+
head_branch: stringValue2(raw?.headRefName) || stringValue2(state?.target_branch) || stringValue2(state?.branch) || null,
|
|
1777
|
+
base_branch: stringValue2(raw?.baseRefName) || stringValue2(state?.base_branch) || "main",
|
|
1778
1778
|
merge_commit: mergeCommit || null,
|
|
1779
|
-
merged_at:
|
|
1780
|
-
closed_at:
|
|
1779
|
+
merged_at: stringValue2(raw?.mergedAt) || null,
|
|
1780
|
+
closed_at: stringValue2(raw?.closedAt) || null,
|
|
1781
1781
|
checked_at: checkedAt,
|
|
1782
1782
|
source: "gh"
|
|
1783
1783
|
};
|
|
@@ -1794,7 +1794,7 @@ function cleanupMergedProofRun(state, repoDir, params, prState) {
|
|
|
1794
1794
|
branch_delete_errors: [],
|
|
1795
1795
|
pruned: false
|
|
1796
1796
|
};
|
|
1797
|
-
const baseBranch =
|
|
1797
|
+
const baseBranch = stringValue2(prState.base_branch) || stringValue2(state?.base_branch) || "main";
|
|
1798
1798
|
let fetchedBase = params.fetch_base === false;
|
|
1799
1799
|
if (params.fetch_base !== false && baseBranch) {
|
|
1800
1800
|
const fetch2 = commandResult("git", ["fetch", "origin", baseBranch], repoDir, 12e4);
|
|
@@ -1812,7 +1812,7 @@ function cleanupMergedProofRun(state, repoDir, params, prState) {
|
|
|
1812
1812
|
}
|
|
1813
1813
|
const removed = [];
|
|
1814
1814
|
const removeErrors = [];
|
|
1815
|
-
for (const candidate of [state?.before_worktree, state?.after_worktree].map(
|
|
1815
|
+
for (const candidate of [state?.before_worktree, state?.after_worktree].map(stringValue2).filter(Boolean)) {
|
|
1816
1816
|
if (!(0, import_node_fs2.existsSync)(candidate) || import_node_path2.default.resolve(candidate) === import_node_path2.default.resolve(repoDir)) continue;
|
|
1817
1817
|
const remove = commandResult("git", ["worktree", "remove", "--force", candidate], repoDir, 12e4);
|
|
1818
1818
|
if (remove.ok) {
|
|
@@ -1823,7 +1823,7 @@ function cleanupMergedProofRun(state, repoDir, params, prState) {
|
|
|
1823
1823
|
}
|
|
1824
1824
|
cleanup.worktrees_removed = removed;
|
|
1825
1825
|
cleanup.worktree_remove_errors = removeErrors;
|
|
1826
|
-
const afterBranch =
|
|
1826
|
+
const afterBranch = stringValue2(state?.after_worktree_branch);
|
|
1827
1827
|
if (afterBranch.startsWith("riddle-proof/")) {
|
|
1828
1828
|
const deleted = commandResult("git", ["branch", "-D", afterBranch], repoDir, 6e4);
|
|
1829
1829
|
if (deleted.ok) {
|
|
@@ -1859,7 +1859,7 @@ function syncPrLifecycle(statePath, params) {
|
|
|
1859
1859
|
const prState2 = {
|
|
1860
1860
|
status: missingPr ? "orphaned" : "unavailable",
|
|
1861
1861
|
pr_url: state.pr_url || null,
|
|
1862
|
-
pr_number: String(state.pr_number || prNumberFromUrl(
|
|
1862
|
+
pr_number: String(state.pr_number || prNumberFromUrl(stringValue2(state.pr_url)) || ""),
|
|
1863
1863
|
repo: state.repo || null,
|
|
1864
1864
|
head_branch: state.target_branch || state.branch || null,
|
|
1865
1865
|
base_branch: state.base_branch || "main",
|
|
@@ -1888,7 +1888,7 @@ function syncPrLifecycle(statePath, params) {
|
|
|
1888
1888
|
const prState2 = {
|
|
1889
1889
|
status: "unavailable",
|
|
1890
1890
|
pr_url: state.pr_url || null,
|
|
1891
|
-
pr_number: String(state.pr_number || prNumberFromUrl(
|
|
1891
|
+
pr_number: String(state.pr_number || prNumberFromUrl(stringValue2(state.pr_url)) || ""),
|
|
1892
1892
|
repo: state.repo || null,
|
|
1893
1893
|
head_branch: state.target_branch || state.branch || null,
|
|
1894
1894
|
base_branch: state.base_branch || "main",
|
|
@@ -2669,8 +2669,8 @@ ${implementRes.stdout || ""}
|
|
|
2669
2669
|
${implementRes.stderr || ""}`;
|
|
2670
2670
|
if (implementError.includes("No implementation detected")) {
|
|
2671
2671
|
const implementationState = readState(config.statePath) || {};
|
|
2672
|
-
const implementationSummary =
|
|
2673
|
-
const implementationDetectionSummary =
|
|
2672
|
+
const implementationSummary = stringValue2(implementationState?.implementation_summary) || null;
|
|
2673
|
+
const implementationDetectionSummary = stringValue2(implementationState?.implementation_detection_summary) || null;
|
|
2674
2674
|
const implementationDetection = implementationState?.implementation_detection && typeof implementationState.implementation_detection === "object" && !Array.isArray(implementationState.implementation_detection) ? implementationState.implementation_detection : null;
|
|
2675
2675
|
recordAttempt("implement", "checkpoint", "Implementation checkpoint found no material code changes yet.", {
|
|
2676
2676
|
checkpoint: "implement_changes_missing",
|
|
@@ -2788,14 +2788,14 @@ ${implementRes.stderr || ""}`;
|
|
|
2788
2788
|
const captureQuality = verifyDecisionRequest2?.capture_quality || {};
|
|
2789
2789
|
const conclusiveVerifyBlockers2 = proofAssessmentHardBlockersForState({
|
|
2790
2790
|
...failedVerifyState,
|
|
2791
|
-
structured_interaction_capture_failure_summary:
|
|
2792
|
-
structured_interaction_failure_summary:
|
|
2791
|
+
structured_interaction_capture_failure_summary: stringValue2(verifyDecisionRequest2?.structured_interaction_capture_failure_summary) || stringValue2(failedVerifyState?.structured_interaction_capture_failure_summary) || void 0,
|
|
2792
|
+
structured_interaction_failure_summary: stringValue2(verifyDecisionRequest2?.structured_interaction_failure_summary) || stringValue2(failedVerifyState?.structured_interaction_failure_summary) || void 0
|
|
2793
2793
|
});
|
|
2794
|
-
const structuredInteractionFailureSummary2 =
|
|
2794
|
+
const structuredInteractionFailureSummary2 = stringValue2(verifyDecisionRequest2?.structured_interaction_capture_failure_summary) || stringValue2(verifyDecisionRequest2?.structured_interaction_failure_summary) || stringValue2(failedVerifyState?.structured_interaction_capture_failure_summary) || stringValue2(failedVerifyState?.structured_interaction_failure_summary) || stringValue2(conclusiveVerifyBlockers2[0]);
|
|
2795
2795
|
const captureTerminalBlocker = failedVerifyStatus === "capture_error" || conclusiveVerifyBlockers2.length > 0 || Boolean(structuredInteractionFailureSummary2) || captureQuality?.terminal_blocker === true || captureQuality?.blocking === true;
|
|
2796
|
-
const terminalCaptureQualitySummary = captureQuality?.terminal_blocker === true || captureQuality?.blocking === true ?
|
|
2796
|
+
const terminalCaptureQualitySummary = captureQuality?.terminal_blocker === true || captureQuality?.blocking === true ? stringValue2(captureQuality?.summary) : "";
|
|
2797
2797
|
const checkpointName = captureTerminalBlocker ? "verify_capture_blocked" : "verify_capture_retry";
|
|
2798
|
-
const summary = terminalCaptureQualitySummary || structuredInteractionFailureSummary2 ||
|
|
2798
|
+
const summary = terminalCaptureQualitySummary || structuredInteractionFailureSummary2 || stringValue2(verifyDecisionRequest2?.summary) || stringValue2(failedVerifyState?.verify_summary) || stringValue2(failedVerifyState?.proof_summary) || stringValue2(verifyRes.error) || "Verify capture failed before the evidence could be judged.";
|
|
2799
2799
|
const failedVerifyDetails = {
|
|
2800
2800
|
executed,
|
|
2801
2801
|
verifyStatus: failedVerifyStatus,
|
|
@@ -2873,10 +2873,10 @@ ${implementRes.stderr || ""}`;
|
|
|
2873
2873
|
};
|
|
2874
2874
|
const conclusiveVerifyBlockers = proofAssessmentHardBlockersForState({
|
|
2875
2875
|
...state,
|
|
2876
|
-
structured_interaction_capture_failure_summary:
|
|
2877
|
-
structured_interaction_failure_summary:
|
|
2876
|
+
structured_interaction_capture_failure_summary: stringValue2(verifyDecisionRequest?.structured_interaction_capture_failure_summary) || stringValue2(state?.structured_interaction_capture_failure_summary) || void 0,
|
|
2877
|
+
structured_interaction_failure_summary: stringValue2(verifyDecisionRequest?.structured_interaction_failure_summary) || stringValue2(state?.structured_interaction_failure_summary) || void 0
|
|
2878
2878
|
});
|
|
2879
|
-
const structuredInteractionFailureSummary =
|
|
2879
|
+
const structuredInteractionFailureSummary = stringValue2(verifyDecisionRequest?.structured_interaction_capture_failure_summary) || stringValue2(verifyDecisionRequest?.structured_interaction_failure_summary) || stringValue2(state?.structured_interaction_capture_failure_summary) || stringValue2(state?.structured_interaction_failure_summary) || stringValue2(conclusiveVerifyBlockers[0]);
|
|
2880
2880
|
if (verifyStatus !== "evidence_captured") {
|
|
2881
2881
|
const captureQuality = verifyDecisionRequest?.capture_quality || {};
|
|
2882
2882
|
const captureTerminalBlocker = conclusiveVerifyBlockers.length > 0 || Boolean(structuredInteractionFailureSummary) || captureQuality?.terminal_blocker === true || captureQuality?.blocking === true;
|
|
@@ -2888,9 +2888,9 @@ ${implementRes.stderr || ""}`;
|
|
|
2888
2888
|
});
|
|
2889
2889
|
state = readState(config.statePath);
|
|
2890
2890
|
}
|
|
2891
|
-
const terminalCaptureQualitySummary = captureQuality?.terminal_blocker === true || captureQuality?.blocking === true ?
|
|
2891
|
+
const terminalCaptureQualitySummary = captureQuality?.terminal_blocker === true || captureQuality?.blocking === true ? stringValue2(captureQuality?.summary) : "";
|
|
2892
2892
|
const checkpointName = captureTerminalBlocker ? "verify_capture_blocked" : "verify_capture_retry";
|
|
2893
|
-
const summary = terminalCaptureQualitySummary || structuredInteractionFailureSummary ||
|
|
2893
|
+
const summary = terminalCaptureQualitySummary || structuredInteractionFailureSummary || stringValue2(proofAssessment.summary) || "Verify ran, but the proof packet still needs internal capture-plan work before it should ship.";
|
|
2894
2894
|
recordAttempt("verify", "checkpoint", summary, {
|
|
2895
2895
|
autoApproved: verifyRes.autoApproved || false,
|
|
2896
2896
|
checkpoint: checkpointName,
|
|
@@ -3415,6 +3415,167 @@ var import_node_fs3 = require("fs");
|
|
|
3415
3415
|
var import_node_path3 = __toESM(require("path"), 1);
|
|
3416
3416
|
var import_node_crypto3 = __toESM(require("crypto"), 1);
|
|
3417
3417
|
|
|
3418
|
+
// src/public-state.ts
|
|
3419
|
+
function riddleProofPublicStateAllowsClaim(summary, claim) {
|
|
3420
|
+
return !summary?.prohibited_claims.includes(claim);
|
|
3421
|
+
}
|
|
3422
|
+
function riddleProofPublicStateAllowsMergeRecommendation(summary) {
|
|
3423
|
+
return riddleProofPublicStateAllowsClaim(summary, "merge_ready") && riddleProofPublicStateAllowsClaim(summary, "sync_allowed");
|
|
3424
|
+
}
|
|
3425
|
+
function riddleProofPublicStateMergeRecommendation(summary, recommendation) {
|
|
3426
|
+
return recommendation && riddleProofPublicStateAllowsMergeRecommendation(summary) ? recommendation : void 0;
|
|
3427
|
+
}
|
|
3428
|
+
function asRecord(value) {
|
|
3429
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
3430
|
+
}
|
|
3431
|
+
function stringValue(value) {
|
|
3432
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
3433
|
+
}
|
|
3434
|
+
function booleanValue(value) {
|
|
3435
|
+
return typeof value === "boolean" ? value : void 0;
|
|
3436
|
+
}
|
|
3437
|
+
function numberValue(value) {
|
|
3438
|
+
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
3439
|
+
}
|
|
3440
|
+
function firstStringValue(...values) {
|
|
3441
|
+
for (const value of values) {
|
|
3442
|
+
const text = stringValue(value);
|
|
3443
|
+
if (text) return text;
|
|
3444
|
+
}
|
|
3445
|
+
return void 0;
|
|
3446
|
+
}
|
|
3447
|
+
function firstBooleanValue(...values) {
|
|
3448
|
+
for (const value of values) {
|
|
3449
|
+
const bool = booleanValue(value);
|
|
3450
|
+
if (typeof bool === "boolean") return bool;
|
|
3451
|
+
}
|
|
3452
|
+
return void 0;
|
|
3453
|
+
}
|
|
3454
|
+
function firstRecordValue(...values) {
|
|
3455
|
+
for (const value of values) {
|
|
3456
|
+
const record = asRecord(value);
|
|
3457
|
+
if (Object.keys(record).length) return record;
|
|
3458
|
+
}
|
|
3459
|
+
return void 0;
|
|
3460
|
+
}
|
|
3461
|
+
function countValue(value) {
|
|
3462
|
+
const number = numberValue(value);
|
|
3463
|
+
return typeof number === "number" && number > 0 ? Math.trunc(number) : 0;
|
|
3464
|
+
}
|
|
3465
|
+
function checkpointSummaryFrom(...values) {
|
|
3466
|
+
const record = firstRecordValue(...values);
|
|
3467
|
+
if (!record) return void 0;
|
|
3468
|
+
const accepted = countValue(record.response_count);
|
|
3469
|
+
const rejected = countValue(record.rejected_response_count);
|
|
3470
|
+
const ignored = countValue(record.ignored_response_count);
|
|
3471
|
+
const duplicate = countValue(record.duplicate_response_count);
|
|
3472
|
+
const summary = {
|
|
3473
|
+
pending: booleanValue(record.pending),
|
|
3474
|
+
accepted_response_count: accepted,
|
|
3475
|
+
rejected_response_count: rejected,
|
|
3476
|
+
ignored_response_count: ignored,
|
|
3477
|
+
duplicate_response_count: duplicate,
|
|
3478
|
+
latest_decision: stringValue(record.latest_decision),
|
|
3479
|
+
audit_disclosure_required: rejected > 0 || ignored > 0 || duplicate > 0
|
|
3480
|
+
};
|
|
3481
|
+
return Object.values(summary).some((value) => typeof value !== "undefined") ? summary : void 0;
|
|
3482
|
+
}
|
|
3483
|
+
function uniqueStrings(values) {
|
|
3484
|
+
return [...new Set(values.filter(Boolean))];
|
|
3485
|
+
}
|
|
3486
|
+
function summarizeRiddleProofPublicState(input) {
|
|
3487
|
+
const record = asRecord(input);
|
|
3488
|
+
const runCard = asRecord(record.run_card);
|
|
3489
|
+
const stopCondition = asRecord(runCard.stop_condition);
|
|
3490
|
+
const raw = asRecord(record.raw);
|
|
3491
|
+
const request = asRecord(record.request);
|
|
3492
|
+
const requestMetadata = asRecord(record.request_metadata);
|
|
3493
|
+
const prState = asRecord(record.pr_state);
|
|
3494
|
+
const handoff = asRecord(record.pr_handoff_policy);
|
|
3495
|
+
const handoffState = stringValue(handoff.state);
|
|
3496
|
+
const status = firstStringValue(record.status, stopCondition.status);
|
|
3497
|
+
const ok = booleanValue(record.ok) ?? null;
|
|
3498
|
+
const shipMode = firstStringValue(request.ship_mode, requestMetadata.ship_mode, record.ship_mode, handoff.ship_mode);
|
|
3499
|
+
const explicitShippingDisabled = firstBooleanValue(
|
|
3500
|
+
record.shipping_disabled,
|
|
3501
|
+
stopCondition.shipping_disabled,
|
|
3502
|
+
raw.shipping_disabled,
|
|
3503
|
+
handoff.shipping_disabled
|
|
3504
|
+
);
|
|
3505
|
+
const shippingDisabled = explicitShippingDisabled === true || shipMode === "none" || handoffState === "proof_complete_ship_disabled";
|
|
3506
|
+
const explicitShipAuthorized = firstBooleanValue(
|
|
3507
|
+
record.ship_authorized,
|
|
3508
|
+
stopCondition.ship_authorized,
|
|
3509
|
+
raw.ship_authorized
|
|
3510
|
+
);
|
|
3511
|
+
const authorizationEvidence = Boolean(
|
|
3512
|
+
status === "shipped" || record.marked_ready === true || stringValue(prState.status) === "merged" || record.merge_commit || record.merged_at
|
|
3513
|
+
);
|
|
3514
|
+
const shipAuthorizedBeforeHold = explicitShipAuthorized ?? authorizationEvidence;
|
|
3515
|
+
const explicitShipHeld = firstBooleanValue(record.ship_held, stopCondition.ship_held, raw.ship_held);
|
|
3516
|
+
const inferredHeld = status === "ready_to_ship" && shippingDisabled && !shipAuthorizedBeforeHold;
|
|
3517
|
+
const shipHeld = explicitShipHeld === true || inferredHeld;
|
|
3518
|
+
const shipAuthorized = shipHeld ? false : shipAuthorizedBeforeHold === true;
|
|
3519
|
+
const proofComplete = Boolean(
|
|
3520
|
+
status === "ready_to_ship" || status === "shipped" || status === "completed" || status === "passed" || ok === true || handoff.proof_complete === true
|
|
3521
|
+
);
|
|
3522
|
+
const checkpointSummary = checkpointSummaryFrom(
|
|
3523
|
+
record.checkpoint_summary,
|
|
3524
|
+
stopCondition.checkpoint_summary,
|
|
3525
|
+
asRecord(record.details).checkpoint_summary,
|
|
3526
|
+
asRecord(raw.details).checkpoint_summary
|
|
3527
|
+
);
|
|
3528
|
+
const blockedOrWaiting = status === "blocked" || status === "failed" || status === "awaiting_checkpoint" || handoffState === "proof_blocked" || handoffState === "proof_review_required" || handoffState === "proof_failed" || handoffState === "proof_checkpoint_required";
|
|
3529
|
+
const proofPassed = Boolean(proofComplete && !blockedOrWaiting);
|
|
3530
|
+
const explicitMergeReady = firstBooleanValue(record.merge_ready, stopCondition.merge_ready, raw.merge_ready, handoff.merge_ready);
|
|
3531
|
+
const normalPrAllowed = firstBooleanValue(record.normal_pr_allowed, raw.normal_pr_allowed, handoff.normal_pr_allowed);
|
|
3532
|
+
const baseHandoffAllowed = !blockedOrWaiting && !shipHeld && !shippingDisabled;
|
|
3533
|
+
const mergeReady = baseHandoffAllowed && normalPrAllowed !== false && (explicitMergeReady ?? shipAuthorized);
|
|
3534
|
+
const syncAllowed = mergeReady;
|
|
3535
|
+
let policyState = "unknown";
|
|
3536
|
+
if (status === "awaiting_checkpoint" || handoffState === "proof_checkpoint_required") policyState = "awaiting_checkpoint";
|
|
3537
|
+
else if (status === "failed" || handoffState === "proof_failed") policyState = "proof_failed";
|
|
3538
|
+
else if (status === "blocked" || handoffState === "proof_blocked" || handoffState === "proof_review_required") policyState = "proof_blocked";
|
|
3539
|
+
else if (handoffState === "proof_complete_ship_disabled") policyState = "proof_complete_ship_disabled";
|
|
3540
|
+
else if (proofComplete && shipHeld && !shipAuthorized) policyState = "proof_passed_ship_held";
|
|
3541
|
+
else if (proofComplete && shippingDisabled && !shipAuthorized) policyState = "proof_complete_ship_disabled";
|
|
3542
|
+
else if (shipAuthorized) policyState = "ship_authorized";
|
|
3543
|
+
else if (proofPassed) policyState = "proof_passed";
|
|
3544
|
+
else if (status === "running") policyState = "proof_in_progress";
|
|
3545
|
+
const requiredDisclosures = [];
|
|
3546
|
+
if (shipHeld) requiredDisclosures.push("ship_held");
|
|
3547
|
+
if (shippingDisabled) requiredDisclosures.push("shipping_disabled");
|
|
3548
|
+
if (checkpointSummary?.audit_disclosure_required) requiredDisclosures.push("checkpoint_audit_counters");
|
|
3549
|
+
if (status === "awaiting_checkpoint" || handoffState === "proof_checkpoint_required") requiredDisclosures.push("checkpoint_required");
|
|
3550
|
+
const prohibitedClaims = [];
|
|
3551
|
+
if (!shipAuthorized || shipHeld || shippingDisabled) prohibitedClaims.push("ship_authorized", "shipped");
|
|
3552
|
+
if (!mergeReady) prohibitedClaims.push("merge_ready");
|
|
3553
|
+
if (!syncAllowed) prohibitedClaims.push("sync_allowed");
|
|
3554
|
+
if (blockedOrWaiting) {
|
|
3555
|
+
prohibitedClaims.push("proof_passed", "ready_to_ship");
|
|
3556
|
+
}
|
|
3557
|
+
if (checkpointSummary?.audit_disclosure_required) {
|
|
3558
|
+
prohibitedClaims.push("all_checkpoint_responses_accepted");
|
|
3559
|
+
}
|
|
3560
|
+
const resultLabel2 = policyState === "awaiting_checkpoint" ? "checkpoint required" : policyState === "proof_blocked" ? "blocked" : policyState === "proof_failed" ? "failed" : policyState === "proof_complete_ship_disabled" ? "proof complete; shipping disabled" : policyState === "proof_passed_ship_held" ? "proof passed; ship held" : policyState === "ship_authorized" ? status === "shipped" ? "shipped" : "ship authorized" : policyState === "proof_passed" ? "passed" : policyState === "proof_in_progress" ? "running" : status || "recorded";
|
|
3561
|
+
return {
|
|
3562
|
+
status,
|
|
3563
|
+
ok,
|
|
3564
|
+
policy_state: policyState,
|
|
3565
|
+
result_label: resultLabel2,
|
|
3566
|
+
proof_complete: proofComplete,
|
|
3567
|
+
proof_passed: proofPassed,
|
|
3568
|
+
ship_held: shipHeld,
|
|
3569
|
+
shipping_disabled: shippingDisabled,
|
|
3570
|
+
ship_authorized: shipAuthorized,
|
|
3571
|
+
merge_ready: mergeReady,
|
|
3572
|
+
sync_allowed: syncAllowed,
|
|
3573
|
+
checkpoint_summary: checkpointSummary,
|
|
3574
|
+
required_disclosures: uniqueStrings(requiredDisclosures),
|
|
3575
|
+
prohibited_claims: uniqueStrings(prohibitedClaims)
|
|
3576
|
+
};
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3418
3579
|
// src/result.ts
|
|
3419
3580
|
function isTerminalStatus(status) {
|
|
3420
3581
|
return status === "blocked" || status === "failed" || status === "ready_to_ship" || status === "shipped" || status === "completed";
|
|
@@ -3589,6 +3750,37 @@ function applyTerminalMetadata(state, metadata) {
|
|
|
3589
3750
|
if (typeof metadata.finalized === "boolean") state.finalized = metadata.finalized;
|
|
3590
3751
|
return state;
|
|
3591
3752
|
}
|
|
3753
|
+
function publicStateForRunState(input) {
|
|
3754
|
+
const state = input.state;
|
|
3755
|
+
const status = input.status || state.status;
|
|
3756
|
+
const raw = recordValue(input.raw) || {};
|
|
3757
|
+
const extendedState = state;
|
|
3758
|
+
const terminalOk = isTerminalStatus(status) ? state.ok : void 0;
|
|
3759
|
+
return summarizeRiddleProofPublicState(compactRecord({
|
|
3760
|
+
status,
|
|
3761
|
+
ok: terminalOk,
|
|
3762
|
+
request: state.request,
|
|
3763
|
+
pr_state: state.pr_state,
|
|
3764
|
+
marked_ready: state.marked_ready,
|
|
3765
|
+
ship_held: state.ship_held,
|
|
3766
|
+
shipping_disabled: state.shipping_disabled,
|
|
3767
|
+
ship_authorized: state.ship_authorized,
|
|
3768
|
+
ship_mode: state.request?.ship_mode,
|
|
3769
|
+
merge_commit: state.merge_commit,
|
|
3770
|
+
merged_at: state.merged_at,
|
|
3771
|
+
checkpoint_summary: state.checkpoint_summary,
|
|
3772
|
+
pr_handoff_policy: recordValue(extendedState.pr_handoff_policy),
|
|
3773
|
+
merge_ready: extendedState.merge_ready,
|
|
3774
|
+
normal_pr_allowed: extendedState.normal_pr_allowed,
|
|
3775
|
+
raw: Object.keys(raw).length ? raw : void 0
|
|
3776
|
+
}));
|
|
3777
|
+
}
|
|
3778
|
+
function publicMergeRecommendationForRunState(input) {
|
|
3779
|
+
return riddleProofPublicStateMergeRecommendation(
|
|
3780
|
+
publicStateForRunState(input),
|
|
3781
|
+
input.state.merge_recommendation
|
|
3782
|
+
);
|
|
3783
|
+
}
|
|
3592
3784
|
function shipControlStateFor(input) {
|
|
3593
3785
|
const state = input.state;
|
|
3594
3786
|
const status = input.status || state.status;
|
|
@@ -3637,6 +3829,11 @@ function createRunResult(input) {
|
|
|
3637
3829
|
state.ok = ok;
|
|
3638
3830
|
if (isProtectedFinalStatus(status)) state.finalized = true;
|
|
3639
3831
|
applyShipControlState(state, { status, raw: input.raw });
|
|
3832
|
+
const publicState = publicStateForRunState({ state, status, raw: input.raw });
|
|
3833
|
+
const publicMergeRecommendation = riddleProofPublicStateMergeRecommendation(
|
|
3834
|
+
publicState,
|
|
3835
|
+
state.merge_recommendation
|
|
3836
|
+
);
|
|
3640
3837
|
return compactRecord({
|
|
3641
3838
|
ok,
|
|
3642
3839
|
status,
|
|
@@ -3654,9 +3851,12 @@ function createRunResult(input) {
|
|
|
3654
3851
|
pr_state: state.pr_state,
|
|
3655
3852
|
marked_ready: state.marked_ready,
|
|
3656
3853
|
left_draft: state.left_draft,
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3854
|
+
result_label: publicState.result_label,
|
|
3855
|
+
ship_held: publicState.ship_held,
|
|
3856
|
+
shipping_disabled: publicState.shipping_disabled,
|
|
3857
|
+
ship_authorized: publicState.ship_authorized,
|
|
3858
|
+
merge_ready: publicState.merge_ready,
|
|
3859
|
+
sync_allowed: publicState.sync_allowed,
|
|
3660
3860
|
ci_status: state.ci_status,
|
|
3661
3861
|
ship_commit: state.ship_commit,
|
|
3662
3862
|
ship_remote_head: state.ship_remote_head,
|
|
@@ -3670,7 +3870,8 @@ function createRunResult(input) {
|
|
|
3670
3870
|
cleanup_report: state.cleanup_report,
|
|
3671
3871
|
notification: state.notification,
|
|
3672
3872
|
proof_decision: state.proof_decision,
|
|
3673
|
-
merge_recommendation:
|
|
3873
|
+
merge_recommendation: publicMergeRecommendation,
|
|
3874
|
+
public_state: publicState,
|
|
3674
3875
|
finalized: state.finalized,
|
|
3675
3876
|
blocker: state.blocker,
|
|
3676
3877
|
checkpoint_packet: state.checkpoint_packet,
|
|
@@ -4640,7 +4841,8 @@ function createRiddleProofRunCard(state, input = {}) {
|
|
|
4640
4841
|
const visualDelta = visualDeltaFrom({ fullRiddleState: fullState, runState: state });
|
|
4641
4842
|
const artifacts = artifactsFrom({ fullRiddleState: fullState, runState: state });
|
|
4642
4843
|
const viewportMatrix = viewportMatrixFrom({ fullRiddleState: fullState, runState: state });
|
|
4643
|
-
const
|
|
4844
|
+
const publicState = publicStateForRunState({ state, status: state.status });
|
|
4845
|
+
const publicMergeRecommendation = publicMergeRecommendationForRunState({ state, status: state.status });
|
|
4644
4846
|
return {
|
|
4645
4847
|
version: RIDDLE_PROOF_RUN_CARD_VERSION,
|
|
4646
4848
|
run_id: state.run_id || "unknown",
|
|
@@ -4694,14 +4896,18 @@ function createRiddleProofRunCard(state, input = {}) {
|
|
|
4694
4896
|
stop_condition: compactRecord({
|
|
4695
4897
|
status: state.status,
|
|
4696
4898
|
terminal: isTerminalStatus(state.status),
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4899
|
+
result_label: publicState.result_label,
|
|
4900
|
+
ship_held: publicState.ship_held,
|
|
4901
|
+
shipping_disabled: publicState.shipping_disabled,
|
|
4902
|
+
ship_authorized: publicState.ship_authorized,
|
|
4903
|
+
merge_ready: publicState.merge_ready,
|
|
4904
|
+
sync_allowed: publicState.sync_allowed,
|
|
4700
4905
|
blocker_code: state.blocker?.code || null,
|
|
4701
4906
|
blocker_message: state.blocker?.message || null,
|
|
4702
4907
|
proof_decision: state.proof_decision,
|
|
4703
|
-
merge_recommendation:
|
|
4704
|
-
monitor_should_continue: !isTerminalStatus(state.status)
|
|
4908
|
+
merge_recommendation: publicMergeRecommendation,
|
|
4909
|
+
monitor_should_continue: !isTerminalStatus(state.status),
|
|
4910
|
+
public_state: publicState
|
|
4705
4911
|
}),
|
|
4706
4912
|
updated_at: state.updated_at
|
|
4707
4913
|
};
|
|
@@ -4857,8 +5063,8 @@ function appendStageHeartbeat(state, input) {
|
|
|
4857
5063
|
function createRunStatusSnapshot(state, at = timestamp2()) {
|
|
4858
5064
|
const latestEvent = state.events[state.events.length - 1];
|
|
4859
5065
|
const runId = state.run_id || "unknown";
|
|
4860
|
-
const
|
|
4861
|
-
const existingRunCardCurrent = state.run_card?.status === state.status && state.run_card.stop_condition?.status === state.status && state.run_card.stop_condition?.terminal === isTerminalStatus(state.status) && state.run_card.stop_condition?.monitor_should_continue === !isTerminalStatus(state.status) && state.run_card.stop_condition?.ship_held ===
|
|
5066
|
+
const publicState = publicStateForRunState({ state, status: state.status });
|
|
5067
|
+
const existingRunCardCurrent = state.run_card?.status === state.status && state.run_card.stop_condition?.status === state.status && state.run_card.stop_condition?.terminal === isTerminalStatus(state.status) && state.run_card.stop_condition?.monitor_should_continue === !isTerminalStatus(state.status) && state.run_card.stop_condition?.ship_held === publicState.ship_held && state.run_card.stop_condition?.shipping_disabled === publicState.shipping_disabled && state.run_card.stop_condition?.ship_authorized === publicState.ship_authorized && state.run_card.stop_condition?.merge_ready === publicState.merge_ready && state.run_card.stop_condition?.sync_allowed === publicState.sync_allowed && state.run_card.stop_condition?.result_label === publicState.result_label;
|
|
4862
5068
|
const runCard = existingRunCardCurrent ? state.run_card : createRiddleProofRunCard(state, { at });
|
|
4863
5069
|
return compactRecord({
|
|
4864
5070
|
run_id: runId,
|
|
@@ -4872,9 +5078,13 @@ function createRunStatusSnapshot(state, at = timestamp2()) {
|
|
|
4872
5078
|
pr_url: state.pr_url ?? null,
|
|
4873
5079
|
pr_branch: state.pr_branch ?? null,
|
|
4874
5080
|
pr_state: state.pr_state,
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
5081
|
+
result_label: publicState.result_label,
|
|
5082
|
+
ship_held: publicState.ship_held,
|
|
5083
|
+
shipping_disabled: publicState.shipping_disabled,
|
|
5084
|
+
ship_authorized: publicState.ship_authorized,
|
|
5085
|
+
merge_ready: publicState.merge_ready,
|
|
5086
|
+
sync_allowed: publicState.sync_allowed,
|
|
5087
|
+
public_state: publicState,
|
|
4878
5088
|
ci_status: state.ci_status,
|
|
4879
5089
|
ship_commit: state.ship_commit,
|
|
4880
5090
|
ship_remote_head: state.ship_remote_head,
|
|
@@ -5244,6 +5454,13 @@ function proofAssessmentHardBlockers(state, payload) {
|
|
|
5244
5454
|
}
|
|
5245
5455
|
return blockers;
|
|
5246
5456
|
}
|
|
5457
|
+
function proofGateStateForCheckpointResponse(state) {
|
|
5458
|
+
const fullState = readJson(state.request.engine_state_path) || {};
|
|
5459
|
+
return compactRecord({
|
|
5460
|
+
...fullState,
|
|
5461
|
+
verification_mode: nonEmptyString(fullState.verification_mode) || state.request.verification_mode
|
|
5462
|
+
});
|
|
5463
|
+
}
|
|
5247
5464
|
function proofAssessmentContinuation(result, payload) {
|
|
5248
5465
|
const proof_assessment_json = jsonParam(payload);
|
|
5249
5466
|
return { ...baseContinuation(result), proof_assessment_json };
|
|
@@ -5790,6 +6007,45 @@ function checkpointResponseContinuation(state, value) {
|
|
|
5790
6007
|
blocker: sourceBlocker
|
|
5791
6008
|
});
|
|
5792
6009
|
}
|
|
6010
|
+
const proofGateState = proofGateStateForCheckpointResponse(state);
|
|
6011
|
+
const hardBlockers = proofAssessmentHardBlockers(proofGateState, assessment);
|
|
6012
|
+
if (proofAssessmentRequestsShip(assessment) && hardBlockers.length) {
|
|
6013
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
6014
|
+
packet,
|
|
6015
|
+
response,
|
|
6016
|
+
blocker: {
|
|
6017
|
+
code: "checkpoint_response_proof_hard_blocker",
|
|
6018
|
+
checkpoint: packet.checkpoint,
|
|
6019
|
+
message: "Riddle Proof cannot mark ready_to_ship while the proof bundle contains a hard blocker: " + hardBlockers[0],
|
|
6020
|
+
details: compactRecord({
|
|
6021
|
+
stage: packet.stage,
|
|
6022
|
+
hard_blockers: hardBlockers,
|
|
6023
|
+
proofAssessment: assessment,
|
|
6024
|
+
response
|
|
6025
|
+
})
|
|
6026
|
+
}
|
|
6027
|
+
});
|
|
6028
|
+
}
|
|
6029
|
+
const visualBlocker = proofAssessmentVisualBlocker(proofGateState, assessment);
|
|
6030
|
+
if (visualBlocker) {
|
|
6031
|
+
const recoveryAssessment = visualDeltaEvidenceRecoveryAssessment(proofGateState, assessment, visualBlocker);
|
|
6032
|
+
appendCheckpointResponse(state, response, { summary: visualBlocker });
|
|
6033
|
+
recordEvent(state, {
|
|
6034
|
+
kind: "checkpoint.response.evidence_recovery_required",
|
|
6035
|
+
checkpoint: packet.checkpoint,
|
|
6036
|
+
stage: "verify",
|
|
6037
|
+
summary: visualBlocker,
|
|
6038
|
+
details: compactRecord({
|
|
6039
|
+
evidence_collection_incomplete: true,
|
|
6040
|
+
recovery_stage: "verify",
|
|
6041
|
+
evidence_issue_code: recoveryAssessment.evidence_issue_code || null,
|
|
6042
|
+
visual_delta: recoveryAssessment.visual_delta || null,
|
|
6043
|
+
proof_assessment: recoveryAssessment,
|
|
6044
|
+
checkpoint_response_source: response.source || null
|
|
6045
|
+
})
|
|
6046
|
+
});
|
|
6047
|
+
return { next: { ...base, proof_assessment_json: jsonParam(recoveryAssessment) } };
|
|
6048
|
+
}
|
|
5793
6049
|
appendCheckpointResponse(state, response);
|
|
5794
6050
|
if (state.request.ship_mode !== "ship" && proofAssessmentRequestsShip(assessment)) {
|
|
5795
6051
|
const result = {
|
|
@@ -8314,7 +8570,7 @@ var DEFAULT_VIEWPORTS = [
|
|
|
8314
8570
|
function isRecord(value) {
|
|
8315
8571
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
8316
8572
|
}
|
|
8317
|
-
function
|
|
8573
|
+
function stringValue3(value) {
|
|
8318
8574
|
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
8319
8575
|
}
|
|
8320
8576
|
function hasOwn(value, key) {
|
|
@@ -8335,10 +8591,10 @@ function valueFromOwn(input, ...keys) {
|
|
|
8335
8591
|
}
|
|
8336
8592
|
return void 0;
|
|
8337
8593
|
}
|
|
8338
|
-
function
|
|
8594
|
+
function numberValue2(value) {
|
|
8339
8595
|
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
8340
8596
|
}
|
|
8341
|
-
function
|
|
8597
|
+
function booleanValue2(value) {
|
|
8342
8598
|
return typeof value === "boolean" ? value : void 0;
|
|
8343
8599
|
}
|
|
8344
8600
|
function horizontalBoundsOverflowPx(value) {
|
|
@@ -8380,10 +8636,10 @@ function horizontalOffenderOverflowPx(value) {
|
|
|
8380
8636
|
));
|
|
8381
8637
|
}
|
|
8382
8638
|
const rect = isRecord(value.rect || value.bounds || value.bounding_rect || value.boundingRect) ? value.rect || value.bounds || value.bounding_rect || value.boundingRect : void 0;
|
|
8383
|
-
const viewportWidth =
|
|
8639
|
+
const viewportWidth = numberValue2(value.viewport_width ?? value.viewportWidth);
|
|
8384
8640
|
if (isRecord(rect) && viewportWidth !== void 0) {
|
|
8385
|
-
const left =
|
|
8386
|
-
const right =
|
|
8641
|
+
const left = numberValue2(rect.left);
|
|
8642
|
+
const right = numberValue2(rect.right);
|
|
8387
8643
|
if (left !== void 0 && left < 0) max = Math.max(max, Math.abs(left));
|
|
8388
8644
|
if (right !== void 0 && right > viewportWidth) max = Math.max(max, right - viewportWidth);
|
|
8389
8645
|
}
|
|
@@ -8406,7 +8662,7 @@ function boundsOffendersForEvidence(value) {
|
|
|
8406
8662
|
function maxPositiveNumber(...values) {
|
|
8407
8663
|
let max = 0;
|
|
8408
8664
|
for (const value of values) {
|
|
8409
|
-
const number =
|
|
8665
|
+
const number = numberValue2(value);
|
|
8410
8666
|
if (number !== void 0 && number > max) max = number;
|
|
8411
8667
|
}
|
|
8412
8668
|
return max;
|
|
@@ -8415,7 +8671,7 @@ function roundPixels(value) {
|
|
|
8415
8671
|
return Math.round(value * 100) / 100;
|
|
8416
8672
|
}
|
|
8417
8673
|
function timeoutSecValue(value) {
|
|
8418
|
-
const number =
|
|
8674
|
+
const number = numberValue2(value);
|
|
8419
8675
|
return number && number > 0 ? Math.ceil(number) : void 0;
|
|
8420
8676
|
}
|
|
8421
8677
|
function jsonRecord(value) {
|
|
@@ -8735,9 +8991,9 @@ function profileSetupReturnSummaryFields(result) {
|
|
|
8735
8991
|
continue;
|
|
8736
8992
|
}
|
|
8737
8993
|
if (!isRecord(item)) continue;
|
|
8738
|
-
const path7 =
|
|
8994
|
+
const path7 = stringValue3(item.path) ?? stringValue3(item.key) ?? stringValue3(item.json_path) ?? stringValue3(item.jsonPath);
|
|
8739
8995
|
if (!path7) continue;
|
|
8740
|
-
const label =
|
|
8996
|
+
const label = stringValue3(item.label) ?? stringValue3(item.name) ?? stringValue3(item.title);
|
|
8741
8997
|
fields.push(label ? { path: path7, label } : { path: path7 });
|
|
8742
8998
|
}
|
|
8743
8999
|
return fields;
|
|
@@ -8867,14 +9123,14 @@ function profileSetupCanvasSignatureStableHashGroups(results) {
|
|
|
8867
9123
|
const groups = /* @__PURE__ */ new Map();
|
|
8868
9124
|
for (const receipt of profileSetupCanvasSignatureReceipts(results)) {
|
|
8869
9125
|
if (receipt.ok === false) continue;
|
|
8870
|
-
const hash =
|
|
9126
|
+
const hash = stringValue3(receipt.hash);
|
|
8871
9127
|
if (!hash) continue;
|
|
8872
|
-
const selector =
|
|
8873
|
-
const frameSelector =
|
|
9128
|
+
const selector = stringValue3(receipt.selector) || "canvas";
|
|
9129
|
+
const frameSelector = stringValue3(receipt.frame_selector);
|
|
8874
9130
|
const key = String(frameSelector || "") + "\n" + selector;
|
|
8875
9131
|
const group = groups.get(key) || { selector, frame_selector: frameSelector, receipts: [] };
|
|
8876
|
-
const ordinal =
|
|
8877
|
-
const label =
|
|
9132
|
+
const ordinal = numberValue2(receipt.ordinal);
|
|
9133
|
+
const label = stringValue3(receipt.label) || (ordinal === void 0 ? `capture-${group.receipts.length + 1}` : `#${ordinal}`);
|
|
8878
9134
|
group.receipts.push({ hash, label, ordinal });
|
|
8879
9135
|
groups.set(key, group);
|
|
8880
9136
|
}
|
|
@@ -8910,12 +9166,12 @@ function profileSetupClickSequenceReceipts(clickedItems) {
|
|
|
8910
9166
|
const nthChildTemplatePattern = /:nth-child\(\d+\)/g;
|
|
8911
9167
|
const groups = /* @__PURE__ */ new Map();
|
|
8912
9168
|
for (const item of clickedItems) {
|
|
8913
|
-
const selector =
|
|
9169
|
+
const selector = stringValue3(item.selector);
|
|
8914
9170
|
if (!selector) continue;
|
|
8915
|
-
const frameSelector =
|
|
8916
|
-
const clickCountValue =
|
|
9171
|
+
const frameSelector = stringValue3(item.frame_selector);
|
|
9172
|
+
const clickCountValue = numberValue2(item.click_count);
|
|
8917
9173
|
const clickCount = clickCountValue === void 0 ? 1 : Math.max(1, Math.min(100, Math.floor(clickCountValue)));
|
|
8918
|
-
const ordinal =
|
|
9174
|
+
const ordinal = numberValue2(item.ordinal);
|
|
8919
9175
|
const match = nthChildPattern.exec(selector);
|
|
8920
9176
|
const selectorTemplate = match ? selector.replace(nthChildTemplatePattern, ":nth-child(*)") : selector;
|
|
8921
9177
|
const valueSource = match ? "nth-child" : "same-selector";
|
|
@@ -9117,7 +9373,7 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
|
|
|
9117
9373
|
});
|
|
9118
9374
|
}
|
|
9119
9375
|
function normalizeName(value, fallback) {
|
|
9120
|
-
const name =
|
|
9376
|
+
const name = stringValue3(value) || fallback;
|
|
9121
9377
|
return name.replace(/\s+/g, " ").trim();
|
|
9122
9378
|
}
|
|
9123
9379
|
function slugifyRiddleProofProfileName(value) {
|
|
@@ -9125,8 +9381,8 @@ function slugifyRiddleProofProfileName(value) {
|
|
|
9125
9381
|
}
|
|
9126
9382
|
function normalizeViewport(input, index) {
|
|
9127
9383
|
if (!isRecord(input)) throw new Error(`target.viewports[${index}] must be an object.`);
|
|
9128
|
-
const width =
|
|
9129
|
-
const height =
|
|
9384
|
+
const width = numberValue2(input.width);
|
|
9385
|
+
const height = numberValue2(input.height);
|
|
9130
9386
|
if (!width || !height || width < 100 || height < 100) {
|
|
9131
9387
|
throw new Error(`target.viewports[${index}] requires numeric width and height >= 100.`);
|
|
9132
9388
|
}
|
|
@@ -9200,7 +9456,7 @@ function normalizeReturnSummaryFields(input, index) {
|
|
|
9200
9456
|
});
|
|
9201
9457
|
}
|
|
9202
9458
|
function normalizeSetupActionRepeat(input, index) {
|
|
9203
|
-
const repeat =
|
|
9459
|
+
const repeat = numberValue2(valueFromOwn(input, "repeat", "repeat_count", "repeatCount", "times"));
|
|
9204
9460
|
if (repeat === void 0) return void 0;
|
|
9205
9461
|
if (!Number.isInteger(repeat) || repeat < 1 || repeat > 100) {
|
|
9206
9462
|
throw new Error(`target.setup_actions[${index}].repeat must be an integer from 1 to 100.`);
|
|
@@ -9213,7 +9469,7 @@ function normalizeSetupActionClickCount(input, type, index) {
|
|
|
9213
9469
|
if (type !== "click") {
|
|
9214
9470
|
throw new Error(`target.setup_actions[${index}].click_count is only supported for click actions.`);
|
|
9215
9471
|
}
|
|
9216
|
-
const clickCount =
|
|
9472
|
+
const clickCount = numberValue2(clickCountInput);
|
|
9217
9473
|
if (clickCount === void 0 || !Number.isInteger(clickCount) || clickCount < 1 || clickCount > 10) {
|
|
9218
9474
|
throw new Error(`target.setup_actions[${index}].click_count must be an integer from 1 to 10.`);
|
|
9219
9475
|
}
|
|
@@ -9238,8 +9494,8 @@ function normalizeSetupActionPointerType(value, type, index) {
|
|
|
9238
9494
|
throw new Error(`target.setup_actions[${index}].pointer_type ${String(value)} is not supported. Supported pointer types: mouse, touch, pen.`);
|
|
9239
9495
|
}
|
|
9240
9496
|
function normalizeSetupActionScreenshotFullPage(input, type, index) {
|
|
9241
|
-
const directFullPage =
|
|
9242
|
-
const viewportOnly =
|
|
9497
|
+
const directFullPage = booleanValue2(valueFromOwn(input, "full_page", "fullPage"));
|
|
9498
|
+
const viewportOnly = booleanValue2(valueFromOwn(input, "viewport_only", "viewportOnly", "viewport_screenshot", "viewportScreenshot"));
|
|
9243
9499
|
if (type !== "screenshot") {
|
|
9244
9500
|
if (directFullPage !== void 0 || viewportOnly !== void 0 || valueFromOwn(input, "screenshot_mode", "screenshotMode", "capture_mode", "captureMode") !== void 0) {
|
|
9245
9501
|
throw new Error(`target.setup_actions[${index}].full_page is only supported for screenshot actions.`);
|
|
@@ -9282,7 +9538,7 @@ function normalizeSetupActionRandomQueue(input, index) {
|
|
|
9282
9538
|
throw new Error(`target.setup_actions[${index}].random_queue must be a non-empty array of numbers from 0 inclusive to 1 exclusive.`);
|
|
9283
9539
|
}
|
|
9284
9540
|
return rawQueue.map((item, queueIndex) => {
|
|
9285
|
-
const value =
|
|
9541
|
+
const value = numberValue2(item);
|
|
9286
9542
|
if (value === void 0 || value < 0 || value >= 1) {
|
|
9287
9543
|
throw new Error(`target.setup_actions[${index}].random_queue[${queueIndex}] must be a finite number from 0 inclusive to 1 exclusive.`);
|
|
9288
9544
|
}
|
|
@@ -9292,7 +9548,7 @@ function normalizeSetupActionRandomQueue(input, index) {
|
|
|
9292
9548
|
function normalizeSetupActionNonNegativeNumber(input, index, outputKey, ...keys) {
|
|
9293
9549
|
const rawValue = valueFromOwn(input, ...keys);
|
|
9294
9550
|
if (rawValue === void 0) return void 0;
|
|
9295
|
-
const value =
|
|
9551
|
+
const value = numberValue2(rawValue);
|
|
9296
9552
|
if (value === void 0 || value < 0) {
|
|
9297
9553
|
throw new Error(`target.setup_actions[${index}].${outputKey} must be a finite non-negative number.`);
|
|
9298
9554
|
}
|
|
@@ -9300,24 +9556,24 @@ function normalizeSetupActionNonNegativeNumber(input, index, outputKey, ...keys)
|
|
|
9300
9556
|
}
|
|
9301
9557
|
function normalizeSetupAction(input, index) {
|
|
9302
9558
|
if (!isRecord(input)) throw new Error(`target.setup_actions[${index}] must be an object.`);
|
|
9303
|
-
const type = normalizeSetupActionType(
|
|
9559
|
+
const type = normalizeSetupActionType(stringValue3(input.type), index);
|
|
9304
9560
|
const rawType = String(input.type || "").trim().replace(/-/g, "_").toLowerCase();
|
|
9305
|
-
const selector =
|
|
9561
|
+
const selector = stringValue3(input.selector);
|
|
9306
9562
|
const frameSelector = stringFromOwn(input, "frame_selector", "frameSelector", "iframe_selector", "iframeSelector");
|
|
9307
|
-
const frameIndex =
|
|
9563
|
+
const frameIndex = numberValue2(valueFromOwn(input, "frame_index", "frameIndex", "iframe_index", "iframeIndex"));
|
|
9308
9564
|
if (frameIndex !== void 0 && (!Number.isInteger(frameIndex) || frameIndex < 0)) {
|
|
9309
9565
|
throw new Error(`target.setup_actions[${index}].frame_index must be a non-negative integer.`);
|
|
9310
9566
|
}
|
|
9311
9567
|
if ((type === "click" || type === "tap" || type === "tap_until" || type === "drag" || type === "fill" || type === "set_input_value" || type === "set_range_value" || type === "canvas_signature" || type === "wait_for_selector" || type === "wait_for_text" || type === "assert_text_visible" || type === "assert_text_absent" || type === "assert_selector_count") && !selector) {
|
|
9312
9568
|
throw new Error(`target.setup_actions[${index}] ${type} requires selector.`);
|
|
9313
9569
|
}
|
|
9314
|
-
const fromX = type === "click" || type === "tap" || type === "tap_until" ?
|
|
9315
|
-
const fromY = type === "click" || type === "tap" || type === "tap_until" ?
|
|
9316
|
-
const toX =
|
|
9317
|
-
const toY =
|
|
9570
|
+
const fromX = type === "click" || type === "tap" || type === "tap_until" ? numberValue2(valueFromOwn(input, "from_x", "fromX", "x", "click_x", "clickX", "start_x", "startX", "x1")) : numberValue2(valueFromOwn(input, "from_x", "fromX", "start_x", "startX", "x1"));
|
|
9571
|
+
const fromY = type === "click" || type === "tap" || type === "tap_until" ? numberValue2(valueFromOwn(input, "from_y", "fromY", "y", "click_y", "clickY", "start_y", "startY", "y1")) : numberValue2(valueFromOwn(input, "from_y", "fromY", "start_y", "startY", "y1"));
|
|
9572
|
+
const toX = numberValue2(valueFromOwn(input, "to_x", "toX", "end_x", "endX", "x2"));
|
|
9573
|
+
const toY = numberValue2(valueFromOwn(input, "to_y", "toY", "end_y", "endY", "y2"));
|
|
9318
9574
|
const coordinateMode = normalizeSetupActionCoordinateMode(valueFromOwn(input, "coordinate_mode", "coordinateMode", "coords", "units"), index);
|
|
9319
9575
|
const pointerType = normalizeSetupActionPointerType(valueFromOwn(input, "pointer_type", "pointerType", "input_type", "inputType"), type, index);
|
|
9320
|
-
const durationMs =
|
|
9576
|
+
const durationMs = numberValue2(input.duration_ms) ?? numberValue2(input.durationMs);
|
|
9321
9577
|
const holdMs = type === "press" ? normalizeSetupActionNonNegativeNumber(input, index, "hold_ms", "hold_ms", "holdMs", "key_down_ms", "keyDownMs", "down_ms", "downMs") ?? durationMs : void 0;
|
|
9322
9578
|
if (type === "press" && holdMs !== void 0 && (holdMs < 0 || holdMs > 3e4)) {
|
|
9323
9579
|
throw new Error(`target.setup_actions[${index}].hold_ms must be a finite number from 0 to 30000.`);
|
|
@@ -9363,13 +9619,13 @@ function normalizeSetupAction(input, index) {
|
|
|
9363
9619
|
throw new Error(`target.setup_actions[${index}] drag pixel coordinates must be non-negative.`);
|
|
9364
9620
|
}
|
|
9365
9621
|
}
|
|
9366
|
-
if (type === "wait_for_text" && !
|
|
9622
|
+
if (type === "wait_for_text" && !stringValue3(input.text) && !stringValue3(input.pattern)) {
|
|
9367
9623
|
throw new Error(`target.setup_actions[${index}] wait_for_text requires text or pattern.`);
|
|
9368
9624
|
}
|
|
9369
|
-
if ((type === "assert_text_visible" || type === "assert_text_absent") && !
|
|
9625
|
+
if ((type === "assert_text_visible" || type === "assert_text_absent") && !stringValue3(input.text) && !stringValue3(input.pattern)) {
|
|
9370
9626
|
throw new Error(`target.setup_actions[${index}] ${type} requires text or pattern.`);
|
|
9371
9627
|
}
|
|
9372
|
-
const expectedCount =
|
|
9628
|
+
const expectedCount = numberValue2(input.expected_count ?? input.expectedCount ?? input.count);
|
|
9373
9629
|
if (type === "assert_selector_count" && (expectedCount === void 0 || !Number.isInteger(expectedCount) || expectedCount < 0)) {
|
|
9374
9630
|
throw new Error(`target.setup_actions[${index}] ${type} requires non-negative integer expected_count.`);
|
|
9375
9631
|
}
|
|
@@ -9381,12 +9637,12 @@ function normalizeSetupAction(input, index) {
|
|
|
9381
9637
|
const randomQueue = type === "deterministic_runtime" ? normalizeSetupActionRandomQueue(input, index) : void 0;
|
|
9382
9638
|
const deterministicNow = type === "deterministic_runtime" ? normalizeSetupActionNonNegativeNumber(input, index, "now", "now", "date_now", "dateNow", "mock_now", "mockNow", "clock", "timestamp", "time_ms", "timeMs") : void 0;
|
|
9383
9639
|
const deterministicAdvanceMs = type === "deterministic_runtime" ? normalizeSetupActionNonNegativeNumber(input, index, "advance_ms", "advance_ms", "advanceMs", "tick_ms", "tickMs", "add_ms", "addMs") : void 0;
|
|
9384
|
-
const deterministicAppend = type === "deterministic_runtime" &&
|
|
9385
|
-
const deterministicRestore = type === "deterministic_runtime" &&
|
|
9640
|
+
const deterministicAppend = type === "deterministic_runtime" && booleanValue2(valueFromOwn(input, "append", "append_random", "appendRandom")) === true;
|
|
9641
|
+
const deterministicRestore = type === "deterministic_runtime" && booleanValue2(valueFromOwn(input, "restore", "reset", "restore_originals", "restoreOriginals")) === true;
|
|
9386
9642
|
if (type === "deterministic_runtime" && randomQueue === void 0 && deterministicNow === void 0 && deterministicAdvanceMs === void 0 && !deterministicRestore) {
|
|
9387
9643
|
throw new Error(`target.setup_actions[${index}] deterministic_runtime requires random_queue, now, advance_ms, or restore.`);
|
|
9388
9644
|
}
|
|
9389
|
-
const key =
|
|
9645
|
+
const key = stringValue3(input.key);
|
|
9390
9646
|
let dialogAccept;
|
|
9391
9647
|
if (type === "dialog_response") {
|
|
9392
9648
|
const acceptInput = valueFromOwn(input, "accept", "accepted", "should_accept", "shouldAccept");
|
|
@@ -9425,13 +9681,13 @@ function normalizeSetupAction(input, index) {
|
|
|
9425
9681
|
throw new Error(`target.setup_actions[${index}] ${type} requires expected_value.`);
|
|
9426
9682
|
}
|
|
9427
9683
|
const rawExpectedValue = valueFromOwn(input, "expected_value", "expectedValue", "expected", "expect_value", "expectValue", "expect");
|
|
9428
|
-
const minValue =
|
|
9429
|
-
const maxValue =
|
|
9684
|
+
const minValue = numberValue2(valueFromOwn(input, "min_value", "minValue", "minimum", "min", "at_least", "atLeast", "gte"));
|
|
9685
|
+
const maxValue = numberValue2(valueFromOwn(input, "max_value", "maxValue", "maximum", "max", "at_most", "atMost", "lte"));
|
|
9430
9686
|
if (type === "assert_window_number") {
|
|
9431
9687
|
if (!hasExpectedValue && minValue === void 0 && maxValue === void 0) {
|
|
9432
9688
|
throw new Error(`target.setup_actions[${index}] ${type} requires expected_value, min_value, or max_value.`);
|
|
9433
9689
|
}
|
|
9434
|
-
if (hasExpectedValue &&
|
|
9690
|
+
if (hasExpectedValue && numberValue2(rawExpectedValue) === void 0) {
|
|
9435
9691
|
throw new Error(`target.setup_actions[${index}] ${type} expected_value must be a finite number.`);
|
|
9436
9692
|
}
|
|
9437
9693
|
}
|
|
@@ -9462,23 +9718,23 @@ function normalizeSetupAction(input, index) {
|
|
|
9462
9718
|
throw new Error(`target.setup_actions[${index}] ${type} requires until_expected_value.`);
|
|
9463
9719
|
}
|
|
9464
9720
|
}
|
|
9465
|
-
const maxCalls =
|
|
9721
|
+
const maxCalls = numberValue2(valueFromOwn(input, "max_calls", "maxCalls", "max_attempts", "maxAttempts", "attempts", "max_taps", "maxTaps", "tap_limit", "tapLimit"));
|
|
9466
9722
|
if ((type === "window_call_until" || type === "tap_until") && (maxCalls === void 0 || !Number.isInteger(maxCalls) || maxCalls < 1 || maxCalls > 100)) {
|
|
9467
9723
|
throw new Error(`target.setup_actions[${index}].max_calls must be an integer from 1 to 100.`);
|
|
9468
9724
|
}
|
|
9469
|
-
const tapBurstSize = type === "tap_until" ?
|
|
9725
|
+
const tapBurstSize = type === "tap_until" ? numberValue2(valueFromOwn(input, "tap_burst_size", "tapBurstSize", "burst_size", "burstSize", "check_every_taps", "checkEveryTaps", "predicate_interval_taps", "predicateIntervalTaps")) : void 0;
|
|
9470
9726
|
if (type === "tap_until" && tapBurstSize !== void 0 && (!Number.isInteger(tapBurstSize) || tapBurstSize < 1 || tapBurstSize > 100)) {
|
|
9471
9727
|
throw new Error(`target.setup_actions[${index}].tap_burst_size must be an integer from 1 to 100.`);
|
|
9472
9728
|
}
|
|
9473
|
-
const settleMs = type === "tap_until" ?
|
|
9729
|
+
const settleMs = type === "tap_until" ? numberValue2(valueFromOwn(input, "settle_ms", "settleMs", "predicate_settle_ms", "predicateSettleMs", "post_burst_wait_ms", "postBurstWaitMs", "after_burst_ms", "afterBurstMs", "settle_after_tap_ms", "settleAfterTapMs")) : void 0;
|
|
9474
9730
|
if (type === "tap_until" && settleMs !== void 0 && (!Number.isInteger(settleMs) || settleMs < 0 || settleMs > 1e4)) {
|
|
9475
9731
|
throw new Error(`target.setup_actions[${index}].settle_ms must be an integer from 0 to 10000.`);
|
|
9476
9732
|
}
|
|
9477
|
-
const intervalMs =
|
|
9733
|
+
const intervalMs = numberValue2(valueFromOwn(input, "interval_ms", "intervalMs", "poll_ms", "pollMs", "call_interval_ms", "callIntervalMs"));
|
|
9478
9734
|
if ((type === "window_call_until" || type === "tap_until") && intervalMs !== void 0 && (!Number.isInteger(intervalMs) || intervalMs < 0 || intervalMs > 5e3)) {
|
|
9479
9735
|
throw new Error(`target.setup_actions[${index}].interval_ms must be an integer from 0 to 5000.`);
|
|
9480
9736
|
}
|
|
9481
|
-
const steps =
|
|
9737
|
+
const steps = numberValue2(input.steps);
|
|
9482
9738
|
if (type === "drag" && steps !== void 0 && (!Number.isInteger(steps) || steps < 1 || steps > 100)) {
|
|
9483
9739
|
throw new Error(`target.setup_actions[${index}].steps must be an integer from 1 to 100.`);
|
|
9484
9740
|
}
|
|
@@ -9517,7 +9773,7 @@ function normalizeSetupAction(input, index) {
|
|
|
9517
9773
|
capture_return: captureReturn,
|
|
9518
9774
|
return_summary_fields: normalizeReturnSummaryFields(input, index),
|
|
9519
9775
|
compare_to: stringFromOwn(input, "compare_to", "compareTo", "previous_signature_path", "previousSignaturePath", "previous_path", "previousPath", "changed_from", "changedFrom"),
|
|
9520
|
-
expect_changed:
|
|
9776
|
+
expect_changed: booleanValue2(valueFromOwn(input, "expect_changed", "expectChanged", "should_change", "shouldChange", "changed")),
|
|
9521
9777
|
until_path: untilPath,
|
|
9522
9778
|
until_expected_value: hasUntilExpectedValue ? toJsonValue(valueFromOwn(input, "until_expected_value", "untilExpectedValue", "until_expected", "untilExpected", "until_value", "untilValue", "expected_value", "expectedValue", "expected")) : void 0,
|
|
9523
9779
|
expected_path: stringFromOwn(input, "expected_path", "expectedPath", "expected_terminal_path", "expectedTerminalPath"),
|
|
@@ -9529,18 +9785,18 @@ function normalizeSetupAction(input, index) {
|
|
|
9529
9785
|
expected_value: hasExpectedValue ? toJsonValue(rawExpectedValue) : void 0,
|
|
9530
9786
|
min_value: minValue,
|
|
9531
9787
|
max_value: maxValue,
|
|
9532
|
-
text:
|
|
9533
|
-
pattern:
|
|
9534
|
-
flags:
|
|
9788
|
+
text: stringValue3(input.text),
|
|
9789
|
+
pattern: stringValue3(input.pattern),
|
|
9790
|
+
flags: stringValue3(input.flags),
|
|
9535
9791
|
accept: dialogAccept,
|
|
9536
9792
|
prompt_text: stringFromOwn(input, "prompt_text", "promptText", "prompt_value", "promptValue"),
|
|
9537
9793
|
message_text: stringFromOwn(input, "message_text", "messageText", "dialog_text", "dialogText"),
|
|
9538
9794
|
message_pattern: stringFromOwn(input, "message_pattern", "messagePattern", "dialog_pattern", "dialogPattern"),
|
|
9539
|
-
index:
|
|
9795
|
+
index: numberValue2(valueFromOwn(input, "index", "target_index", "targetIndex")),
|
|
9540
9796
|
expected_count: expectedCount,
|
|
9541
|
-
ms:
|
|
9542
|
-
timeout_ms:
|
|
9543
|
-
after_ms:
|
|
9797
|
+
ms: numberValue2(input.ms) ?? numberValue2(input.wait_ms) ?? numberValue2(input.waitMs),
|
|
9798
|
+
timeout_ms: numberValue2(input.timeout_ms) ?? numberValue2(input.timeoutMs),
|
|
9799
|
+
after_ms: numberValue2(input.after_ms) ?? numberValue2(input.afterMs),
|
|
9544
9800
|
repeat: normalizeSetupActionRepeat(input, index),
|
|
9545
9801
|
reload: input.reload === true,
|
|
9546
9802
|
storage: normalizeSetupActionStorage(input.storage, index),
|
|
@@ -9555,7 +9811,7 @@ function normalizeSetupActions(value) {
|
|
|
9555
9811
|
return value.map(normalizeSetupAction);
|
|
9556
9812
|
}
|
|
9557
9813
|
function normalizeTargetScreenshotFullPage(input) {
|
|
9558
|
-
const directFullPage =
|
|
9814
|
+
const directFullPage = booleanValue2(valueFromOwn(
|
|
9559
9815
|
input,
|
|
9560
9816
|
"screenshot_full_page",
|
|
9561
9817
|
"screenshotFullPage",
|
|
@@ -9564,7 +9820,7 @@ function normalizeTargetScreenshotFullPage(input) {
|
|
|
9564
9820
|
"full_page_screenshots",
|
|
9565
9821
|
"fullPageScreenshots"
|
|
9566
9822
|
));
|
|
9567
|
-
const viewportOnly =
|
|
9823
|
+
const viewportOnly = booleanValue2(valueFromOwn(
|
|
9568
9824
|
input,
|
|
9569
9825
|
"viewport_screenshots",
|
|
9570
9826
|
"viewportScreenshots",
|
|
@@ -9592,20 +9848,20 @@ function normalizeTargetScreenshotFullPage(input) {
|
|
|
9592
9848
|
}
|
|
9593
9849
|
function normalizeNetworkMock(input, index) {
|
|
9594
9850
|
if (!isRecord(input)) throw new Error(`target.network_mocks[${index}] must be an object.`);
|
|
9595
|
-
const url =
|
|
9851
|
+
const url = stringValue3(input.url) || stringValue3(input.glob) || stringValue3(input.pattern);
|
|
9596
9852
|
if (!url) throw new Error(`target.network_mocks[${index}] requires url.`);
|
|
9597
9853
|
const payload = normalizeNetworkMockResponsePayload(input, `target.network_mocks[${index}]`);
|
|
9598
9854
|
const responsesInput = input.responses ?? input.sequence;
|
|
9599
9855
|
const responses = normalizeNetworkMockResponses(responsesInput, index, payload);
|
|
9600
9856
|
const requestBody = normalizeNetworkMockRequestBodyConstraints(input, `target.network_mocks[${index}]`);
|
|
9601
|
-
const requiredHitCount =
|
|
9857
|
+
const requiredHitCount = numberValue2(
|
|
9602
9858
|
input.required_hit_count ?? input.requiredHitCount ?? input.required_hits ?? input.requiredHits ?? input.min_hits ?? input.minHits
|
|
9603
9859
|
);
|
|
9604
9860
|
if (requiredHitCount !== void 0 && (!Number.isInteger(requiredHitCount) || requiredHitCount < 1)) {
|
|
9605
9861
|
throw new Error(`target.network_mocks[${index}].required_hit_count must be a positive integer.`);
|
|
9606
9862
|
}
|
|
9607
9863
|
const forbidden = input.forbidden === true || input.must_not_hit === true || input.mustNotHit === true || input.should_not_run === true || input.shouldNotRun === true;
|
|
9608
|
-
const configuredMaxHitCount =
|
|
9864
|
+
const configuredMaxHitCount = numberValue2(
|
|
9609
9865
|
input.max_hit_count ?? input.maxHitCount ?? input.max_hits ?? input.maxHits
|
|
9610
9866
|
);
|
|
9611
9867
|
if (configuredMaxHitCount !== void 0 && (!Number.isInteger(configuredMaxHitCount) || configuredMaxHitCount < 0)) {
|
|
@@ -9620,7 +9876,7 @@ function normalizeNetworkMock(input, index) {
|
|
|
9620
9876
|
if (maxHitCount !== void 0 && effectiveRequiredHitCount > maxHitCount) {
|
|
9621
9877
|
throw new Error(`target.network_mocks[${index}].max_hit_count cannot be less than its required hit count.`);
|
|
9622
9878
|
}
|
|
9623
|
-
const sequenceScopeInput =
|
|
9879
|
+
const sequenceScopeInput = stringValue3(
|
|
9624
9880
|
input.sequence_scope ?? input.sequenceScope ?? input.response_sequence_scope ?? input.responseSequenceScope
|
|
9625
9881
|
);
|
|
9626
9882
|
let sequenceScope;
|
|
@@ -9638,7 +9894,7 @@ function normalizeNetworkMock(input, index) {
|
|
|
9638
9894
|
...payload,
|
|
9639
9895
|
label: normalizeName(input.label || input.name, `network-mock-${index + 1}`),
|
|
9640
9896
|
url,
|
|
9641
|
-
method:
|
|
9897
|
+
method: stringValue3(input.method)?.toUpperCase(),
|
|
9642
9898
|
responses,
|
|
9643
9899
|
repeat_responses: input.repeat_responses === true || input.repeatResponses === true || input.cycle_responses === true || input.cycleResponses === true,
|
|
9644
9900
|
sequence_scope: sequenceScope,
|
|
@@ -9681,18 +9937,18 @@ function normalizeNetworkMockRequestBodyConstraints(input, label) {
|
|
|
9681
9937
|
};
|
|
9682
9938
|
}
|
|
9683
9939
|
function normalizeNetworkMockResponsePayload(input, label, defaults = {}) {
|
|
9684
|
-
const status =
|
|
9940
|
+
const status = numberValue2(input.status) ?? defaults.status ?? 200;
|
|
9685
9941
|
if (!Number.isInteger(status) || status < 100 || status > 599) {
|
|
9686
9942
|
throw new Error(`${label}.status must be an HTTP status code.`);
|
|
9687
9943
|
}
|
|
9688
|
-
const body =
|
|
9944
|
+
const body = stringValue3(input.body) ?? stringValue3(input.body_text) ?? stringValue3(input.bodyText) ?? defaults.body;
|
|
9689
9945
|
const hasJsonBody = Object.prototype.hasOwnProperty.call(input, "body_json") || Object.prototype.hasOwnProperty.call(input, "bodyJson") || Object.prototype.hasOwnProperty.call(input, "json");
|
|
9690
9946
|
const requestBody = normalizeNetworkMockRequestBodyConstraints(input, label);
|
|
9691
9947
|
const abort = normalizeNetworkMockAbort(input, label, defaults.abort, defaults.abort_error_code);
|
|
9692
9948
|
return {
|
|
9693
|
-
label:
|
|
9949
|
+
label: stringValue3(input.label) || stringValue3(input.name) || defaults.label,
|
|
9694
9950
|
status,
|
|
9695
|
-
content_type:
|
|
9951
|
+
content_type: stringValue3(input.content_type) || stringValue3(input.contentType) || defaults.content_type,
|
|
9696
9952
|
headers: stringRecord(input.headers) || defaults.headers,
|
|
9697
9953
|
body,
|
|
9698
9954
|
body_json: hasJsonBody ? toJsonValue(input.body_json ?? input.bodyJson ?? input.json) : defaults.body_json,
|
|
@@ -9711,7 +9967,7 @@ function normalizeNetworkMockAbort(input, label, defaultAbort, defaultErrorCode)
|
|
|
9711
9967
|
const explicitAbort = typeof abortInput === "string" ? abortInput.trim().length > 0 : abortInput === true;
|
|
9712
9968
|
const abort = explicitAbort || defaultAbort === true;
|
|
9713
9969
|
if (!abort) return {};
|
|
9714
|
-
const codeInput =
|
|
9970
|
+
const codeInput = stringValue3(
|
|
9715
9971
|
typeof abortInput === "string" ? abortInput : input.abort_error_code ?? input.abortErrorCode ?? input.abort_error ?? input.abortError ?? input.network_error ?? input.networkError
|
|
9716
9972
|
) || defaultErrorCode || "failed";
|
|
9717
9973
|
const abort_error_code = codeInput.toLowerCase();
|
|
@@ -9721,7 +9977,7 @@ function normalizeNetworkMockAbort(input, label, defaultAbort, defaultErrorCode)
|
|
|
9721
9977
|
return { abort: true, abort_error_code };
|
|
9722
9978
|
}
|
|
9723
9979
|
function normalizeNetworkMockDelay(input, label, defaultValue) {
|
|
9724
|
-
const value =
|
|
9980
|
+
const value = numberValue2(
|
|
9725
9981
|
input.delay_ms ?? input.delayMs ?? input.wait_ms ?? input.waitMs ?? input.latency_ms ?? input.latencyMs
|
|
9726
9982
|
) ?? defaultValue;
|
|
9727
9983
|
if (value === void 0) return void 0;
|
|
@@ -9836,7 +10092,7 @@ function collectRiddleProofProfileEnvironmentBlockedWarnings(profile, blocker) {
|
|
|
9836
10092
|
return warnings;
|
|
9837
10093
|
}
|
|
9838
10094
|
function normalizeRouteInventoryPath(value, label) {
|
|
9839
|
-
const path7 =
|
|
10095
|
+
const path7 = stringValue3(value);
|
|
9840
10096
|
if (!path7) throw new Error(`${label} requires path.`);
|
|
9841
10097
|
if (!path7.startsWith("/")) throw new Error(`${label}.path must start with /.`);
|
|
9842
10098
|
return normalizeRoutePath2(path7);
|
|
@@ -9845,7 +10101,7 @@ function normalizeRouteInventoryRoute(input, index) {
|
|
|
9845
10101
|
if (typeof input === "string") return { path: normalizeRouteInventoryPath(input, `checks route_inventory expected_routes[${index}]`) };
|
|
9846
10102
|
if (!isRecord(input)) throw new Error(`checks route_inventory expected_routes[${index}] must be a string or object.`);
|
|
9847
10103
|
return {
|
|
9848
|
-
name:
|
|
10104
|
+
name: stringValue3(input.name),
|
|
9849
10105
|
path: normalizeRouteInventoryPath(input.path, `checks route_inventory expected_routes[${index}]`)
|
|
9850
10106
|
};
|
|
9851
10107
|
}
|
|
@@ -9880,7 +10136,7 @@ function normalizeStringList(value, label) {
|
|
|
9880
10136
|
}
|
|
9881
10137
|
function normalizeHttpStatus(value, label) {
|
|
9882
10138
|
if (value === void 0) return void 0;
|
|
9883
|
-
const status =
|
|
10139
|
+
const status = numberValue2(value);
|
|
9884
10140
|
if (status === void 0 || !Number.isInteger(status) || status < 100 || status > 599) {
|
|
9885
10141
|
throw new Error(`${label} must be an HTTP status code.`);
|
|
9886
10142
|
}
|
|
@@ -9895,7 +10151,7 @@ function normalizeHttpStatuses(value, label) {
|
|
|
9895
10151
|
}
|
|
9896
10152
|
function normalizePositiveInteger(value, label, max) {
|
|
9897
10153
|
if (value === void 0) return void 0;
|
|
9898
|
-
const number =
|
|
10154
|
+
const number = numberValue2(value);
|
|
9899
10155
|
if (number === void 0 || !Number.isInteger(number) || number < 1 || max !== void 0 && number > max) {
|
|
9900
10156
|
throw new Error(`${label} must be an integer from 1 to ${max ?? "unbounded"}.`);
|
|
9901
10157
|
}
|
|
@@ -9918,7 +10174,7 @@ function normalizeHttpStatusBodyJsonAssertions(value, label) {
|
|
|
9918
10174
|
return value.map((item, index) => {
|
|
9919
10175
|
const itemLabel = `${label}[${index}]`;
|
|
9920
10176
|
if (typeof item === "string") {
|
|
9921
|
-
const path8 =
|
|
10177
|
+
const path8 = stringValue3(item);
|
|
9922
10178
|
if (!path8) throw new Error(`${itemLabel} path must not be empty.`);
|
|
9923
10179
|
return { path: path8, exists: true };
|
|
9924
10180
|
}
|
|
@@ -9926,12 +10182,12 @@ function normalizeHttpStatusBodyJsonAssertions(value, label) {
|
|
|
9926
10182
|
const path7 = stringFromOwn(item, "path", "json_path", "jsonPath", "key");
|
|
9927
10183
|
if (!path7) throw new Error(`${itemLabel}.path is required.`);
|
|
9928
10184
|
const assertion = {
|
|
9929
|
-
label:
|
|
10185
|
+
label: stringValue3(item.label),
|
|
9930
10186
|
path: path7
|
|
9931
10187
|
};
|
|
9932
|
-
const exists =
|
|
10188
|
+
const exists = booleanValue2(valueFromOwn(item, "exists", "present"));
|
|
9933
10189
|
if (exists !== void 0) assertion.exists = exists;
|
|
9934
|
-
const type =
|
|
10190
|
+
const type = stringValue3(valueFromOwn(item, "type", "value_type", "valueType"));
|
|
9935
10191
|
if (type !== void 0) {
|
|
9936
10192
|
const allowedTypes = ["array", "boolean", "null", "number", "object", "string"];
|
|
9937
10193
|
if (!allowedTypes.includes(type)) {
|
|
@@ -9961,43 +10217,43 @@ function dialogCountFieldForCheckType(type) {
|
|
|
9961
10217
|
}
|
|
9962
10218
|
function normalizeCheck(input, index) {
|
|
9963
10219
|
if (!isRecord(input)) throw new Error(`checks[${index}] must be an object.`);
|
|
9964
|
-
const type =
|
|
10220
|
+
const type = stringValue3(input.type);
|
|
9965
10221
|
if (!type) throw new Error(`checks[${index}].type is required.`);
|
|
9966
10222
|
if (!isSupportedCheckType(type)) {
|
|
9967
10223
|
throw new Error(`checks[${index}].type ${type} is not supported. Supported checks: ${RIDDLE_PROOF_PROFILE_CHECK_TYPES.join(", ")}`);
|
|
9968
10224
|
}
|
|
9969
10225
|
const isDialogCountCheck = isDialogCountCheckType(type);
|
|
9970
|
-
if ((type === "selector_visible" || type === "selector_absent" || type === "selector_count_at_least" || type === "selector_count_equals" || type === "selector_count_equal" || type === "selector_count_eq" || type === "selector_text_visible" || type === "selector_text_absent" || type === "observe_within" && !
|
|
10226
|
+
if ((type === "selector_visible" || type === "selector_absent" || type === "selector_count_at_least" || type === "selector_count_equals" || type === "selector_count_equal" || type === "selector_count_eq" || type === "selector_text_visible" || type === "selector_text_absent" || type === "observe_within" && !stringValue3(input.text) && !stringValue3(input.pattern)) && !stringValue3(input.selector)) {
|
|
9971
10227
|
throw new Error(`checks[${index}] ${type} requires selector.`);
|
|
9972
10228
|
}
|
|
9973
|
-
if ((type === "frame_text_visible" || type === "frame_url_equals" || type === "frame_url_matches" || type === "frame_no_horizontal_overflow") && !
|
|
10229
|
+
if ((type === "frame_text_visible" || type === "frame_url_equals" || type === "frame_url_matches" || type === "frame_no_horizontal_overflow") && !stringValue3(input.selector)) {
|
|
9974
10230
|
throw new Error(`checks[${index}] ${type} requires selector.`);
|
|
9975
10231
|
}
|
|
9976
|
-
if (type === "frame_text_visible" && !
|
|
10232
|
+
if (type === "frame_text_visible" && !stringValue3(input.text) && !stringValue3(input.pattern)) {
|
|
9977
10233
|
throw new Error(`checks[${index}] frame_text_visible requires text or pattern.`);
|
|
9978
10234
|
}
|
|
9979
10235
|
const expectedUrl = stringFromOwn(input, "expected_url", "expectedUrl", "url", "expected_value", "expectedValue", "value");
|
|
9980
10236
|
if (type === "frame_url_equals" && expectedUrl === void 0) {
|
|
9981
10237
|
throw new Error(`checks[${index}] frame_url_equals requires expected_url.`);
|
|
9982
10238
|
}
|
|
9983
|
-
if (type === "frame_url_matches" && !
|
|
10239
|
+
if (type === "frame_url_matches" && !stringValue3(input.pattern)) {
|
|
9984
10240
|
throw new Error(`checks[${index}] frame_url_matches requires pattern.`);
|
|
9985
10241
|
}
|
|
9986
|
-
if ((type === "text_visible" || type === "text_absent" || type === "selector_text_visible" || type === "selector_text_absent") && !
|
|
10242
|
+
if ((type === "text_visible" || type === "text_absent" || type === "selector_text_visible" || type === "selector_text_absent") && !stringValue3(input.text) && !stringValue3(input.pattern)) {
|
|
9987
10243
|
throw new Error(`checks[${index}] ${type} requires text or pattern.`);
|
|
9988
10244
|
}
|
|
9989
|
-
if ((type === "url_search_param_equals" || type === "url_search_param_absent") && !
|
|
10245
|
+
if ((type === "url_search_param_equals" || type === "url_search_param_absent") && !stringValue3(input.param) && !stringValue3(input.search_param) && !stringValue3(input.searchParam) && !stringValue3(input.key)) {
|
|
9990
10246
|
throw new Error(`checks[${index}] ${type} requires param.`);
|
|
9991
10247
|
}
|
|
9992
10248
|
const expectedValue = stringFromOwn(input, "expected_value", "expectedValue", "value");
|
|
9993
10249
|
if (type === "url_search_param_equals" && expectedValue === void 0) {
|
|
9994
10250
|
throw new Error(`checks[${index}] url_search_param_equals requires expected_value.`);
|
|
9995
10251
|
}
|
|
9996
|
-
const minCount =
|
|
10252
|
+
const minCount = numberValue2(input.min_count) ?? numberValue2(input.minCount);
|
|
9997
10253
|
if (type === "selector_count_at_least" && minCount === void 0) {
|
|
9998
10254
|
throw new Error(`checks[${index}] selector_count_at_least requires min_count.`);
|
|
9999
10255
|
}
|
|
10000
|
-
const expectedCount =
|
|
10256
|
+
const expectedCount = numberValue2(input.expected_count) ?? numberValue2(input.expectedCount) ?? numberValue2(input.count);
|
|
10001
10257
|
if ((type === "selector_count_equals" || type === "selector_count_equal" || type === "selector_count_eq" || isDialogCountCheck) && expectedCount === void 0) {
|
|
10002
10258
|
throw new Error(`checks[${index}] ${type} requires expected_count.`);
|
|
10003
10259
|
}
|
|
@@ -10006,7 +10262,7 @@ function normalizeCheck(input, index) {
|
|
|
10006
10262
|
}
|
|
10007
10263
|
const expectedTexts = normalizeExpectedTexts(input.expected_texts ?? input.expectedTexts, index);
|
|
10008
10264
|
if (type === "selector_text_order") {
|
|
10009
|
-
if (!
|
|
10265
|
+
if (!stringValue3(input.selector)) throw new Error(`checks[${index}] selector_text_order requires selector.`);
|
|
10010
10266
|
if (!expectedTexts?.length) throw new Error(`checks[${index}] selector_text_order requires expected_texts.`);
|
|
10011
10267
|
}
|
|
10012
10268
|
const expectedRoutes = normalizeRouteInventoryRoutes(input.expected_routes ?? input.expectedRoutes, index);
|
|
@@ -10032,7 +10288,7 @@ function normalizeCheck(input, index) {
|
|
|
10032
10288
|
) : void 0;
|
|
10033
10289
|
const maxLinks = isLinkStatusCheck ? normalizePositiveInteger(input.max_links ?? input.maxLinks ?? input.limit, `checks[${index}] max_links`, 500) : void 0;
|
|
10034
10290
|
const minBytes = isStatusCheck ? normalizePositiveInteger(input.min_bytes ?? input.minBytes ?? input.min_response_bytes ?? input.minResponseBytes, `checks[${index}] min_bytes`) : void 0;
|
|
10035
|
-
const expectedContentType = isStatusCheck ?
|
|
10291
|
+
const expectedContentType = isStatusCheck ? stringValue3(input.expected_content_type) || stringValue3(input.expectedContentType) || stringValue3(input.content_type) || stringValue3(input.contentType) : void 0;
|
|
10036
10292
|
const allowedContentTypes = isStatusCheck ? normalizeStringList(
|
|
10037
10293
|
input.allowed_content_types ?? input.allowedContentTypes ?? input.expected_content_types ?? input.expectedContentTypes,
|
|
10038
10294
|
`checks[${index}] allowed_content_types`
|
|
@@ -10064,33 +10320,33 @@ function normalizeCheck(input, index) {
|
|
|
10064
10320
|
}
|
|
10065
10321
|
return {
|
|
10066
10322
|
type,
|
|
10067
|
-
label:
|
|
10068
|
-
expected_path:
|
|
10069
|
-
param:
|
|
10323
|
+
label: stringValue3(input.label),
|
|
10324
|
+
expected_path: stringValue3(input.expected_path),
|
|
10325
|
+
param: stringValue3(input.param) || stringValue3(input.search_param) || stringValue3(input.searchParam) || stringValue3(input.key),
|
|
10070
10326
|
expected_value: expectedValue,
|
|
10071
10327
|
expected_url: expectedUrl,
|
|
10072
10328
|
expected_routes: expectedRoutes,
|
|
10073
|
-
selector:
|
|
10329
|
+
selector: stringValue3(input.selector),
|
|
10074
10330
|
url: isHttpStatusCheck ? requestUrl : void 0,
|
|
10075
10331
|
method: isHttpStatusCheck ? method || "GET" : void 0,
|
|
10076
10332
|
headers: isHttpStatusCheck ? stringRecord(input.headers) : void 0,
|
|
10077
|
-
body: isHttpStatusCheck ?
|
|
10333
|
+
body: isHttpStatusCheck ? stringValue3(input.body) : void 0,
|
|
10078
10334
|
body_json: isHttpStatusCheck && hasBodyJson ? toJsonValue(input.body_json ?? input.bodyJson ?? input.json) : void 0,
|
|
10079
10335
|
body_contains: bodyContains,
|
|
10080
10336
|
body_not_contains: bodyNotContains,
|
|
10081
10337
|
body_not_patterns: bodyNotPatterns,
|
|
10082
10338
|
body_json_assertions: bodyJsonAssertions,
|
|
10083
10339
|
expected_texts: expectedTexts,
|
|
10084
|
-
link_selector:
|
|
10085
|
-
source_selector:
|
|
10086
|
-
route_path_prefix:
|
|
10087
|
-
route_ready_selector:
|
|
10088
|
-
route_ready_text:
|
|
10089
|
-
route_ready_pattern:
|
|
10090
|
-
route_ready_flags:
|
|
10091
|
-
text:
|
|
10092
|
-
pattern:
|
|
10093
|
-
flags:
|
|
10340
|
+
link_selector: stringValue3(input.link_selector) || stringValue3(input.linkSelector),
|
|
10341
|
+
source_selector: stringValue3(input.source_selector) || stringValue3(input.sourceSelector),
|
|
10342
|
+
route_path_prefix: stringValue3(input.route_path_prefix) || stringValue3(input.routePathPrefix),
|
|
10343
|
+
route_ready_selector: stringValue3(input.route_ready_selector) || stringValue3(input.routeReadySelector),
|
|
10344
|
+
route_ready_text: stringValue3(input.route_ready_text) || stringValue3(input.routeReadyText),
|
|
10345
|
+
route_ready_pattern: stringValue3(input.route_ready_pattern) || stringValue3(input.routeReadyPattern),
|
|
10346
|
+
route_ready_flags: stringValue3(input.route_ready_flags) || stringValue3(input.routeReadyFlags),
|
|
10347
|
+
text: stringValue3(input.text),
|
|
10348
|
+
pattern: stringValue3(input.pattern),
|
|
10349
|
+
flags: stringValue3(input.flags),
|
|
10094
10350
|
viewports: normalizeStringList(input.viewports ?? input.viewport_names ?? input.viewportNames, `checks[${index}] viewports`),
|
|
10095
10351
|
allowed_console_texts: normalizeStringList(input.allowed_console_texts ?? input.allowedConsoleTexts ?? input.allow_console_texts ?? input.allowConsoleTexts, `checks[${index}] allowed_console_texts`),
|
|
10096
10352
|
allowed_console_patterns: normalizeStringList(input.allowed_console_patterns ?? input.allowedConsolePatterns ?? input.allow_console_patterns ?? input.allowConsolePatterns, `checks[${index}] allowed_console_patterns`),
|
|
@@ -10107,8 +10363,8 @@ function normalizeCheck(input, index) {
|
|
|
10107
10363
|
min_bytes: minBytes,
|
|
10108
10364
|
allowed_content_types: allowedContentTypes,
|
|
10109
10365
|
allow_get_fallback: isLinkStatusCheck ? input.allow_get_fallback === false || input.allowGetFallback === false ? false : true : void 0,
|
|
10110
|
-
max_overflow_px:
|
|
10111
|
-
timeout_ms:
|
|
10366
|
+
max_overflow_px: numberValue2(input.max_overflow_px),
|
|
10367
|
+
timeout_ms: numberValue2(input.timeout_ms) ?? numberValue2(input.timeoutMs) ?? numberValue2(input.within_ms) ?? numberValue2(input.withinMs),
|
|
10112
10368
|
run_direct_routes: input.run_direct_routes === false || input.runDirectRoutes === false ? false : true,
|
|
10113
10369
|
run_clickthroughs: input.run_clickthroughs === false || input.runClickthroughs === false ? false : true,
|
|
10114
10370
|
run_all_viewports: input.run_all_viewports === true || input.runAllViewports === true,
|
|
@@ -10137,15 +10393,15 @@ function normalizeFailurePolicy(input) {
|
|
|
10137
10393
|
}
|
|
10138
10394
|
function normalizeRiddleProofProfile(input, options = {}) {
|
|
10139
10395
|
if (!isRecord(input)) throw new Error("profile must be a JSON object.");
|
|
10140
|
-
const version =
|
|
10396
|
+
const version = stringValue3(input.version) || RIDDLE_PROOF_PROFILE_VERSION;
|
|
10141
10397
|
if (version !== RIDDLE_PROOF_PROFILE_VERSION) {
|
|
10142
10398
|
throw new Error(`Unsupported profile version ${version}. Expected ${RIDDLE_PROOF_PROFILE_VERSION}.`);
|
|
10143
10399
|
}
|
|
10144
10400
|
const targetInput = isRecord(input.target) ? input.target : {};
|
|
10145
10401
|
const checks = Array.isArray(input.checks) ? input.checks.map(normalizeCheck) : [];
|
|
10146
10402
|
if (!checks.length) throw new Error("profile.checks must contain at least one check.");
|
|
10147
|
-
const targetUrl =
|
|
10148
|
-
const route =
|
|
10403
|
+
const targetUrl = stringValue3(options.url) || stringValue3(targetInput.url);
|
|
10404
|
+
const route = stringValue3(options.route) || stringValue3(targetInput.route);
|
|
10149
10405
|
if (!targetUrl && !route) throw new Error("profile.target requires url or route, or pass --url.");
|
|
10150
10406
|
return {
|
|
10151
10407
|
version: RIDDLE_PROOF_PROFILE_VERSION,
|
|
@@ -10154,17 +10410,17 @@ function normalizeRiddleProofProfile(input, options = {}) {
|
|
|
10154
10410
|
url: targetUrl,
|
|
10155
10411
|
route,
|
|
10156
10412
|
viewports: options.viewports?.length ? options.viewports : normalizeViewports(targetInput.viewports),
|
|
10157
|
-
auth:
|
|
10413
|
+
auth: stringValue3(targetInput.auth) || "none",
|
|
10158
10414
|
timeout_sec: timeoutSecValue(targetInput.timeout_sec) ?? timeoutSecValue(targetInput.timeoutSec) ?? timeoutSecValue(targetInput.riddle_timeout_sec) ?? timeoutSecValue(targetInput.riddleTimeoutSec),
|
|
10159
|
-
wait_for_selector:
|
|
10160
|
-
wait_ms:
|
|
10415
|
+
wait_for_selector: stringValue3(targetInput.wait_for_selector) || stringValue3(targetInput.waitForSelector),
|
|
10416
|
+
wait_ms: numberValue2(targetInput.wait_ms) ?? numberValue2(targetInput.waitMs),
|
|
10161
10417
|
screenshot_full_page: normalizeTargetScreenshotFullPage(targetInput),
|
|
10162
10418
|
setup_actions: normalizeSetupActions(targetInput.setup_actions ?? targetInput.setupActions),
|
|
10163
10419
|
network_mocks: normalizeNetworkMocks(targetInput.network_mocks ?? targetInput.networkMocks)
|
|
10164
10420
|
},
|
|
10165
10421
|
checks,
|
|
10166
10422
|
artifacts: Array.isArray(input.artifacts) ? input.artifacts.map((item) => String(item)).filter(Boolean) : ["screenshot", "console", "dom_summary", "proof_json"],
|
|
10167
|
-
baseline_policy:
|
|
10423
|
+
baseline_policy: stringValue3(input.baseline_policy) || stringValue3(input.baselinePolicy) || "invariant_only",
|
|
10168
10424
|
failure_policy: normalizeFailurePolicy(input.failure_policy || input.failurePolicy),
|
|
10169
10425
|
metadata: jsonRecord(input.metadata)
|
|
10170
10426
|
};
|
|
@@ -10243,8 +10499,8 @@ function httpStatusIsAllowed(status, check) {
|
|
|
10243
10499
|
return allowed?.length ? allowed.includes(status) : status >= 200 && status < 400;
|
|
10244
10500
|
}
|
|
10245
10501
|
function linkStatusObservedBytes(result) {
|
|
10246
|
-
const bytes =
|
|
10247
|
-
const contentLength =
|
|
10502
|
+
const bytes = numberValue2(result.bytes);
|
|
10503
|
+
const contentLength = numberValue2(result.content_length);
|
|
10248
10504
|
return Math.max(bytes ?? 0, contentLength ?? 0) || void 0;
|
|
10249
10505
|
}
|
|
10250
10506
|
function normalizeLinkStatusContentType(value) {
|
|
@@ -10261,7 +10517,7 @@ function linkStatusContentTypesMatch(actual, expected) {
|
|
|
10261
10517
|
function linkStatusContentTypeOk(result, check) {
|
|
10262
10518
|
const expected = check.allowed_content_types;
|
|
10263
10519
|
if (!expected?.length) return true;
|
|
10264
|
-
const actual = normalizeLinkStatusContentType(
|
|
10520
|
+
const actual = normalizeLinkStatusContentType(stringValue3(result.content_type));
|
|
10265
10521
|
if (!actual) return false;
|
|
10266
10522
|
return expected.some((contentType) => {
|
|
10267
10523
|
const normalized = normalizeLinkStatusContentType(contentType);
|
|
@@ -10301,28 +10557,28 @@ function httpStatusBodyJsonAssertionFailures(result, check) {
|
|
|
10301
10557
|
}));
|
|
10302
10558
|
}
|
|
10303
10559
|
return result.body_json_assertions.filter((assertion) => isRecord(assertion) && assertion.ok !== true).map((assertion) => ({
|
|
10304
|
-
label:
|
|
10305
|
-
path:
|
|
10560
|
+
label: stringValue3(assertion.label) || stringValue3(assertion.path) || "json assertion",
|
|
10561
|
+
path: stringValue3(assertion.path) || "",
|
|
10306
10562
|
ok: false,
|
|
10307
10563
|
exists: assertion.exists === true,
|
|
10308
10564
|
observed: hasOwn(assertion, "observed") ? toJsonValue(assertion.observed) : void 0,
|
|
10309
10565
|
observed_sample: hasOwn(assertion, "observed_sample") ? toJsonValue(assertion.observed_sample) : void 0,
|
|
10310
|
-
observed_length:
|
|
10311
|
-
observed_key_count:
|
|
10312
|
-
observed_omitted_count:
|
|
10313
|
-
observed_type:
|
|
10314
|
-
expected_exists:
|
|
10566
|
+
observed_length: numberValue2(assertion.observed_length),
|
|
10567
|
+
observed_key_count: numberValue2(assertion.observed_key_count),
|
|
10568
|
+
observed_omitted_count: numberValue2(assertion.observed_omitted_count),
|
|
10569
|
+
observed_type: stringValue3(assertion.observed_type) || "missing",
|
|
10570
|
+
expected_exists: booleanValue2(assertion.expected_exists),
|
|
10315
10571
|
equals: hasOwn(assertion, "equals") ? toJsonValue(assertion.equals) : void 0,
|
|
10316
10572
|
not_equals: hasOwn(assertion, "not_equals") ? toJsonValue(assertion.not_equals) : void 0,
|
|
10317
10573
|
contains: hasOwn(assertion, "contains") ? toJsonValue(assertion.contains) : void 0,
|
|
10318
|
-
type:
|
|
10574
|
+
type: stringValue3(assertion.type),
|
|
10319
10575
|
errors: Array.isArray(assertion.errors) ? assertion.errors.map(String) : void 0
|
|
10320
10576
|
}));
|
|
10321
10577
|
}
|
|
10322
10578
|
function linkStatusResultOk(result, check) {
|
|
10323
|
-
const status =
|
|
10579
|
+
const status = numberValue2(result.status);
|
|
10324
10580
|
if (!httpStatusIsAllowed(status, check)) return false;
|
|
10325
|
-
if (
|
|
10581
|
+
if (stringValue3(result.error)) return false;
|
|
10326
10582
|
if (result.ok === false) return false;
|
|
10327
10583
|
if (!linkStatusContentTypeOk(result, check)) return false;
|
|
10328
10584
|
if (check.require_nonzero_bytes) {
|
|
@@ -10437,12 +10693,12 @@ async function preflightHttpStatusCheck(check, index, targetUrl, fetchImpl) {
|
|
|
10437
10693
|
url,
|
|
10438
10694
|
method,
|
|
10439
10695
|
ok,
|
|
10440
|
-
status:
|
|
10696
|
+
status: numberValue2(result.status) ?? null,
|
|
10441
10697
|
status_text: statusText,
|
|
10442
10698
|
error,
|
|
10443
|
-
content_type:
|
|
10444
|
-
content_length:
|
|
10445
|
-
bytes:
|
|
10699
|
+
content_type: stringValue3(result.content_type) ?? null,
|
|
10700
|
+
content_length: numberValue2(result.content_length) ?? null,
|
|
10701
|
+
bytes: numberValue2(result.bytes) ?? null,
|
|
10446
10702
|
body_contains: isRecord(result.body_contains) ? Object.fromEntries(Object.entries(result.body_contains).map(([key, value]) => [key, value === true])) : null,
|
|
10447
10703
|
body_contains_missing: bodyContainsMissing,
|
|
10448
10704
|
body_not_contains: isRecord(result.body_not_contains) ? Object.fromEntries(Object.entries(result.body_not_contains).map(([key, value]) => [key, value === true])) : null,
|
|
@@ -10499,11 +10755,11 @@ function summarizeHttpStatusEvidence(viewport, check) {
|
|
|
10499
10755
|
if (!linkStatusResultOk(statusEvidence, check)) {
|
|
10500
10756
|
failures.push({
|
|
10501
10757
|
code: "http_status_failed",
|
|
10502
|
-
url:
|
|
10503
|
-
status:
|
|
10504
|
-
method:
|
|
10505
|
-
error:
|
|
10506
|
-
content_type:
|
|
10758
|
+
url: stringValue3(statusEvidence.url) ?? httpStatusRequestUrl(check, viewport.url),
|
|
10759
|
+
status: numberValue2(statusEvidence.status) ?? null,
|
|
10760
|
+
method: stringValue3(statusEvidence.method) ?? httpStatusMethod(check),
|
|
10761
|
+
error: stringValue3(statusEvidence.error) ?? null,
|
|
10762
|
+
content_type: stringValue3(statusEvidence.content_type) ?? null,
|
|
10507
10763
|
bytes: linkStatusObservedBytes(statusEvidence) ?? null,
|
|
10508
10764
|
allowed_statuses: httpStatusAllowedStatuses(check) ?? ["2xx", "3xx"],
|
|
10509
10765
|
min_bytes: check.min_bytes ?? null,
|
|
@@ -10516,20 +10772,20 @@ function summarizeHttpStatusEvidence(viewport, check) {
|
|
|
10516
10772
|
body_not_patterns_found: bodyNotPatternsFound,
|
|
10517
10773
|
body_json_assertions: check.body_json_assertions ?? null,
|
|
10518
10774
|
body_json_assertions_failed: bodyJsonAssertionsFailed.map((assertion) => toJsonValue(assertion)),
|
|
10519
|
-
body_sample:
|
|
10775
|
+
body_sample: stringValue3(statusEvidence.body_sample) ?? null
|
|
10520
10776
|
});
|
|
10521
10777
|
}
|
|
10522
10778
|
return {
|
|
10523
10779
|
viewport: viewport.name,
|
|
10524
10780
|
key,
|
|
10525
|
-
url:
|
|
10526
|
-
method:
|
|
10527
|
-
status:
|
|
10528
|
-
status_text:
|
|
10781
|
+
url: stringValue3(statusEvidence.url) ?? httpStatusRequestUrl(check, viewport.url),
|
|
10782
|
+
method: stringValue3(statusEvidence.method) ?? httpStatusMethod(check),
|
|
10783
|
+
status: numberValue2(statusEvidence.status) ?? null,
|
|
10784
|
+
status_text: stringValue3(statusEvidence.status_text) ?? null,
|
|
10529
10785
|
ok: failures.length === 0,
|
|
10530
|
-
error:
|
|
10531
|
-
content_type:
|
|
10532
|
-
content_length:
|
|
10786
|
+
error: stringValue3(statusEvidence.error) ?? null,
|
|
10787
|
+
content_type: stringValue3(statusEvidence.content_type) ?? null,
|
|
10788
|
+
content_length: numberValue2(statusEvidence.content_length) ?? null,
|
|
10533
10789
|
bytes: linkStatusObservedBytes(statusEvidence) ?? null,
|
|
10534
10790
|
body_contains: isRecord(statusEvidence.body_contains) ? toJsonValue(statusEvidence.body_contains) : null,
|
|
10535
10791
|
body_contains_missing: bodyContainsMissing,
|
|
@@ -10539,7 +10795,7 @@ function summarizeHttpStatusEvidence(viewport, check) {
|
|
|
10539
10795
|
body_not_patterns_found: bodyNotPatternsFound,
|
|
10540
10796
|
body_json_assertions: Array.isArray(statusEvidence.body_json_assertions) ? toJsonValue(statusEvidence.body_json_assertions) : null,
|
|
10541
10797
|
body_json_assertions_failed: bodyJsonAssertionsFailed.map((assertion) => toJsonValue(assertion)),
|
|
10542
|
-
body_sample:
|
|
10798
|
+
body_sample: stringValue3(statusEvidence.body_sample) ?? null,
|
|
10543
10799
|
failures
|
|
10544
10800
|
};
|
|
10545
10801
|
}
|
|
@@ -10560,27 +10816,27 @@ function summarizeLinkStatusEvidence(viewport, check) {
|
|
|
10560
10816
|
};
|
|
10561
10817
|
}
|
|
10562
10818
|
const results = Array.isArray(linkEvidence.results) ? linkEvidence.results.filter(isRecord) : [];
|
|
10563
|
-
const totalCount =
|
|
10564
|
-
const resultCount =
|
|
10565
|
-
const storedResultCount =
|
|
10566
|
-
const omittedResultCount =
|
|
10567
|
-
const omittedSuccessCount =
|
|
10819
|
+
const totalCount = numberValue2(linkEvidence.total_count) ?? results.length;
|
|
10820
|
+
const resultCount = numberValue2(linkEvidence.result_count) ?? totalCount;
|
|
10821
|
+
const storedResultCount = numberValue2(linkEvidence.stored_result_count) ?? results.length;
|
|
10822
|
+
const omittedResultCount = numberValue2(linkEvidence.omitted_result_count) ?? Math.max(0, resultCount - storedResultCount);
|
|
10823
|
+
const omittedSuccessCount = numberValue2(linkEvidence.omitted_success_count) ?? 0;
|
|
10568
10824
|
const okCount = results.filter((result) => linkStatusResultOk(result, check)).length;
|
|
10569
10825
|
const failures = results.filter((result) => !linkStatusResultOk(result, check)).map((result) => ({
|
|
10570
10826
|
code: "link_status_failed",
|
|
10571
|
-
url:
|
|
10572
|
-
status:
|
|
10573
|
-
method:
|
|
10574
|
-
error:
|
|
10575
|
-
content_type:
|
|
10827
|
+
url: stringValue3(result.url) ?? null,
|
|
10828
|
+
status: numberValue2(result.status) ?? null,
|
|
10829
|
+
method: stringValue3(result.method) ?? null,
|
|
10830
|
+
error: stringValue3(result.error) ?? null,
|
|
10831
|
+
content_type: stringValue3(result.content_type) ?? null,
|
|
10576
10832
|
bytes: linkStatusObservedBytes(result) ?? null,
|
|
10577
10833
|
min_bytes: check.min_bytes ?? null,
|
|
10578
10834
|
allowed_content_types: check.allowed_content_types ?? null
|
|
10579
10835
|
}));
|
|
10580
|
-
if (
|
|
10581
|
-
failures.push({ code: "link_status_capture_failed", error:
|
|
10836
|
+
if (stringValue3(linkEvidence.error)) {
|
|
10837
|
+
failures.push({ code: "link_status_capture_failed", error: stringValue3(linkEvidence.error) ?? "" });
|
|
10582
10838
|
}
|
|
10583
|
-
const recordedFailedCount =
|
|
10839
|
+
const recordedFailedCount = numberValue2(linkEvidence.failed_count) ?? 0;
|
|
10584
10840
|
if (!failures.length && recordedFailedCount > 0) {
|
|
10585
10841
|
const recordedFailures = Array.isArray(linkEvidence.failures) ? linkEvidence.failures.slice(0, 20) : [];
|
|
10586
10842
|
failures.push({
|
|
@@ -10592,8 +10848,8 @@ function summarizeLinkStatusEvidence(viewport, check) {
|
|
|
10592
10848
|
if (linkEvidence.truncated === true) {
|
|
10593
10849
|
failures.push({
|
|
10594
10850
|
code: "link_status_probe_truncated",
|
|
10595
|
-
discovered_count:
|
|
10596
|
-
max_links:
|
|
10851
|
+
discovered_count: numberValue2(linkEvidence.discovered_count) ?? totalCount,
|
|
10852
|
+
max_links: numberValue2(linkEvidence.max_links) ?? check.max_links ?? 100
|
|
10597
10853
|
});
|
|
10598
10854
|
}
|
|
10599
10855
|
if (check.expected_count !== void 0 && totalCount !== check.expected_count) {
|
|
@@ -10607,11 +10863,11 @@ function summarizeLinkStatusEvidence(viewport, check) {
|
|
|
10607
10863
|
viewport: viewport.name,
|
|
10608
10864
|
selector: linkStatusSelector(check),
|
|
10609
10865
|
total_count: totalCount,
|
|
10610
|
-
discovered_count:
|
|
10611
|
-
ok_count:
|
|
10866
|
+
discovered_count: numberValue2(linkEvidence.discovered_count) ?? totalCount,
|
|
10867
|
+
ok_count: numberValue2(linkEvidence.ok_count) ?? okCount,
|
|
10612
10868
|
failed_count: failures.length,
|
|
10613
10869
|
truncated: linkEvidence.truncated === true,
|
|
10614
|
-
max_links:
|
|
10870
|
+
max_links: numberValue2(linkEvidence.max_links) ?? check.max_links ?? 100,
|
|
10615
10871
|
result_count: resultCount,
|
|
10616
10872
|
stored_result_count: storedResultCount,
|
|
10617
10873
|
omitted_result_count: omittedResultCount,
|
|
@@ -10686,13 +10942,13 @@ function frameTextSample(frame) {
|
|
|
10686
10942
|
function summarizeRouteInventory(viewport, inventory) {
|
|
10687
10943
|
const directRoutes = Array.isArray(inventory.direct_routes) ? inventory.direct_routes : [];
|
|
10688
10944
|
const clickthroughs = Array.isArray(inventory.clickthroughs) ? inventory.clickthroughs : [];
|
|
10689
|
-
const sourceLinkCount =
|
|
10690
|
-
const sourceUniqueLinkCount =
|
|
10691
|
-
const sourceCandidateCount =
|
|
10692
|
-
const sourceCandidateUniqueLinkCount =
|
|
10693
|
-
const sourceLinkScope =
|
|
10945
|
+
const sourceLinkCount = numberValue2(inventory.source_link_count) ?? numberValue2(inventory.home_game_link_count) ?? null;
|
|
10946
|
+
const sourceUniqueLinkCount = numberValue2(inventory.source_unique_link_count) ?? numberValue2(inventory.home_unique_game_link_count) ?? null;
|
|
10947
|
+
const sourceCandidateCount = numberValue2(inventory.source_candidate_count);
|
|
10948
|
+
const sourceCandidateUniqueLinkCount = numberValue2(inventory.source_candidate_unique_link_count);
|
|
10949
|
+
const sourceLinkScope = stringValue3(inventory.source_link_scope);
|
|
10694
10950
|
const duplicateSourceLinks = Array.isArray(inventory.duplicate_source_link_paths) ? inventory.duplicate_source_link_paths.map((path7) => String(path7)) : [];
|
|
10695
|
-
const duplicateSourceLinkCount =
|
|
10951
|
+
const duplicateSourceLinkCount = numberValue2(inventory.duplicate_source_link_count) ?? (sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null);
|
|
10696
10952
|
const failures = Array.isArray(inventory.failures) ? inventory.failures : [];
|
|
10697
10953
|
return {
|
|
10698
10954
|
viewport,
|
|
@@ -10716,9 +10972,9 @@ function routeInventoryExpectedRouteSummaries(value, fallback) {
|
|
|
10716
10972
|
return path8 ? { path: path8 } : void 0;
|
|
10717
10973
|
}
|
|
10718
10974
|
if (!isRecord(route)) return void 0;
|
|
10719
|
-
const path7 =
|
|
10975
|
+
const path7 = stringValue3(route.path);
|
|
10720
10976
|
if (!path7) return void 0;
|
|
10721
|
-
const name =
|
|
10977
|
+
const name = stringValue3(route.name);
|
|
10722
10978
|
return name ? { name, path: path7 } : { path: path7 };
|
|
10723
10979
|
}).filter((route) => Boolean(route));
|
|
10724
10980
|
}
|
|
@@ -10819,15 +11075,15 @@ function matchesAllowedMessage(input, texts, patterns) {
|
|
|
10819
11075
|
}
|
|
10820
11076
|
function consoleEventLocationUrl(input) {
|
|
10821
11077
|
if (!isRecord(input) || !isRecord(input.location)) return void 0;
|
|
10822
|
-
return
|
|
11078
|
+
return stringValue3(input.location.url);
|
|
10823
11079
|
}
|
|
10824
11080
|
function expectedFailedNetworkMockEvents(evidence) {
|
|
10825
11081
|
return (evidence.network_mocks || []).filter((event) => {
|
|
10826
11082
|
if (!isRecord(event) || event.ok === false) return false;
|
|
10827
|
-
const status =
|
|
11083
|
+
const status = numberValue2(event.status);
|
|
10828
11084
|
const isHttpFailure = status !== void 0 && status >= 400;
|
|
10829
|
-
const isAbortedMock = event.abort === true && Boolean(
|
|
10830
|
-
return (isHttpFailure || isAbortedMock) && Boolean(
|
|
11085
|
+
const isAbortedMock = event.abort === true && Boolean(stringValue3(event.abort_error_code));
|
|
11086
|
+
return (isHttpFailure || isAbortedMock) && Boolean(stringValue3(event.url));
|
|
10831
11087
|
});
|
|
10832
11088
|
}
|
|
10833
11089
|
function matchingExpectedFailedNetworkMockConsoleEvent(event, evidence) {
|
|
@@ -10836,9 +11092,9 @@ function matchingExpectedFailedNetworkMockConsoleEvent(event, evidence) {
|
|
|
10836
11092
|
const eventUrl = consoleEventLocationUrl(event);
|
|
10837
11093
|
if (!eventUrl) return void 0;
|
|
10838
11094
|
return expectedFailedNetworkMockEvents(evidence).find((mockEvent) => {
|
|
10839
|
-
const status =
|
|
10840
|
-
const abortErrorCode =
|
|
10841
|
-
return
|
|
11095
|
+
const status = numberValue2(mockEvent.status);
|
|
11096
|
+
const abortErrorCode = stringValue3(mockEvent.abort_error_code);
|
|
11097
|
+
return stringValue3(mockEvent.url) === eventUrl && (status !== void 0 && sample.includes(String(status)) || Boolean(abortErrorCode) && /Failed to load resource/i.test(sample));
|
|
10842
11098
|
});
|
|
10843
11099
|
}
|
|
10844
11100
|
function isExpectedFailedNetworkMockConsoleEvent(event, evidence) {
|
|
@@ -10849,10 +11105,10 @@ function expectedFailedNetworkMockConsoleEventSummary(event, evidence) {
|
|
|
10849
11105
|
const sample = allowedMessageSample(event);
|
|
10850
11106
|
return {
|
|
10851
11107
|
url: consoleEventLocationUrl(event) ?? null,
|
|
10852
|
-
status: match ?
|
|
10853
|
-
abort_error_code: match ?
|
|
10854
|
-
label: match ?
|
|
10855
|
-
response_label: match ?
|
|
11108
|
+
status: match ? numberValue2(match.status) ?? null : null,
|
|
11109
|
+
abort_error_code: match ? stringValue3(match.abort_error_code) ?? null : null,
|
|
11110
|
+
label: match ? stringValue3(match.label) ?? null : null,
|
|
11111
|
+
response_label: match ? stringValue3(match.response_label) ?? null : null,
|
|
10856
11112
|
text: isRecord(event) && typeof event.text === "string" ? event.text.slice(0, 300) : sample.slice(0, 300)
|
|
10857
11113
|
};
|
|
10858
11114
|
}
|
|
@@ -10980,7 +11236,7 @@ function assessCheckFromEvidence(check, evidence) {
|
|
|
10980
11236
|
if (isDialogCountCheckType(check.type)) {
|
|
10981
11237
|
const field = dialogCountFieldForCheckType(check.type);
|
|
10982
11238
|
const expectedCount = check.expected_count ?? 0;
|
|
10983
|
-
const actualCount =
|
|
11239
|
+
const actualCount = numberValue2(evidence.dom_summary?.[field]) ?? 0;
|
|
10984
11240
|
return {
|
|
10985
11241
|
type: check.type,
|
|
10986
11242
|
label: checkLabel(check),
|
|
@@ -11181,14 +11437,14 @@ function assessCheckFromEvidence(check, evidence) {
|
|
|
11181
11437
|
return {
|
|
11182
11438
|
viewport: viewport.name,
|
|
11183
11439
|
matched,
|
|
11184
|
-
elapsed_ms:
|
|
11185
|
-
timeout_ms:
|
|
11186
|
-
attempts:
|
|
11187
|
-
selector_count:
|
|
11188
|
-
visible_count:
|
|
11189
|
-
matched_count:
|
|
11190
|
-
sample:
|
|
11191
|
-
error:
|
|
11440
|
+
elapsed_ms: numberValue2(observation?.elapsed_ms) ?? null,
|
|
11441
|
+
timeout_ms: numberValue2(observation?.timeout_ms) ?? timeoutMs,
|
|
11442
|
+
attempts: numberValue2(observation?.attempts) ?? null,
|
|
11443
|
+
selector_count: numberValue2(observation?.selector_count) ?? null,
|
|
11444
|
+
visible_count: numberValue2(observation?.visible_count) ?? null,
|
|
11445
|
+
matched_count: numberValue2(observation?.matched_count) ?? null,
|
|
11446
|
+
sample: stringValue3(observation?.sample) ?? null,
|
|
11447
|
+
error: stringValue3(observation?.error) ?? null
|
|
11192
11448
|
};
|
|
11193
11449
|
});
|
|
11194
11450
|
const failed = results.filter((result) => !result.matched).length;
|
|
@@ -11346,7 +11602,7 @@ function assessCheckFromEvidence(check, evidence) {
|
|
|
11346
11602
|
body_not_patterns: check.body_not_patterns ?? [],
|
|
11347
11603
|
body_json_assertions: toJsonValue(check.body_json_assertions ?? []),
|
|
11348
11604
|
viewports: summaries.map((summary) => toJsonValue(summary)),
|
|
11349
|
-
failures: failed.flatMap((summary) => Array.isArray(summary.failures) ? summary.failures.map((failure) => toJsonValue({ viewport:
|
|
11605
|
+
failures: failed.flatMap((summary) => Array.isArray(summary.failures) ? summary.failures.map((failure) => toJsonValue({ viewport: stringValue3(summary.viewport) ?? null, failure })) : [])
|
|
11350
11606
|
},
|
|
11351
11607
|
message: failed.length ? `HTTP status failed in ${failed.length} viewport(s).` : void 0
|
|
11352
11608
|
};
|
|
@@ -11354,7 +11610,7 @@ function assessCheckFromEvidence(check, evidence) {
|
|
|
11354
11610
|
if (check.type === "link_status" || check.type === "artifact_link_status") {
|
|
11355
11611
|
const selector = linkStatusSelector(check);
|
|
11356
11612
|
const summaries = viewports.map((viewport) => summarizeLinkStatusEvidence(viewport, check));
|
|
11357
|
-
const failed = summaries.filter((summary) => (
|
|
11613
|
+
const failed = summaries.filter((summary) => (numberValue2(summary.failed_count) ?? 0) > 0);
|
|
11358
11614
|
return {
|
|
11359
11615
|
type: check.type,
|
|
11360
11616
|
label: checkLabel(check),
|
|
@@ -11368,7 +11624,7 @@ function assessCheckFromEvidence(check, evidence) {
|
|
|
11368
11624
|
min_bytes: check.min_bytes ?? null,
|
|
11369
11625
|
allowed_content_types: check.allowed_content_types ?? null,
|
|
11370
11626
|
viewports: summaries.map((summary) => toJsonValue(summary)),
|
|
11371
|
-
failures: failed.flatMap((summary) => Array.isArray(summary.failures) ? summary.failures.map((failure) => toJsonValue({ viewport:
|
|
11627
|
+
failures: failed.flatMap((summary) => Array.isArray(summary.failures) ? summary.failures.map((failure) => toJsonValue({ viewport: stringValue3(summary.viewport) ?? null, failure })) : [])
|
|
11372
11628
|
},
|
|
11373
11629
|
message: failed.length ? `Link status failed in ${failed.length} viewport(s).` : void 0
|
|
11374
11630
|
};
|
|
@@ -11392,13 +11648,13 @@ function assessCheckFromEvidence(check, evidence) {
|
|
|
11392
11648
|
const first = inventories[0]?.inventory;
|
|
11393
11649
|
const directRoutes = Array.isArray(first?.direct_routes) ? first.direct_routes : [];
|
|
11394
11650
|
const clickthroughs = Array.isArray(first?.clickthroughs) ? first.clickthroughs : [];
|
|
11395
|
-
const sourceLinkCount =
|
|
11396
|
-
const sourceUniqueLinkCount =
|
|
11397
|
-
const sourceCandidateCount =
|
|
11398
|
-
const sourceCandidateUniqueLinkCount =
|
|
11399
|
-
const sourceLinkScope =
|
|
11651
|
+
const sourceLinkCount = numberValue2(first?.source_link_count) ?? numberValue2(first?.home_game_link_count) ?? null;
|
|
11652
|
+
const sourceUniqueLinkCount = numberValue2(first?.source_unique_link_count) ?? numberValue2(first?.home_unique_game_link_count) ?? null;
|
|
11653
|
+
const sourceCandidateCount = numberValue2(first?.source_candidate_count);
|
|
11654
|
+
const sourceCandidateUniqueLinkCount = numberValue2(first?.source_candidate_unique_link_count);
|
|
11655
|
+
const sourceLinkScope = stringValue3(first?.source_link_scope);
|
|
11400
11656
|
const duplicateSourceLinks = Array.isArray(first?.duplicate_source_link_paths) ? first.duplicate_source_link_paths.map((path7) => String(path7)) : [];
|
|
11401
|
-
const duplicateSourceLinkCount =
|
|
11657
|
+
const duplicateSourceLinkCount = numberValue2(first?.duplicate_source_link_count) ?? (sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null);
|
|
11402
11658
|
const expectedRoutes = routeInventoryExpectedRouteSummaries(first?.expected_routes, check.expected_routes);
|
|
11403
11659
|
return {
|
|
11404
11660
|
type: check.type,
|
|
@@ -11415,8 +11671,8 @@ function assessCheckFromEvidence(check, evidence) {
|
|
|
11415
11671
|
duplicate_source_link_count: duplicateSourceLinkCount,
|
|
11416
11672
|
duplicate_source_links: duplicateSourceLinks,
|
|
11417
11673
|
duplicates_allowed: check.require_unique_routes === false,
|
|
11418
|
-
homepage_link_count:
|
|
11419
|
-
homepage_unique_link_count:
|
|
11674
|
+
homepage_link_count: numberValue2(first?.home_game_link_count) ?? sourceLinkCount,
|
|
11675
|
+
homepage_unique_link_count: numberValue2(first?.home_unique_game_link_count) ?? sourceUniqueLinkCount,
|
|
11420
11676
|
direct_route_count: directRoutes.length,
|
|
11421
11677
|
clickthrough_count: clickthroughs.length,
|
|
11422
11678
|
viewport_count: inventories.length,
|
|
@@ -17635,9 +17891,9 @@ function collectRiddleProfileArtifactRefs(input) {
|
|
|
17635
17891
|
const priorities = /* @__PURE__ */ new Map();
|
|
17636
17892
|
function add(item, source) {
|
|
17637
17893
|
if (!isRecord(item)) return;
|
|
17638
|
-
const url =
|
|
17639
|
-
const path7 =
|
|
17640
|
-
const rawName =
|
|
17894
|
+
const url = stringValue3(item.url);
|
|
17895
|
+
const path7 = stringValue3(item.path);
|
|
17896
|
+
const rawName = stringValue3(item.name) || stringValue3(item.filename) || artifactNameFromPath(url || path7) || "";
|
|
17641
17897
|
const name = normalizeRiddleProfileArtifactName(rawName);
|
|
17642
17898
|
if (!name && !url && !path7) return;
|
|
17643
17899
|
const key = profileArtifactDedupeKey(name, url || path7 || "");
|
|
@@ -17646,8 +17902,8 @@ function collectRiddleProfileArtifactRefs(input) {
|
|
|
17646
17902
|
name,
|
|
17647
17903
|
url,
|
|
17648
17904
|
path: path7,
|
|
17649
|
-
kind:
|
|
17650
|
-
content_type:
|
|
17905
|
+
kind: stringValue3(item.kind) || stringValue3(item.type),
|
|
17906
|
+
content_type: stringValue3(item.content_type) || stringValue3(item.contentType),
|
|
17651
17907
|
source
|
|
17652
17908
|
};
|
|
17653
17909
|
const existingIndex = indexes.get(key);
|
|
@@ -17721,158 +17977,6 @@ function extractRiddleProofProfileResult(input) {
|
|
|
17721
17977
|
return void 0;
|
|
17722
17978
|
}
|
|
17723
17979
|
|
|
17724
|
-
// src/public-state.ts
|
|
17725
|
-
function asRecord(value) {
|
|
17726
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
17727
|
-
}
|
|
17728
|
-
function stringValue3(value) {
|
|
17729
|
-
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
17730
|
-
}
|
|
17731
|
-
function booleanValue2(value) {
|
|
17732
|
-
return typeof value === "boolean" ? value : void 0;
|
|
17733
|
-
}
|
|
17734
|
-
function numberValue2(value) {
|
|
17735
|
-
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
17736
|
-
}
|
|
17737
|
-
function firstStringValue(...values) {
|
|
17738
|
-
for (const value of values) {
|
|
17739
|
-
const text = stringValue3(value);
|
|
17740
|
-
if (text) return text;
|
|
17741
|
-
}
|
|
17742
|
-
return void 0;
|
|
17743
|
-
}
|
|
17744
|
-
function firstBooleanValue(...values) {
|
|
17745
|
-
for (const value of values) {
|
|
17746
|
-
const bool = booleanValue2(value);
|
|
17747
|
-
if (typeof bool === "boolean") return bool;
|
|
17748
|
-
}
|
|
17749
|
-
return void 0;
|
|
17750
|
-
}
|
|
17751
|
-
function firstRecordValue(...values) {
|
|
17752
|
-
for (const value of values) {
|
|
17753
|
-
const record = asRecord(value);
|
|
17754
|
-
if (Object.keys(record).length) return record;
|
|
17755
|
-
}
|
|
17756
|
-
return void 0;
|
|
17757
|
-
}
|
|
17758
|
-
function countValue(value) {
|
|
17759
|
-
const number = numberValue2(value);
|
|
17760
|
-
return typeof number === "number" && number > 0 ? Math.trunc(number) : 0;
|
|
17761
|
-
}
|
|
17762
|
-
function checkpointSummaryFrom(...values) {
|
|
17763
|
-
const record = firstRecordValue(...values);
|
|
17764
|
-
if (!record) return void 0;
|
|
17765
|
-
const accepted = countValue(record.response_count);
|
|
17766
|
-
const rejected = countValue(record.rejected_response_count);
|
|
17767
|
-
const ignored = countValue(record.ignored_response_count);
|
|
17768
|
-
const duplicate = countValue(record.duplicate_response_count);
|
|
17769
|
-
const summary = {
|
|
17770
|
-
pending: booleanValue2(record.pending),
|
|
17771
|
-
accepted_response_count: accepted,
|
|
17772
|
-
rejected_response_count: rejected,
|
|
17773
|
-
ignored_response_count: ignored,
|
|
17774
|
-
duplicate_response_count: duplicate,
|
|
17775
|
-
latest_decision: stringValue3(record.latest_decision),
|
|
17776
|
-
audit_disclosure_required: rejected > 0 || ignored > 0 || duplicate > 0
|
|
17777
|
-
};
|
|
17778
|
-
return Object.values(summary).some((value) => typeof value !== "undefined") ? summary : void 0;
|
|
17779
|
-
}
|
|
17780
|
-
function uniqueStrings(values) {
|
|
17781
|
-
return [...new Set(values.filter(Boolean))];
|
|
17782
|
-
}
|
|
17783
|
-
function summarizeRiddleProofPublicState(input) {
|
|
17784
|
-
const record = asRecord(input);
|
|
17785
|
-
const runCard = asRecord(record.run_card);
|
|
17786
|
-
const stopCondition = asRecord(runCard.stop_condition);
|
|
17787
|
-
const raw = asRecord(record.raw);
|
|
17788
|
-
const request = asRecord(record.request);
|
|
17789
|
-
const requestMetadata = asRecord(record.request_metadata);
|
|
17790
|
-
const prState = asRecord(record.pr_state);
|
|
17791
|
-
const handoff = asRecord(record.pr_handoff_policy);
|
|
17792
|
-
const handoffState = stringValue3(handoff.state);
|
|
17793
|
-
const status = firstStringValue(record.status, stopCondition.status);
|
|
17794
|
-
const ok = booleanValue2(record.ok) ?? null;
|
|
17795
|
-
const shipMode = firstStringValue(request.ship_mode, requestMetadata.ship_mode, record.ship_mode, handoff.ship_mode);
|
|
17796
|
-
const explicitShippingDisabled = firstBooleanValue(
|
|
17797
|
-
record.shipping_disabled,
|
|
17798
|
-
stopCondition.shipping_disabled,
|
|
17799
|
-
raw.shipping_disabled,
|
|
17800
|
-
handoff.shipping_disabled
|
|
17801
|
-
);
|
|
17802
|
-
const shippingDisabled = explicitShippingDisabled === true || shipMode === "none" || handoffState === "proof_complete_ship_disabled";
|
|
17803
|
-
const explicitShipAuthorized = firstBooleanValue(
|
|
17804
|
-
record.ship_authorized,
|
|
17805
|
-
stopCondition.ship_authorized,
|
|
17806
|
-
raw.ship_authorized
|
|
17807
|
-
);
|
|
17808
|
-
const authorizationEvidence = Boolean(
|
|
17809
|
-
status === "shipped" || record.marked_ready === true || stringValue3(prState.status) === "merged" || record.merge_commit || record.merged_at
|
|
17810
|
-
);
|
|
17811
|
-
const shipAuthorizedBeforeHold = explicitShipAuthorized ?? authorizationEvidence;
|
|
17812
|
-
const explicitShipHeld = firstBooleanValue(record.ship_held, stopCondition.ship_held, raw.ship_held);
|
|
17813
|
-
const inferredHeld = status === "ready_to_ship" && shippingDisabled && !shipAuthorizedBeforeHold;
|
|
17814
|
-
const shipHeld = explicitShipHeld === true || inferredHeld;
|
|
17815
|
-
const shipAuthorized = shipHeld ? false : shipAuthorizedBeforeHold === true;
|
|
17816
|
-
const proofComplete = Boolean(
|
|
17817
|
-
status === "ready_to_ship" || status === "shipped" || status === "completed" || status === "passed" || ok === true || handoff.proof_complete === true
|
|
17818
|
-
);
|
|
17819
|
-
const checkpointSummary = checkpointSummaryFrom(
|
|
17820
|
-
record.checkpoint_summary,
|
|
17821
|
-
stopCondition.checkpoint_summary,
|
|
17822
|
-
asRecord(record.details).checkpoint_summary,
|
|
17823
|
-
asRecord(raw.details).checkpoint_summary
|
|
17824
|
-
);
|
|
17825
|
-
const blockedOrWaiting = status === "blocked" || status === "failed" || status === "awaiting_checkpoint" || handoffState === "proof_blocked" || handoffState === "proof_review_required" || handoffState === "proof_failed" || handoffState === "proof_checkpoint_required";
|
|
17826
|
-
const proofPassed = Boolean(proofComplete && !blockedOrWaiting);
|
|
17827
|
-
const explicitMergeReady = firstBooleanValue(record.merge_ready, stopCondition.merge_ready, raw.merge_ready, handoff.merge_ready);
|
|
17828
|
-
const normalPrAllowed = firstBooleanValue(record.normal_pr_allowed, raw.normal_pr_allowed, handoff.normal_pr_allowed);
|
|
17829
|
-
const baseHandoffAllowed = !blockedOrWaiting && !shipHeld && !shippingDisabled;
|
|
17830
|
-
const mergeReady = baseHandoffAllowed && normalPrAllowed !== false && (explicitMergeReady ?? shipAuthorized);
|
|
17831
|
-
const syncAllowed = mergeReady;
|
|
17832
|
-
let policyState = "unknown";
|
|
17833
|
-
if (status === "awaiting_checkpoint" || handoffState === "proof_checkpoint_required") policyState = "awaiting_checkpoint";
|
|
17834
|
-
else if (status === "failed" || handoffState === "proof_failed") policyState = "proof_failed";
|
|
17835
|
-
else if (status === "blocked" || handoffState === "proof_blocked" || handoffState === "proof_review_required") policyState = "proof_blocked";
|
|
17836
|
-
else if (handoffState === "proof_complete_ship_disabled") policyState = "proof_complete_ship_disabled";
|
|
17837
|
-
else if (proofComplete && shipHeld && !shipAuthorized) policyState = "proof_passed_ship_held";
|
|
17838
|
-
else if (proofComplete && shippingDisabled && !shipAuthorized) policyState = "proof_complete_ship_disabled";
|
|
17839
|
-
else if (shipAuthorized) policyState = "ship_authorized";
|
|
17840
|
-
else if (proofPassed) policyState = "proof_passed";
|
|
17841
|
-
else if (status === "running") policyState = "proof_in_progress";
|
|
17842
|
-
const requiredDisclosures = [];
|
|
17843
|
-
if (shipHeld) requiredDisclosures.push("ship_held");
|
|
17844
|
-
if (shippingDisabled) requiredDisclosures.push("shipping_disabled");
|
|
17845
|
-
if (checkpointSummary?.audit_disclosure_required) requiredDisclosures.push("checkpoint_audit_counters");
|
|
17846
|
-
if (status === "awaiting_checkpoint" || handoffState === "proof_checkpoint_required") requiredDisclosures.push("checkpoint_required");
|
|
17847
|
-
const prohibitedClaims = [];
|
|
17848
|
-
if (!shipAuthorized || shipHeld || shippingDisabled) prohibitedClaims.push("ship_authorized", "shipped");
|
|
17849
|
-
if (!mergeReady) prohibitedClaims.push("merge_ready");
|
|
17850
|
-
if (!syncAllowed) prohibitedClaims.push("sync_allowed");
|
|
17851
|
-
if (blockedOrWaiting) {
|
|
17852
|
-
prohibitedClaims.push("proof_passed", "ready_to_ship");
|
|
17853
|
-
}
|
|
17854
|
-
if (checkpointSummary?.audit_disclosure_required) {
|
|
17855
|
-
prohibitedClaims.push("all_checkpoint_responses_accepted");
|
|
17856
|
-
}
|
|
17857
|
-
const resultLabel2 = policyState === "awaiting_checkpoint" ? "checkpoint required" : policyState === "proof_blocked" ? "blocked" : policyState === "proof_failed" ? "failed" : policyState === "proof_complete_ship_disabled" ? "proof complete; shipping disabled" : policyState === "proof_passed_ship_held" ? "proof passed; ship held" : policyState === "ship_authorized" ? status === "shipped" ? "shipped" : "ship authorized" : policyState === "proof_passed" ? "passed" : policyState === "proof_in_progress" ? "running" : status || "recorded";
|
|
17858
|
-
return {
|
|
17859
|
-
status,
|
|
17860
|
-
ok,
|
|
17861
|
-
policy_state: policyState,
|
|
17862
|
-
result_label: resultLabel2,
|
|
17863
|
-
proof_complete: proofComplete,
|
|
17864
|
-
proof_passed: proofPassed,
|
|
17865
|
-
ship_held: shipHeld,
|
|
17866
|
-
shipping_disabled: shippingDisabled,
|
|
17867
|
-
ship_authorized: shipAuthorized,
|
|
17868
|
-
merge_ready: mergeReady,
|
|
17869
|
-
sync_allowed: syncAllowed,
|
|
17870
|
-
checkpoint_summary: checkpointSummary,
|
|
17871
|
-
required_disclosures: uniqueStrings(requiredDisclosures),
|
|
17872
|
-
prohibited_claims: uniqueStrings(prohibitedClaims)
|
|
17873
|
-
};
|
|
17874
|
-
}
|
|
17875
|
-
|
|
17876
17980
|
// src/pr-comment.ts
|
|
17877
17981
|
var RIDDLE_PROOF_PR_COMMENT_MARKER = "<!-- riddle-proof:pr-comment:v1 -->";
|
|
17878
17982
|
function asRecord2(value) {
|
|
@@ -18023,6 +18127,10 @@ function summarizeRiddleProofPrComment(input) {
|
|
|
18023
18127
|
status: firstStringValue2(result.status, stopCondition.status),
|
|
18024
18128
|
checkpoint_summary: checkpointSummary || result.checkpoint_summary
|
|
18025
18129
|
});
|
|
18130
|
+
const mergeRecommendation = riddleProofPublicStateMergeRecommendation(
|
|
18131
|
+
publicState,
|
|
18132
|
+
firstStringValue2(result.merge_recommendation, stopCondition.merge_recommendation, resultRaw.merge_recommendation)
|
|
18133
|
+
);
|
|
18026
18134
|
return {
|
|
18027
18135
|
ok,
|
|
18028
18136
|
status: stringValue4(proofResult.status),
|
|
@@ -18040,7 +18148,7 @@ function summarizeRiddleProofPrComment(input) {
|
|
|
18040
18148
|
merge_ready: publicState.merge_ready,
|
|
18041
18149
|
sync_allowed: publicState.sync_allowed,
|
|
18042
18150
|
proof_decision: firstStringValue2(result.proof_decision, stopCondition.proof_decision, resultRaw.proof_decision),
|
|
18043
|
-
merge_recommendation:
|
|
18151
|
+
merge_recommendation: mergeRecommendation,
|
|
18044
18152
|
checkpoint_summary: checkpointSummary,
|
|
18045
18153
|
public_state: publicState,
|
|
18046
18154
|
passed_checks: nestedChecks.passed,
|
|
@@ -18093,8 +18201,7 @@ function hasHandoffControl(summary) {
|
|
|
18093
18201
|
}
|
|
18094
18202
|
function shouldRenderMergeRecommendation(summary) {
|
|
18095
18203
|
if (!summary.merge_recommendation) return false;
|
|
18096
|
-
|
|
18097
|
-
return !prohibited.includes("merge_ready") && !prohibited.includes("sync_allowed");
|
|
18204
|
+
return riddleProofPublicStateAllowsMergeRecommendation(summary.public_state);
|
|
18098
18205
|
}
|
|
18099
18206
|
function checkpointSummaryLine(summary) {
|
|
18100
18207
|
const accepted = summary.response_count ?? 0;
|