@bli-cockpit/cli 0.2.284 → 0.2.286
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.
|
@@ -20,7 +20,16 @@ const HOW_WORDS = { tap: "approved by you", edit: "approved by you with an edit"
|
|
|
20
20
|
function checkWhat(actKind) {
|
|
21
21
|
return `check ${checkWhere(actKind)}, then approve with --checked-sent sent or --checked-sent not-sent`;
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* A meeting review card (`notes.review`) that Tower closed because the review moved on reads `rejected` in the database
|
|
25
|
+
* (the card states have no "withdrawn"), exactly like one the person dismissed. Neither is a "no" to anything, so the
|
|
26
|
+
* words say it was closed and that the review itself is untouched.
|
|
27
|
+
*/
|
|
28
|
+
const REVIEW_CARD_KIND = "notes.review";
|
|
29
|
+
const REVIEW_CARD_CLOSED = "closed: the review moved on, or you dismissed this card. The review itself is unchanged";
|
|
23
30
|
export function statusWords(card) {
|
|
31
|
+
if (card.act_kind === REVIEW_CARD_KIND && card.status === "rejected")
|
|
32
|
+
return REVIEW_CARD_CLOSED;
|
|
24
33
|
if (card.status === "executing" && card.stuck)
|
|
25
34
|
return `stuck sending, it may or may not have gone out: ${checkWhat(card.act_kind)}`;
|
|
26
35
|
if (card.status === "failed" && card.delivery_unknown)
|
|
@@ -91,8 +100,10 @@ export function cardDetailLines(card, color) {
|
|
|
91
100
|
const lines = [`${card.title} [${statusWords(card)}]`, `Kind: ${card.kind_label}`, `To: ${card.recipient_label}`, `Why: ${card.reason}`, `From: ${sourceLine(card)}`];
|
|
92
101
|
for (const fact of card.facts ?? [])
|
|
93
102
|
lines.push(`${fact.label}: ${fact.value}`);
|
|
94
|
-
if (card.decided_how)
|
|
95
|
-
|
|
103
|
+
if (card.decided_how) {
|
|
104
|
+
const closedReview = card.act_kind === REVIEW_CARD_KIND && card.decided_how === "reject";
|
|
105
|
+
lines.push(`Decision: ${closedReview ? REVIEW_CARD_CLOSED : (HOW_WORDS[card.decided_how] ?? card.decided_how)}`);
|
|
106
|
+
}
|
|
96
107
|
if (card.rule)
|
|
97
108
|
lines.push(`Standing rule: ${card.rule.label}`);
|
|
98
109
|
lines.push("", ...contentLines(card));
|
|
@@ -21,7 +21,7 @@ export async function runCockpitCli(argv, io) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
if (command === "--version" || command === "-V" || command === "version") {
|
|
24
|
-
writeLine(io?.stdout ?? process.stdout, "0.2.
|
|
24
|
+
writeLine(io?.stdout ?? process.stdout, "0.2.286");
|
|
25
25
|
return 0;
|
|
26
26
|
}
|
|
27
27
|
|
package/dist/staging-gate.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*
|
|
16
16
|
* Three reasons close the gate, most urgent first:
|
|
17
17
|
*
|
|
18
|
-
* - `low_disk`: the volume's free space is under max(5 GiB, 5% of the volume),
|
|
18
|
+
* - `low_disk`: the volume's free space is under max(5 GiB, min(5% of the volume, 20 GiB)),
|
|
19
19
|
* for a file bigger than 1% of the free space left (smaller files are admitted).
|
|
20
20
|
* - `state_over_ceiling`: everything the collector writes under its state dir
|
|
21
21
|
* (staging, spool, logs, cursors, state; never the study folders
|
|
@@ -40,10 +40,17 @@ import { classifyStateEntry } from "./state-dir-audit.js";
|
|
|
40
40
|
/** Hard ceiling on everything the collector writes under its state dir. */
|
|
41
41
|
export const DEFAULT_STATE_CEILING_BYTES = 512 * 1024 * 1024;
|
|
42
42
|
export const STATE_CEILING_ENV = "COCKPIT_STATE_CEILING_BYTES";
|
|
43
|
-
/** Overrides the low-disk floor (bytes); unset means max(5 GiB, 5% of volume). */
|
|
43
|
+
/** Overrides the low-disk floor (bytes); unset means max(5 GiB, min(5% of volume, 20 GiB)). */
|
|
44
44
|
export const MIN_FREE_ENV = "COCKPIT_MIN_FREE_BYTES";
|
|
45
45
|
export const LOW_DISK_FLOOR_BYTES = 5 * 1024 * 1024 * 1024;
|
|
46
46
|
export const LOW_DISK_FLOOR_FRACTION = 0.05;
|
|
47
|
+
/**
|
|
48
|
+
* The percent part stops growing here (BLI-23183). The fleet's own heartbeat numbers showed the 5% rule putting a
|
|
49
|
+
* 930 GB Windows desktop at a 46.5 GB floor with 44.2 GB free: paused, and RED on the board, on a disk nobody would
|
|
50
|
+
* call full. The fixed 5 GiB part already protects the operating system; 20 GiB is the share of a big disk Tower
|
|
51
|
+
* leaves alone, and a 228 GB Mac (floor 11.4 GB) is unchanged.
|
|
52
|
+
*/
|
|
53
|
+
export const LOW_DISK_FLOOR_MAX_BYTES = 20 * 1024 * 1024 * 1024;
|
|
47
54
|
/**
|
|
48
55
|
* A file at most this fraction of the free space left is never refused for low
|
|
49
56
|
* disk: a 7 MB upload does not threaten a volume with gigabytes free, even one
|
|
@@ -101,7 +108,8 @@ pathApi = path) {
|
|
|
101
108
|
export function lowDiskFloorBytes(totalBytes, override) {
|
|
102
109
|
if (override !== null)
|
|
103
110
|
return override;
|
|
104
|
-
|
|
111
|
+
const percentPart = Math.min(LOW_DISK_FLOOR_MAX_BYTES, Math.ceil(totalBytes * LOW_DISK_FLOOR_FRACTION));
|
|
112
|
+
return Math.max(LOW_DISK_FLOOR_BYTES, percentPart);
|
|
105
113
|
}
|
|
106
114
|
/**
|
|
107
115
|
* Everything the collector writes under its state dir, studies excluded: the
|