Persistence Honesty: Guests, Firebase, Cache, and User-Owned Sync

Persistence Honesty: Guests, Firebase, Cache, and User-Owned Sync

4 50 109
calendar_todayschedule2 min read

Persistence Honesty: Guests, Firebase, Cache, and User-Owned Sync

“Local-first” in our prose means interaction and ingestion default to the device — not “no server for signed-in users.” This part is the mode matrix every writer and growth campaign must internalise. Deeper guest/auth detail also lives in content/coderlegion-sovereign-engineering-serial/05-local-first-browser-vault.md; here we align with the 2026 calibration ledger.


Ground truth table

User mode Authoritative trades Code touchpoints
Guest Browser localStorage (namespaced keys, quota handling) localPortfolioStore patterns
Authenticated Firebase cloud — authoritative history useTradesTradeService.getTrades
UI preferences Zustand persist with partialize — chart/filters only portfolioStore
IndexedDB Primarily Firestore client SDK cache; cleared on logout where implemented useAuth teardown
Google Drive User-owned file (pocket_portfolio_db.json) — dumb sync lane Sovereign Sync docs / architecture page

Why “IndexedDB is our database” is wrong

Guests do not use IndexedDB as the primary trade vault — they use localStorage. Authenticated users’ authority is Firebase, with IndexedDB as offline/cache for the SDK. Claiming IndexedDB is “the portfolio vault for everyone” fails procurement diligence in one grep.


Local-first ≠ no cloud

Approved phrases (from docs/command/claims-vs-codebase-calibration.md):

  • Client-side aggregation by construction for LLM context.
  • Stateless inference handler for portfolio text on /api/ai/chat.

Prohibited without sign-off:

  • “Zero server footprint” / “fully local portfolio” for auth workflows.
  • “No cloud” — Firebase, Vercel, LLM APIs, optional Redis/KV are all cloud-adjacent.

Google Drive: sovereign sync, not app logic

Drive holds a user-owned JSON file. The app does not execute portfolio business rules on Google’s servers — it treats Drive as dumb storage for export/sync. That is a credible “user-owned lane” story without claiming we eliminated Firebase for signed-in users.


Engineering takeaway for Part 12

Honest persistence makes the inference boundary (Parts 2–3) believable: we are not pretending the full ledger never existed; we are proving the LLM hop does not require re-uploading it row-by-row.


Part 4 of Sovereign Ingestion & Stateless Inference.

Read the full Sovereign Intelligence book, explore Open Portfolio, or try Pocket Portfolio.

🔥 Join developers growing publicly
Share your knowledge, build in public, and grow your developer presence with a global community.

More Posts

Local-First: The Browser as the Vault

Pocket Portfolio - Apr 20

The End of Data Export: Why the Cloud is a Compliance Trap

Pocket Portfolio - Apr 6

Split-Brain: Analyst-Grade Reasoning Without Raw Transactions on the Server

Pocket Portfolio - Apr 8

I’m a Senior Dev and I’ve Forgotten How to Think Without a Prompt

Karol Modelskiverified - Mar 19

Google Drive Sync

Pocket Portfolio - Jan 5
chevron_left
5.8k Points163 Badges
United Kingdompocketportfolio.app/press
66Posts
50Comments
32Connections
Led delivery of OceanBrain at National Grid Ventures, reducing manual subsea investigations by 60%.
... Show more

Related Jobs

View all jobs →

Commenters (This Week)

2 comments
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!