muse-crew 0.8.0 → 0.8.1
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/lib/publish-npm.sh +24 -6
- package/package.json +1 -1
package/lib/publish-npm.sh
CHANGED
|
@@ -212,7 +212,13 @@ if [ "$ALREADY_PUBLISHED" = "0" ]; then
|
|
|
212
212
|
|
|
213
213
|
# 11. Publish. "previously published versions" means a retried Publish
|
|
214
214
|
# already landed this version (the merge lock guarantees no other task
|
|
215
|
-
# picked it) — continue.
|
|
215
|
+
# picked it) — continue. A "staged version" 409 means npm accepted the
|
|
216
|
+
# publish but staged it: the PUT returned 2xx yet the version is
|
|
217
|
+
# invisible in the packument until it finalizes (~7 min observed
|
|
218
|
+
# 2026-09-17). Never re-PUT a staged version — the registry rejects it
|
|
219
|
+
# and the re-PUT proves nothing. Poll the registry at step 12 until it
|
|
220
|
+
# finalizes or the budget exhausts (fail closed). Any other failure is
|
|
221
|
+
# fatal.
|
|
216
222
|
if PUB_OUT="$(python3 "$NPM_PUBLISH_PY" "$TGZ" 2>&1)"; then
|
|
217
223
|
echo "PUBLISHED=$TARGET_VERSION"
|
|
218
224
|
else
|
|
@@ -220,6 +226,10 @@ if [ "$ALREADY_PUBLISHED" = "0" ]; then
|
|
|
220
226
|
*"previously published versions"*)
|
|
221
227
|
echo "PUBLISHED_ALREADY=$TARGET_VERSION"
|
|
222
228
|
;;
|
|
229
|
+
*"staged version"*)
|
|
230
|
+
echo "PUBLISHED_STAGED=$TARGET_VERSION"
|
|
231
|
+
echo "publish staged by registry — polling for visibility, not re-PUTting"
|
|
232
|
+
;;
|
|
223
233
|
*)
|
|
224
234
|
rm -f "$TGZ"
|
|
225
235
|
fail "publish" "$(printf '%s\n' "$PUB_OUT" | tail -5)"
|
|
@@ -231,12 +241,20 @@ if [ "$ALREADY_PUBLISHED" = "0" ]; then
|
|
|
231
241
|
# 12. Verify: ground truth is the registry, not any agent's summary.
|
|
232
242
|
# The registry is eventually consistent: a publish followed by an
|
|
233
243
|
# immediate read can observe the pre-publish version (canary 5a027278
|
|
234
|
-
# hit a stale read replica ~6s after publish).
|
|
235
|
-
#
|
|
236
|
-
#
|
|
244
|
+
# hit a stale read replica ~6s after publish). Worse, npm may STAGE a
|
|
245
|
+
# publish: the PUT returns 2xx but the version stays invisible in the
|
|
246
|
+
# packument until it finalizes (~7 min observed 2026-09-17) — a
|
|
247
|
+
# re-PUT then 409s as "previously staged". A short budget would park
|
|
248
|
+
# a landed publish, so the default budget covers staged finalization
|
|
249
|
+
# with headroom (30 x 30s = 15 min, still bounded). A single stale
|
|
250
|
+
# read must never park a landed publish, so this block retries with
|
|
251
|
+
# backoff and client cache-busting instead of failing on the first
|
|
252
|
+
# mismatch. Budget exhaustion fails closed: a publish that never
|
|
253
|
+
# becomes visible is not claimed — a human with 2FA investigates
|
|
254
|
+
# (e.g. `npm stage approve`) and the version is never re-PUT blind.
|
|
237
255
|
# STEP-12-ANCHOR: publish verification (retry-tolerant)
|
|
238
|
-
VERIFY_ATTEMPTS="${VERIFY_ATTEMPTS:-
|
|
239
|
-
VERIFY_SLEEP_SECS="${VERIFY_SLEEP_SECS:-
|
|
256
|
+
VERIFY_ATTEMPTS="${VERIFY_ATTEMPTS:-30}"
|
|
257
|
+
VERIFY_SLEEP_SECS="${VERIFY_SLEEP_SECS:-30}"
|
|
240
258
|
REG=""
|
|
241
259
|
for attempt in $(seq 1 "$VERIFY_ATTEMPTS"); do
|
|
242
260
|
# --prefer-online busts npm's client-side packument cache; the retry
|
package/package.json
CHANGED