Skip to content

Update the disk GC from VERSION 3 to 5: keep only the newest staged VS Code build (~2G) #158

Done

Description

@gregoryfoster

Problem

co-processor's disk GC is VERSION 3 (/usr/local/lib/cannobserv/disk-gc/VERSION, from #99). The vendored maintaining-host-disk pins VERSION 5 (skills/maintaining-host-disk/scripts/_pin.sh, in 9d988572 since PR #155).

VERSION 4 changed only the vscode-servers tier: it keeps only the newest staged build (gregoryfoster/skills#551). VERSION 5 is VERSION 4 with one docstring changed.

Under VERSION 3, the GC keeps every staged build newer than the live one. On 2026-12-02 05:42Z it kept four of them, all newer than the live 1.145.2: 1.145.3, 1.146.0, 1.147.0 and 1.148.0, about 650–690 MB each. VS Code has since staged 1.149.0. ~/.vscode-server/cli is 3.3G, and the root disk is 73% used (5.1G free), with the GC's warning at 80% [measured 2026-12-02].

Under VERSION 4 or 5, only the newest staged build would stay, which frees roughly 2G.

Steps

maintaining-host-disk § The run, the "update the disk GC" path. Every sudo step is approved by the operator in this repo's session.

  1. pull-disk-gc.sh into a fresh staging directory: an anonymous pull, digest-checked against the pin.
  2. install-disk-gc.sh --staging <dir>: the plan should read update (3 → 5). Then sudo … --approve.
  3. Verify:
    • VERSION reads 5;
    • both timers are still enabled;
    • the installer's journald_restart verdict was followed;
    • the next GC run (or a report-only run) keeps one staged build;
    • the headroom sensor still checks in ok.
  4. Update docs/MONITORING.md § Disk GC (:119, :147): VERSION 5 and the new keep rule. deploy/disk-gc/disk-gc.conf needs no change: no config key changed in VERSION 4 or 5.

Done when

  • The host runs VERSION 5, and the first run after the update kept only the newest staged Stable-* build. Record the space freed and the root disk's percentage.
  • The docs PR is merged. It is docs only, so there is no deploy.

Known context

  • The skill says no host has yet taken VERSION 5 through it (SKILL.md § Status, read 2026-11-30). This would be the first. An adopter note on gregoryfoster/skills is the operator's call.
  • Not in scope: Claude Code's session temp (/tmp/claude-1000, 1,262 MB). It is a candidate tier for Provisioner's GC, reported on CannObserv/provisioner#56 (comment 7352912369).

Epic: #84.

Activity

  1. gregoryfoster commented on Dec 2, 2026

    @gregoryfoster
    MemberAuthor

    Brief review, against origin/main ade4e31 and the host, 2026-12-02 ~17:30Z. Corrections first:

    1. The live build is gone from disk. The 05:42Z run kept the four staged builds and the live Stable-c4453f8e (1.145.2, in use). At 13:47Z, when 1.149.0 staged, that directory was removed while its server still runs from it: /proc/1909/exe → …/Stable-c4453f8e…/server/node (deleted). The GC didn't remove it (its only run today was 05:42Z, and it kept it). VS Code's CLI did, most likely (lru.json now lists exactly the five on disk) [inferred]. All five Stable-* builds on disk are idle: 1.145.3 (656M), 1.146.0 (675M), 1.147.0 (687M), 1.148.0 (694M), 1.149.0 (655M).
    2. So the expected VERSION 5 result differs. No live build is among the directories the GC scans, so the rule that applies should be with nothing live, the newest (editor-builds.md row 2), not the newest staged: keep 1.149.0, remove the other four, about 2.7G, not ~2G [expected; the report-only run decides]. "Exactly one Stable-* build kept" holds either way.
    3. The GC's lines are alert 85%, clear 80% (deploy/disk-gc/disk-gc.conf:27-28), not "warning at 80%".
    4. Now: / 74% used, 4.9G available (sensor 17:20:13Z, checked in ok (ok): HTTP 202).

    Confirmed as written: installed VERSION 3; the pin is VERSION 5 at 9d988572 (ade4e31, PR #155); both timers enabled; the docs lines are docs/MONITORING.md:119 and :147; disk-gc.conf needs no change. :147's rule (nothing live → keep the newest) still holds under VERSION 5, so it needs only its version reference.

    Proceeding: pull → plan → --approve (operator-approved in session).

  2. added 3 commits that reference this issue on Dec 2, 2026
  3. gregoryfoster commented on Dec 2, 2026

    @gregoryfoster
    MemberAuthor

    Host record: disk GC 3 → 5 on co-processor, 2026-12-02 (through maintaining-host-disk at 9d988572; each sudo step approved by the operator in session)

    Step Result
    Pull, into a fresh staging dir exit 0: tag 4ed0817c…, manifest sha256:b0ca3360…, layer 60 (sha256:cbf7fe5c…, diff_id sha256:35d22fdc…, 23,135 B), all 8 MANIFEST files OK, version: 5
    Plan action: update, installed_version: 3 → staged_version: 5, removed: [], journald_restart: false, journald_overrides: []
    --approve applied: true, systemctl_ran: true (daemon-reload), failed: null. journald not restarted, per the verdict
    VERSION 5
    Timers cannobserv-disk-gc.timer and cannobserv-disk-headroom.timer: both enabled, active
    Report-only run (disk-gc gc) exit 0: would remove 3.2G in 7 item(s); 1 withheld, 6 kept, 0 failed
    GC run (systemctl start cannobserv-disk-gc.service, 17:27:51Z) Result=success, exit 0: removed 3.2G in 7 item(s); 1 withheld, 6 kept, 0 failed; state.json {"exit": 0, "v": "5"}
    Stable-* kept exactly one: Stable-fd90a6de… (1.149.0, the newest; none live)
    Removed vscode-servers: 1.148.0 (693.9M), 1.146.0 (674.7M), 1.147.0 (686.7M), 1.145.3 (655.7M); claude-extensions 2.1.333 (408.8M); vsix-cache 2.1.334 (188.8M) and .trash (16K); uv cache prune ran; npm-cache withheld (recent)
    Space freed 3,469,201,408 bytes (df -B1, before vs after)
    Root disk 74% → 56% (5.0G → 8.2G available)
    Sensor's next run (17:30:13Z) ok: co-processor: / is 57% used, 8.1G available (alert at 85%, clears at 80%) then checked in ok (ok): HTTP 202
    tests/test_disk_gc.py 16 passed against the installed VERSION 5

    As predicted in the review above: no build was live on disk (the running 1.145.2's directory was already gone), so the rule applied was nothing live → the newest, not the newest staged. The latter path is still unobserved on this host. The first timer-driven VERSION 5 run is due 2026-12-03 05:15–05:45Z.

    Docs: PR #161. Found on the way: #160, an expired dated fixture in test_patching.py that fails the suite on main.

  4. added 10 commits that reference this issue on Dec 2, 2026
  5. gregoryfoster commented on Dec 3, 2026

    @gregoryfoster
    MemberAuthor

    First timer-driven VERSION 5 run, 2026-12-03. This discharges PR #161's known limit no timer-driven VERSION 5 run yet.

    Check Result
    Run cannobserv-disk-gc.timer → service at 05:27:46Z: Result=success, exit 0; state.json {"exit": 0, "v": "5"}
    GC removed 124.0K in 1 item(s); 0 withheld, 6 kept, 0 failed (the npm cache); uv cache prune ran
    Stable-* kept still exactly one: Stable-fd90a6de… (1.149.0, the newest; none live)
    VS Code nothing restaged overnight. The running server is still Stable-c4453f8e… from its deleted directory (6 processes)
    Root disk 56% (11,161,739,264 B used, 8.2G available)
    Sensor, first run after (05:30:13Z) ok: … / is 56% used, 8.2G available, then checked in ok (ok): HTTP 202
    Next run 2026-12-04 05:42:51Z

    Still unobserved on this host: the newest staged build kept beside a live one. That needs a client on a build that's on disk, with a newer one staged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions