Skip to content

feat: archive scanned conversations locally#2356

Open
Lefeaker wants to merge 4 commits intoferdium:developfrom
Lefeaker:feat/local-archive-mvp
Open

feat: archive scanned conversations locally#2356
Lefeaker wants to merge 4 commits intoferdium:developfrom
Lefeaker:feat/local-archive-mvp

Conversation

@Lefeaker
Copy link

@Lefeaker Lefeaker commented Mar 7, 2026

Summary

Implement the local archive MVP for scanned AI conversations.

This adds the host-side pipeline that receives scan payloads from the recipe webview, stores them in local SQLite, rebuilds Markdown exports, supports manual rescan from the app menu, and includes cleanup/export tooling for archive maintenance.

What Changed

  • add local archive storage under src/archive/
    • SQLite initialization
    • schema for accounts, conversations, messages
    • archive persistence service
  • receive aihub-scan-messages in ServicesStore
  • add recipe preload bridge support for rescan
  • add menu action: Rescan Current Conversation
    • shortcut: CmdOrCtrl+Shift+Alt+S
  • add export script
    • scripts/export-ai-hub-archive.cjs
  • add cleanup script
    • scripts/cleanup-ai-hub-archive.cjs
  • improve local metadata handling when local recipe files / sandbox config are missing
  • fix archive naming and dedupe behavior
    • use canonical conversation key from /c/<id> when available
    • prevent title-only duplicates
    • dedupe exports per account + conversation key
    • safely clean historical duplicate conversation rows from SQLite

Why

This is the minimum viable local archive chain:

  1. scan current open conversation
  2. send structured messages to host
  3. persist to local SQLite
  4. export Markdown from persisted records

Validation

  • targeted lint / typecheck / tests passed through commit hooks
  • archive export succeeded
  • verified Markdown output under ~/Library/Application Support/FerdiumDev/ai-hub/conversations/
  • verified second-account conversations can be archived independently
  • verified duplicate historical conversation rows were backed up, cleaned, and re-exported

Output Paths

  • SQLite: ~/Library/Application Support/FerdiumDev/ai-hub/archive.db
  • latest Markdown: ~/Library/Application Support/FerdiumDev/ai-hub/conversation.md
  • per-conversation Markdown: ~/Library/Application Support/FerdiumDev/ai-hub/conversations/

Scope Notes

  • supports current open conversation full scan
  • does not yet do incremental live sync while chatting
  • does not yet wire Gemini / Claude archive pipelines
  • does not yet handle attachments, references, summaries, or memory features

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