Menu ▾ ▴

#22 [Feature]: Add encrypted runtime cache inspection and cleanup

closed
nobody
2026-09-12
2026-09-11
Anonymous
No

Originally created by: thomijasir
Originally owned by: thomijasir

Feature description

Provide supported commands for viewing cache metadata and removing old encrypted runtime cache entries.

Current behavior

Runtime cache files are managed internally. Users cannot see which environments are cached or remove entries without finding files in the data directory.

Why we need this

Cached secrets can outlive the project that created them. Users need a safe way to review cache age and remove stale data without opening or deleting internal files manually.

Proposed CLI interface

  • dopbase cache list
  • dopbase cache clean --older-than 14d
  • dopbase cache clean --all
  • dopbase cache clean --dry-run [--older-than 14d|--all]

Expected behavior

  • List server URL, project, environment, environment ID, fetch time, age, and aliases.
  • Do not decrypt or display secret values for listing or cleanup decisions beyond the minimum metadata needed from the authenticated cache document.
  • Default cleanup to entries older than 14 days.
  • Require --all for deleting entries regardless of age.
  • --dry-run prints the entries that would be removed without changing the cache.
  • Lock the cache during cleanup and write the remaining document atomically.
  • Remove an empty cache document after its final entry is deleted.
  • Support human tables and structured --json output.

Security and compatibility

  • Never print secret values, credential-derived keys, cache keys, nonces, or ciphertext.
  • Keep existing server and credential isolation.
  • Do not treat a corrupt cache as permission to delete it. Report the path and a safe manual recovery step.

Out of scope

  • Changing runtime cache encryption.
  • Cleaning saved sessions or client configuration.
  • Adding cache freshness controls to run.

Acceptance criteria

  • [ ] List shows accurate metadata for every entry available to the active server and credential.
  • [ ] Age cleanup removes only matching old entries.
  • [ ] --all removes all matching entries after normal confirmation rules.
  • [ ] Dry run performs no writes.
  • [ ] Cleanup survives concurrent CLI access without corrupting the cache.
  • [ ] JSON output contains metadata and removal counts but no values.

Test scenarios

  • Add cache command tests under app/tests/cli/.
  • Cover empty caches, multiple entries, age boundaries, dry run, all mode, confirmation, JSON output, locking, atomic replacement, corrupt documents, and secret-value absence.

Documentation

Document cache location at a high level, metadata shown, the 14-day cleanup default, and recovery from corrupt cache files.

Dependencies

Build on the existing runtime cache locking and document format. The global non-interactive mode in [#19] governs cleanup confirmation.

Related

Tickets: #19
Tickets: #47

Discussion

  • Anonymous

    Anonymous - 2026-09-11
     
  • Anonymous

    Anonymous - 2026-09-12

    Ticket changed by: dopbase

    • status: open --> closed
     

Log in to post a comment.