llm_router gains groq in the fallback chain and a ContextVar sink: when
set, call_llm streams SSE from the provider and forwards each real delta
while still returning the full text, so callers need no changes.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
feat: real Groq reasoning narrator with streamed thinking + honest engine tags
Agents now surface a genuine model's chain-of-thought (ChatGroq,
reasoning_format=parsed) streamed as incremental 'thinking' events, and
every done event carries engine=live|simulated so the UI never presents
scripted output as live. No GROQ_API_KEY -> narrator absent, never faked.
Includes assert-based self-check.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1. ARR disambiguation: removed "revenue" from the ARR regex so that
"FY2025 revenue $1.4M" no longer shadows the explicit "ARR: $3.7M"
headline. Added an "arr is reported at" pattern as a secondary match.
2. Customer concentration: added pattern for "Top customer contributes X%"
(singular, no count after "top") and "X% of revenue/ARR [top/single]"
— the previous patterns required a digit ("top 3 customers") and missed
single-customer concentration statements.
3. Legal placeholder filter: the StrataIQ appendix had 30 boilerplate
"Due Diligence Section #N ... investigation area" sections whose word
"investigation" triggered the legal parser. Added a skip guard for
lines matching "this section contains additional" or "due diligence
section N".
4. Uploaded-pitch risk signal scan: the market competition scan now
includes raw doc_text so "Microsoft Copilot / OpenAI Enterprise /
Anthropic Team" in the document body triggers the heavy-competition
penalty …
fix: eliminate cross-company contamination in uploaded pitch evaluation
Root cause: three-layer bug caused StrataIQ uploads to be evaluated as NovaPay.
Layer 1 — pitch_loader.py: resolve_uploaded_pitch() searched only the public
MemoryGraph (missing uid-scoped incidents for authenticated users) and returned
a relative filename like pitch_INC-xxx.json that _load_pitch_file() would look
for in data/ — where it doesn't exist — then silently fall back to novapay_pitch.json.
Fix: check uid-scoped graph first, then public; return absolute path so the file
is always found regardless of which memory directory it lives in.
Layer 2 — api/main.py trigger_deal: when resolved_pitch was None (company name
lookup failed), sim_state.active_pitch_file was set to None, causing every
subsequent _load_pitch_file() call during the run to fall through to the NovaPay
default. Fix: only update active_pitch_file when resolved_pitch is not None.
Layer 3 — api/main.py mock-LLM: the /mock-llm endpoint ran in a fresh HTTP
request context where current_pitch_file ContextVar was neve…
fix: apply deep audit — 35+ bug fixes across backend, engine, and frontend
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…
feat: restructure PDF report with dedicated per-partner pages
Each partner agent now gets its own full page with a color-coded role
banner (financial=blue, legal=violet, technical=cyan, market=green,
managing=slate). Scorecard redesigned as a 2×2 domain card grid with
a dark weighted-total banner. Cover → Exec Summary → Scorecard →
partner pages in canonical order, precisely aligned margins throughout.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: replace /.info/connected probe with real write — Admin SDK doesn't support .info namespace
- Add probe() to core/rtdb.py that makes a real network call at startup
- Wire probe() into lifespan so misconfig shows immediately in HF Space logs
- Replace bare `except Exception: pass` at all rtdb call sites with warning logs
- Fix misleading comment on _fdb.reference("/") — it does not validate the URL
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
feat: add token-based authentication for report downloads and update decision parsing to support varied formatting
- core/rtdb.py: don't set _ready=True before firebase_admin._apps check —
the old code permanently locked out RTDB if Admin wasn't ready on first
call. Now retries until Admin is initialized, then marks permanent.
- api/v1.py: GET /api/v1/rtdb-test writes a test entry to /diagnostics/ping
(no auth required) and returns firebase_admin status, rtdb status, and
write result — so we can verify connectivity without reading logs.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: re-pad FIREBASE_SERVICE_ACCOUNT_B64 before base64 decode
HF Spaces strips trailing '=' characters from secret values, which makes
base64.b64decode raise 'Incorrect padding'. Adding back the padding with
-len % 4 fixes the decode, allowing Firebase Admin to initialize correctly.
Without this, ALL auth token verification was silently failing and every
WebSocket connection landed as uid=__public__ — no user data was isolated
and RTDB received nothing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: pass databaseURL to Firebase Admin + write presence on WS connect
- core/auth.py: initialize_app now includes databaseURL from env — without
this, all firebase_admin.db.reference() calls raised ValueError and RTDB
was silently disabled even when FIREBASE_DATABASE_URL was set.
- api/main.py: on WebSocket connect, upsert user profile and write a
session_connected activity so the Firebase Console shows live users
the moment they open the dashboard (not just on deal trigger).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- api/v1.py: fix 15 endpoints where uid=None fell through to global
memory_graph (leaking last user's deal data). All unauthenticated
requests now use isolated __public__ namespace.
- api/main.py: same fix on WS endpoint; wire Firebase RTDB writes on
deal verdict, session start, and user profile upsert.
- core/rtdb.py: new module — durable per-user RTDB storage for deals,
chats, sessions, activity. Falls back silently without FIREBASE_DATABASE_URL.
- frontend/components/MemoryView.tsx: replace bare fetch() with apiFetch()
so history and deal detail calls carry the auth token — fixes History
page showing blank after isolation fix.
- frontend/lib/firebase.ts: add databaseURL to Firebase config.
- frontend/pages/index.tsx: mobile responsive — px-4/sm:px-8 on all
sections, tighter hero padding, smaller font on mobile, overflow-x-hidden.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: professional PDF report — strip agent internals, color verdict, risk bar chart
- api/main.py: redirect_slashes=False — /mcp now serves directly, no 307
redirect that caused Invalid Host header (421) on HF Space proxy
- api/v1.py: _mcp_transports() auto-detects public URL from x-forwarded-host
headers so it returns the correct HF Space URL, not localhost:8000
- IntegrationsView: true one-click deep links — Cursor (cursor:// protocol),
VS Code (vscode:mcp/install), Smithery button, Claude Desktop auto-install
script, Windsurf config, manual JSON; frontend ignores localhost URL fallback
- Auth: user isolation per uid on WebSocket + rate limiting on deal trigger
- Profile: Google photo + display name in sidebar, Firestore upsert on trigger
- firebase.ts: remove broken signInWithRedirect, throw POPUP_BLOCKED instead
- base_agent.py: exponential backoff reconnect in real Band mode
- apiFetch.ts: auto sign-out on 401 (expired token)
- ErrorBoundary: catches render errors so one bad component can't blank dashboard
- smithery.json: Smithery registry config for one…
fix: resolve user data isolation for both mock and real modes across all REST endpoints