Four bugs fixed:
1. _resolved_uid property replaces duplicated uid-lookup logic across
MemoryGraph. The global singleton (explicit_uid=None) was sending
authenticated users' deal data to the __public__ Firestore namespace,
so Firestore recovery never found their history. All Firestore calls
now use _resolved_uid (falls through to sim_state.active_uid).
2. create_incident seeds local cache from Firestore first when local is
empty. Previously, triggering a new deal after a restart wrote only
that deal to local, causing list_incidents to ignore all prior
Firestore history on every subsequent read.
3. list_incidents writes Firestore data back to the local file when
recovering, so subsequent reads don't hit Firestore on every call.
4. Chat history (append_chat/get_chat_history) now mirrors to and
recovers from a new Firestore collection (fusion_chats/{uid}/
sessions/{id}/turns). /chat/sessions falls back to Firestore when
no local chat_history_*.json fil…
fix: harden multi-user isolation, auth persistence, and data safety
- broadcast authoritative weighted_score/verdict/confidence as structured
fields so the dashboard no longer depends on regex-scraping LLM text
(weighted risk now shows the moment the committee concludes)
- normalize guest sessions to the __public__ memory namespace so deals are
written and read from the same place — history + verdict survive refresh
- add strict pitch-deck signal gate to /upload-pitch: non-pitch documents
are rejected with a clear message instead of producing a bogus verdict
- report download: parse JSON-or-text errors; stop a later upload from
clobbering a past deal's pitch lookup
- doctrine: senior-partner reasoning discipline + locked verdict format
- fix missing import asyncio (latent NameError in chat WebSocket)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
feat: persist incidents to Firestore so they survive server restarts
- New core/firestore_memory.py: write-through + read-fallback helpers
- memory_graph.py: create_incident/log_finding/set_final_decision all
mirror to Firestore collection fusion_incidents/{uid}/incidents/{id}
- get_incident/list_incidents/get_latest_incident_id fall back to
Firestore when local JSON files are empty (server restart recovery)
- pitch_data stored as JSON string to stay under 1MB Firestore doc limit
- All Firestore ops are best-effort: errors are silently logged at DEBUG
fix: resolve user data isolation for both mock and real modes across all REST endpoints