clan-lab's orphaned-tag sweep asks doctl for a field it doesn't have (ResourceCount vs DropletCount) — 170+ dead clan-lab-expires-* tags on the account #740

Closed
opened 2026-08-24 02:07:45 +00:00 by matou-build-agent · 4 comments

cmd_reap in .claude/skills/clan-lab/clan-lab finishes by sweeping expiry tags that no droplet holds any more:

doctl compute tag list --format Name,ResourceCount --no-header |
  awk '$1 ~ /^clan-lab-expires-/ && $2 == 0 { print $1 }' | ...

ResourceCount is not a field doctl renders. On doctl 1.160.1 it prints <nil> for every row, so awk compares the string "<nil>" against "0", never matches, and the sweep has never deleted a single tag. The real field is DropletCount — verified live on the account just now:

$ doctl compute tag list --format Name,ResourceCount --no-header | head -2
clan-lab                       <nil>
idss-gateway                   <nil>

$ doctl compute tag list --format Name,DropletCount --no-header | head -3
clan-lab                       0
idss-gateway                   1
idss-rental                    1

Consequence: 170+ orphaned clan-lab-expires-<epoch> tag objects are sitting on the DigitalOcean account, the oldest dating to ~2026-07-09 when the CLI was first validated. They cost nothing and are not billing — this is clutter, not an outage — but the sweep reads as working and does not.

Found while fixing #723 (the reaper cron had never run at all, for an unrelated PATH reason). Confirmed still true after a successful reap: the droplet went, the tag stayed.

Also worth fixing in the same pass — set_expiry, same file, line 93:

[ -n "$old" ] && doctl compute droplet untag "$1" --tag-name "$old"

Under set -euo pipefail, when $old is empty this line evaluates to false and, not being the last command in the function, kills the whole script. So clan-lab extend on a lab that somehow has no clan-lab-expires- tag dies silently part-way through instead of setting the new expiry. Line 95 already guards itself with || true; line 93 does not.

Why a session, not the swarm

Both fixes are in .claude/skills/clan-lab/clan-lab. That path is permission-gated for an agent session under the current harness (.claude/** writes need an interactive grant), so #723's session could not make them and filed this instead. A session with the grant, or a human, can do both in one commit; scripts/tests/clan-lab-reap-test.sh is the place to guard them, and its comment block already names the ResourceCount trap and explains why it deliberately does not assert the sweep today (a fixture printing 0 would make a no-op look green).

`cmd_reap` in `.claude/skills/clan-lab/clan-lab` finishes by sweeping expiry tags that no droplet holds any more: ``` doctl compute tag list --format Name,ResourceCount --no-header | awk '$1 ~ /^clan-lab-expires-/ && $2 == 0 { print $1 }' | ... ``` **`ResourceCount` is not a field doctl renders.** On doctl 1.160.1 it prints `<nil>` for every row, so awk compares the string `"<nil>"` against `"0"`, never matches, and the sweep has never deleted a single tag. The real field is **`DropletCount`** — verified live on the account just now: ``` $ doctl compute tag list --format Name,ResourceCount --no-header | head -2 clan-lab <nil> idss-gateway <nil> $ doctl compute tag list --format Name,DropletCount --no-header | head -3 clan-lab 0 idss-gateway 1 idss-rental 1 ``` Consequence: **170+ orphaned `clan-lab-expires-<epoch>` tag objects** are sitting on the DigitalOcean account, the oldest dating to ~2026-07-09 when the CLI was first validated. They cost nothing and are not billing — this is clutter, not an outage — but the sweep reads as working and does not. Found while fixing #723 (the reaper cron had never run at all, for an unrelated PATH reason). Confirmed still true *after* a successful reap: the droplet went, the tag stayed. Also worth fixing in the same pass — `set_expiry`, same file, line 93: ``` [ -n "$old" ] && doctl compute droplet untag "$1" --tag-name "$old" ``` Under `set -euo pipefail`, when `$old` is empty this line evaluates to false and, not being the last command in the function, **kills the whole script**. So `clan-lab extend` on a lab that somehow has no `clan-lab-expires-` tag dies silently part-way through instead of setting the new expiry. Line 95 already guards itself with `|| true`; line 93 does not. ## Why a session, not the swarm Both fixes are in `.claude/skills/clan-lab/clan-lab`. That path is permission-gated for an agent session under the current harness (`.claude/**` writes need an interactive grant), so #723's session could not make them and filed this instead. A session with the grant, or a human, can do both in one commit; `scripts/tests/clan-lab-reap-test.sh` is the place to guard them, and its comment block already names the `ResourceCount` trap and explains why it deliberately does not assert the sweep today (a fixture printing `0` would make a no-op look green).
Author
Member

Session report — one bug confirmed and swept, one claim corrected, one grant left

Ruled by agent under ADR 0174 — veto anytime.

1. The ResourceCount bug: confirmed, and it is worse than a typo

Verified live on doctl 1.160.1. tag list has exactly two columns:

$ doctl compute tag list --help
--format Name   Columns for output in a comma-separated list. Possible values: Name, `DropletCount`.

The part worth carrying forward is how doctl fails: an unknown --format
column is not a non-zero exit and not a message on stderr. It prints the
literal <nil> in that position and exits 0. So awk '$2 == 0' compared
"<nil>" to 0, never matched, the pipeline exited 0, and the sweep read as
working in the code, in the log, and in the exit status. That is #723's
enforcer-that-never-ran one layer down — a filter that never matched — and it is
invisible for the same reason: a cleanup job that correctly finds nothing to do
looks identical to one that cannot see. Written up as GOTCHAS #75.

2. Swept live — 172 gone, and the fixed CLI is what swept them

Not a hand-rolled one-liner: the candidate patch below was applied to a copy and
clan-lab reap run from it, so the fix is its own proof.

before:  172 clan-lab-expires-* tags, all DropletCount 0
         oldest clan-lab-expires-1783580974 -> 2026-07-09 07:09Z   (as you called it)
         newest clan-lab-expires-1787552857 -> 2026-08-24 06:27Z
after:   0

Both halves of the filter are exercised by what survived: clan-lab,
idss-707-probe and ssh-timing-test-691 all have DropletCount 0 and were left
alone by the prefix test, and all five account droplets (matou-prod,
mail.matou.nz, mail.mauke.network, matou-workstation,
idss-gateway-rehearsal-c-8bc1) were untouched.

Why this was a two-way door: all 172 names were captured before deletion and
each is recreatable with doctl compute tag create <name>; no droplet held any
of them; nothing else on the account matched the prefix; no spend; no
security-posture change. The full name list is in the next comment for the
record.

3. The set_expiry claim does NOT reproduce — correcting the ticket

Under set -euo pipefail, when $old is empty this line evaluates to false
and, not being the last command in the function, kills the whole script.

It is the opposite way round. bash exempts a failing non-final component of
an && list from set -e; what it does not exempt is a function whose last
command is a false && list, because the function then returns 1 to its caller.
Line 93 is not last — line 95 follows it and ends || true — so nothing
propagates:

$ bash -c 'set -euo pipefail; f(){ old=""; [ -n "$old" ] && echo untag; echo tail; }; f; echo after'
tail
after                                    # <- no death

$ bash -c 'set -euo pipefail; f(){ old=""; [ -n "$old" ] && echo untag; }; g(){ f; echo g-tail; }; g'
$ echo $?
1                                        # <- death, but only when it IS last

And end to end, against the unpatched CLI with a stub doctl returning no
tags for droplet get:

$ clan-lab extend clan-lab-noexp-aaaa 4
clan-lab-noexp-aaaa now expires Mon Aug 24 09:13:00 UTC 2026     # rc=0

So extend on a lab with no expiry tag works today. The line is still worth
changing — it is a landmine one edit away from being real (move it, or delete
line 95, and it returns 1 into a set -e caller) — but the fix below is
justified by something that does bite, found while writing the test for it:

two expiry tags on one droplet. Reachable, because it is exactly what a
set_expiry that tagged and then failed to untag leaves behind. $old is then
two lines, and --tag-name "$old" passes both names as a single newline-joined
argument. That untag is the last command of its && list, so its failure
does kill extend under set -e — one stuck droplet poisoning every later
extend on it. The patch untags and drops each old tag on its own.

4. The patch — proven, 8/8

scripts/tests/clan-lab-reap-test.sh grows 5 -> 8 cases on branch
740-clan-lab-tag-sweep (8fa8da8a). Case 5 (the sweep) and case 7 (the
two-tag droplet) are red against today's CLI and green against this patch;
case 6 pins the extend behaviour from §3 and passes either way.

The key move is in the stub, and it answers the question the old comment block
raised: the stub doctl now serves tag list per requested column, exactly
as the real one does, <nil> included. A faithful stub dissolves the dilemma
instead of documenting it — ask for ResourceCount and the test fails the way
production failed, so no fixture can make a no-op look green.

@@ -90,9 +90,20 @@
   old="$(expires_tag_of "$1")"
   doctl compute tag create "clan-lab-expires-$2" >/dev/null 2>&1 || true
   doctl compute droplet tag "$1" --tag-name "clan-lab-expires-$2"
-  [ -n "$old" ] && doctl compute droplet untag "$1" --tag-name "$old"
-  # tags are account-wide objects; drop the old one if now unused
-  [ -n "$old" ] && doctl compute tag delete "$old" --force >/dev/null 2>&1 || true
+  # Every OLD expiry tag goes, one at a time. `$old` can hold MORE than one: a
+  # set_expiry that tagged and then failed to untag leaves two on the droplet,
+  # and the old single `--tag-name "$old"` then passed both names as one
+  # newline-joined argument — an untag that is the last command of its `&&` list,
+  # so its failure did kill `extend` under `set -e`, for good, on that droplet.
+  # No bare `[ -n "$old" ] && ...` either: as the last command of a function that
+  # is what a false test returns to a `set -e` caller (#740).
+  while read -r tag; do
+    [ -n "$tag" ] || continue
+    doctl compute droplet untag "$1" --tag-name "$tag" ||
+      echo "clan-lab: warning: could not untag '$tag' from $1 (new expiry is set)" >&2
+    # tags are account-wide objects; drop the old one if now unused
+    doctl compute tag delete "$tag" --force >/dev/null 2>&1 || true
+  done <<<"$old"
 }
 
 latest_golden() { # -> image id of newest clan-lab-golden-* snapshot (or empty)
@@ -200,9 +211,21 @@
       reaped=$((reaped + 1))
     fi
   done < <(labs)
-  # sweep orphaned expiry tags (tag objects with no droplets left)
-  doctl compute tag list --format Name,ResourceCount --no-header |
-    awk '$1 ~ /^clan-lab-expires-/ && $2 == 0 { print $1 }' |
+  # Sweep orphaned expiry tags (tag objects no droplet holds any more). The
+  # column is DropletCount, the only count `tag list` has. `ResourceCount` is
+  # not a column doctl renders, and an unknown --format column prints the
+  # literal `<nil>` and exits 0 rather than erroring, so this sweep matched
+  # nothing from the day it was written and 172 dead tags accumulated (#740,
+  # GOTCHAS #75).
+  #
+  # The filter tests the STRING "0", not numeric 0, deliberately: awk compares an
+  # EMPTY field equal to numeric 0, so a count that fails to render — the next
+  # renamed column, a doctl that prints blank rather than `<nil>` — would sweep
+  # tags that live labs still hold. Deleting the tag object strips it from the
+  # droplet, labs() then reads expiry 0, and the next hourly reap destroys a
+  # running lab. Unknown must mean "leave it", never "orphan".
+  doctl compute tag list --format Name,DropletCount --no-header |
+    awk '$1 ~ /^clan-lab-expires-/ && $2 == "0" { print $1 }' |
     while read -r tag; do doctl compute tag delete "$tag" --force >/dev/null 2>&1 || true; done
   echo "reap done ($reaped destroyed)"
 }

Verify with:

git checkout 740-clan-lab-tag-sweep
bash scripts/tests/clan-lab-reap-test.sh                        # RED  (case 5)
# apply the patch to .claude/skills/clan-lab/clan-lab, then:
bash scripts/tests/clan-lab-reap-test.sh                        # 8/8 passed

Landed on main (9b3e69b9): GOTCHAS #75 + STATUS.md. The test is deliberately
not on main — a knowingly-red suite there is an invitation to soften an
assertion rather than fix the code, which is the same lie the original comment
block was avoiding.

5. Why this is not closed

See the ## Why human below. Everything except the two hunks is done.

## Session report — one bug confirmed and swept, one claim corrected, one grant left Ruled by agent under ADR 0174 — veto anytime. ### 1. The `ResourceCount` bug: confirmed, and it is worse than a typo Verified live on doctl 1.160.1. `tag list` has **exactly two** columns: ``` $ doctl compute tag list --help --format Name Columns for output in a comma-separated list. Possible values: Name, `DropletCount`. ``` The part worth carrying forward is *how* doctl fails: an unknown `--format` column is **not** a non-zero exit and **not** a message on stderr. It prints the literal `<nil>` in that position and exits 0. So `awk '$2 == 0'` compared `"<nil>"` to `0`, never matched, the pipeline exited 0, and the sweep read as working in the code, in the log, *and* in the exit status. That is #723's enforcer-that-never-ran one layer down — a filter that never matched — and it is invisible for the same reason: a cleanup job that correctly finds nothing to do looks identical to one that cannot see. Written up as **GOTCHAS #75**. ### 2. Swept live — 172 gone, and the fixed CLI is what swept them Not a hand-rolled one-liner: the candidate patch below was applied to a copy and `clan-lab reap` run from it, so the fix is its own proof. ``` before: 172 clan-lab-expires-* tags, all DropletCount 0 oldest clan-lab-expires-1783580974 -> 2026-07-09 07:09Z (as you called it) newest clan-lab-expires-1787552857 -> 2026-08-24 06:27Z after: 0 ``` Both halves of the filter are exercised by what *survived*: `clan-lab`, `idss-707-probe` and `ssh-timing-test-691` all have DropletCount 0 and were left alone by the prefix test, and all five account droplets (`matou-prod`, `mail.matou.nz`, `mail.mauke.network`, `matou-workstation`, `idss-gateway-rehearsal-c-8bc1`) were untouched. **Why this was a two-way door:** all 172 names were captured before deletion and each is recreatable with `doctl compute tag create <name>`; no droplet held any of them; nothing else on the account matched the prefix; no spend; no security-posture change. The full name list is in the next comment for the record. ### 3. The `set_expiry` claim does NOT reproduce — correcting the ticket > Under `set -euo pipefail`, when `$old` is empty this line evaluates to false > and, not being the last command in the function, kills the whole script. It is the opposite way round. bash exempts a failing **non-final** component of an `&&` list from `set -e`; what it does *not* exempt is a function whose **last** command is a false `&&` list, because the function then returns 1 to its caller. Line 93 is not last — line 95 follows it and ends `|| true` — so nothing propagates: ``` $ bash -c 'set -euo pipefail; f(){ old=""; [ -n "$old" ] && echo untag; echo tail; }; f; echo after' tail after # <- no death $ bash -c 'set -euo pipefail; f(){ old=""; [ -n "$old" ] && echo untag; }; g(){ f; echo g-tail; }; g' $ echo $? 1 # <- death, but only when it IS last ``` And end to end, against the **unpatched** CLI with a stub doctl returning no tags for `droplet get`: ``` $ clan-lab extend clan-lab-noexp-aaaa 4 clan-lab-noexp-aaaa now expires Mon Aug 24 09:13:00 UTC 2026 # rc=0 ``` So `extend` on a lab with no expiry tag works today. The line is still worth changing — it is a landmine one edit away from being real (move it, or delete line 95, and it returns 1 into a `set -e` caller) — but the fix below is justified by something that *does* bite, found while writing the test for it: **two expiry tags on one droplet.** Reachable, because it is exactly what a `set_expiry` that tagged and then failed to untag leaves behind. `$old` is then two lines, and `--tag-name "$old"` passes both names as a single newline-joined argument. *That* untag **is** the last command of its `&&` list, so its failure does kill `extend` under `set -e` — one stuck droplet poisoning every later extend on it. The patch untags and drops each old tag on its own. ### 4. The patch — proven, 8/8 `scripts/tests/clan-lab-reap-test.sh` grows 5 -> 8 cases on branch **`740-clan-lab-tag-sweep`** (`8fa8da8a`). Case 5 (the sweep) and case 7 (the two-tag droplet) are **red** against today's CLI and green against this patch; case 6 pins the `extend` behaviour from §3 and passes either way. The key move is in the stub, and it answers the question the old comment block raised: the stub `doctl` now serves `tag list` **per requested column**, exactly as the real one does, `<nil>` included. A faithful stub dissolves the dilemma instead of documenting it — ask for `ResourceCount` and the test fails the way production failed, so no fixture can make a no-op look green. ```diff @@ -90,9 +90,20 @@ old="$(expires_tag_of "$1")" doctl compute tag create "clan-lab-expires-$2" >/dev/null 2>&1 || true doctl compute droplet tag "$1" --tag-name "clan-lab-expires-$2" - [ -n "$old" ] && doctl compute droplet untag "$1" --tag-name "$old" - # tags are account-wide objects; drop the old one if now unused - [ -n "$old" ] && doctl compute tag delete "$old" --force >/dev/null 2>&1 || true + # Every OLD expiry tag goes, one at a time. `$old` can hold MORE than one: a + # set_expiry that tagged and then failed to untag leaves two on the droplet, + # and the old single `--tag-name "$old"` then passed both names as one + # newline-joined argument — an untag that is the last command of its `&&` list, + # so its failure did kill `extend` under `set -e`, for good, on that droplet. + # No bare `[ -n "$old" ] && ...` either: as the last command of a function that + # is what a false test returns to a `set -e` caller (#740). + while read -r tag; do + [ -n "$tag" ] || continue + doctl compute droplet untag "$1" --tag-name "$tag" || + echo "clan-lab: warning: could not untag '$tag' from $1 (new expiry is set)" >&2 + # tags are account-wide objects; drop the old one if now unused + doctl compute tag delete "$tag" --force >/dev/null 2>&1 || true + done <<<"$old" } latest_golden() { # -> image id of newest clan-lab-golden-* snapshot (or empty) @@ -200,9 +211,21 @@ reaped=$((reaped + 1)) fi done < <(labs) - # sweep orphaned expiry tags (tag objects with no droplets left) - doctl compute tag list --format Name,ResourceCount --no-header | - awk '$1 ~ /^clan-lab-expires-/ && $2 == 0 { print $1 }' | + # Sweep orphaned expiry tags (tag objects no droplet holds any more). The + # column is DropletCount, the only count `tag list` has. `ResourceCount` is + # not a column doctl renders, and an unknown --format column prints the + # literal `<nil>` and exits 0 rather than erroring, so this sweep matched + # nothing from the day it was written and 172 dead tags accumulated (#740, + # GOTCHAS #75). + # + # The filter tests the STRING "0", not numeric 0, deliberately: awk compares an + # EMPTY field equal to numeric 0, so a count that fails to render — the next + # renamed column, a doctl that prints blank rather than `<nil>` — would sweep + # tags that live labs still hold. Deleting the tag object strips it from the + # droplet, labs() then reads expiry 0, and the next hourly reap destroys a + # running lab. Unknown must mean "leave it", never "orphan". + doctl compute tag list --format Name,DropletCount --no-header | + awk '$1 ~ /^clan-lab-expires-/ && $2 == "0" { print $1 }' | while read -r tag; do doctl compute tag delete "$tag" --force >/dev/null 2>&1 || true; done echo "reap done ($reaped destroyed)" } ``` Verify with: ``` git checkout 740-clan-lab-tag-sweep bash scripts/tests/clan-lab-reap-test.sh # RED (case 5) # apply the patch to .claude/skills/clan-lab/clan-lab, then: bash scripts/tests/clan-lab-reap-test.sh # 8/8 passed ``` Landed on `main` (`9b3e69b9`): GOTCHAS #75 + STATUS.md. The test is deliberately **not** on main — a knowingly-red suite there is an invitation to soften an assertion rather than fix the code, which is the same lie the original comment block was avoiding. ### 5. Why this is not closed See the `## Why human` below. Everything except the two hunks is done.
Author
Member

Record: the 172 orphaned tag names deleted 2026-08-24

Captured before the sweep so the action is literally revertible — doctl compute tag create <name> recreates any of them. Kept here because a two-way-door ruling is only two-way if the way back is written down.

172 names
clan-lab-expires-1783580974
clan-lab-expires-1783591837
clan-lab-expires-1783596246
clan-lab-expires-1783647351
clan-lab-expires-1783647668
clan-lab-expires-1783652824
clan-lab-expires-1784877326
clan-lab-expires-1784879470
clan-lab-expires-1784879710
clan-lab-expires-1784879711
clan-lab-expires-1784881094
clan-lab-expires-1784881213
clan-lab-expires-1785340570
clan-lab-expires-1785361671
clan-lab-expires-1785361975
clan-lab-expires-1785368969
clan-lab-expires-1785382623
clan-lab-expires-1785382674
clan-lab-expires-1785385230
clan-lab-expires-1785385479
clan-lab-expires-1785395138
clan-lab-expires-1785397707
clan-lab-expires-1785397903
clan-lab-expires-1785401242
clan-lab-expires-1785401942
clan-lab-expires-1785404610
clan-lab-expires-1785447040
clan-lab-expires-1786366868
clan-lab-expires-1786367454
clan-lab-expires-1786368049
clan-lab-expires-1786368651
clan-lab-expires-1786369249
clan-lab-expires-1786369847
clan-lab-expires-1786370450
clan-lab-expires-1786371043
clan-lab-expires-1786371646
clan-lab-expires-1786372249
clan-lab-expires-1786372845
clan-lab-expires-1786373444
clan-lab-expires-1786374048
clan-lab-expires-1786374643
clan-lab-expires-1786375245
clan-lab-expires-1786375849
clan-lab-expires-1786376449
clan-lab-expires-1786377046
clan-lab-expires-1786377646
clan-lab-expires-1786378246
clan-lab-expires-1786378846
clan-lab-expires-1786379446
clan-lab-expires-1786380044
clan-lab-expires-1786380644
clan-lab-expires-1786381246
clan-lab-expires-1786381849
clan-lab-expires-1786392661
clan-lab-expires-1786396263
clan-lab-expires-1786398068
clan-lab-expires-1786400467
clan-lab-expires-1786403514
clan-lab-expires-1786407064
clan-lab-expires-1786410069
clan-lab-expires-1786415497
clan-lab-expires-1786428693
clan-lab-expires-1786450914
clan-lab-expires-1786453904
clan-lab-expires-1786481485
clan-lab-expires-1786488688
clan-lab-expires-1786492871
clan-lab-expires-1786494699
clan-lab-expires-1786495879
clan-lab-expires-1786499515
clan-lab-expires-1786502473
clan-lab-expires-1786507909
clan-lab-expires-1786512468
clan-lab-expires-1786514620
clan-lab-expires-1786516791
clan-lab-expires-1786518123
clan-lab-expires-1786524141
clan-lab-expires-1786526524
clan-lab-expires-1786528638
clan-lab-expires-1786591861
clan-lab-expires-1786592571
clan-lab-expires-1786603154
clan-lab-expires-1786604810
clan-lab-expires-1786606240
clan-lab-expires-1786607967
clan-lab-expires-1786610497
clan-lab-expires-1786611564
clan-lab-expires-1786615072
clan-lab-expires-1786616359
clan-lab-expires-1786700641
clan-lab-expires-1786702998
clan-lab-expires-1786705274
clan-lab-expires-1786710307
clan-lab-expires-1786740955
clan-lab-expires-1786743177
clan-lab-expires-1786745258
clan-lab-expires-1786747279
clan-lab-expires-1786748484
clan-lab-expires-1786749106
clan-lab-expires-1786751736
clan-lab-expires-1786752297
clan-lab-expires-1786754874
clan-lab-expires-1786759057
clan-lab-expires-1786760737
clan-lab-expires-1786762481
clan-lab-expires-1786764013
clan-lab-expires-1786764253
clan-lab-expires-1786765302
clan-lab-expires-1786767314
clan-lab-expires-1786769368
clan-lab-expires-1786772585
clan-lab-expires-1786775732
clan-lab-expires-1786777895
clan-lab-expires-1786780174
clan-lab-expires-1786783051
clan-lab-expires-1786785933
clan-lab-expires-1786787737
clan-lab-expires-1786788123
clan-lab-expires-1786789156
clan-lab-expires-1786790104
clan-lab-expires-1786792527
clan-lab-expires-1786794796
clan-lab-expires-1786796578
clan-lab-expires-1786797370
clan-lab-expires-1786799704
clan-lab-expires-1786799934
clan-lab-expires-1786815816
clan-lab-expires-1787179175
clan-lab-expires-1787185028
clan-lab-expires-1787185144
clan-lab-expires-1787186956
clan-lab-expires-1787192577
clan-lab-expires-1787195120
clan-lab-expires-1787197644
clan-lab-expires-1787198602
clan-lab-expires-1787210602
clan-lab-expires-1787213827
clan-lab-expires-1787280891
clan-lab-expires-1787284499
clan-lab-expires-1787293965
clan-lab-expires-1787295787
clan-lab-expires-1787297589
clan-lab-expires-1787299123
clan-lab-expires-1787303324
clan-lab-expires-1787306700
clan-lab-expires-1787311000
clan-lab-expires-1787312804
clan-lab-expires-1787314606
clan-lab-expires-1787317364
clan-lab-expires-1787360712
clan-lab-expires-1787373527
clan-lab-expires-1787373646
clan-lab-expires-1787375804
clan-lab-expires-1787380004
clan-lab-expires-1787382222
clan-lab-expires-1787390235
clan-lab-expires-1787400714
clan-lab-expires-1787403219
clan-lab-expires-1787418644
clan-lab-expires-1787420114
clan-lab-expires-1787422279
clan-lab-expires-1787426594
clan-lab-expires-1787436282
clan-lab-expires-1787438866
clan-lab-expires-1787475931
clan-lab-expires-1787512017
clan-lab-expires-1787513434
clan-lab-expires-1787524358
clan-lab-expires-1787539195
clan-lab-expires-1787540814
clan-lab-expires-1787552539
clan-lab-expires-1787552857
### Record: the 172 orphaned tag names deleted 2026-08-24 Captured before the sweep so the action is literally revertible — `doctl compute tag create <name>` recreates any of them. Kept here because a two-way-door ruling is only two-way if the way back is written down. <details><summary>172 names</summary> ``` clan-lab-expires-1783580974 clan-lab-expires-1783591837 clan-lab-expires-1783596246 clan-lab-expires-1783647351 clan-lab-expires-1783647668 clan-lab-expires-1783652824 clan-lab-expires-1784877326 clan-lab-expires-1784879470 clan-lab-expires-1784879710 clan-lab-expires-1784879711 clan-lab-expires-1784881094 clan-lab-expires-1784881213 clan-lab-expires-1785340570 clan-lab-expires-1785361671 clan-lab-expires-1785361975 clan-lab-expires-1785368969 clan-lab-expires-1785382623 clan-lab-expires-1785382674 clan-lab-expires-1785385230 clan-lab-expires-1785385479 clan-lab-expires-1785395138 clan-lab-expires-1785397707 clan-lab-expires-1785397903 clan-lab-expires-1785401242 clan-lab-expires-1785401942 clan-lab-expires-1785404610 clan-lab-expires-1785447040 clan-lab-expires-1786366868 clan-lab-expires-1786367454 clan-lab-expires-1786368049 clan-lab-expires-1786368651 clan-lab-expires-1786369249 clan-lab-expires-1786369847 clan-lab-expires-1786370450 clan-lab-expires-1786371043 clan-lab-expires-1786371646 clan-lab-expires-1786372249 clan-lab-expires-1786372845 clan-lab-expires-1786373444 clan-lab-expires-1786374048 clan-lab-expires-1786374643 clan-lab-expires-1786375245 clan-lab-expires-1786375849 clan-lab-expires-1786376449 clan-lab-expires-1786377046 clan-lab-expires-1786377646 clan-lab-expires-1786378246 clan-lab-expires-1786378846 clan-lab-expires-1786379446 clan-lab-expires-1786380044 clan-lab-expires-1786380644 clan-lab-expires-1786381246 clan-lab-expires-1786381849 clan-lab-expires-1786392661 clan-lab-expires-1786396263 clan-lab-expires-1786398068 clan-lab-expires-1786400467 clan-lab-expires-1786403514 clan-lab-expires-1786407064 clan-lab-expires-1786410069 clan-lab-expires-1786415497 clan-lab-expires-1786428693 clan-lab-expires-1786450914 clan-lab-expires-1786453904 clan-lab-expires-1786481485 clan-lab-expires-1786488688 clan-lab-expires-1786492871 clan-lab-expires-1786494699 clan-lab-expires-1786495879 clan-lab-expires-1786499515 clan-lab-expires-1786502473 clan-lab-expires-1786507909 clan-lab-expires-1786512468 clan-lab-expires-1786514620 clan-lab-expires-1786516791 clan-lab-expires-1786518123 clan-lab-expires-1786524141 clan-lab-expires-1786526524 clan-lab-expires-1786528638 clan-lab-expires-1786591861 clan-lab-expires-1786592571 clan-lab-expires-1786603154 clan-lab-expires-1786604810 clan-lab-expires-1786606240 clan-lab-expires-1786607967 clan-lab-expires-1786610497 clan-lab-expires-1786611564 clan-lab-expires-1786615072 clan-lab-expires-1786616359 clan-lab-expires-1786700641 clan-lab-expires-1786702998 clan-lab-expires-1786705274 clan-lab-expires-1786710307 clan-lab-expires-1786740955 clan-lab-expires-1786743177 clan-lab-expires-1786745258 clan-lab-expires-1786747279 clan-lab-expires-1786748484 clan-lab-expires-1786749106 clan-lab-expires-1786751736 clan-lab-expires-1786752297 clan-lab-expires-1786754874 clan-lab-expires-1786759057 clan-lab-expires-1786760737 clan-lab-expires-1786762481 clan-lab-expires-1786764013 clan-lab-expires-1786764253 clan-lab-expires-1786765302 clan-lab-expires-1786767314 clan-lab-expires-1786769368 clan-lab-expires-1786772585 clan-lab-expires-1786775732 clan-lab-expires-1786777895 clan-lab-expires-1786780174 clan-lab-expires-1786783051 clan-lab-expires-1786785933 clan-lab-expires-1786787737 clan-lab-expires-1786788123 clan-lab-expires-1786789156 clan-lab-expires-1786790104 clan-lab-expires-1786792527 clan-lab-expires-1786794796 clan-lab-expires-1786796578 clan-lab-expires-1786797370 clan-lab-expires-1786799704 clan-lab-expires-1786799934 clan-lab-expires-1786815816 clan-lab-expires-1787179175 clan-lab-expires-1787185028 clan-lab-expires-1787185144 clan-lab-expires-1787186956 clan-lab-expires-1787192577 clan-lab-expires-1787195120 clan-lab-expires-1787197644 clan-lab-expires-1787198602 clan-lab-expires-1787210602 clan-lab-expires-1787213827 clan-lab-expires-1787280891 clan-lab-expires-1787284499 clan-lab-expires-1787293965 clan-lab-expires-1787295787 clan-lab-expires-1787297589 clan-lab-expires-1787299123 clan-lab-expires-1787303324 clan-lab-expires-1787306700 clan-lab-expires-1787311000 clan-lab-expires-1787312804 clan-lab-expires-1787314606 clan-lab-expires-1787317364 clan-lab-expires-1787360712 clan-lab-expires-1787373527 clan-lab-expires-1787373646 clan-lab-expires-1787375804 clan-lab-expires-1787380004 clan-lab-expires-1787382222 clan-lab-expires-1787390235 clan-lab-expires-1787400714 clan-lab-expires-1787403219 clan-lab-expires-1787418644 clan-lab-expires-1787420114 clan-lab-expires-1787422279 clan-lab-expires-1787426594 clan-lab-expires-1787436282 clan-lab-expires-1787438866 clan-lab-expires-1787475931 clan-lab-expires-1787512017 clan-lab-expires-1787513434 clan-lab-expires-1787524358 clan-lab-expires-1787539195 clan-lab-expires-1787540814 clan-lab-expires-1787552539 clan-lab-expires-1787552857 ``` </details>
Author
Member

Why human

Ben's hands, for exactly one thing: an interactive permission grant.

Both remaining hunks are in .claude/skills/clan-lab/clan-lab. The harness gates
writes under .claude/** behind an interactive grant — that is the interlock on
an agent editing its own configuration and skills, and this session is an
unattended one-shot with no one to ask. There is no user-configured deny rule to
route around; the gate is the built-in one, and the honest options were "get the
grant" or "stop that part". Manufacturing the permission for myself — a
sed through Bash, or an allow-rule added to settings.json — would be
self-authorizing past a safety control, which is the ratchet ADR 0174 §3 names
even though a shell-script edit is otherwise a textbook two-way door.

So this is not a ruling anyone needs to make, and it carries no proposed
default for a later session to adopt under ADR 0174 §1: the residue is a
mechanical grant, not a judgement.

The ask, ~2 minutes:

  1. git checkout 740-clan-lab-tag-sweep
  2. Apply the diff in the report above to .claude/skills/clan-lab/clan-lab
    (2 hunks: set_expiry, cmd_reap).
  3. bash scripts/tests/clan-lab-reap-test.sh -> 8/8 passed.
  4. Commit both together, merge to main, and roll STATUS.md's #740 lead from
    "BLOCKED" to shipped.

Everything else is already done and needs nothing: the 172 orphaned tags are
swept off the account, GOTCHAS #75 and STATUS.md are on main (9b3e69b9), and
the red-before-green test is pushed (8fa8da8a). The account is clean today —
what is still missing is only the fix that keeps it clean, so the tags will begin
re-accumulating from the next clan-lab create, one per lab, harmlessly.

One note for whoever does step 4: the hourly cron runs from
/home/dev/swarm/Matou/idss/scripts/clan-lab-reap.sh, a separate checkout
sitting on 09ca7197. It needs a pull before the fix is live on the cron path.

## Why human **Ben's hands, for exactly one thing: an interactive permission grant.** Both remaining hunks are in `.claude/skills/clan-lab/clan-lab`. The harness gates writes under `.claude/**` behind an interactive grant — that is the interlock on an agent editing its own configuration and skills, and this session is an unattended one-shot with no one to ask. There is no user-configured deny rule to route around; the gate is the built-in one, and the honest options were "get the grant" or "stop that part". Manufacturing the permission for myself — a `sed` through Bash, or an allow-rule added to `settings.json` — would be self-authorizing past a safety control, which is the ratchet ADR 0174 §3 names even though a shell-script edit is otherwise a textbook two-way door. So this is not a *ruling* anyone needs to make, and it carries no proposed default for a later session to adopt under ADR 0174 §1: the residue is a mechanical grant, not a judgement. **The ask, ~2 minutes:** 1. `git checkout 740-clan-lab-tag-sweep` 2. Apply the diff in the report above to `.claude/skills/clan-lab/clan-lab` (2 hunks: `set_expiry`, `cmd_reap`). 3. `bash scripts/tests/clan-lab-reap-test.sh` -> `8/8 passed`. 4. Commit both together, merge to `main`, and roll STATUS.md's #740 lead from "BLOCKED" to shipped. **Everything else is already done and needs nothing:** the 172 orphaned tags are swept off the account, GOTCHAS #75 and STATUS.md are on `main` (`9b3e69b9`), and the red-before-green test is pushed (`8fa8da8a`). The account is clean today — what is still missing is only the fix that keeps it clean, so the tags will begin re-accumulating from the next `clan-lab create`, one per lab, harmlessly. One note for whoever does step 4: the hourly cron runs from `/home/dev/swarm/Matou/idss/scripts/clan-lab-reap.sh`, a **separate checkout** sitting on `09ca7197`. It needs a pull before the fix is live on the cron path.
Owner

Close report (Ben, 2026-08-24)

The one-grant residue is done by human hands, exactly per the ask:

  1. git checkout 740-clan-lab-tag-sweep → test RED on case 5 (sweep), reproduced.
  2. Applied the two hunks from the report to .claude/skills/clan-lab/clan-lab → bba35ba; test 8/8 on the branch.
  3. Merged to main → 39552ea. One conflict: scripts/tests/clan-lab-reap-test.sh had grown a case 5 on main from #741 (the REAP_* production shape). Kept both — #741's case stays 5, the #740 cases are now 6/7/8 → 9/9 green.
  4. STATUS.md lead rolled BLOCKED → shipped (dd8aec9).
  5. The hourly cron checkout /home/dev/swarm/Matou/idss fast-forwarded to main, so clan-lab-reap.sh now runs the DropletCount sweep.

Closing.

## Close report (Ben, 2026-08-24) The one-grant residue is done by human hands, exactly per the ask: 1. `git checkout 740-clan-lab-tag-sweep` → test RED on case 5 (sweep), reproduced. 2. Applied the two hunks from the report to `.claude/skills/clan-lab/clan-lab` → `bba35ba`; test 8/8 on the branch. 3. Merged to `main` → `39552ea`. One conflict: `scripts/tests/clan-lab-reap-test.sh` had grown a case 5 on main from #741 (the REAP_* production shape). Kept both — #741's case stays 5, the #740 cases are now 6/7/8 → **9/9 green**. 4. STATUS.md lead rolled BLOCKED → shipped (`dd8aec9`). 5. The hourly cron checkout `/home/dev/swarm/Matou/idss` fast-forwarded to main, so `clan-lab-reap.sh` now runs the DropletCount sweep. Closing.
ben closed this issue 2026-08-24 13:43:24 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#740
No description provided.