Repository navigation
fix(disk): go-build cap, a scratchpad lookup that cannot hang or fail open, and a stalled-reclaimer alert, all spotcheck by default (refs theQuert/stima-api#5886) - #113
Conversation
…ace floor, from --check, in spotcheck by default (refs theQuert/stima-api#5886) The go build cache was trimmed only by reclaim-byproducts (hung for hours on 2026-10-24) and by this step only under CC_DJ_ACT_LOW_FREE_GB. It now also runs when the cache is over CC_DJ_GO_BUILD_CAP_GB (default 8, one bounded du -sk) or free space is under CC_DJ_GO_BUILD_FREE_GB (default 35), from --check even when the low-disk act does not run. The unused-120-min selection is unchanged and CC_DJ_NEW_STEPS_MODE still gates deletion: spotcheck logs decision=would-remove and deletes nothing. Auto takes one system-wide lsof right before the delete and skips any held entry; an lsof that cannot report deletes nothing.
…ed stamp is older than twice its StartInterval (refs theQuert/stima-api#5886) reclaim-byproducts stamps only a sweep that finished without a failure, and on 2026-10-24 it hung for hours with nothing saying so. A round now compares the stamp with twice the installed agent's StartInterval (CC_RW_RECLAIM_STALL_SECS overrides; 172800 for a calendar schedule; 7200 when the plist cannot be read) and raises ALERT:reclaim-stalled plus a notification once per stall, re-armed by a fresh stamp. Alert only: nothing is ended or deleted.
…tchpad liveness rule; a lookup that does not finish keeps everything (refs theQuert/stima-api#5886)
…one that times out; TERM takes the group down; the cache key carries the extraction rule (refs theQuert/stima-api#5886)
…ing, a failed or partial one deletes nothing; correct the act-trigger comment (refs theQuert/stima-api#5886)
…stall alert; only a stale stamp alerts (refs theQuert/stima-api#5886)
…(else script) mtime, so a first sweep that never finishes still alerts once (refs theQuert/stima-api#5886)
|
#113 live spot-check round 8 on the Mac mini (read 02:50–02:56Z, read-only). Log timestamps are local (+0800). Load was 159 (1-minute average) at 02:51Z.
SCRIPT-SAFE count: G2 8 clean rounds. G3 8 clean, 0 misses; rounds 7 and 8 are safe abstains (kept everything), not judged samples. G4 8 clean, including its first true alert. The rate stays every two hours, and the modes stay Follow-up, not blocking (this is the second timeout, as named in round 7): under the current load the lookup cannot finish in 600 s, so G3 judges nothing. Nothing is lost while the mode is check-result: PASS |
|
check-by 2026-10-29T04:50:00Z: #113 live spot-check round 9 on the Mac mini. pass-when: every |
theQuert/stima-api#5886 guards G2, G3 and G4 (EL-DISK-5886-CONSUMERS-1739). The plan is in https://github.com/theQuert/stima-api/issues/5886. The root cause:
reclaim-byproductsis the only live trimmer ofgo-buildand the Claude scratchpads.Every new deleting step defaults to spotcheck (log-only). Nothing deletes more until a separate change flips a mode after 5 clean rounds (SCRIPT-SAFE).
G2: go-build cap (
shell/disk-janitor.sh,config/disk-janitor.conf)go-build-agenow also runs from the hourly--checkwhen either of these holds:go-buildis overCC_DJ_GO_BUILD_CAP_GB(default 8);CC_DJ_GO_BUILD_FREE_GB(default 35).lsof -nP -b -Fn, time-bounded byCC_DJ_HOLDER_TIMEOUT_SECONDS(default 120).reason=lsof-unusable).dudoes not count as over the cap.auto, act runs below 30 GB free, so go-build-age's effective act trigger is 30 GB. This is documented in CLAUDE.md.G3: a scratchpad liveness lookup that cannot hang or fail open (
shell/reclaim-byproducts.sh)v2).CC_RB_MENTION_BUDGET_SECONDS, default 600) and runs in its own process group. TERM, INT and HUP also take that group down.path-in-use.shcall is bounded by the phase budget left.G4: stalled-reclaimer alarm (
shell/resource-watch.sh)ALERT:reclaim-stalledonce when the last-finished stamp is older than 2× the LaunchAgentStartInterval. With the installed 7200 s interval, that is 14400 s.Review
lsof;Tests (foreground, temp dirs and fakes only)
tests/reclaim-byproducts.sh: rc=0,passed: 314, failed: 0(on 296353f; 396c9e4 does not touch reclaim)tests/disk-janitor.sh: rc=0, 434 ok, 0 not ok,disk-janitor validation passed(on 296353f; 396c9e4 does not touch the janitor)tests/resource-watch.sh: rc=0, 166 ok, 0 not ok,resource-watch validation passed(on 396c9e4)lsofand a partiallsof: each deletes nothing;bounded_grouptest that the grandchild is killed by timeout and by TERM;Deploy (not done in this PR)
install.shon the Mac mini. The livedisk-janitor.confneeds no change, since the new knobs have defaults and the modes stay spotcheck.~/.cc-reaper.