@biffo/cli 0.298.15 → 0.298.16

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@biffo/cli",
3
- "version": "0.298.15",
3
+ "version": "0.298.16",
4
4
  "description": "Biffo project scaffolding CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -303,6 +303,18 @@ if [ "$BIFFO_PG_REAP_HOURS" -gt 0 ] 2>/dev/null && command -v docker >/dev/null
303
303
  # Containers created before this label existed report an empty value and
304
304
  # fall through to the age rule below, exactly as `biffo.ephemeral=1`
305
305
  # migrated in (#1383). Nothing is stranded; they simply age out once.
306
+ #
307
+ # #1683: ownership must be checked BOTH ways, not just the GONE case.
308
+ # The original `if` only ever short-circuited (`continue`) when the
309
+ # checkout was gone -- a LIVE owner matched neither that condition nor
310
+ # any other, so it fell straight through into the unconditional age
311
+ # check below and was destroyed at 24h regardless. That is precisely
312
+ # the outcome this rule was written to prevent: ownership was only
313
+ # ever ACCELERATING reaping of dead checkouts, never protecting live
314
+ # ones. A container whose checkout still exists must never reach the
315
+ # age comparison at all, however old it is -- so that case gets its
316
+ # own explicit branch here rather than falling out of the bottom of
317
+ # this one by omission.
306
318
  _owner=$(docker inspect -f '{{index .Config.Labels "biffo.checkout"}}' "$_c" 2>/dev/null)
307
319
  if [ -n "$_owner" ] && [ "$_owner" != "<no value>" ] && [ ! -d "$_owner" ]; then
308
320
  if docker rm -f -v "$_c" >/dev/null 2>&1; then
@@ -310,6 +322,13 @@ if [ "$BIFFO_PG_REAP_HOURS" -gt 0 ] 2>/dev/null && command -v docker >/dev/null
310
322
  _reaped_gone=$((_reaped_gone + 1))
311
323
  fi
312
324
  continue
325
+ elif [ -n "$_owner" ] && [ "$_owner" != "<no value>" ] && [ -d "$_owner" ]; then
326
+ # Owner known and alive: ownership decides on its own, full stop.
327
+ # An UNLABELLED container (empty/`<no value>`) has no knowable
328
+ # owner and deliberately does NOT take this branch -- it falls
329
+ # through to the age rule below exactly as before, or this change
330
+ # would leak every pre-#1680 container forever.
331
+ continue
313
332
  fi
314
333
  # Both are UTC ISO-8601 to the second, so a string compare IS a time
315
334
  # compare -- no epoch conversion, and portable across date(1) flavours.