@riddledc/riddle-proof 0.7.203 → 0.7.204
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/cli.cjs +69 -21
- package/dist/cli.js +69 -21
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -242,7 +242,9 @@ riddle-proof-loop run-profile aggregate \
|
|
|
242
242
|
`desktop/profile-result.json` and `ipad-mini/profile-result.json`, then writes
|
|
243
243
|
the combined `profile-result.json` and `summary.md`. Use `--inputs` with a
|
|
244
244
|
comma-separated list of files or directories when the child outputs do not
|
|
245
|
-
share one parent directory.
|
|
245
|
+
share one parent directory. Aggregate summaries label summed hosted timing as
|
|
246
|
+
child poll totals and also show the maximum child latency, so a matrix report
|
|
247
|
+
does not make sequential child wait time look like a single job duration.
|
|
246
248
|
|
|
247
249
|
When promoting proof artifacts into a durable public profile, avoid guessing
|
|
248
250
|
which backend or runner tokens are preserved inside `proof.json`. Derive the
|
package/dist/cli.cjs
CHANGED
|
@@ -16704,6 +16704,7 @@ function profileRiddleJobMarkdown(result) {
|
|
|
16704
16704
|
const artifactRecovery = riddle.artifact_recovery === true;
|
|
16705
16705
|
const retryCount = cliFiniteNumber(riddle.retry_count);
|
|
16706
16706
|
const staleJobIds = Array.isArray(riddle.stale_job_ids) ? riddle.stale_job_ids.map((value) => cliString(value)).filter((value) => Boolean(value)) : [];
|
|
16707
|
+
const splitJobs = Array.isArray(riddle.split_jobs) ? riddle.split_jobs.map(cliRecord).filter((job) => Boolean(job)) : [];
|
|
16707
16708
|
const parts = [
|
|
16708
16709
|
mode ? `mode ${markdownInlineCode(mode)}` : "",
|
|
16709
16710
|
jobCount === void 0 ? "" : `jobs ${jobCount}`,
|
|
@@ -16713,9 +16714,18 @@ function profileRiddleJobMarkdown(result) {
|
|
|
16713
16714
|
].filter(Boolean);
|
|
16714
16715
|
const lines = parts.length ? [`- ${parts.join(", ")}`] : [];
|
|
16715
16716
|
if (queueElapsedMs !== void 0 || elapsedMs3 !== void 0 || attempt !== void 0 || attempts !== void 0) {
|
|
16716
|
-
|
|
16717
|
-
|
|
16718
|
-
|
|
16717
|
+
if (splitJobs.length) {
|
|
16718
|
+
const maxChildQueueElapsedMs = maxDefinedNumbers(splitJobs.map((job) => cliFiniteNumber(job.queue_elapsed_ms)));
|
|
16719
|
+
const maxChildElapsedMs = maxDefinedNumbers(splitJobs.map((job) => cliFiniteNumber(job.elapsed_ms)));
|
|
16720
|
+
const maxChildPreSubmissionElapsedMs = maxDefinedNumbers(splitJobs.map((job) => cliFiniteNumber(job.pre_submission_elapsed_ms)));
|
|
16721
|
+
lines.push(
|
|
16722
|
+
`- child poll totals: queue ${formatPollDuration(queueElapsedMs)}, elapsed ${formatPollDuration(elapsedMs3)}${preSubmissionElapsedMs === void 0 || preSubmissionElapsedMs < 1e3 ? "" : `, pre-submit ${formatPollDuration(preSubmissionElapsedMs)}`}; max child queue ${formatPollDuration(maxChildQueueElapsedMs)}, max child elapsed ${formatPollDuration(maxChildElapsedMs)}${maxChildPreSubmissionElapsedMs === void 0 || maxChildPreSubmissionElapsedMs < 1e3 ? "" : `, max child pre-submit ${formatPollDuration(maxChildPreSubmissionElapsedMs)}`}`
|
|
16723
|
+
);
|
|
16724
|
+
} else {
|
|
16725
|
+
lines.push(
|
|
16726
|
+
`- poll: queue ${formatPollDuration(queueElapsedMs)}, elapsed ${formatPollDuration(elapsedMs3)}${preSubmissionElapsedMs === void 0 || preSubmissionElapsedMs < 1e3 ? "" : `, pre-submit ${formatPollDuration(preSubmissionElapsedMs)}`}${attempt === void 0 ? "" : `, attempt ${attempt}${attempts === void 0 ? "" : `/${attempts}`}`}`
|
|
16727
|
+
);
|
|
16728
|
+
}
|
|
16719
16729
|
}
|
|
16720
16730
|
if (submittedAt || completedAt) {
|
|
16721
16731
|
lines.push(`- timing:${submittedAt ? ` submitted ${markdownInlineCode(submittedAt)}` : ""}${completedAt ? ` completed ${markdownInlineCode(completedAt)}` : ""}`);
|
|
@@ -16726,7 +16736,6 @@ function profileRiddleJobMarkdown(result) {
|
|
|
16726
16736
|
if (retryCount !== void 0 && retryCount > 0) {
|
|
16727
16737
|
lines.push(`- retry recovery: replaced ${retryCount} unsubmitted job${retryCount === 1 ? "" : "s"}${staleJobIds.length ? ` (${staleJobIds.map((value) => markdownInlineCode(value)).join(", ")})` : ""}`);
|
|
16728
16738
|
}
|
|
16729
|
-
const splitJobs = Array.isArray(riddle.split_jobs) ? riddle.split_jobs.map(cliRecord).filter((job) => Boolean(job)) : [];
|
|
16730
16739
|
for (const job of splitJobs.slice(0, 12)) {
|
|
16731
16740
|
const viewport = cliString(job.viewport) || "viewport";
|
|
16732
16741
|
const splitJobId = cliString(job.job_id);
|
|
@@ -16751,6 +16760,10 @@ function profileRiddleJobMarkdown(result) {
|
|
|
16751
16760
|
if (splitJobs.length > 12) lines.push(`- ${splitJobs.length - 12} additional split job(s) omitted.`);
|
|
16752
16761
|
return lines;
|
|
16753
16762
|
}
|
|
16763
|
+
function maxDefinedNumbers(values) {
|
|
16764
|
+
const numbers = values.filter((value) => typeof value === "number" && Number.isFinite(value));
|
|
16765
|
+
return numbers.length ? Math.max(...numbers) : void 0;
|
|
16766
|
+
}
|
|
16754
16767
|
function profileMetadataStringArray(value) {
|
|
16755
16768
|
return Array.isArray(value) ? value.map((item) => typeof item === "string" ? item.trim() : "").filter((item) => Boolean(item)) : [];
|
|
16756
16769
|
}
|
|
@@ -16839,32 +16852,64 @@ function profileIsCleanupInventoryReceipt(receipt) {
|
|
|
16839
16852
|
const haystack = profileCleanupInventoryHaystack(receipt);
|
|
16840
16853
|
return haystack.includes("cleanup") || haystack.includes("post-cleanup") || haystack.includes("stale") || haystack.includes("statehygiene") || haystack.includes("state hygiene") || haystack.includes("remained after") || haystack.includes("still present");
|
|
16841
16854
|
}
|
|
16842
|
-
function
|
|
16843
|
-
const
|
|
16855
|
+
function profileIsCleanupPhaseInventoryReceipt(receipt) {
|
|
16856
|
+
const storedTo = (cliString(receipt.return_stored_to) || "").toLowerCase();
|
|
16857
|
+
const storedSegments = storedTo.split(/[.[\]/]/).filter(Boolean);
|
|
16858
|
+
const storedSegment = storedSegments[storedSegments.length - 1] || storedTo;
|
|
16859
|
+
const state = (cliString(setupReturnSummaryValue(receipt, ["state", "phase"])) || "").toLowerCase();
|
|
16860
|
+
const summary = (cliReturnSummaryLabel(receipt.return_summary) || "").toLowerCase();
|
|
16861
|
+
const markers = [storedSegment, state, summary];
|
|
16862
|
+
return markers.some((marker) => marker === "cleanup" || marker === "postcleanup" || marker === "post-cleanup" || marker === "aftercleanup" || marker === "after-cleanup" || marker.includes("post-cleanup") || marker.includes("after-cleanup") || marker.includes("after-clear") || marker.includes("after-reset") || marker.includes("after-undo") || marker.includes("after-discard") || marker.includes("after-new"));
|
|
16863
|
+
}
|
|
16864
|
+
function profileCleanupPhaseInventoryReceipts(setupViewports) {
|
|
16865
|
+
return setupViewports.flatMap((viewport) => [
|
|
16844
16866
|
...setupReceiptArray(viewport, "window_eval"),
|
|
16845
16867
|
...setupReceiptArray(viewport, "window_call")
|
|
16846
|
-
]);
|
|
16847
|
-
|
|
16848
|
-
|
|
16849
|
-
|
|
16868
|
+
]).filter((receipt) => profileIsCleanupInventoryReceipt(receipt) && profileIsCleanupPhaseInventoryReceipt(receipt));
|
|
16869
|
+
}
|
|
16870
|
+
function profileFailedCleanupInventoryReceiptReason(receipt) {
|
|
16871
|
+
if (receipt.ok === false) {
|
|
16850
16872
|
const error = cliString(receipt.error);
|
|
16851
16873
|
const reason = cliString(receipt.reason);
|
|
16852
16874
|
return compactProfileReceiptReason(error) || compactProfileReceiptReason(reason) || "cleanup inventory failed";
|
|
16853
16875
|
}
|
|
16876
|
+
const parts = [];
|
|
16877
|
+
if (setupReturnedSummaryValue(receipt, ["ok"]) === false) parts.push("ok=false");
|
|
16878
|
+
if (setupReturnedSummaryValue(receipt, ["success"]) === false) parts.push("success=false");
|
|
16879
|
+
const staleCount = cliFiniteNumber(setupReturnSummaryValue(receipt, ["staleCount"]));
|
|
16880
|
+
if (staleCount !== void 0 && staleCount > 0) parts.push(`staleCount=${staleCount}`);
|
|
16881
|
+
const staleNames = setupReturnSummaryValue(receipt, ["staleNames"]);
|
|
16882
|
+
if (Array.isArray(staleNames) && staleNames.length > 0) {
|
|
16883
|
+
const staleNamesLabel = cliValueLabel(staleNames);
|
|
16884
|
+
if (staleNamesLabel) parts.push(`staleNames=${compactProfileReceiptReason(staleNamesLabel, 120) ?? staleNamesLabel}`);
|
|
16885
|
+
}
|
|
16886
|
+
const productIssue = setupReturnedSummaryValue(receipt, ["productIssue", "issue"]);
|
|
16887
|
+
const productIssueLabel = typeof productIssue === "string" ? compactProfileReceiptReason(productIssue, 120) : void 0;
|
|
16888
|
+
if (parts.length && productIssueLabel) parts.push(productIssueLabel);
|
|
16889
|
+
return parts.length ? parts.join(", ") : void 0;
|
|
16890
|
+
}
|
|
16891
|
+
function profileFailedCleanupInventoryReason(setupViewports) {
|
|
16892
|
+
const receipts = profileCleanupPhaseInventoryReceipts(setupViewports);
|
|
16893
|
+
for (const receipt of [...receipts].reverse()) {
|
|
16894
|
+
const reason = profileFailedCleanupInventoryReceiptReason(receipt);
|
|
16895
|
+
if (reason) return reason;
|
|
16896
|
+
}
|
|
16854
16897
|
return void 0;
|
|
16855
16898
|
}
|
|
16899
|
+
function profilePassedCleanupInventoryReceiptReason(receipt) {
|
|
16900
|
+
if (receipt.ok === false) return void 0;
|
|
16901
|
+
if (setupReturnedSummaryValue(receipt, ["ok"]) === false) return void 0;
|
|
16902
|
+
if (setupReturnedSummaryValue(receipt, ["success"]) === false) return void 0;
|
|
16903
|
+
const staleCount = cliFiniteNumber(setupReturnSummaryValue(receipt, ["staleCount"]));
|
|
16904
|
+
const staleNames = setupReturnSummaryValue(receipt, ["staleNames"]);
|
|
16905
|
+
if (staleCount !== 0 || !Array.isArray(staleNames) || staleNames.length !== 0) return void 0;
|
|
16906
|
+
return "staleCount=0, staleNames=[]";
|
|
16907
|
+
}
|
|
16856
16908
|
function profilePassedCleanupInventoryReason(setupViewports) {
|
|
16857
|
-
const receipts = setupViewports
|
|
16858
|
-
|
|
16859
|
-
|
|
16860
|
-
|
|
16861
|
-
for (const receipt of receipts) {
|
|
16862
|
-
if (receipt.ok === false || !profileIsCleanupInventoryReceipt(receipt)) continue;
|
|
16863
|
-
if (setupReturnSummaryValue(receipt, ["ok"]) === false) continue;
|
|
16864
|
-
const staleCount = cliFiniteNumber(setupReturnSummaryValue(receipt, ["staleCount"]));
|
|
16865
|
-
const staleNames = setupReturnSummaryValue(receipt, ["staleNames"]);
|
|
16866
|
-
if (staleCount !== 0 || !Array.isArray(staleNames) || staleNames.length !== 0) continue;
|
|
16867
|
-
return "staleCount=0, staleNames=[]";
|
|
16909
|
+
const receipts = profileCleanupPhaseInventoryReceipts(setupViewports);
|
|
16910
|
+
for (const receipt of [...receipts].reverse()) {
|
|
16911
|
+
const reason = profilePassedCleanupInventoryReceiptReason(receipt);
|
|
16912
|
+
if (reason) return reason;
|
|
16868
16913
|
}
|
|
16869
16914
|
return void 0;
|
|
16870
16915
|
}
|
|
@@ -17609,6 +17654,9 @@ function setupReturnSummaryValue(receipt, names) {
|
|
|
17609
17654
|
for (const name of names) {
|
|
17610
17655
|
if (receipt[name] !== void 0) return receipt[name];
|
|
17611
17656
|
}
|
|
17657
|
+
return setupReturnedSummaryValue(receipt, names);
|
|
17658
|
+
}
|
|
17659
|
+
function setupReturnedSummaryValue(receipt, names) {
|
|
17612
17660
|
const returned = cliRecord(receipt.returned);
|
|
17613
17661
|
for (const name of names) {
|
|
17614
17662
|
if (returned?.[name] !== void 0) return returned[name];
|
package/dist/cli.js
CHANGED
|
@@ -529,6 +529,7 @@ function profileRiddleJobMarkdown(result) {
|
|
|
529
529
|
const artifactRecovery = riddle.artifact_recovery === true;
|
|
530
530
|
const retryCount = cliFiniteNumber(riddle.retry_count);
|
|
531
531
|
const staleJobIds = Array.isArray(riddle.stale_job_ids) ? riddle.stale_job_ids.map((value) => cliString(value)).filter((value) => Boolean(value)) : [];
|
|
532
|
+
const splitJobs = Array.isArray(riddle.split_jobs) ? riddle.split_jobs.map(cliRecord).filter((job) => Boolean(job)) : [];
|
|
532
533
|
const parts = [
|
|
533
534
|
mode ? `mode ${markdownInlineCode(mode)}` : "",
|
|
534
535
|
jobCount === void 0 ? "" : `jobs ${jobCount}`,
|
|
@@ -538,9 +539,18 @@ function profileRiddleJobMarkdown(result) {
|
|
|
538
539
|
].filter(Boolean);
|
|
539
540
|
const lines = parts.length ? [`- ${parts.join(", ")}`] : [];
|
|
540
541
|
if (queueElapsedMs !== void 0 || elapsedMs !== void 0 || attempt !== void 0 || attempts !== void 0) {
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
542
|
+
if (splitJobs.length) {
|
|
543
|
+
const maxChildQueueElapsedMs = maxDefinedNumbers(splitJobs.map((job) => cliFiniteNumber(job.queue_elapsed_ms)));
|
|
544
|
+
const maxChildElapsedMs = maxDefinedNumbers(splitJobs.map((job) => cliFiniteNumber(job.elapsed_ms)));
|
|
545
|
+
const maxChildPreSubmissionElapsedMs = maxDefinedNumbers(splitJobs.map((job) => cliFiniteNumber(job.pre_submission_elapsed_ms)));
|
|
546
|
+
lines.push(
|
|
547
|
+
`- child poll totals: queue ${formatPollDuration(queueElapsedMs)}, elapsed ${formatPollDuration(elapsedMs)}${preSubmissionElapsedMs === void 0 || preSubmissionElapsedMs < 1e3 ? "" : `, pre-submit ${formatPollDuration(preSubmissionElapsedMs)}`}; max child queue ${formatPollDuration(maxChildQueueElapsedMs)}, max child elapsed ${formatPollDuration(maxChildElapsedMs)}${maxChildPreSubmissionElapsedMs === void 0 || maxChildPreSubmissionElapsedMs < 1e3 ? "" : `, max child pre-submit ${formatPollDuration(maxChildPreSubmissionElapsedMs)}`}`
|
|
548
|
+
);
|
|
549
|
+
} else {
|
|
550
|
+
lines.push(
|
|
551
|
+
`- poll: queue ${formatPollDuration(queueElapsedMs)}, elapsed ${formatPollDuration(elapsedMs)}${preSubmissionElapsedMs === void 0 || preSubmissionElapsedMs < 1e3 ? "" : `, pre-submit ${formatPollDuration(preSubmissionElapsedMs)}`}${attempt === void 0 ? "" : `, attempt ${attempt}${attempts === void 0 ? "" : `/${attempts}`}`}`
|
|
552
|
+
);
|
|
553
|
+
}
|
|
544
554
|
}
|
|
545
555
|
if (submittedAt || completedAt) {
|
|
546
556
|
lines.push(`- timing:${submittedAt ? ` submitted ${markdownInlineCode(submittedAt)}` : ""}${completedAt ? ` completed ${markdownInlineCode(completedAt)}` : ""}`);
|
|
@@ -551,7 +561,6 @@ function profileRiddleJobMarkdown(result) {
|
|
|
551
561
|
if (retryCount !== void 0 && retryCount > 0) {
|
|
552
562
|
lines.push(`- retry recovery: replaced ${retryCount} unsubmitted job${retryCount === 1 ? "" : "s"}${staleJobIds.length ? ` (${staleJobIds.map((value) => markdownInlineCode(value)).join(", ")})` : ""}`);
|
|
553
563
|
}
|
|
554
|
-
const splitJobs = Array.isArray(riddle.split_jobs) ? riddle.split_jobs.map(cliRecord).filter((job) => Boolean(job)) : [];
|
|
555
564
|
for (const job of splitJobs.slice(0, 12)) {
|
|
556
565
|
const viewport = cliString(job.viewport) || "viewport";
|
|
557
566
|
const splitJobId = cliString(job.job_id);
|
|
@@ -576,6 +585,10 @@ function profileRiddleJobMarkdown(result) {
|
|
|
576
585
|
if (splitJobs.length > 12) lines.push(`- ${splitJobs.length - 12} additional split job(s) omitted.`);
|
|
577
586
|
return lines;
|
|
578
587
|
}
|
|
588
|
+
function maxDefinedNumbers(values) {
|
|
589
|
+
const numbers = values.filter((value) => typeof value === "number" && Number.isFinite(value));
|
|
590
|
+
return numbers.length ? Math.max(...numbers) : void 0;
|
|
591
|
+
}
|
|
579
592
|
function profileMetadataStringArray(value) {
|
|
580
593
|
return Array.isArray(value) ? value.map((item) => typeof item === "string" ? item.trim() : "").filter((item) => Boolean(item)) : [];
|
|
581
594
|
}
|
|
@@ -664,32 +677,64 @@ function profileIsCleanupInventoryReceipt(receipt) {
|
|
|
664
677
|
const haystack = profileCleanupInventoryHaystack(receipt);
|
|
665
678
|
return haystack.includes("cleanup") || haystack.includes("post-cleanup") || haystack.includes("stale") || haystack.includes("statehygiene") || haystack.includes("state hygiene") || haystack.includes("remained after") || haystack.includes("still present");
|
|
666
679
|
}
|
|
667
|
-
function
|
|
668
|
-
const
|
|
680
|
+
function profileIsCleanupPhaseInventoryReceipt(receipt) {
|
|
681
|
+
const storedTo = (cliString(receipt.return_stored_to) || "").toLowerCase();
|
|
682
|
+
const storedSegments = storedTo.split(/[.[\]/]/).filter(Boolean);
|
|
683
|
+
const storedSegment = storedSegments[storedSegments.length - 1] || storedTo;
|
|
684
|
+
const state = (cliString(setupReturnSummaryValue(receipt, ["state", "phase"])) || "").toLowerCase();
|
|
685
|
+
const summary = (cliReturnSummaryLabel(receipt.return_summary) || "").toLowerCase();
|
|
686
|
+
const markers = [storedSegment, state, summary];
|
|
687
|
+
return markers.some((marker) => marker === "cleanup" || marker === "postcleanup" || marker === "post-cleanup" || marker === "aftercleanup" || marker === "after-cleanup" || marker.includes("post-cleanup") || marker.includes("after-cleanup") || marker.includes("after-clear") || marker.includes("after-reset") || marker.includes("after-undo") || marker.includes("after-discard") || marker.includes("after-new"));
|
|
688
|
+
}
|
|
689
|
+
function profileCleanupPhaseInventoryReceipts(setupViewports) {
|
|
690
|
+
return setupViewports.flatMap((viewport) => [
|
|
669
691
|
...setupReceiptArray(viewport, "window_eval"),
|
|
670
692
|
...setupReceiptArray(viewport, "window_call")
|
|
671
|
-
]);
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
693
|
+
]).filter((receipt) => profileIsCleanupInventoryReceipt(receipt) && profileIsCleanupPhaseInventoryReceipt(receipt));
|
|
694
|
+
}
|
|
695
|
+
function profileFailedCleanupInventoryReceiptReason(receipt) {
|
|
696
|
+
if (receipt.ok === false) {
|
|
675
697
|
const error = cliString(receipt.error);
|
|
676
698
|
const reason = cliString(receipt.reason);
|
|
677
699
|
return compactProfileReceiptReason(error) || compactProfileReceiptReason(reason) || "cleanup inventory failed";
|
|
678
700
|
}
|
|
701
|
+
const parts = [];
|
|
702
|
+
if (setupReturnedSummaryValue(receipt, ["ok"]) === false) parts.push("ok=false");
|
|
703
|
+
if (setupReturnedSummaryValue(receipt, ["success"]) === false) parts.push("success=false");
|
|
704
|
+
const staleCount = cliFiniteNumber(setupReturnSummaryValue(receipt, ["staleCount"]));
|
|
705
|
+
if (staleCount !== void 0 && staleCount > 0) parts.push(`staleCount=${staleCount}`);
|
|
706
|
+
const staleNames = setupReturnSummaryValue(receipt, ["staleNames"]);
|
|
707
|
+
if (Array.isArray(staleNames) && staleNames.length > 0) {
|
|
708
|
+
const staleNamesLabel = cliValueLabel(staleNames);
|
|
709
|
+
if (staleNamesLabel) parts.push(`staleNames=${compactProfileReceiptReason(staleNamesLabel, 120) ?? staleNamesLabel}`);
|
|
710
|
+
}
|
|
711
|
+
const productIssue = setupReturnedSummaryValue(receipt, ["productIssue", "issue"]);
|
|
712
|
+
const productIssueLabel = typeof productIssue === "string" ? compactProfileReceiptReason(productIssue, 120) : void 0;
|
|
713
|
+
if (parts.length && productIssueLabel) parts.push(productIssueLabel);
|
|
714
|
+
return parts.length ? parts.join(", ") : void 0;
|
|
715
|
+
}
|
|
716
|
+
function profileFailedCleanupInventoryReason(setupViewports) {
|
|
717
|
+
const receipts = profileCleanupPhaseInventoryReceipts(setupViewports);
|
|
718
|
+
for (const receipt of [...receipts].reverse()) {
|
|
719
|
+
const reason = profileFailedCleanupInventoryReceiptReason(receipt);
|
|
720
|
+
if (reason) return reason;
|
|
721
|
+
}
|
|
679
722
|
return void 0;
|
|
680
723
|
}
|
|
724
|
+
function profilePassedCleanupInventoryReceiptReason(receipt) {
|
|
725
|
+
if (receipt.ok === false) return void 0;
|
|
726
|
+
if (setupReturnedSummaryValue(receipt, ["ok"]) === false) return void 0;
|
|
727
|
+
if (setupReturnedSummaryValue(receipt, ["success"]) === false) return void 0;
|
|
728
|
+
const staleCount = cliFiniteNumber(setupReturnSummaryValue(receipt, ["staleCount"]));
|
|
729
|
+
const staleNames = setupReturnSummaryValue(receipt, ["staleNames"]);
|
|
730
|
+
if (staleCount !== 0 || !Array.isArray(staleNames) || staleNames.length !== 0) return void 0;
|
|
731
|
+
return "staleCount=0, staleNames=[]";
|
|
732
|
+
}
|
|
681
733
|
function profilePassedCleanupInventoryReason(setupViewports) {
|
|
682
|
-
const receipts = setupViewports
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
for (const receipt of receipts) {
|
|
687
|
-
if (receipt.ok === false || !profileIsCleanupInventoryReceipt(receipt)) continue;
|
|
688
|
-
if (setupReturnSummaryValue(receipt, ["ok"]) === false) continue;
|
|
689
|
-
const staleCount = cliFiniteNumber(setupReturnSummaryValue(receipt, ["staleCount"]));
|
|
690
|
-
const staleNames = setupReturnSummaryValue(receipt, ["staleNames"]);
|
|
691
|
-
if (staleCount !== 0 || !Array.isArray(staleNames) || staleNames.length !== 0) continue;
|
|
692
|
-
return "staleCount=0, staleNames=[]";
|
|
734
|
+
const receipts = profileCleanupPhaseInventoryReceipts(setupViewports);
|
|
735
|
+
for (const receipt of [...receipts].reverse()) {
|
|
736
|
+
const reason = profilePassedCleanupInventoryReceiptReason(receipt);
|
|
737
|
+
if (reason) return reason;
|
|
693
738
|
}
|
|
694
739
|
return void 0;
|
|
695
740
|
}
|
|
@@ -1434,6 +1479,9 @@ function setupReturnSummaryValue(receipt, names) {
|
|
|
1434
1479
|
for (const name of names) {
|
|
1435
1480
|
if (receipt[name] !== void 0) return receipt[name];
|
|
1436
1481
|
}
|
|
1482
|
+
return setupReturnedSummaryValue(receipt, names);
|
|
1483
|
+
}
|
|
1484
|
+
function setupReturnedSummaryValue(receipt, names) {
|
|
1437
1485
|
const returned = cliRecord(receipt.returned);
|
|
1438
1486
|
for (const name of names) {
|
|
1439
1487
|
if (returned?.[name] !== void 0) return returned[name];
|