@riddledc/riddle-proof 0.7.214 → 0.7.216
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +130 -5
- package/dist/cli.js +130 -5
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -17078,10 +17078,24 @@ function profileHasOfflineAudioMetricsReceipt(receipts) {
|
|
|
17078
17078
|
"peak",
|
|
17079
17079
|
"rms"
|
|
17080
17080
|
];
|
|
17081
|
-
|
|
17082
|
-
|
|
17083
|
-
|
|
17084
|
-
|
|
17081
|
+
const metricFieldNames = new Set(metricFields.map((name) => name.toLowerCase()));
|
|
17082
|
+
const positiveMetricValue = (value) => {
|
|
17083
|
+
const number = cliFiniteNumber(value);
|
|
17084
|
+
return number !== void 0 && number > 0;
|
|
17085
|
+
};
|
|
17086
|
+
const metricSummaryItem = (item) => {
|
|
17087
|
+
const label = (cliString(item.label) || "").toLowerCase();
|
|
17088
|
+
const path7 = (cliString(item.path) || "").toLowerCase();
|
|
17089
|
+
const tail = (path7.split(".").filter(Boolean).pop() || label).toLowerCase();
|
|
17090
|
+
const normalizedLabel = label.replace(/[^a-z0-9]+/g, "");
|
|
17091
|
+
const normalizedTail = tail.replace(/[^a-z0-9]+/g, "");
|
|
17092
|
+
return metricFieldNames.has(normalizedLabel) || metricFieldNames.has(normalizedTail) || /(^|\.)(mixhealth|monitormetrics|instrumentmetrics)\.(peak|rms)$/.test(path7);
|
|
17093
|
+
};
|
|
17094
|
+
return receipts.some((receipt) => {
|
|
17095
|
+
if (metricFields.some((name) => positiveMetricValue(setupReturnSummaryValue(receipt, [name])))) return true;
|
|
17096
|
+
const summaries = Array.isArray(receipt.return_summary) ? receipt.return_summary.map(cliRecord).filter((item) => Boolean(item)) : [];
|
|
17097
|
+
return summaries.some((item) => metricSummaryItem(item) && positiveMetricValue(item.value));
|
|
17098
|
+
});
|
|
17085
17099
|
}
|
|
17086
17100
|
function profileHasActiveRouteLocalProofReceipt(receipts) {
|
|
17087
17101
|
return receipts.some((receipt) => {
|
|
@@ -17217,6 +17231,72 @@ function profileHasRecoveredStateReceipt(receipts) {
|
|
|
17217
17231
|
return hasRecoveredState || success || hasValid && hasInvalid === false || leftTerminalState && retrySurfaceReady;
|
|
17218
17232
|
});
|
|
17219
17233
|
}
|
|
17234
|
+
function profileHasSequenceInputReceipt(receipts) {
|
|
17235
|
+
let hasSequenceContract = false;
|
|
17236
|
+
let hasInputReadyState = false;
|
|
17237
|
+
let hasSequenceOutcome = false;
|
|
17238
|
+
for (const receipt of receipts) {
|
|
17239
|
+
const storedTo = cliString(receipt.return_stored_to) || "";
|
|
17240
|
+
const label = cliString(receipt.label) || "";
|
|
17241
|
+
const path7 = cliString(receipt.path) || cliString(receipt.function_name) || "";
|
|
17242
|
+
const slot = profileLowerSummaryValue(receipt, ["slot", "phase", "state"]);
|
|
17243
|
+
const statusText = profileLowerSummaryValue(receipt, ["statusText", "status", "message"]);
|
|
17244
|
+
const summary = cliReturnSummaryLabel(receipt.return_summary) || "";
|
|
17245
|
+
const haystack = `${storedTo} ${label} ${path7} ${slot} ${statusText} ${summary}`.toLowerCase();
|
|
17246
|
+
const sequenceText = [
|
|
17247
|
+
"expectedSequence",
|
|
17248
|
+
"expectedLevel2Sequence",
|
|
17249
|
+
"inputSequence",
|
|
17250
|
+
"targetSequence",
|
|
17251
|
+
"sequence",
|
|
17252
|
+
"pattern"
|
|
17253
|
+
].map((name) => cliString(setupReturnSummaryValue(receipt, [name]))?.toLowerCase()).find(Boolean) || "";
|
|
17254
|
+
const sequenceArray = [
|
|
17255
|
+
setupReturnSummaryValue(receipt, ["expectedSequence"]),
|
|
17256
|
+
setupReturnSummaryValue(receipt, ["expectedLevel2Sequence"]),
|
|
17257
|
+
setupReturnSummaryValue(receipt, ["inputSequence"]),
|
|
17258
|
+
setupReturnSummaryValue(receipt, ["targetSequence"]),
|
|
17259
|
+
setupReturnSummaryValue(receipt, ["sequence"])
|
|
17260
|
+
].some((value) => Array.isArray(value) && value.length > 0);
|
|
17261
|
+
const mentionsSequence = Boolean(sequenceArray || sequenceText) || haystack.includes("sequence") || haystack.includes("short-long") || haystack.includes("short,long") || haystack.includes("short long") || haystack.includes("long-short") || haystack.includes("long,short") || haystack.includes("long short");
|
|
17262
|
+
if (mentionsSequence) hasSequenceContract = true;
|
|
17263
|
+
const level = cliFiniteNumber(setupReturnSummaryValue(receipt, ["level"]));
|
|
17264
|
+
const expectedSteps = cliFiniteNumber(setupReturnSummaryValue(receipt, ["expectedSteps", "stepCount", "sequenceLength"]));
|
|
17265
|
+
const controlsEnabled = setupReturnSummaryValue(receipt, ["controlsEnabled", "inputControlsEnabled", "inputEnabled", "canInput"]) === true || setupReturnSummaryValue(receipt, ["shortDisabled"]) === false || setupReturnSummaryValue(receipt, ["longDisabled"]) === false;
|
|
17266
|
+
const inputReady = haystack.includes("input") || statusText.includes("your turn") || statusText.includes("ready");
|
|
17267
|
+
if (inputReady && (controlsEnabled || level !== void 0 || expectedSteps !== void 0)) {
|
|
17268
|
+
hasInputReadyState = true;
|
|
17269
|
+
}
|
|
17270
|
+
const success = setupReturnSummaryValue(receipt, ["success", "passed"]) === true || statusText.includes("perfect") || statusText.includes("success");
|
|
17271
|
+
const failure = statusText.includes("miss") || statusText.includes("failure") || setupReturnSummaryValue(receipt, ["failed"]) === true;
|
|
17272
|
+
const streak = cliFiniteNumber(setupReturnSummaryValue(receipt, ["streak"]));
|
|
17273
|
+
const best = cliFiniteNumber(setupReturnSummaryValue(receipt, ["best"]));
|
|
17274
|
+
if (mentionsSequence && (success || failure || streak !== void 0 || best !== void 0)) {
|
|
17275
|
+
hasSequenceOutcome = true;
|
|
17276
|
+
}
|
|
17277
|
+
}
|
|
17278
|
+
return hasSequenceContract && (hasInputReadyState || hasSequenceOutcome);
|
|
17279
|
+
}
|
|
17280
|
+
function profileHasRestartReadyReceipt(receipts) {
|
|
17281
|
+
return receipts.some((receipt) => {
|
|
17282
|
+
const storedTo = cliString(receipt.return_stored_to) || "";
|
|
17283
|
+
const label = cliString(receipt.label) || "";
|
|
17284
|
+
const path7 = cliString(receipt.path) || cliString(receipt.function_name) || "";
|
|
17285
|
+
const slot = profileLowerSummaryValue(receipt, ["slot", "phase", "state"]);
|
|
17286
|
+
const statusText = profileLowerSummaryValue(receipt, ["statusText", "status", "message"]);
|
|
17287
|
+
const summary = cliReturnSummaryLabel(receipt.return_summary) || "";
|
|
17288
|
+
const haystack = `${storedTo} ${label} ${path7} ${slot} ${statusText} ${summary}`.toLowerCase();
|
|
17289
|
+
const labelsRestart = haystack.includes("restart") || haystack.includes("play again") || haystack.includes("play-again") || haystack.includes("playagain") || haystack.includes("retry");
|
|
17290
|
+
if (!labelsRestart) return false;
|
|
17291
|
+
const ok = receipt.ok !== false && setupReturnSummaryValue(receipt, ["ok"]) !== false;
|
|
17292
|
+
const controlsEnabled = setupReturnSummaryValue(receipt, ["controlsEnabled", "inputControlsEnabled", "inputEnabled", "canInput"]) === true || setupReturnSummaryValue(receipt, ["shortDisabled"]) === false && setupReturnSummaryValue(receipt, ["longDisabled"]) === false;
|
|
17293
|
+
const level = cliFiniteNumber(setupReturnSummaryValue(receipt, ["level"]));
|
|
17294
|
+
const streak = cliFiniteNumber(setupReturnSummaryValue(receipt, ["streak"]));
|
|
17295
|
+
const best = cliFiniteNumber(setupReturnSummaryValue(receipt, ["best"]));
|
|
17296
|
+
const readyState = statusText.includes("your turn") || statusText.includes("ready") || setupReturnSummaryValue(receipt, ["ready", "restartReady", "restart_ready"]) === true;
|
|
17297
|
+
return ok && controlsEnabled && (readyState || level !== void 0 || streak !== void 0 || best !== void 0);
|
|
17298
|
+
});
|
|
17299
|
+
}
|
|
17220
17300
|
function profileMetadataHasGeneratedOutputContract(metadata) {
|
|
17221
17301
|
const contract = cliRecord(metadata.declared_state_contract);
|
|
17222
17302
|
if (!contract) return false;
|
|
@@ -17265,6 +17345,7 @@ function profilePackReceiptStatus(result, metadata, receipt) {
|
|
|
17265
17345
|
const valueReceipts = [
|
|
17266
17346
|
...setupViewports.flatMap((viewport) => setupReceiptArray(viewport, "window_eval")),
|
|
17267
17347
|
...setupViewports.flatMap((viewport) => setupReceiptArray(viewport, "window_call")),
|
|
17348
|
+
...setupViewports.flatMap((viewport) => setupReceiptArray(viewport, "window_call_until")),
|
|
17268
17349
|
...setupActionValueReceipts
|
|
17269
17350
|
].filter((item) => item.ok !== false);
|
|
17270
17351
|
const clickCount = setupViewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.clicked_total) || 0), 0) + profileSetupReceiptTotal(setupViewports, "click") + profileSetupReceiptTotal(setupViewports, "click_count");
|
|
@@ -17322,6 +17403,34 @@ function profilePackReceiptStatus(result, metadata, receipt) {
|
|
|
17322
17403
|
const after = cliFiniteNumber(setupReturnSummaryValue(item, ["after", "afterCount", "itemCount", "count"]));
|
|
17323
17404
|
return before !== void 0 && after !== void 0 && after > before;
|
|
17324
17405
|
});
|
|
17406
|
+
const stateGrowthMetricNames = [
|
|
17407
|
+
"best",
|
|
17408
|
+
"streak",
|
|
17409
|
+
"score",
|
|
17410
|
+
"level",
|
|
17411
|
+
"progress",
|
|
17412
|
+
"coins",
|
|
17413
|
+
"totalCoins",
|
|
17414
|
+
"totalEarned",
|
|
17415
|
+
"saveTotalCoins",
|
|
17416
|
+
"saveTotalClicks",
|
|
17417
|
+
"perClick",
|
|
17418
|
+
"perSecond",
|
|
17419
|
+
"clickPowerLevel",
|
|
17420
|
+
"autoClickerLevel"
|
|
17421
|
+
];
|
|
17422
|
+
const hasPositiveStateGrowthMetric = valueReceipts.some((item) => stateGrowthMetricNames.some((name) => {
|
|
17423
|
+
const storedTo = cliString(item.return_stored_to) || "";
|
|
17424
|
+
const label = cliString(item.label) || "";
|
|
17425
|
+
const path7 = cliString(item.path) || cliString(item.function_name) || "";
|
|
17426
|
+
const slot = profileLowerSummaryValue(item, ["slot", "phase", "state"]);
|
|
17427
|
+
const statusText = profileLowerSummaryValue(item, ["statusText", "status", "message"]);
|
|
17428
|
+
const haystack = `${storedTo} ${label} ${path7} ${slot} ${statusText}`.toLowerCase();
|
|
17429
|
+
const stateGrowthOutcome = haystack.includes("growth") || haystack.includes("success") || haystack.includes("after") || haystack.includes("add") || haystack.includes("upgrade") || haystack.includes("bought") || haystack.includes("perfect") || setupReturnSummaryValue(item, ["success", "passed"]) === true;
|
|
17430
|
+
if (!stateGrowthOutcome) return false;
|
|
17431
|
+
const value = cliFiniteNumber(setupReturnSummaryValue(item, [name]));
|
|
17432
|
+
return value !== void 0 && value > 0;
|
|
17433
|
+
}));
|
|
17325
17434
|
const hasReachability = profileReachabilitySummaryMarkdown(result).length > 0 || result.checks.some((check) => check.type === "selector_visible" && Boolean(cliRecord(check.evidence)?.selector));
|
|
17326
17435
|
const hasOverflowEvidence = result.checks.some((check) => check.type === "no_horizontal_overflow" || check.type === "no_mobile_horizontal_overflow" || check.type === "frame_no_horizontal_overflow") || evidenceViewports.some((viewport) => (cliFiniteNumber(viewport.overflow_px) || 0) > 0 || (cliFiniteNumber(viewport.bounds_overflow_px) || 0) > 0 || Boolean(viewport.overflow_offenders?.length));
|
|
17327
17436
|
const hasConsoleAccounting = profileHasCheck(result, ["no_console_warnings", "no_fatal_console_errors"]) || Boolean(result.evidence?.console || result.evidence?.page_errors);
|
|
@@ -17408,6 +17517,8 @@ function profilePackReceiptStatus(result, metadata, receipt) {
|
|
|
17408
17517
|
const hasControlledSuccessLaunchReceipt = profileHasControlledLaunchReceipt(valueReceipts, "success");
|
|
17409
17518
|
const hasRouteContinuationReceipt = profileHasRouteContinuationReceipt(valueReceipts);
|
|
17410
17519
|
const hasRecoveredStateReceipt = profileHasRecoveredStateReceipt(valueReceipts);
|
|
17520
|
+
const hasSequenceInputReceipt = profileHasSequenceInputReceipt(valueReceipts) && (inputDispatchCount > 0 || hasNaturalInput);
|
|
17521
|
+
const hasRestartReadyReceipt = profileHasRestartReadyReceipt(valueReceipts);
|
|
17411
17522
|
const hasGeneratedOutputContract = profileMetadataHasGeneratedOutputContract(metadata);
|
|
17412
17523
|
const hasGeneratedOutputReceipt = profileHasGeneratedOutputReceipt(valueReceipts);
|
|
17413
17524
|
const failedCleanupInventoryReason = profileFailedCleanupInventoryReason(setupViewports);
|
|
@@ -17575,6 +17686,20 @@ function profilePackReceiptStatus(result, metadata, receipt) {
|
|
|
17575
17686
|
"visible cleanup affordance receipt missing"
|
|
17576
17687
|
);
|
|
17577
17688
|
}
|
|
17689
|
+
if (text.includes("input") && (text.includes("sequence") || text.includes("short-long") || text.includes("short long") || text.includes("long-short") || text.includes("long long") || text.includes("long short"))) {
|
|
17690
|
+
return profileReceiptSignalStatus(
|
|
17691
|
+
hasSequenceInputReceipt,
|
|
17692
|
+
"sequence input receipt present",
|
|
17693
|
+
"sequence input receipt missing"
|
|
17694
|
+
);
|
|
17695
|
+
}
|
|
17696
|
+
if (text.includes("restart") && (text.includes("receipt") || text.includes("ready") || text.includes("re-enabled") || text.includes("controls"))) {
|
|
17697
|
+
return profileReceiptSignalStatus(
|
|
17698
|
+
hasRestartReadyReceipt,
|
|
17699
|
+
"restart-ready receipt present",
|
|
17700
|
+
"restart-ready receipt missing"
|
|
17701
|
+
);
|
|
17702
|
+
}
|
|
17578
17703
|
if (text.includes("retry") || text.includes("repair") || text.includes("reset") || text.includes("affordance")) {
|
|
17579
17704
|
return profileReceiptSignalStatus(hasStateContract || clickCount > 0, "affordance or transition receipt present", "affordance receipt missing");
|
|
17580
17705
|
}
|
|
@@ -17585,7 +17710,7 @@ function profilePackReceiptStatus(result, metadata, receipt) {
|
|
|
17585
17710
|
return profileReceiptSignalStatus(hasTextVisibility || screenshotCount > 0, "initial visible-state evidence present", "initial state evidence missing");
|
|
17586
17711
|
}
|
|
17587
17712
|
if (text.includes("state-growth") || text.includes("state growth") || text.includes("growth receipt") || text.includes("grid grows") || text.includes("state") && text.includes("after the click")) {
|
|
17588
|
-
return profileReceiptSignalStatus(hasStateGrowthReceipt, "state-growth receipt present", "state-growth receipt missing");
|
|
17713
|
+
return profileReceiptSignalStatus(hasStateGrowthReceipt || hasPositiveStateGrowthMetric, "state-growth receipt present", "state-growth receipt missing");
|
|
17589
17714
|
}
|
|
17590
17715
|
if (text.includes("visible grid") || text.includes("control evidence") || text.includes("grid") && text.includes("control")) {
|
|
17591
17716
|
return profileReceiptSignalStatus(
|
package/dist/cli.js
CHANGED
|
@@ -838,10 +838,24 @@ function profileHasOfflineAudioMetricsReceipt(receipts) {
|
|
|
838
838
|
"peak",
|
|
839
839
|
"rms"
|
|
840
840
|
];
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
841
|
+
const metricFieldNames = new Set(metricFields.map((name) => name.toLowerCase()));
|
|
842
|
+
const positiveMetricValue = (value) => {
|
|
843
|
+
const number = cliFiniteNumber(value);
|
|
844
|
+
return number !== void 0 && number > 0;
|
|
845
|
+
};
|
|
846
|
+
const metricSummaryItem = (item) => {
|
|
847
|
+
const label = (cliString(item.label) || "").toLowerCase();
|
|
848
|
+
const path2 = (cliString(item.path) || "").toLowerCase();
|
|
849
|
+
const tail = (path2.split(".").filter(Boolean).pop() || label).toLowerCase();
|
|
850
|
+
const normalizedLabel = label.replace(/[^a-z0-9]+/g, "");
|
|
851
|
+
const normalizedTail = tail.replace(/[^a-z0-9]+/g, "");
|
|
852
|
+
return metricFieldNames.has(normalizedLabel) || metricFieldNames.has(normalizedTail) || /(^|\.)(mixhealth|monitormetrics|instrumentmetrics)\.(peak|rms)$/.test(path2);
|
|
853
|
+
};
|
|
854
|
+
return receipts.some((receipt) => {
|
|
855
|
+
if (metricFields.some((name) => positiveMetricValue(setupReturnSummaryValue(receipt, [name])))) return true;
|
|
856
|
+
const summaries = Array.isArray(receipt.return_summary) ? receipt.return_summary.map(cliRecord).filter((item) => Boolean(item)) : [];
|
|
857
|
+
return summaries.some((item) => metricSummaryItem(item) && positiveMetricValue(item.value));
|
|
858
|
+
});
|
|
845
859
|
}
|
|
846
860
|
function profileHasActiveRouteLocalProofReceipt(receipts) {
|
|
847
861
|
return receipts.some((receipt) => {
|
|
@@ -977,6 +991,72 @@ function profileHasRecoveredStateReceipt(receipts) {
|
|
|
977
991
|
return hasRecoveredState || success || hasValid && hasInvalid === false || leftTerminalState && retrySurfaceReady;
|
|
978
992
|
});
|
|
979
993
|
}
|
|
994
|
+
function profileHasSequenceInputReceipt(receipts) {
|
|
995
|
+
let hasSequenceContract = false;
|
|
996
|
+
let hasInputReadyState = false;
|
|
997
|
+
let hasSequenceOutcome = false;
|
|
998
|
+
for (const receipt of receipts) {
|
|
999
|
+
const storedTo = cliString(receipt.return_stored_to) || "";
|
|
1000
|
+
const label = cliString(receipt.label) || "";
|
|
1001
|
+
const path2 = cliString(receipt.path) || cliString(receipt.function_name) || "";
|
|
1002
|
+
const slot = profileLowerSummaryValue(receipt, ["slot", "phase", "state"]);
|
|
1003
|
+
const statusText = profileLowerSummaryValue(receipt, ["statusText", "status", "message"]);
|
|
1004
|
+
const summary = cliReturnSummaryLabel(receipt.return_summary) || "";
|
|
1005
|
+
const haystack = `${storedTo} ${label} ${path2} ${slot} ${statusText} ${summary}`.toLowerCase();
|
|
1006
|
+
const sequenceText = [
|
|
1007
|
+
"expectedSequence",
|
|
1008
|
+
"expectedLevel2Sequence",
|
|
1009
|
+
"inputSequence",
|
|
1010
|
+
"targetSequence",
|
|
1011
|
+
"sequence",
|
|
1012
|
+
"pattern"
|
|
1013
|
+
].map((name) => cliString(setupReturnSummaryValue(receipt, [name]))?.toLowerCase()).find(Boolean) || "";
|
|
1014
|
+
const sequenceArray = [
|
|
1015
|
+
setupReturnSummaryValue(receipt, ["expectedSequence"]),
|
|
1016
|
+
setupReturnSummaryValue(receipt, ["expectedLevel2Sequence"]),
|
|
1017
|
+
setupReturnSummaryValue(receipt, ["inputSequence"]),
|
|
1018
|
+
setupReturnSummaryValue(receipt, ["targetSequence"]),
|
|
1019
|
+
setupReturnSummaryValue(receipt, ["sequence"])
|
|
1020
|
+
].some((value) => Array.isArray(value) && value.length > 0);
|
|
1021
|
+
const mentionsSequence = Boolean(sequenceArray || sequenceText) || haystack.includes("sequence") || haystack.includes("short-long") || haystack.includes("short,long") || haystack.includes("short long") || haystack.includes("long-short") || haystack.includes("long,short") || haystack.includes("long short");
|
|
1022
|
+
if (mentionsSequence) hasSequenceContract = true;
|
|
1023
|
+
const level = cliFiniteNumber(setupReturnSummaryValue(receipt, ["level"]));
|
|
1024
|
+
const expectedSteps = cliFiniteNumber(setupReturnSummaryValue(receipt, ["expectedSteps", "stepCount", "sequenceLength"]));
|
|
1025
|
+
const controlsEnabled = setupReturnSummaryValue(receipt, ["controlsEnabled", "inputControlsEnabled", "inputEnabled", "canInput"]) === true || setupReturnSummaryValue(receipt, ["shortDisabled"]) === false || setupReturnSummaryValue(receipt, ["longDisabled"]) === false;
|
|
1026
|
+
const inputReady = haystack.includes("input") || statusText.includes("your turn") || statusText.includes("ready");
|
|
1027
|
+
if (inputReady && (controlsEnabled || level !== void 0 || expectedSteps !== void 0)) {
|
|
1028
|
+
hasInputReadyState = true;
|
|
1029
|
+
}
|
|
1030
|
+
const success = setupReturnSummaryValue(receipt, ["success", "passed"]) === true || statusText.includes("perfect") || statusText.includes("success");
|
|
1031
|
+
const failure = statusText.includes("miss") || statusText.includes("failure") || setupReturnSummaryValue(receipt, ["failed"]) === true;
|
|
1032
|
+
const streak = cliFiniteNumber(setupReturnSummaryValue(receipt, ["streak"]));
|
|
1033
|
+
const best = cliFiniteNumber(setupReturnSummaryValue(receipt, ["best"]));
|
|
1034
|
+
if (mentionsSequence && (success || failure || streak !== void 0 || best !== void 0)) {
|
|
1035
|
+
hasSequenceOutcome = true;
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
return hasSequenceContract && (hasInputReadyState || hasSequenceOutcome);
|
|
1039
|
+
}
|
|
1040
|
+
function profileHasRestartReadyReceipt(receipts) {
|
|
1041
|
+
return receipts.some((receipt) => {
|
|
1042
|
+
const storedTo = cliString(receipt.return_stored_to) || "";
|
|
1043
|
+
const label = cliString(receipt.label) || "";
|
|
1044
|
+
const path2 = cliString(receipt.path) || cliString(receipt.function_name) || "";
|
|
1045
|
+
const slot = profileLowerSummaryValue(receipt, ["slot", "phase", "state"]);
|
|
1046
|
+
const statusText = profileLowerSummaryValue(receipt, ["statusText", "status", "message"]);
|
|
1047
|
+
const summary = cliReturnSummaryLabel(receipt.return_summary) || "";
|
|
1048
|
+
const haystack = `${storedTo} ${label} ${path2} ${slot} ${statusText} ${summary}`.toLowerCase();
|
|
1049
|
+
const labelsRestart = haystack.includes("restart") || haystack.includes("play again") || haystack.includes("play-again") || haystack.includes("playagain") || haystack.includes("retry");
|
|
1050
|
+
if (!labelsRestart) return false;
|
|
1051
|
+
const ok = receipt.ok !== false && setupReturnSummaryValue(receipt, ["ok"]) !== false;
|
|
1052
|
+
const controlsEnabled = setupReturnSummaryValue(receipt, ["controlsEnabled", "inputControlsEnabled", "inputEnabled", "canInput"]) === true || setupReturnSummaryValue(receipt, ["shortDisabled"]) === false && setupReturnSummaryValue(receipt, ["longDisabled"]) === false;
|
|
1053
|
+
const level = cliFiniteNumber(setupReturnSummaryValue(receipt, ["level"]));
|
|
1054
|
+
const streak = cliFiniteNumber(setupReturnSummaryValue(receipt, ["streak"]));
|
|
1055
|
+
const best = cliFiniteNumber(setupReturnSummaryValue(receipt, ["best"]));
|
|
1056
|
+
const readyState = statusText.includes("your turn") || statusText.includes("ready") || setupReturnSummaryValue(receipt, ["ready", "restartReady", "restart_ready"]) === true;
|
|
1057
|
+
return ok && controlsEnabled && (readyState || level !== void 0 || streak !== void 0 || best !== void 0);
|
|
1058
|
+
});
|
|
1059
|
+
}
|
|
980
1060
|
function profileMetadataHasGeneratedOutputContract(metadata) {
|
|
981
1061
|
const contract = cliRecord(metadata.declared_state_contract);
|
|
982
1062
|
if (!contract) return false;
|
|
@@ -1025,6 +1105,7 @@ function profilePackReceiptStatus(result, metadata, receipt) {
|
|
|
1025
1105
|
const valueReceipts = [
|
|
1026
1106
|
...setupViewports.flatMap((viewport) => setupReceiptArray(viewport, "window_eval")),
|
|
1027
1107
|
...setupViewports.flatMap((viewport) => setupReceiptArray(viewport, "window_call")),
|
|
1108
|
+
...setupViewports.flatMap((viewport) => setupReceiptArray(viewport, "window_call_until")),
|
|
1028
1109
|
...setupActionValueReceipts
|
|
1029
1110
|
].filter((item) => item.ok !== false);
|
|
1030
1111
|
const clickCount = setupViewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.clicked_total) || 0), 0) + profileSetupReceiptTotal(setupViewports, "click") + profileSetupReceiptTotal(setupViewports, "click_count");
|
|
@@ -1082,6 +1163,34 @@ function profilePackReceiptStatus(result, metadata, receipt) {
|
|
|
1082
1163
|
const after = cliFiniteNumber(setupReturnSummaryValue(item, ["after", "afterCount", "itemCount", "count"]));
|
|
1083
1164
|
return before !== void 0 && after !== void 0 && after > before;
|
|
1084
1165
|
});
|
|
1166
|
+
const stateGrowthMetricNames = [
|
|
1167
|
+
"best",
|
|
1168
|
+
"streak",
|
|
1169
|
+
"score",
|
|
1170
|
+
"level",
|
|
1171
|
+
"progress",
|
|
1172
|
+
"coins",
|
|
1173
|
+
"totalCoins",
|
|
1174
|
+
"totalEarned",
|
|
1175
|
+
"saveTotalCoins",
|
|
1176
|
+
"saveTotalClicks",
|
|
1177
|
+
"perClick",
|
|
1178
|
+
"perSecond",
|
|
1179
|
+
"clickPowerLevel",
|
|
1180
|
+
"autoClickerLevel"
|
|
1181
|
+
];
|
|
1182
|
+
const hasPositiveStateGrowthMetric = valueReceipts.some((item) => stateGrowthMetricNames.some((name) => {
|
|
1183
|
+
const storedTo = cliString(item.return_stored_to) || "";
|
|
1184
|
+
const label = cliString(item.label) || "";
|
|
1185
|
+
const path2 = cliString(item.path) || cliString(item.function_name) || "";
|
|
1186
|
+
const slot = profileLowerSummaryValue(item, ["slot", "phase", "state"]);
|
|
1187
|
+
const statusText = profileLowerSummaryValue(item, ["statusText", "status", "message"]);
|
|
1188
|
+
const haystack = `${storedTo} ${label} ${path2} ${slot} ${statusText}`.toLowerCase();
|
|
1189
|
+
const stateGrowthOutcome = haystack.includes("growth") || haystack.includes("success") || haystack.includes("after") || haystack.includes("add") || haystack.includes("upgrade") || haystack.includes("bought") || haystack.includes("perfect") || setupReturnSummaryValue(item, ["success", "passed"]) === true;
|
|
1190
|
+
if (!stateGrowthOutcome) return false;
|
|
1191
|
+
const value = cliFiniteNumber(setupReturnSummaryValue(item, [name]));
|
|
1192
|
+
return value !== void 0 && value > 0;
|
|
1193
|
+
}));
|
|
1085
1194
|
const hasReachability = profileReachabilitySummaryMarkdown(result).length > 0 || result.checks.some((check) => check.type === "selector_visible" && Boolean(cliRecord(check.evidence)?.selector));
|
|
1086
1195
|
const hasOverflowEvidence = result.checks.some((check) => check.type === "no_horizontal_overflow" || check.type === "no_mobile_horizontal_overflow" || check.type === "frame_no_horizontal_overflow") || evidenceViewports.some((viewport) => (cliFiniteNumber(viewport.overflow_px) || 0) > 0 || (cliFiniteNumber(viewport.bounds_overflow_px) || 0) > 0 || Boolean(viewport.overflow_offenders?.length));
|
|
1087
1196
|
const hasConsoleAccounting = profileHasCheck(result, ["no_console_warnings", "no_fatal_console_errors"]) || Boolean(result.evidence?.console || result.evidence?.page_errors);
|
|
@@ -1168,6 +1277,8 @@ function profilePackReceiptStatus(result, metadata, receipt) {
|
|
|
1168
1277
|
const hasControlledSuccessLaunchReceipt = profileHasControlledLaunchReceipt(valueReceipts, "success");
|
|
1169
1278
|
const hasRouteContinuationReceipt = profileHasRouteContinuationReceipt(valueReceipts);
|
|
1170
1279
|
const hasRecoveredStateReceipt = profileHasRecoveredStateReceipt(valueReceipts);
|
|
1280
|
+
const hasSequenceInputReceipt = profileHasSequenceInputReceipt(valueReceipts) && (inputDispatchCount > 0 || hasNaturalInput);
|
|
1281
|
+
const hasRestartReadyReceipt = profileHasRestartReadyReceipt(valueReceipts);
|
|
1171
1282
|
const hasGeneratedOutputContract = profileMetadataHasGeneratedOutputContract(metadata);
|
|
1172
1283
|
const hasGeneratedOutputReceipt = profileHasGeneratedOutputReceipt(valueReceipts);
|
|
1173
1284
|
const failedCleanupInventoryReason = profileFailedCleanupInventoryReason(setupViewports);
|
|
@@ -1335,6 +1446,20 @@ function profilePackReceiptStatus(result, metadata, receipt) {
|
|
|
1335
1446
|
"visible cleanup affordance receipt missing"
|
|
1336
1447
|
);
|
|
1337
1448
|
}
|
|
1449
|
+
if (text.includes("input") && (text.includes("sequence") || text.includes("short-long") || text.includes("short long") || text.includes("long-short") || text.includes("long long") || text.includes("long short"))) {
|
|
1450
|
+
return profileReceiptSignalStatus(
|
|
1451
|
+
hasSequenceInputReceipt,
|
|
1452
|
+
"sequence input receipt present",
|
|
1453
|
+
"sequence input receipt missing"
|
|
1454
|
+
);
|
|
1455
|
+
}
|
|
1456
|
+
if (text.includes("restart") && (text.includes("receipt") || text.includes("ready") || text.includes("re-enabled") || text.includes("controls"))) {
|
|
1457
|
+
return profileReceiptSignalStatus(
|
|
1458
|
+
hasRestartReadyReceipt,
|
|
1459
|
+
"restart-ready receipt present",
|
|
1460
|
+
"restart-ready receipt missing"
|
|
1461
|
+
);
|
|
1462
|
+
}
|
|
1338
1463
|
if (text.includes("retry") || text.includes("repair") || text.includes("reset") || text.includes("affordance")) {
|
|
1339
1464
|
return profileReceiptSignalStatus(hasStateContract || clickCount > 0, "affordance or transition receipt present", "affordance receipt missing");
|
|
1340
1465
|
}
|
|
@@ -1345,7 +1470,7 @@ function profilePackReceiptStatus(result, metadata, receipt) {
|
|
|
1345
1470
|
return profileReceiptSignalStatus(hasTextVisibility || screenshotCount > 0, "initial visible-state evidence present", "initial state evidence missing");
|
|
1346
1471
|
}
|
|
1347
1472
|
if (text.includes("state-growth") || text.includes("state growth") || text.includes("growth receipt") || text.includes("grid grows") || text.includes("state") && text.includes("after the click")) {
|
|
1348
|
-
return profileReceiptSignalStatus(hasStateGrowthReceipt, "state-growth receipt present", "state-growth receipt missing");
|
|
1473
|
+
return profileReceiptSignalStatus(hasStateGrowthReceipt || hasPositiveStateGrowthMetric, "state-growth receipt present", "state-growth receipt missing");
|
|
1349
1474
|
}
|
|
1350
1475
|
if (text.includes("visible grid") || text.includes("control evidence") || text.includes("grid") && text.includes("control")) {
|
|
1351
1476
|
return profileReceiptSignalStatus(
|