8000 feat(storage): show the space each source takes and what Lens made of it by adeelahmad · Pull Request #640 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(storage): show the space each source takes and what Lens made of it - #640

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-xfmkzn
Oct 18, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-xfmkzn

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: Admin › System health showed only how full the disk was, not which source (an upload folder, a mailbox, an import) was filling it.

After: under Disk, System health lists each source's assets with the space their own files take and the space of what Lens made of them (frames, pages, reports, exports, cached copies of files on storage connections). Agents get the same from GET /api/v1/resources/origins?storage=true, which adds media_bytes and made_bytes to each origin.

How: library.Origins.storage walks each asset's files and folders on the disk, reusing the list deletion.py already keeps of what an asset owns, so it is right however the files got there. It runs only when storage=true is asked for.

Motivation and Context

Item from the personal feature plan sheet ("what is using my space").

Screenshots (if appropriate):

n/a

Steps to reproduce (if appropriate):

Admin › System health › Disk.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests (tests/api/test_recording_list.py).
  • My change requires documentation updates, and I have updated docs/ accordingly (docs/api.md, Resources).
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md. Written as changelog.d/storage-per-source.md, per build(release): changelog fragments in changelog.d/ instead of one Unreleased section #581.

Done questions (AGENTS.md)

  • Goal: delivers what the user wanted, merged on green CI.
  • Agents: usable through the API, MCP or an assistant tool. GET /api/v1/resources/origins?storage=true.
  • Zero setup: no new prerequisite, .env edit or manual step.
  • Fewest clicks and keystrokes. Shown on the page admins already open for the disk.
  • Configurable: new settings in the web app with defaults; wizard asks only what is required. n/a: no settings.
  • Light: default install still runs on a Raspberry Pi with cloud models. The disk walk runs only when asked for.
  • Private and secure: data local and encrypted, passkeys, threat model updated. Scoped to the namespaces the caller can read, as the origin counts already were.
  • Cost: cheapest path, model calls in the activity ledger, budgets respected. n/a: no model calls.
  • User decides: consequential or new actions wait for the user; defaults unchanged.
  • Upgrades: existing installs upgrade safely (upgrade step for stored-data changes). n/a: no stored-data change; read from the disk.
  • Honest: sources cited; labelled built, in progress or planned.
  • Tests, docs and generated files updated (make openapi).
  • Open standards; dependencies keep Lens MIT. n/a: no dependencies.
  • Result reported with evidence; "refine later" items written down. Refine later: cache the walk for very large archives.
  • Reuse: existing Lens code and permissive libraries reused, nothing reinvented. Reuses deletion.py's list of an asset's files.

Local CI (ci/local-ci.sh): FastAPI (embedded and server), Next.js (1240 tests), pre-commit and PR title passed.


Generated by Claude Code

@adeelahmad adeelahmad self-assigned this Oct 18, 2026
@adeelahmad
adeelahmad merged commit bdc25d0 into main Oct 18, 2026
12 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-xfmkzn branch October 18, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0