Repository navigation
Closed
Copy link
Labels
Description
Context
Live debugging of mecatui sessions and /sessions against real historical stores exposed several coupled storage and UX failures:
- mecatl workspace: 12 GB / 807 snapshots; ToolHive: 3 GB / 157 snapshots.
- 645/807 latest records exceed the 64 KiB tail window, causing full-file scans.
- A live process allocated 78.5 GB and ran 1,113 GCs in ~156s while listing.
- inventory paging currently bounds response size, not work; the client fetches all pages before rendering.
- 800/807 mecatl and 156/157 ToolHive snapshots predate durable
kind, so they appear under Other and are inspect-only. - retention and stale-session reconciliation traverse the same expensive inventory.
Outcome
Large historical stores remain responsive and manageable without data loss:
- latest-record reads are bounded by the latest record, not file history;
- current snapshots stop growing quadratically;
- inventory pagination is work-bounded and progressive;
- legacy sessions can be explicitly adopted as writable chats from the TUI without silently escalating unknown records;
- storage migration/compaction and destructive cleanup are distinct, safe workflows;
- automatic retention is configurable and observable.
Delivery phases
Phase 0 — immediate safety and relief
- protect unknown sessions from automatic retention;
- bounded reverse latest-record reader.
Phase 1 — storage and inventory
- versioned atomic current snapshots;
- rebuildable metadata catalog, true pagination, narrower locking;
- progressive Sessions TUI.
Phase 2 — management APIs
- resumable storage migration/compaction;
- retention planner/manual cleanup;
- storage health;
- server-side legacy adoption.
Phase 3 — operator UX
- retention configuration;
- TUI adoption;
- TUI cleanup/optimization;
- systemd/macOS operations documentation.
Non-goals / separations
- Physical format migration must not reclassify
unknownasmain. - Storage compaction (preserves sessions) must not share consent with cleanup (deletes sessions).
- Legacy adoption is an explicit trust decision and must remain separate from physical migration.
- The TUI must call authenticated server operations; it must never edit store files directly.
- External cron/find deletion is unsupported; daemon-owned retention remains the normal automatic path.
Sub-issues
Collapse Sub-issuesSub-issues
Loading 13 sub-issues
Activity