storage-watchdog-ops
Operate ACFS storage watchdog: inspect disk pressure, logs, and Rust target cleanup. Triggers: storage, watchdog, disk pressure, target cleanup.
What this skill does
# storage-watchdog-ops
Operator runbook for the **ACFS storage watchdog** — the Go daemon
(`acfs-storage-watchdog.service`, built from `~/acfs/ops/storage-watchdog`).
This skill is the human/agent **trigger and remediation layer** over that
daemon; it does not reimplement cleanup. When you need to know *is the disk
under pressure, did the watchdog handle it, and what do I do if it didn't* —
this is the runbook.
## What the daemon actually does (so you interpret it correctly)
- It is a **narrow, safe** disk-reclaimer. It deletes **only** directories
literally named `target` whose **parent directory contains `Cargo.toml`**
(Rust build artifacts). Nothing else is ever removed.
- It **does not follow symlinks**, never deletes the filesystem root, `.`, or
`""`, and never touches source files or non-Rust `target/` directories.
- Cleanup **starts only under pressure**: free space below `--min-free-gb`
(service default 50) **OR** used percent at/above `--max-used-pct` (default
90). With no pressure it logs `ok: no pressure` and deletes nothing.
- Under pressure it sorts candidates **oldest-mtime first** and deletes until
free space reaches `--target-free-gb` (default 100) or candidates are
exhausted, then logs `cleanup complete`.
- It runs as a **user** systemd service, `Nice=19` / `IOSchedulingClass=idle`,
ticking every `--interval-seconds` (default 600). Default scan roots:
`~/dev ~/acfs ~/.cargo`.
Thresholds are also overridable by env (`STORAGE_WATCHDOG_MIN_FREE_GB`,
`STORAGE_WATCHDOG_MAX_USED_PCT`, `STORAGE_WATCHDOG_TARGET_FREE_GB`,
`STORAGE_WATCHDOG_INTERVAL_SECONDS`, `STORAGE_WATCHDOG_STATE_DIR`,
`STORAGE_WATCHDOG_LOG_FILE`).
## 1. Check status
```bash
# Is the daemon alive and ticking?
systemctl --user status acfs-storage-watchdog.service
# Recent decisions from the service journal
journalctl --user -u acfs-storage-watchdog.service -n 50 --no-pager
# Persistent decision log (survives restarts)
tail -n 50 "${STORAGE_WATCHDOG_LOG_FILE:-$HOME/.local/state/acfs-storage-watchdog/watchdog.log}"
# Ground truth on the disk it is protecting
df -h "$HOME/dev" "$HOME/acfs" 2>/dev/null
```
Key log lines to find (each tick emits a `check`):
```
storage-watchdog: check avail_kb=… used_pct=… min_free_gb=50 max_used_pct=90 target_free_gb=100 dry_run=false roots=…
storage-watchdog: ok: no pressure
storage-watchdog: delete target size_kb=… mtime=… path=…
storage-watchdog: cleanup complete candidates=… deleted_kb=… avail_kb=…
```
## 2. Interpret
| Observation | Meaning | Action |
|---|---|---|
| `active (running)`, recent `check`, `ok: no pressure` | Healthy. Disk is above thresholds; nothing to clean. | None. |
| `check` with `avail_kb` low / `used_pct` ≥ max, then `delete target …` / `cleanup complete` | Working as designed; it reclaimed Rust artifacts. | Confirm `df -h` recovered. None. |
| Pressure in `check` but **no** `delete`/`cleanup` lines and `cleanup complete candidates=0` | Pressure is real but **no safe candidates exist** — nothing on disk is a Rust `target/` under a `Cargo.toml`. The watchdog can't help. | Go to §3 manual + §4 escalate. The bloat is elsewhere. |
| `delete failed path=… err=…` | A specific target couldn't be removed (perms, busy). It continues to the next. | Investigate that path manually (§3). |
| `failed`/`inactive`, no recent `check` | Daemon down — it is **not** protecting the disk. | Go to §3 restart. |
| `no scan roots exist: …` (exit) | Configured roots are absent on this host. | Fix `--root` flags in the unit (§3 thresholds). |
The watchdog **only ever frees Rust `target/` space**. If `df` says the disk is
full of media, logs, container layers, or a single huge non-Rust dir, a healthy
watchdog will correctly do nothing — that is not a watchdog bug, it is a
different remediation (see system-performance-remediation).
## 3. Remediate
**Restart a down daemon:**
```bash
systemctl --user restart acfs-storage-watchdog.service
systemctl --user status acfs-storage-watchdog.service
journalctl --user -u acfs-storage-watchdog.service -n 20 --no-pager
```
**Force an immediate, non-destructive assessment** (does not wait for the next
tick; deletes nothing — shows exactly what it *would* remove, oldest first):
```bash
cd "$HOME/acfs/ops/storage-watchdog"
go run ./cmd/storage-watchdog --once --dry-run --root "$HOME/dev" --root "$HOME/acfs"
```
**Force a real one-shot cleanup** (same safety policy; only Rust targets):
```bash
cd "$HOME/acfs/ops/storage-watchdog"
go run ./cmd/storage-watchdog --once --root "$HOME/dev" --root "$HOME/acfs"
```
**Prove the safety policy still holds** before trusting a forced run (creates a
throwaway fixture, asserts old/new Rust targets deleted but source + non-Rust
`target/` preserved):
```bash
cd "$HOME/acfs/ops/storage-watchdog"
go run ./cmd/storage-watchdog --self-test
```
**Hand-clean a single Rust target the daemon flagged but couldn't remove**
(verify it really is a Rust target first — never blind `rm -rf`):
```bash
p="<path from the delete-failed log line>"
test -f "$(dirname "$p")/Cargo.toml" && test "$(basename "$p")" = target \
&& du -sh "$p" && rm -rf "$p" # only after both tests pass
```
**Adjust thresholds** (e.g. start cleaning earlier on a small disk) — edit the
unit's `ExecStart` flags or set env, then reload:
```bash
systemctl --user edit acfs-storage-watchdog.service # override min/max/target or roots
systemctl --user daemon-reload
systemctl --user restart acfs-storage-watchdog.service
```
## 4. Escalate
Escalate beyond this skill when:
- **Pressure persists after a real `--once` run** and `cleanup complete` shows
`candidates=0` or `deleted_kb` far below what's needed — the disk is full of
something the watchdog is (correctly) not allowed to touch. Hand off to
**system-performance-remediation** to find the actual hog (`du -xh … | sort -h`,
container/image layers, logs, datasets).
- **Repeated `delete failed`** on the same path → a permissions/ownership or
busy-mount issue the watchdog can't resolve; needs host admin.
- **Daemon won't stay up** (`Restart=always` but flapping) → inspect
`journalctl` for the `FATAL`/exit reason; likely bad flags or absent roots.
- The host is a **non-ACFS / non-Rust** box where this daemon was mis-deployed —
disable it (`systemctl --user disable --now acfs-storage-watchdog.service`)
rather than fighting `candidates=0`.
Never widen the deletion policy as a "fix" (deleting non-`target` dirs, removing
the `Cargo.toml`-parent check, or following symlinks). The narrow policy is the
safety guarantee; broadening it turns a reclaimer into a data-loss incident.
## Related
- `system-performance-remediation` — the broader disk/CPU/memory remediation rule
this daemon was specialized from; use it when the watchdog has no candidates.
- ACFS source of truth: `~/acfs/ops/storage-watchdog/README.md` and
`cmd/storage-watchdog/`.
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.