Skip to content

fleet-monitor: disk-headroom alert for laptop /home — warn at 95% with the largest target dirs named, before ENOSPC is the signal #6813

Closed

Description

@developing-today

Problem

When the laptop's /home filesystem filled to 100% on 2026-11-06/07 (#6797), the first signal was builds dying with No space left on device (os error 28) mid-compile. Nothing in the fleet watches disk headroom: the cargo-target-janitor was failing silently every hour (filed separately), and no monitor reported the filesystem state at 90%, 95%, or 99%.

Measured trajectory (2026-11-07): 0–9 GiB avail (~05:05Z) → 217 MB avail (start of lane code-d's shift) → 39 GiB avail after incidental lane cleanups (05:31Z). ~/git/fleet alone holds 604 GiB of worktrees/targets, so the swing between "fine" and "dead" is a handful of parallel Rust builds.

Requested change (triage scopes the exact home)

Add a disk-headroom check to the fleet's existing monitoring (repo-fleet-monitor is the natural owner; triage confirms) that, hourly:

  • reads df for the laptop /home filesystem,
  • at ≥95% used, surfaces an alert in the monitor's normal report naming the filesystem, the avail figure, and the largest build-output consumers (the ~/git/fleet target classes by size, e.g. top 5 directories),
  • repeats/escalates at ≥98% or when avail drops under ~10 GiB regardless of percentage,
  • stays silent below threshold (no new noise class in the hourly report).

Acceptance

  • The check exists in the monitor's run and its state records the last-observed used% / avail.
  • A threshold crossing (or a fixture simulating one) produces exactly one alert entry naming the top consumers; a non-crossing produces none.
  • The alert text distinguishes "janitor healthy but targets growing" from "janitor failing" when that state is readable from the janitor's run records.

Refs: #6797 (triage), #3372 (prior occurrence, also discovered by failure).

Acceptance criteria

  • A fleet monitor/watchdog check reports laptop /home disk headroom and warns at 95% full (before ENOSPC), naming the largest target/worktree directories contributing.
  • The alert reaches a surface the fleet actually reads (monitor summary / watchdog log) with the measured usage, threshold, and top contributors.
  • The check is quiet below the threshold and does not duplicate-alert every cycle while the condition persists unchanged.

Activity

  1. added
    task/triageQueue packet kind: verify, reproduce, and route this item
    source/queue-workerFiled or worked by the queue/worker pilot
    priority/normalOrdinary priority (the default)
    area/infraInfrastructure, deployment, and operations
    on Nov 7, 2026
  2. developing-today commented on Nov 7, 2026

    @developing-today
    ContributorAuthor

    Picked up by repo-worker-code-b — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-code-b posts progress markers; after 30 minutes of silence any other worker may pick this up.)

  3. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed on Nov 7, 2026
  4. developing-today commented on Nov 7, 2026

    @developing-today
    ContributorAuthor

    🤖 Agent note · triaged — owner confirmed, implementation scoped (fallback mode, code#6619)

    Owner: confirmed. repo-fleet-monitor is the right home — it already runs the fleet's hourly-class reconciliation duties from a generated digest and reports through one DELIVERY summary, which is exactly the "normal report" the alert must land in. One correction to the filing: the monitor's live cadence is every 2h (repo copy crons/hourly/repo-fleet-monitor__interval@2h.md), not hourly — the check inherits 2h. Tightening it to 1h is a rate change and needs Drew's word per standing rules; 2h is inside this failure's timescale (the 2026-11-06/07 fill took hours, and the ≥95% band fires long before ENOSPC).

    Fresh state (2026-11-07T06:28Z, laptop): /home is at 99% used, ~38.6 GiB avail (3.3T filesystem) — i.e. above the issue's ≥98% escalation band by percentage right now (the avail < ~10 GiB trigger is not met). The alert, had it existed, would be firing at escalation level today. ~/git/fleet build outputs remain the swing consumer, as filed.

    Scoped implementation (for the implementing claim):

    1. Reading step in the monitor run, beside the run-start digest: one bounded laptop-agent call — df --output=pcent,avail /home plus the top-5 consumers from a bounded one-level size pass over ~/git/fleet worktree target dirs (hard timeout; a du over the whole tree is itself a load event — prefer the cargo-target-janitor's own size/run records when fresh, fall back to the bounded pass).
    2. State: hidden_files/disk-headroom-state.json — last observed used% / avail GiB, current band (ok / warn≥95 / escalate≥98-or-avail<10GiB), last-alert timestamp + band, so a crossing produces exactly one alert entry and repeats only on band change or a further ~5-point drop (the issue's repeats/escalates clause), never one per run.
    3. Surface: alert lines in the monitor's existing DELIVERY summary only when band ≠ ok, naming filesystem, used%, avail, and the top-5 consumers. Silent below threshold — no new noise class.
    4. Janitor distinction: the alert text reads the cargo-target-janitor's latest run outcome (its run records on the laptop; its live-claims source was repaired today via PR fix(cargo-target-janitor): live claims source + wider scope (#6812) #6820 / cargo-target-janitor: queue helper path is dead (~/hatch/tools/repo-queue.py) — every hourly run refuses cleanup while in-scope targets sit at 275G vs the 150G cap #6812) and states "janitor healthy, targets growing" vs "janitor failing" accordingly; if the record is unreadable, the alert says so instead of guessing.
    5. Fixture test: the check must accept an injected reading (env/arg fixture) — a simulated ≥98% crossing yields exactly one alert entry in a dry-run summary; a 90% reading yields none. This is the acceptance evidence; a real crossing must not be staged on the laptop.

    Verdict: triaged, scoped, ready for an implementation claim against the monitor body + a small digest/state helper. Not a worker-lane code change to the code repo; nothing here needs Drew except the optional 1h cadence question, which is NOT blocking.

  5. added
    status/triagedTriaged and routed (see agent note)
    and removed on Nov 7, 2026
  6. developing-today commented on Nov 7, 2026

    @developing-today
    ContributorAuthor

    Released by repo-worker-code-b (outcome: done). Triaged (fallback, lane code-b): owner CONFIRMED as repo-fleet-monitor (digest-driven, one DELIVERY summary); cadence correction - the monitor runs every 2h, not hourly, and the check inherits 2h (a 1h rate change needs Drew, non-blocking). Fresh laptop reading 2026-11-07T06:28Z: /home 99% used, ~38.6 GiB avail - above the >=98% escalation band today. Implementation scoped on the issue: bounded df + top-5 consumer reading beside the run-start digest, disk-headroom-state.json for exactly-one-alert semantics, DELIVERY-summary surfacing only on band != ok, janitor healthy-vs-failing distinction from its run records (post-#6812/PR #6820), and an injected-reading fixture as the acceptance test. status/triaged set. Ready for an implementation claim.

  7. 15 remaining items

  8. added
    queue/blockedQueue or user escalation state
    status/blockedQueue or user escalation state
    and removed
    work/assignedQueue worker lifecycle state
    on Nov 8, 2026
  9. dezren39 commented on Nov 8, 2026

    @dezren39
    Member

    agent-note:v1
    event: blocked
    task: 11400 (repo-health-code-pilot; worker repo-worker-code; OpenChamber scheduled lane c29174f1-48e0-4b13-b4ff-9b73ab67e9ab)
    state: blocked; no implementation or live schedule change was made.
    blocker: The schedule registry points to /home/hatch/workspace/goals/keep-the-four-repos-healthy/crons/hourly/repo-fleet-monitor__interval@2h.md, which is absent on this laptop. No repo-fleet-monitor source exists in developing-today/code, and this session has no cron.update tool. The required repo-copy-first and live update cannot be done safely without both.
    resume: Provide the authoritative monitor source/workspace and cron.update access; then implement and test the repo copy, commit it, and update the live job with the exact text. No real disk fill was staged.
    labels: queue/blocked + status/blocked; claim labels removed.

  10. dezren39 commented on Nov 11, 2026

    @dezren39
    Member

    🤖 Agent note · dropped-thread catcher blocked-claim validation — blocker partly real, work re-homed

    • Agent: dropped-thread-catcher (hourly), 2026-11-11T07:31Z run
    • Claim checked (task 11400, 2026-11-08T02:21Z): implementation blocked because the repo-fleet-monitor source was absent on the laptop and the session had no cron.update tool.
    • Live evidence (2026-11-11T07:40Z): the claim about the monitor is now literally true in a stronger form — cron.view repo-fleet-monitor returns "schedule does not exist": the monitor job this issue names as owner no longer exists as a live schedule (its last run in its chat is 2026-11-08 20:12 CST; only an archived definition copy remains at ~/workspace/cron.d/_archive/repo-fleet-monitor__interval@2h.md). So there is no monitor source to edit — but that does NOT park the alert itself.
    • Why the work is still fleet-solvable: the alert's job — read laptop /home headroom, name the largest consumers, surface at ≥95% / escalate ≥98% — is already 90% performed every 4h by the live git-hygiene-sweep job, which measures /home, deletes idle artifact dirs, and exception-reports to the Reports chat (runs 88/90 caught the 2026-11-10/11 fill at 99%). The disk filled again to 99% on 2026-11-10/11 (see darwin-nix#373), so this alert is still owed and now urgent in kind.
    • Disposition: re-home the implementation to git-hygiene-sweep (add the ≥95%/≥98% headroom alert with top-5 consumers + de-dup to its existing disk duty), or recreate a monitor — triage picks; the archived monitor definition above is the source text if recreating. Blocked labels removed, queue/queued added so the code pilot feeder enqueues the packet.
  11. added
    epic/storageEpic: epic/storage (fleet reprioritization 2026-11-12)
    and removed
    status/blockedQueue or user escalation state
    queue/blockedQueue or user escalation state
    on Nov 11, 2026
  12. added this to the Storage program milestone on Nov 12, 2026
  13. dezren39 commented on Nov 14, 2026

    @dezren39
    Member

    agent-note:v1

    Implemented — in the re-homed location the dropped-thread catcher chose on 2026-11-11 (the repo-fleet-monitor job no longer exists; its last run was 2026-11-08):

    1. git-hygiene-sweep instruction (goal hidden_files/git-hygiene-sweep-instruction.md) gained Duty C — disk-headroom alert: every run reuses Duty B's laptop df for /home, computes the band (quiet <95% and ≥10 GiB avail; warn ≥95%; escalate ≥98% or <10 GiB avail), records {last_band, used_pct, avail_gib, observed_at} in hidden_files/disk-headroom-state.json every run, and alerts exactly once per band change (incl. one recovery notice), naming the filesystem, used%/avail, the threshold, and the top 5 build-output consumers under ~/git/fleet — with the janitor distinction ("janitor healthy but targets growing" vs "janitor failing / not running") stated when the janitor's run state is readable, and stated as unreadable when it is not.
    2. The live git-hygiene-sweep cron job (every 4h) body now carries the headroom crossing as an explicit exception condition (verified by cron.view readback after cron.update), so a crossing produces the Fleet Reports Space exception record + one chat message; below threshold the sweep stays silent.
    3. Fixture test of the band logic (task 11400 scratch): real reading 88% / 416 GiB → quiet, no alert; simulated quiet→warn→warn→escalate(99%, 8 GiB)→quiet sequence produced exactly 3 alerts (one per band change, none on the repeat) — PASS. State file seeded with the live 2026-11-14T04:57Z reading (88%, 416 GiB avail, quiet).

    The next scheduled hygiene run (2026-11-13 23:05 CST) is the first live exercise of Duty C.

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

Metadata

Metadata

Assignees

Labels

area/infraInfrastructure, deployment, and operationseffort/sSmall: expected under 2 hours of workepic/storageEpic: epic/storage (fleet reprioritization 2026-11-12)kind/infrastructureInfrastructure / host-portability workmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)source/queue-workerFiled or worked by the queue/worker pilottask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions