@tokenoftrust/cli 3.7.3 → 3.7.4
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/package.json +1 -1
- package/src/commands/ship.mjs +19 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenoftrust/cli",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.4",
|
|
4
4
|
"description": "Token of Trust developer CLI — clone a tenant store, run it locally with save→reload, and submit it for preview. Installs the `tot` command.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Token of Trust",
|
package/src/commands/ship.mjs
CHANGED
|
@@ -291,6 +291,8 @@ export function normalizeShipResult(data) {
|
|
|
291
291
|
artifactDigest: typeof o.artifactDigest === "string" ? o.artifactDigest : null,
|
|
292
292
|
receiptId: typeof o.receiptId === "string" ? o.receiptId : null,
|
|
293
293
|
rollbackTarget: o.rollbackTarget && typeof o.rollbackTarget === "object" ? o.rollbackTarget : null,
|
|
294
|
+
retriable: o.retriable === false ? false : o.retriable === true ? true : null,
|
|
295
|
+
pointerWritten: o.pointerWritten === true,
|
|
294
296
|
};
|
|
295
297
|
}
|
|
296
298
|
|
|
@@ -699,20 +701,34 @@ function reportShipResult(result, { tenant, liveUrl, noOpen, openUrl }) {
|
|
|
699
701
|
return 1;
|
|
700
702
|
}
|
|
701
703
|
if (result.state === "promote_failed" || result.state === "record_failed") {
|
|
704
|
+
// A deterministic refusal (the live flip's compare-and-set, or any outcome that says a retry
|
|
705
|
+
// cannot change it) must not be offered as safe to retry.
|
|
706
|
+
const deterministic = result.retriable === false || result.reason === "live_moved";
|
|
702
707
|
console.error(
|
|
703
708
|
fail(
|
|
704
709
|
result.message || `ship ${result.state.replace("_", " ")}`,
|
|
705
|
-
|
|
710
|
+
deterministic
|
|
711
|
+
? "do not re-run `tot ship` — this refusal is deterministic and will not change"
|
|
712
|
+
: "re-run `tot ship` — the ship is idempotent and safe to retry",
|
|
706
713
|
),
|
|
707
714
|
);
|
|
708
715
|
return 1;
|
|
709
716
|
}
|
|
710
717
|
if (result.state === "publishing") {
|
|
711
|
-
|
|
718
|
+
// Dispatched is not written. Say the pointer moved only once this result says it was.
|
|
719
|
+
console.log(
|
|
720
|
+
result.pointerWritten
|
|
721
|
+
? `\n ⏳ ${tenant} is publishing — the live pointer moved, CDN delivery is still confirming.`
|
|
722
|
+
: `\n ⏳ ${tenant} is publishing — dispatched; the live pointer is not written yet.`,
|
|
723
|
+
);
|
|
712
724
|
if (result.pinnedSha) console.log(` pinned: ${result.pinnedSha}`);
|
|
713
725
|
if (result.receiptId) console.log(` receipt: ${result.receiptId}`);
|
|
714
726
|
if (result.message) console.log(` ${result.message}`);
|
|
715
|
-
console.log(
|
|
727
|
+
console.log(
|
|
728
|
+
result.pointerWritten
|
|
729
|
+
? " re-run `tot ship` in a bit to confirm — it dedupes onto this same dispatch, safe to retry."
|
|
730
|
+
: " re-run `tot ship` in a bit to confirm — it dedupes onto this same dispatch.",
|
|
731
|
+
);
|
|
716
732
|
return 1;
|
|
717
733
|
}
|
|
718
734
|
console.error(
|