Skip to content

Disk-space preflight for recordings and a storage report in doctor #354

Closed

Description

@TMHSDigital

Summary

Retention prunes only screenshots, frames and index sidecars (recordings and edits are never touched), doctor's storage reports only { home, homeExists }, and nothing checks free space before a capture (no statfs anywhere in src/). The default cap is 1 h, the maximum is 7 days, and every edit writes a new full file.

Where

  • src/utils/retention.ts:1-14, 66-70
  • src/tools/doctor.ts:43
  • src/tools/startRecording.ts:133-142

Impact

A long or forgotten recording on a nearly full drive fails partway with an ffmpeg write error, and SCREENCAST_HOME fills up over weeks with no tool that says how much space it uses.

Proposal

  1. doctor: storage.freeBytes (fs.statfs on the home volume) and per-folder bytes for recordings/, edits/, screenshots/ and frames/, plus a problems entry below a threshold.
  2. start_recording: estimate bytes from fps, quality and maxDurationSec, refuse with a clear error below a floor (or the estimate), and warn when near.
  3. Optional: an opt-in SCREENCAST_MAX_HOME_GB, or delete_recording { olderThanDays, dryRun }.

Getting started

  • Relevant files: src/tools/doctor.ts, src/tools/startRecording.ts, src/utils/retention.ts
  • How to run tests: npm test

Filed by repo-audit/full-audit at b9b94fa. Severity: medium. Effort: M. audit-key: enhancement|src/tools/doctor.ts|storage

Activity

  1. added
    enhancement
    effort: medium
    on Nov 17, 2026
  2. TMHSDigital commented on Nov 17, 2026

    @TMHSDigital
    OwnerAuthor

    5ea2b09 adds part 1: doctor's storage.freeBytes, per-folder bytes, and a problem below 2 GB free. Still open: part 2 (start_recording estimating the size from fps, quality and maxDurationSec and refusing or warning when free space is short) and the optional cap or bulk delete.

  3. TMHSDigital commented on Nov 18, 2026

    @TMHSDigital
    OwnerAuthor

    c097bfd: start_recording now checks free space on the output drive before spawning anything (nearest existing folder above the output): it refuses below 500 MB and returns a diskNote below 2 GB. Together with doctor's storage report from 5ea2b09 this covers points 1 and 2; the optional cap / bulk delete in point 3 is not done. Verified with unit tests in storage.test.ts and the full suite.

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

    effort: mediumenhancementpriority: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions