Skip to content

feat(storage): add bounded storage usage report#917

Closed
luoye520ww wants to merge 1 commit into
KunAgent:developfrom
luoye520ww:codex/storage-usage-report
Closed

feat(storage): add bounded storage usage report#917
luoye520ww wants to merge 1 commit into
KunAgent:developfrom
luoye520ww:codex/storage-usage-report

Conversation

@luoye520ww

Copy link
Copy Markdown
Collaborator

Problem

Storage governance needs a read-only, bounded usage report before cleanup or retention work can be safely added.

Scope

This PR adds only the storage usage scanner and its contract-level tests. It does not add UI, automatic cleanup, retention, or IPC wiring.

Changes

  • Report threads, attachments, checkpoints, worktrees, logs, diagnostics, extensions, and models.
  • Count bytes, files, directories, latest modification time, errors, and truncation per category.
  • Use bounded per-category traversal with opendir and lstat; symlinks are never followed.
  • Missing roots are reported as empty and malformed limits fail closed.

Validation

pm.cmd exec vitest run src/main/services/storage-usage-report.test.ts (3 passed)

pm.cmd run typecheck (passed)

pm.cmd --prefix kun run typecheck (passed)

pm.cmd run lint (passed)

pm.cmd run build (passed)

  • git diff --check (passed)

Review

Completed functional, lifecycle, data integrity, security, cross-platform, performance, compatibility, and scope review. The scanner performs no writes or deletes.

Follow-ups

IPC/UI exposure and cleanup policy should be separate PRs.

@luoye520ww

Copy link
Copy Markdown
Collaborator Author

Superseded by #944, which consolidates storage usage reporting, safe cleanup decisions, and data-retention validation into one reviewed PR. Closing this split PR to avoid duplicate review.

@luoye520ww

Copy link
Copy Markdown
Collaborator Author

Closed in favor of #944.

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.

1 participant