From e2a404cbd21eb90f6da2b32af40c204da86021ed Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Nov 2026 22:13:15 +0000 Subject: [PATCH 1/4] #73 - add an Argos teardown-storage skill teardown.sh lists, with sizes, the dev compose stacks (containers, volumes including the database, networks), unused Argos images, Docker's build cache and run-local's state; `remove` removes them and reports the space freed. It leaves every other compose project alone, refuses if a dev-named stack came from a router/brick/tpu compose file or a run-local client still serves, and with Docker stopped clears only run-local's state. run-local suggests it when a session is done with the stack. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013vbA3iKVfvhFrgVECq2K4Z --- .../.claude/skills/run-local/SKILL.md | 2 +- .../.claude/skills/teardown-storage/SKILL.md | 18 +++++ .../teardown-storage/scripts/teardown.sh | 79 +++++++++++++++++++ tests/e2e.sh | 43 ++++++++++ 4 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 software/application-software/argos/workspace-inherit/.claude/skills/teardown-storage/SKILL.md create mode 100755 software/application-software/argos/workspace-inherit/.claude/skills/teardown-storage/scripts/teardown.sh diff --git a/software/application-software/argos/workspace-inherit/.claude/skills/run-local/SKILL.md b/software/application-software/argos/workspace-inherit/.claude/skills/run-local/SKILL.md index 7acb908..e61c7b2 100644 --- a/software/application-software/argos/workspace-inherit/.claude/skills/run-local/SKILL.md +++ b/software/application-software/argos/workspace-inherit/.claude/skills/run-local/SKILL.md @@ -11,4 +11,4 @@ bash scripts/run-local.sh ... It starts the backend if it's down (`client-dev`, or `scylla-dev` plus `cargo run` when a target changes `scylla-server/`), and serves each target's client on the next free port; parallel runs (one per session or agent) each get their own. With no branches it reports what's running. -Report each branch's client URL and the backend. A failed compile or a stale-backend warning is a finding: show it to the user. Stop a client with `kill ` from its line. When every port is taken it lists what holds each; clients from other checkouts are the user's, so ask before stopping them. +Report each branch's client URL and the backend. A failed compile or a stale-backend warning is a finding: show it to the user. Stop a client with `kill ` from its line. When every port is taken it lists what holds each; clients from other checkouts are the user's, so ask before stopping them. When the session is done with the stack, suggest `teardown-storage` to free its disk; don't run it unasked. diff --git a/software/application-software/argos/workspace-inherit/.claude/skills/teardown-storage/SKILL.md b/software/application-software/argos/workspace-inherit/.claude/skills/teardown-storage/SKILL.md new file mode 100644 index 0000000..8422b92 --- /dev/null +++ b/software/application-software/argos/workspace-inherit/.claude/skills/teardown-storage/SKILL.md @@ -0,0 +1,18 @@ +--- +name: teardown-storage +description: Free the disk the local Argos stack leaves behind — the dev compose stacks with their database volume, unused Argos images, Docker's build cache and run-local's state. Run it only when the user asks; when a session that ran run-local, verify-graph or verify-telemetry is done, suggest it instead. +--- + +Never run this unasked: the dev backend is shared by every workspace and session on this machine, so wiping it stops their stacks and drops their data, verify-graph's seeded run included. At the end of a session that ran the stack, suggest it in one line. + +1. Stop what uses the stack first: this session's clients (`kill ` from run-local's lines), its Playwright CLI sessions (`playwright-cli list`, then `playwright-cli -s= close`) and a `cargo run` backend it started. Clients from other checkouts are the user's; ask before stopping them. +2. List what would go, with sizes: + + ``` + bash scripts/teardown.sh + ``` + + It names the dev stacks' containers, volumes and networks, unused Argos images, the build cache (every project's, since Docker can't tell them apart) and run-local's state, then what it leaves alone and what is still in use. Show the user the list and ask before going on. If it refuses because a dev-named stack came from a production compose file, report that; never remove it another way. +3. On a yes: `bash scripts/teardown.sh remove`. It refuses while a run-local client still serves. Report the space freed; Docker Desktop's disk image can take a while to shrink. + +With Docker stopped it clears only run-local's state; start Docker and run it again for the rest. Base images, worktrees' `node_modules` and `target` folders, and Playwright's browsers stay. diff --git a/software/application-software/argos/workspace-inherit/.claude/skills/teardown-storage/scripts/teardown.sh b/software/application-software/argos/workspace-inherit/.claude/skills/teardown-storage/scripts/teardown.sh new file mode 100755 index 0000000..8ddab8f --- /dev/null +++ b/software/application-software/argos/workspace-inherit/.claude/skills/teardown-storage/scripts/teardown.sh @@ -0,0 +1,79 @@ +#!/usr/bin/env bash +# teardown.sh [remove]: list, with sizes, the storage the Argos skills leave on this machine: the dev +# compose stacks (project odyssey_[_]) with their containers, volumes (the database +# too) and networks, unused Argos images (argos*, calypso*, odyssey*), Docker's unused build cache and +# run-local's state. `remove` removes them and prints the space freed. Other compose projects (router, +# brick, tpu) are left alone; nothing is removed if a dev-named stack came from a production compose +# file or a run-local client still serves. With Docker stopped, only run-local's state is handled. +set -euo pipefail +mode=${1:-list} +case $mode in list | remove) ;; *) echo "usage: teardown.sh [remove]" >&2 && exit 2 ;; esac +state=${TMPDIR:-/tmp}; state=${state%/}/argos-run-local +p=com.docker.compose.project +units='function b(s, u) { u = s; sub(/^[0-9.]+/, "", u); sub(/[ (].*/, "", u) + return (s + 0) * (u ~ /^[kK]B$/ ? 1e3 : u == "MB" ? 1e6 : u == "GB" ? 1e9 : u == "TB" ? 1e12 : 1) } + function h(n) { return n >= 1e9 ? sprintf("%.2fGB", n / 1e9) : n >= 1e6 ? sprintf("%.1fMB", n / 1e6) : sprintf("%.0fkB", n / 1e3) }' +dev() { printf %s "$1" | grep -Eqx 'odyssey_(client-dev|scylla-dev|db|fake-data)(_.+)?'; } +docker=0; docker info >/dev/null 2>&1 && docker=1 +plan='' keep='' used='' busy='' wrong='' +add() { plan="$plan$1|$2|$3|$4"$'\n'; } # +inuse() { case "$used" in *" $1 "* | *" $2"*) return 0 ;; esac; return 1; } # : a kept container's image +total() { # bytes Docker and run-local's state use now + { [ $docker = 0 ] || docker system df --format '{{.Size}}'; [ ! -d "$state" ] || du -sk "$state" | awk '{ printf "%.0fB\n", $1 * 1024 }'; } | + awk "$units"'{ t += b($1) } END { printf "%.0f\n", t }' +} + +if [ $docker = 1 ]; then + while IFS='|' read -r name proj files size image; do + if dev "$proj"; then + case $files in *compose.router.yml* | *compose.brick.yml* | *compose.tpu.yml*) wrong="$wrong $name ($proj) came from $files"$'\n' ;; esac + add container "$name" "${size%% (*}" "$proj" + else + used="$used $image " + case $proj in odyssey*) case "$keep " in *" $proj "*) ;; *) keep="$keep $proj" ;; esac ;; esac + fi + done < <(docker ps -a --size --format "{{.Names}}|{{.Label \"$p\"}}|{{.Label \"$p.config_files\"}}|{{.Size}}|{{.Image}}") + sizes=$(docker system df -v | awk '/^VOLUME NAME/ { v = 1; next } v && NF == 0 { v = 0 } v { print $1 "|" $NF }') + while IFS='|' read -r name proj; do + if dev "$proj"; then add volume "$name" "$(echo "$sizes" | awk -F'|' -v n="$name" '$1 == n { print $2 }')" "$proj"; fi + done < <(docker volume ls --filter "label=$p" --format "{{.Name}}|{{.Label \"$p\"}}") + while IFS='|' read -r name proj; do + if dev "$proj"; then add network "$name" "" "$proj"; fi + done < <(docker network ls --filter "label=$p" --format "{{.Name}}|{{.Label \"$p\"}}") + while IFS='|' read -r repo tag id size; do + case ${repo##*/} in argos* | calypso* | odyssey*) ;; *) continue ;; esac + ref=$repo:$tag; [ "$tag" != "" ] || ref=$id + if ! inuse "$ref" "$id" && { [ "$tag" != latest ] || ! inuse "$repo" "$id"; }; then add image "$ref" "$size" ""; fi + done < <(docker images --format '{{.Repository}}|{{.Tag}}|{{.ID}}|{{.Size}}') + cache=$(docker system df --format '{{.Type}}|{{.Reclaimable}}' | awk -F'|' '$1 == "Build Cache" { print $2 }') + [ "$(echo "$cache" | awk "$units"'{ print (b($0) > 0) }')" != 1 ] || add build-cache "every project's unused cache" "$cache" "" +fi +if [ -d "$state" ]; then + for f in "$state"/*.pid; do + if [ -f "$f" ] && kill -0 "$(cat "$f")" 2>/dev/null; then + busy="$busy run-local client on port $(cat "${f%.pid}.port" 2>/dev/null): kill $(cat "$f")"$'\n' + fi + done + add state "$state" "$(du -sk "$state" | awk '{ printf "%.0fB", $1 * 1024 }')" run-local +fi + +printf %s "$plan" | awk -F'|' "$units"'{ printf "%-11s %s%s %s\n", $1, $2, $4 == "" ? "" : " (" $4 ")", $3 == "" ? "" : h(b($3)); t += b($3) } + END { print (NR ? "about " h(t) " in all" : "nothing to remove") }' +[ $docker = 1 ] || echo "Docker isn't running: start it and re-run to free its storage" +[ -z "$keep" ] || echo "left alone (not dev stacks):$keep" +[ -z "$busy" ] || printf 'in use (stop first):\n%s' "$busy" +[ -z "$wrong" ] || { printf 'teardown: refusing; these dev-named stacks came from a production compose file:\n%s' "$wrong" >&2 && exit 1; } +[ "$mode" = remove ] || exit 0 +[ -z "$busy" ] || { echo "teardown: stop the clients in use first" >&2 && exit 1; } + +before=$(total) +del() { # ...: run it on each listed item of that kind + local kind=$1 n; shift + printf %s "$plan" | awk -F'|' -v k="$kind" '$1 == k { print $2 }' | + while IFS= read -r n; do docker "$@" "$n" >/dev/null || echo "kept $kind $n"; done +} +del container rm -f && del volume volume rm && del network network rm && del image image rm +case $plan in *build-cache\|*) docker builder prune -af >/dev/null ;; esac +rm -rf "$state" +echo "freed $(awk "$units"' BEGIN { print h('"$before"' - '"$(total)"') }')" +[ $docker = 0 ] || echo "(Docker Desktop's disk image can take a while to shrink)" diff --git a/tests/e2e.sh b/tests/e2e.sh index f2751e4..20d7578 100644 --- a/tests/e2e.sh +++ b/tests/e2e.sh @@ -1837,6 +1837,49 @@ grep -q 'each workspace has its own .fixture/config.ini' "$t/err" || fail "regis [ ! -e "$d/$F/.fixture/config.ini" ] || fail "protected native configuration was written to main" ok "new registry entries protect their declared native configuration without validator changes" +# --- 13b. Argos teardown-storage: lists dev stacks, unused Argos images, build cache and run-local state with +# sizes; removes only those, never a production stack, nothing while a client serves; Docker stopped: state only +mkdir -p "$t/dk/bin" "$t/dk/tmp/argos-run-local" +cat >"$t/dk/bin/docker" <>"$t/dk/log" && touch "$t/dk/removed" ;; +esac +EOF +chmod +x "$t/dk/bin/docker" && touch "$t/dk/log" +td() { PATH="$t/dk/bin:$PATH" TMPDIR=$t/dk/tmp bash "$src/software/application-software/argos/workspace-inherit/.claude/skills/teardown-storage/scripts/teardown.sh" "$@"; } +echo 1 >"$t/dk/tmp/argos-run-local/x.port" +sleep 30 & +echo $! >"$t/dk/tmp/argos-run-local/x.pid" +{ out=$(td) && echo "$out" | grep -qx 'volume odyssey_client-dev_db-data (odyssey_client-dev) 312.0MB' && + echo "$out" | grep -qx 'image argos-client-813-check:latest 98.0MB' && echo "$out" | grep -q '^build-cache .* 1.40GB$' && + echo "$out" | grep -q '^container odyssey_client-dev-odyssey-db-1 ' && echo "$out" | grep -q '^network odyssey_client-dev_default ' && + echo "$out" | grep -qx 'left alone (not dev stacks): odyssey_router' && echo "$out" | grep -q "kill $(cat "$t/dk/tmp/argos-run-local/x.pid")" && + ! echo "$out" | grep -q 'argos-scylla\|postgres\|odyssey_router_' && [ ! -s "$t/dk/log" ]; } || fail "teardown list: $out" +! td remove >/dev/null 2>&1 && [ ! -s "$t/dk/log" ] || fail "teardown removed while a run-local client serves" +kill "$(cat "$t/dk/tmp/argos-run-local/x.pid")" && touch "$t/dk/prod" +! td remove >/dev/null 2>"$t/err" && grep -q 'odyssey_db_1.*compose.tpu.yml' "$t/err" && [ ! -s "$t/dk/log" ] || + fail "teardown touched a dev-named stack made from a production compose file" +rm "$t/dk/prod" +{ out=$(td remove) && echo "$out" | grep -q '^freed 1.50GB$' && [ ! -e "$t/dk/tmp/argos-run-local" ] && + [ "$(cat "$t/dk/log")" = "$(printf '%s\n' 'docker rm -f odyssey_client-dev-odyssey-db-1' 'docker volume rm odyssey_client-dev_db-data' \ + 'docker network rm odyssey_client-dev_default' 'docker image rm argos-client-813-check:latest' 'docker builder prune -af')" ]; } || + fail "teardown remove: $out $(cat "$t/dk/log")" +mkdir "$t/dk/tmp/argos-run-local" && touch "$t/dk/down" && : >"$t/dk/log" +{ out=$(td remove) && echo "$out" | grep -q "Docker isn't running" && [ ! -e "$t/dk/tmp/argos-run-local" ] && [ ! -s "$t/dk/log" ]; } || + fail "teardown with Docker stopped: $out" +ok "teardown-storage lists dev stacks and unused Argos storage with sizes, removes only those and reports the space freed" + # --- 14. shellcheck, if installed if command -v shellcheck >/dev/null; then From f79417b3fa78fdbe23ac4fcd2c8e4c9f5ad2cacd Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Nov 2026 22:30:48 +0000 Subject: [PATCH 2/4] #73 - make teardown targeted to what run-local started, with an auto timer teardown.sh now removes only what run-local recorded (its clients, cargo run, and the dev compose projects it started, with their containers, volumes, networks and images) without asking. `in ` schedules it; `auto ` stores the workspace's choice (git config argos.teardown), and run-local arms the timer when it brings the stack up, or prints teardown=unset so the model asks once. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013vbA3iKVfvhFrgVECq2K4Z --- .../.claude/skills/run-local/SKILL.md | 2 +- .../skills/run-local/scripts/run-local.sh | 18 ++- .../.claude/skills/teardown-storage/SKILL.md | 18 +-- .../teardown-storage/scripts/teardown.sh | 126 ++++++++---------- tests/e2e.sh | 60 ++++----- 5 files changed, 101 insertions(+), 123 deletions(-) mode change 100644 => 100755 tests/e2e.sh diff --git a/software/application-software/argos/workspace-inherit/.claude/skills/run-local/SKILL.md b/software/application-software/argos/workspace-inherit/.claude/skills/run-local/SKILL.md index e61c7b2..582ca72 100644 --- a/software/application-software/argos/workspace-inherit/.claude/skills/run-local/SKILL.md +++ b/software/application-software/argos/workspace-inherit/.claude/skills/run-local/SKILL.md @@ -11,4 +11,4 @@ bash scripts/run-local.sh ... It starts the backend if it's down (`client-dev`, or `scylla-dev` plus `cargo run` when a target changes `scylla-server/`), and serves each target's client on the next free port; parallel runs (one per session or agent) each get their own. With no branches it reports what's running. -Report each branch's client URL and the backend. A failed compile or a stale-backend warning is a finding: show it to the user. Stop a client with `kill ` from its line. When every port is taken it lists what holds each; clients from other checkouts are the user's, so ask before stopping them. When the session is done with the stack, suggest `teardown-storage` to free its disk; don't run it unasked. +Report each branch's client URL and the backend. A failed compile or a stale-backend warning is a finding: show it to the user. Stop a client with `kill ` from its line. When every port is taken it lists what holds each; clients from other checkouts are the user's, so ask before stopping them. When it brings the stack up it arms `teardown-storage`'s timer if the workspace has one set; on `teardown=unset`, use `teardown-storage` to ask the user once and store their choice. diff --git a/software/application-software/argos/workspace-inherit/.claude/skills/run-local/scripts/run-local.sh b/software/application-software/argos/workspace-inherit/.claude/skills/run-local/scripts/run-local.sh index f598657..6ead444 100755 --- a/software/application-software/argos/workspace-inherit/.claude/skills/run-local/scripts/run-local.sh +++ b/software/application-software/argos/workspace-inherit/.claude/skills/run-local/scripts/run-local.sh @@ -4,7 +4,8 @@ # piece. The backend (first listener on 8000-8090, step 10) is started if down: # ./argos.sh client-dev when no target changes scylla-server/, else scylla-dev plus `cargo run` in the # one worktree that does. Each target's client is then served by serve.sh on its own port. With no -# branches, reports what is running. +# branches, reports what is running. The dev projects it starts are recorded for teardown-storage, +# whose timer it arms for the workspace's `argos.teardown` minutes (git config), or prints teardown=unset. set -euo pipefail here=$(cd "$(dirname "$0")" && pwd) # shellcheck source=/dev/null @@ -12,6 +13,7 @@ here=$(cd "$(dirname "$0")" && pwd) state=${TMPDIR:-/tmp}; state=${state%/}/argos-run-local up() { (exec 3<>"/dev/tcp/127.0.0.1/$1") 2>/dev/null || (exec 3<>"/dev/tcp/::1/$1") 2>/dev/null; } # ng serve binds ::1 backend() { for p in $(seq 8000 10 8090); do up "$p" && echo "http://localhost:$p" && return; done; echo none; } +projects() { docker ps -a --format '{{.Label "com.docker.compose.project"}}' 2>/dev/null | grep -Ex 'odyssey_(client-dev|scylla-dev)(_.+)?' | sort -u || true; } scylla() { if docker ps --filter name=scylla-server --format '{{.Names}}' 2>/dev/null | grep -q .; then echo docker elif [ "$(backend)" != none ]; then echo local @@ -41,20 +43,28 @@ done [ ${#rust[@]} -le 1 ] || { echo "run-local: several targets change scylla-server/; run them one at a time" >&2 && exit 1; } if [ "$(backend)" = none ]; then - mkdir -p "$state" + mkdir -p "$state" && had=$(projects) if [ ${#rust[@]} = 0 ]; then (cd "${wts[0]}" && ./argos.sh client-dev up -d) >"$state/compose.log" 2>&1 || { echo "run-local: ./argos.sh client-dev up failed:" >&2 && tail -20 "$state/compose.log" >&2 && exit 1; } else (cd "${rust[0]}" && ./argos.sh scylla-dev up -d) >"$state/compose.log" 2>&1 || { echo "run-local: ./argos.sh scylla-dev up failed:" >&2 && tail -20 "$state/compose.log" >&2 && exit 1; } - (cd "${rust[0]}/scylla-server" && + (cd "${rust[0]}/scylla-server" || exit 1 DATABASE_URL=${DATABASE_URL:-postgresql://postgres:password@127.0.0.1:${ODYSSEY_DB_PORT:-5432}/postgres} \ - nohup cargo run >"$state/scylla.log" 2>&1 &) + nohup cargo run >"$state/scylla.log" 2>&1 & + echo $! >"$state/scylla.pid") echo "run-local: cargo run started for $(basename "${rust[0]}"); log $state/scylla.log" fi + comm -13 <(printf '%s\n' "$had") <(projects) >>"$state/projects" # what teardown-storage removes for _ in $(seq 600); do [ "$(backend)" != none ] && break; sleep 1; done [ "$(backend)" != none ] || { echo "run-local: backend not up after 600s; see $state/" >&2 && exit 1; } + m=$(git -C "$DELPHI_ROOT" config argos.teardown || true) + case $m in + off) ;; + '') echo "teardown=unset (ask the user whether to tear the stack down automatically; see teardown-storage)" ;; + *) bash "$here/../../teardown-storage/scripts/teardown.sh" in "$m" ;; + esac elif [ ${#rust[@]} = 1 ] && [ "$(scylla)" = docker ]; then echo "run-local: warning: backend is the scylla-server image but $(basename "${rust[0]}") changes scylla-server/;" \ "stop it (./argos.sh client-dev down) and re-run to test that branch's backend" >&2 diff --git a/software/application-software/argos/workspace-inherit/.claude/skills/teardown-storage/SKILL.md b/software/application-software/argos/workspace-inherit/.claude/skills/teardown-storage/SKILL.md index 8422b92..a2b70ec 100644 --- a/software/application-software/argos/workspace-inherit/.claude/skills/teardown-storage/SKILL.md +++ b/software/application-software/argos/workspace-inherit/.claude/skills/teardown-storage/SKILL.md @@ -1,18 +1,12 @@ --- name: teardown-storage -description: Free the disk the local Argos stack leaves behind — the dev compose stacks with their database volume, unused Argos images, Docker's build cache and run-local's state. Run it only when the user asks; when a session that ran run-local, verify-graph or verify-telemetry is done, suggest it instead. +description: Tear down what run-local brought up — its clients and `cargo run`, and the dev compose stacks it started with their database volume, networks and images — now, on a timer, or automatically after every run-local. Use when the user wants the local Argos stack gone, or when run-local reports teardown=unset. --- -Never run this unasked: the dev backend is shared by every workspace and session on this machine, so wiping it stops their stacks and drops their data, verify-graph's seeded run included. At the end of a session that ran the stack, suggest it in one line. +It touches only what run-local started (recorded in its state); other stacks, images and Docker's build cache stay. It doesn't ask: run it when the user wants the stack gone, and report the space freed. Close this session's Playwright CLI sessions first (`playwright-cli list`, then `playwright-cli -s= close`). -1. Stop what uses the stack first: this session's clients (`kill ` from run-local's lines), its Playwright CLI sessions (`playwright-cli list`, then `playwright-cli -s= close`) and a `cargo run` backend it started. Clients from other checkouts are the user's; ask before stopping them. -2. List what would go, with sizes: +- Now: `bash scripts/teardown.sh` +- Later: `bash scripts/teardown.sh in ` (replaces an earlier timer). +- After every run-local: `bash scripts/teardown.sh auto ` stores the workspace's choice, and run-local arms the timer each time it brings the stack up; `bash scripts/teardown.sh auto` prints it. When run-local reports `teardown=unset`, ask the user once whether to tear the stack down automatically and after how many minutes, store the answer with `auto`, and arm this run with `in`. - ``` - bash scripts/teardown.sh - ``` - - It names the dev stacks' containers, volumes and networks, unused Argos images, the build cache (every project's, since Docker can't tell them apart) and run-local's state, then what it leaves alone and what is still in use. Show the user the list and ask before going on. If it refuses because a dev-named stack came from a production compose file, report that; never remove it another way. -3. On a yes: `bash scripts/teardown.sh remove`. It refuses while a run-local client still serves. Report the space freed; Docker Desktop's disk image can take a while to shrink. - -With Docker stopped it clears only run-local's state; start Docker and run it again for the rest. Base images, worktrees' `node_modules` and `target` folders, and Playwright's browsers stay. +With Docker stopped it stops the processes and keeps the record; start Docker and run it again. diff --git a/software/application-software/argos/workspace-inherit/.claude/skills/teardown-storage/scripts/teardown.sh b/software/application-software/argos/workspace-inherit/.claude/skills/teardown-storage/scripts/teardown.sh index 8ddab8f..7798f3d 100755 --- a/software/application-software/argos/workspace-inherit/.claude/skills/teardown-storage/scripts/teardown.sh +++ b/software/application-software/argos/workspace-inherit/.claude/skills/teardown-storage/scripts/teardown.sh @@ -1,79 +1,61 @@ #!/usr/bin/env bash -# teardown.sh [remove]: list, with sizes, the storage the Argos skills leave on this machine: the dev -# compose stacks (project odyssey_[_]) with their containers, volumes (the database -# too) and networks, unused Argos images (argos*, calypso*, odyssey*), Docker's unused build cache and -# run-local's state. `remove` removes them and prints the space freed. Other compose projects (router, -# brick, tpu) are left alone; nothing is removed if a dev-named stack came from a production compose -# file or a run-local client still serves. With Docker stopped, only run-local's state is handled. +# teardown.sh [in | auto [|off]]: tear down what run-local brought up on this +# machine, and nothing else: the processes in its state (clients, `cargo run`, a pending timer), the +# compose projects it started (its state's `projects`) with their containers, volumes (the database +# too), networks and the images only they used, then its state; prints the space freed. With Docker +# stopped it stops the processes, keeps the record and exits 1. `in ` does it later, in the +# background, replacing an earlier timer. `auto` prints or sets the minutes run-local arms that timer +# with when it brings the stack up (git config argos.teardown in the workspace; off: never). set -euo pipefail -mode=${1:-list} -case $mode in list | remove) ;; *) echo "usage: teardown.sh [remove]" >&2 && exit 2 ;; esac +here=$(cd "$(dirname "$0")" && pwd) state=${TMPDIR:-/tmp}; state=${state%/}/argos-run-local -p=com.docker.compose.project -units='function b(s, u) { u = s; sub(/^[0-9.]+/, "", u); sub(/[ (].*/, "", u) - return (s + 0) * (u ~ /^[kK]B$/ ? 1e3 : u == "MB" ? 1e6 : u == "GB" ? 1e9 : u == "TB" ? 1e12 : 1) } - function h(n) { return n >= 1e9 ? sprintf("%.2fGB", n / 1e9) : n >= 1e6 ? sprintf("%.1fMB", n / 1e6) : sprintf("%.0fkB", n / 1e3) }' -dev() { printf %s "$1" | grep -Eqx 'odyssey_(client-dev|scylla-dev|db|fake-data)(_.+)?'; } -docker=0; docker info >/dev/null 2>&1 && docker=1 -plan='' keep='' used='' busy='' wrong='' -add() { plan="$plan$1|$2|$3|$4"$'\n'; } # -inuse() { case "$used" in *" $1 "* | *" $2"*) return 0 ;; esac; return 1; } # : a kept container's image -total() { # bytes Docker and run-local's state use now - { [ $docker = 0 ] || docker system df --format '{{.Size}}'; [ ! -d "$state" ] || du -sk "$state" | awk '{ printf "%.0fB\n", $1 * 1024 }'; } | - awk "$units"'{ t += b($1) } END { printf "%.0f\n", t }' -} - -if [ $docker = 1 ]; then - while IFS='|' read -r name proj files size image; do - if dev "$proj"; then - case $files in *compose.router.yml* | *compose.brick.yml* | *compose.tpu.yml*) wrong="$wrong $name ($proj) came from $files"$'\n' ;; esac - add container "$name" "${size%% (*}" "$proj" - else - used="$used $image " - case $proj in odyssey*) case "$keep " in *" $proj "*) ;; *) keep="$keep $proj" ;; esac ;; esac +usage() { echo "usage: teardown.sh [in | auto [|off]]" >&2 && exit 2; } +minutes() { [ -n "$1" ] && [ -z "${1//[0-9]/}" ] && [ "$1" -gt 0 ]; } +case ${1:-now} in + auto) + root=${DELPHI_ROOT:?unset: start the session at the workspace root} + if [ $# -ge 2 ]; then + [ "$2" = off ] || minutes "$2" || usage + git -C "$root" config argos.teardown "$2" fi - done < <(docker ps -a --size --format "{{.Names}}|{{.Label \"$p\"}}|{{.Label \"$p.config_files\"}}|{{.Size}}|{{.Image}}") - sizes=$(docker system df -v | awk '/^VOLUME NAME/ { v = 1; next } v && NF == 0 { v = 0 } v { print $1 "|" $NF }') - while IFS='|' read -r name proj; do - if dev "$proj"; then add volume "$name" "$(echo "$sizes" | awk -F'|' -v n="$name" '$1 == n { print $2 }')" "$proj"; fi - done < <(docker volume ls --filter "label=$p" --format "{{.Name}}|{{.Label \"$p\"}}") - while IFS='|' read -r name proj; do - if dev "$proj"; then add network "$name" "" "$proj"; fi - done < <(docker network ls --filter "label=$p" --format "{{.Name}}|{{.Label \"$p\"}}") - while IFS='|' read -r repo tag id size; do - case ${repo##*/} in argos* | calypso* | odyssey*) ;; *) continue ;; esac - ref=$repo:$tag; [ "$tag" != "" ] || ref=$id - if ! inuse "$ref" "$id" && { [ "$tag" != latest ] || ! inuse "$repo" "$id"; }; then add image "$ref" "$size" ""; fi - done < <(docker images --format '{{.Repository}}|{{.Tag}}|{{.ID}}|{{.Size}}') - cache=$(docker system df --format '{{.Type}}|{{.Reclaimable}}' | awk -F'|' '$1 == "Build Cache" { print $2 }') - [ "$(echo "$cache" | awk "$units"'{ print (b($0) > 0) }')" != 1 ] || add build-cache "every project's unused cache" "$cache" "" + git -C "$root" config argos.teardown || echo unset + exit 0 ;; + in) + minutes "${2:-}" || usage + mkdir -p "$state" + [ ! -f "$state/timer.pid" ] || { pkill -P "$(cat "$state/timer.pid")" 2>/dev/null || true; } + # shellcheck disable=SC2016 # expanded by the inner bash + nohup bash -c 'sleep "$1" && exec bash "$2"' _ $(($2 * 60)) "$here/teardown.sh" >"$state.log" 2>&1 & + echo $! >"$state/timer.pid" + echo "teardown in $2m (pid $!, log $state.log)" + exit 0 ;; + now) ;; + *) usage ;; +esac + +[ -d "$state" ] || { echo "teardown: run-local brought nothing up" && exit 0; } +for f in "$state"/*.pid; do # children first: npx and cargo leave their servers behind otherwise + [ -f "$f" ] && pid=$(cat "$f") && [ "$pid" != $$ ] || continue + pkill -P "$pid" 2>/dev/null || true; kill "$pid" 2>/dev/null || true +done +rm -f "$state"/*.pid +if [ -s "$state/projects" ] && ! docker info >/dev/null 2>&1; then + echo "teardown: stopped run-local's processes; start Docker and re-run for $(tr '\n' ' ' <"$state/projects")" >&2 + exit 1 fi -if [ -d "$state" ]; then - for f in "$state"/*.pid; do - if [ -f "$f" ] && kill -0 "$(cat "$f")" 2>/dev/null; then - busy="$busy run-local client on port $(cat "${f%.pid}.port" 2>/dev/null): kill $(cat "$f")"$'\n' - fi - done - add state "$state" "$(du -sk "$state" | awk '{ printf "%.0fB", $1 * 1024 }')" run-local +total() { docker system df --format '{{.Size}}' | awk '{ s = $1; u = s; sub(/^[0-9.]+/, "", u) + t += s * (u ~ /^[kK]B$/ ? 1e3 : u == "MB" ? 1e6 : u == "GB" ? 1e9 : u == "TB" ? 1e12 : 1) } END { printf "%.0f\n", t }'; } +if [ -s "$state/projects" ]; then + before=$(total) + while IFS= read -r proj; do + l=label=com.docker.compose.project=$proj + images=$(docker ps -a --filter "$l" --format '{{.Image}}' | sort -u) + for c in $(docker ps -aq --filter "$l"); do docker rm -f "$c" >/dev/null; done + for v in $(docker volume ls -q --filter "$l"); do docker volume rm "$v" >/dev/null; done + for n in $(docker network ls -q --filter "$l"); do docker network rm "$n" >/dev/null; done + for i in $images; do docker image rm "$i" >/dev/null 2>&1 || echo "kept image $i (another container uses it)"; done + echo "removed $proj" + done <"$state/projects" + awk -v n=$((before - $(total))) 'BEGIN { print "freed " (n >= 1e9 ? sprintf("%.2fGB", n / 1e9) : sprintf("%.1fMB", n / 1e6)) }' fi - -printf %s "$plan" | awk -F'|' "$units"'{ printf "%-11s %s%s %s\n", $1, $2, $4 == "" ? "" : " (" $4 ")", $3 == "" ? "" : h(b($3)); t += b($3) } - END { print (NR ? "about " h(t) " in all" : "nothing to remove") }' -[ $docker = 1 ] || echo "Docker isn't running: start it and re-run to free its storage" -[ -z "$keep" ] || echo "left alone (not dev stacks):$keep" -[ -z "$busy" ] || printf 'in use (stop first):\n%s' "$busy" -[ -z "$wrong" ] || { printf 'teardown: refusing; these dev-named stacks came from a production compose file:\n%s' "$wrong" >&2 && exit 1; } -[ "$mode" = remove ] || exit 0 -[ -z "$busy" ] || { echo "teardown: stop the clients in use first" >&2 && exit 1; } - -before=$(total) -del() { # ...: run it on each listed item of that kind - local kind=$1 n; shift - printf %s "$plan" | awk -F'|' -v k="$kind" '$1 == k { print $2 }' | - while IFS= read -r n; do docker "$@" "$n" >/dev/null || echo "kept $kind $n"; done -} -del container rm -f && del volume volume rm && del network network rm && del image image rm -case $plan in *build-cache\|*) docker builder prune -af >/dev/null ;; esac rm -rf "$state" -echo "freed $(awk "$units"' BEGIN { print h('"$before"' - '"$(total)"') }')" -[ $docker = 0 ] || echo "(Docker Desktop's disk image can take a while to shrink)" diff --git a/tests/e2e.sh b/tests/e2e.sh old mode 100644 new mode 100755 index 20d7578..ba1f55c --- a/tests/e2e.sh +++ b/tests/e2e.sh @@ -1837,48 +1837,40 @@ grep -q 'each workspace has its own .fixture/config.ini' "$t/err" || fail "regis [ ! -e "$d/$F/.fixture/config.ini" ] || fail "protected native configuration was written to main" ok "new registry entries protect their declared native configuration without validator changes" -# --- 13b. Argos teardown-storage: lists dev stacks, unused Argos images, build cache and run-local state with -# sizes; removes only those, never a production stack, nothing while a client serves; Docker stopped: state only -mkdir -p "$t/dk/bin" "$t/dk/tmp/argos-run-local" +# --- 13b. Argos teardown-storage: removes only what run-local recorded (its processes, then each recorded +# project's containers, volumes, networks and images), now or on a timer; `auto` stores the workspace's minutes +mkdir -p "$t/dk/bin" "$t/dk/tmp" && git init -q "$t/dk/root" cat >"$t/dk/bin/docker" <>"$t/dk/log" && touch "$t/dk/removed" ;; + *) echo "docker \$*" >>"$t/dk/log" && touch "$t/dk/removed" && [ "\$*" != "image rm postgres:17.2" ] ;; esac EOF chmod +x "$t/dk/bin/docker" && touch "$t/dk/log" -td() { PATH="$t/dk/bin:$PATH" TMPDIR=$t/dk/tmp bash "$src/software/application-software/argos/workspace-inherit/.claude/skills/teardown-storage/scripts/teardown.sh" "$@"; } -echo 1 >"$t/dk/tmp/argos-run-local/x.port" -sleep 30 & -echo $! >"$t/dk/tmp/argos-run-local/x.pid" -{ out=$(td) && echo "$out" | grep -qx 'volume odyssey_client-dev_db-data (odyssey_client-dev) 312.0MB' && - echo "$out" | grep -qx 'image argos-client-813-check:latest 98.0MB' && echo "$out" | grep -q '^build-cache .* 1.40GB$' && - echo "$out" | grep -q '^container odyssey_client-dev-odyssey-db-1 ' && echo "$out" | grep -q '^network odyssey_client-dev_default ' && - echo "$out" | grep -qx 'left alone (not dev stacks): odyssey_router' && echo "$out" | grep -q "kill $(cat "$t/dk/tmp/argos-run-local/x.pid")" && - ! echo "$out" | grep -q 'argos-scylla\|postgres\|odyssey_router_' && [ ! -s "$t/dk/log" ]; } || fail "teardown list: $out" -! td remove >/dev/null 2>&1 && [ ! -s "$t/dk/log" ] || fail "teardown removed while a run-local client serves" -kill "$(cat "$t/dk/tmp/argos-run-local/x.pid")" && touch "$t/dk/prod" -! td remove >/dev/null 2>"$t/err" && grep -q 'odyssey_db_1.*compose.tpu.yml' "$t/err" && [ ! -s "$t/dk/log" ] || - fail "teardown touched a dev-named stack made from a production compose file" -rm "$t/dk/prod" -{ out=$(td remove) && echo "$out" | grep -q '^freed 1.50GB$' && [ ! -e "$t/dk/tmp/argos-run-local" ] && - [ "$(cat "$t/dk/log")" = "$(printf '%s\n' 'docker rm -f odyssey_client-dev-odyssey-db-1' 'docker volume rm odyssey_client-dev_db-data' \ - 'docker network rm odyssey_client-dev_default' 'docker image rm argos-client-813-check:latest' 'docker builder prune -af')" ]; } || - fail "teardown remove: $out $(cat "$t/dk/log")" -mkdir "$t/dk/tmp/argos-run-local" && touch "$t/dk/down" && : >"$t/dk/log" -{ out=$(td remove) && echo "$out" | grep -q "Docker isn't running" && [ ! -e "$t/dk/tmp/argos-run-local" ] && [ ! -s "$t/dk/log" ]; } || - fail "teardown with Docker stopped: $out" -ok "teardown-storage lists dev stacks and unused Argos storage with sizes, removes only those and reports the space freed" +td() { PATH="$t/dk/bin:$PATH" TMPDIR=$t/dk/tmp DELPHI_ROOT=$t/dk/root bash "$src/software/application-software/argos/workspace-inherit/.claude/skills/teardown-storage/scripts/teardown.sh" "$@"; } +gone() { for _ in $(seq 30); do kill -0 "$1" 2>/dev/null || return 0; sleep 0.1; done; return 1; } +st=$t/dk/tmp/argos-run-local +{ [ "$(td auto)" = unset ] && [ "$(td auto 90)" = 90 ] && [ "$(td auto off)" = off ] && ! td auto 0 2>/dev/null && + ! td in x 2>/dev/null && [ "$(td)" = "teardown: run-local brought nothing up" ]; } || fail "teardown auto/usage" +mkdir -p "$st" && echo odyssey_client-dev >"$st/projects" && (sleep 300 >/dev/null 2>&1 & echo $! >"$st/x.pid") +{ td in 5 >/dev/null && t1=$(cat "$st/timer.pid") && kill -0 "$t1" && td in 7 >/dev/null && t2=$(cat "$st/timer.pid") && + [ "$t1" != "$t2" ] && gone "$t1" && kill -0 "$t2"; } || fail "teardown in doesn't replace its timer" +c=$(cat "$st/x.pid") && touch "$t/dk/down" +{ ! td 2>"$t/err" && grep -q 'start Docker and re-run for odyssey_client-dev' "$t/err" && gone "$c" && gone "$t2" && + [ -s "$st/projects" ] && [ ! -s "$t/dk/log" ]; } || fail "teardown with Docker stopped: $(cat "$t/err")" +rm "$t/dk/down" && (sleep 300 >/dev/null 2>&1 & echo $! >"$st/x.pid") && c=$(cat "$st/x.pid") && td in 5 >/dev/null && t3=$(cat "$st/timer.pid") +{ out=$(td) && gone "$c" && gone "$t3" && [ ! -e "$st" ] && echo "$out" | grep -qx 'removed odyssey_client-dev' && + echo "$out" | grep -qx 'kept image postgres:17.2 (another container uses it)' && echo "$out" | grep -qx 'freed 1.50GB' && + [ "$(cat "$t/dk/log")" = "$(printf '%s\n' 'docker rm -f c1' 'docker rm -f c2' 'docker volume rm odyssey_client-dev_db-data' \ + 'docker network rm odyssey_client-dev_default' 'docker image rm odyssey_client-dev-scylla-server' 'docker image rm postgres:17.2')" ]; } || + fail "teardown: $out $(cat "$t/dk/log")" +ok "teardown-storage removes only what run-local recorded, now or on a replaceable timer, and stores the workspace's auto minutes" # --- 14. shellcheck, if installed From af8510bc4e9e07fb6baf486a1330cc1a245fa6e0 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Nov 2026 14:58:52 +0000 Subject: [PATCH 3/4] #73 - drop the teardown-storage test from e2e, which doesn't test specific skills Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013vbA3iKVfvhFrgVECq2K4Z --- tests/e2e.sh | 35 ----------------------------------- 1 file changed, 35 deletions(-) mode change 100755 => 100644 tests/e2e.sh diff --git a/tests/e2e.sh b/tests/e2e.sh old mode 100755 new mode 100644 index ba1f55c..f2751e4 --- a/tests/e2e.sh +++ b/tests/e2e.sh @@ -1837,41 +1837,6 @@ grep -q 'each workspace has its own .fixture/config.ini' "$t/err" || fail "regis [ ! -e "$d/$F/.fixture/config.ini" ] || fail "protected native configuration was written to main" ok "new registry entries protect their declared native configuration without validator changes" -# --- 13b. Argos teardown-storage: removes only what run-local recorded (its processes, then each recorded -# project's containers, volumes, networks and images), now or on a timer; `auto` stores the workspace's minutes -mkdir -p "$t/dk/bin" "$t/dk/tmp" && git init -q "$t/dk/root" -cat >"$t/dk/bin/docker" <>"$t/dk/log" && touch "$t/dk/removed" && [ "\$*" != "image rm postgres:17.2" ] ;; -esac -EOF -chmod +x "$t/dk/bin/docker" && touch "$t/dk/log" -td() { PATH="$t/dk/bin:$PATH" TMPDIR=$t/dk/tmp DELPHI_ROOT=$t/dk/root bash "$src/software/application-software/argos/workspace-inherit/.claude/skills/teardown-storage/scripts/teardown.sh" "$@"; } -gone() { for _ in $(seq 30); do kill -0 "$1" 2>/dev/null || return 0; sleep 0.1; done; return 1; } -st=$t/dk/tmp/argos-run-local -{ [ "$(td auto)" = unset ] && [ "$(td auto 90)" = 90 ] && [ "$(td auto off)" = off ] && ! td auto 0 2>/dev/null && - ! td in x 2>/dev/null && [ "$(td)" = "teardown: run-local brought nothing up" ]; } || fail "teardown auto/usage" -mkdir -p "$st" && echo odyssey_client-dev >"$st/projects" && (sleep 300 >/dev/null 2>&1 & echo $! >"$st/x.pid") -{ td in 5 >/dev/null && t1=$(cat "$st/timer.pid") && kill -0 "$t1" && td in 7 >/dev/null && t2=$(cat "$st/timer.pid") && - [ "$t1" != "$t2" ] && gone "$t1" && kill -0 "$t2"; } || fail "teardown in doesn't replace its timer" -c=$(cat "$st/x.pid") && touch "$t/dk/down" -{ ! td 2>"$t/err" && grep -q 'start Docker and re-run for odyssey_client-dev' "$t/err" && gone "$c" && gone "$t2" && - [ -s "$st/projects" ] && [ ! -s "$t/dk/log" ]; } || fail "teardown with Docker stopped: $(cat "$t/err")" -rm "$t/dk/down" && (sleep 300 >/dev/null 2>&1 & echo $! >"$st/x.pid") && c=$(cat "$st/x.pid") && td in 5 >/dev/null && t3=$(cat "$st/timer.pid") -{ out=$(td) && gone "$c" && gone "$t3" && [ ! -e "$st" ] && echo "$out" | grep -qx 'removed odyssey_client-dev' && - echo "$out" | grep -qx 'kept image postgres:17.2 (another container uses it)' && echo "$out" | grep -qx 'freed 1.50GB' && - [ "$(cat "$t/dk/log")" = "$(printf '%s\n' 'docker rm -f c1' 'docker rm -f c2' 'docker volume rm odyssey_client-dev_db-data' \ - 'docker network rm odyssey_client-dev_default' 'docker image rm odyssey_client-dev-scylla-server' 'docker image rm postgres:17.2')" ]; } || - fail "teardown: $out $(cat "$t/dk/log")" -ok "teardown-storage removes only what run-local recorded, now or on a replaceable timer, and stores the workspace's auto minutes" - # --- 14. shellcheck, if installed if command -v shellcheck >/dev/null; then From 48b314739e87487e5c4e1c61f3daa811bbc90797 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Nov 2026 15:44:43 +0000 Subject: [PATCH 4/4] #73 - restore the teardown-storage e2e test Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013vbA3iKVfvhFrgVECq2K4Z --- tests/e2e.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) mode change 100644 => 100755 tests/e2e.sh diff --git a/tests/e2e.sh b/tests/e2e.sh old mode 100644 new mode 100755 index f2751e4..ba1f55c --- a/tests/e2e.sh +++ b/tests/e2e.sh @@ -1837,6 +1837,41 @@ grep -q 'each workspace has its own .fixture/config.ini' "$t/err" || fail "regis [ ! -e "$d/$F/.fixture/config.ini" ] || fail "protected native configuration was written to main" ok "new registry entries protect their declared native configuration without validator changes" +# --- 13b. Argos teardown-storage: removes only what run-local recorded (its processes, then each recorded +# project's containers, volumes, networks and images), now or on a timer; `auto` stores the workspace's minutes +mkdir -p "$t/dk/bin" "$t/dk/tmp" && git init -q "$t/dk/root" +cat >"$t/dk/bin/docker" <>"$t/dk/log" && touch "$t/dk/removed" && [ "\$*" != "image rm postgres:17.2" ] ;; +esac +EOF +chmod +x "$t/dk/bin/docker" && touch "$t/dk/log" +td() { PATH="$t/dk/bin:$PATH" TMPDIR=$t/dk/tmp DELPHI_ROOT=$t/dk/root bash "$src/software/application-software/argos/workspace-inherit/.claude/skills/teardown-storage/scripts/teardown.sh" "$@"; } +gone() { for _ in $(seq 30); do kill -0 "$1" 2>/dev/null || return 0; sleep 0.1; done; return 1; } +st=$t/dk/tmp/argos-run-local +{ [ "$(td auto)" = unset ] && [ "$(td auto 90)" = 90 ] && [ "$(td auto off)" = off ] && ! td auto 0 2>/dev/null && + ! td in x 2>/dev/null && [ "$(td)" = "teardown: run-local brought nothing up" ]; } || fail "teardown auto/usage" +mkdir -p "$st" && echo odyssey_client-dev >"$st/projects" && (sleep 300 >/dev/null 2>&1 & echo $! >"$st/x.pid") +{ td in 5 >/dev/null && t1=$(cat "$st/timer.pid") && kill -0 "$t1" && td in 7 >/dev/null && t2=$(cat "$st/timer.pid") && + [ "$t1" != "$t2" ] && gone "$t1" && kill -0 "$t2"; } || fail "teardown in doesn't replace its timer" +c=$(cat "$st/x.pid") && touch "$t/dk/down" +{ ! td 2>"$t/err" && grep -q 'start Docker and re-run for odyssey_client-dev' "$t/err" && gone "$c" && gone "$t2" && + [ -s "$st/projects" ] && [ ! -s "$t/dk/log" ]; } || fail "teardown with Docker stopped: $(cat "$t/err")" +rm "$t/dk/down" && (sleep 300 >/dev/null 2>&1 & echo $! >"$st/x.pid") && c=$(cat "$st/x.pid") && td in 5 >/dev/null && t3=$(cat "$st/timer.pid") +{ out=$(td) && gone "$c" && gone "$t3" && [ ! -e "$st" ] && echo "$out" | grep -qx 'removed odyssey_client-dev' && + echo "$out" | grep -qx 'kept image postgres:17.2 (another container uses it)' && echo "$out" | grep -qx 'freed 1.50GB' && + [ "$(cat "$t/dk/log")" = "$(printf '%s\n' 'docker rm -f c1' 'docker rm -f c2' 'docker volume rm odyssey_client-dev_db-data' \ + 'docker network rm odyssey_client-dev_default' 'docker image rm odyssey_client-dev-scylla-server' 'docker image rm postgres:17.2')" ]; } || + fail "teardown: $out $(cat "$t/dk/log")" +ok "teardown-storage removes only what run-local recorded, now or on a replaceable timer, and stores the workspace's auto minutes" + # --- 14. shellcheck, if installed if command -v shellcheck >/dev/null; then