Spaces:
Sleeping
Sleeping
Commit History
-
deploy#2: unified reco-fit gate + session-privacy fix + profile-completeness + full UI rebuildβ
- Reco-fit gate (absorbs #10/#26): product-type + hard-eligibility(entry-age) + required-feature(maternity) + fit-rank + UIN dedup; new policy_identity.py; fixes overall_score rank-inversion. 7-persona audit failures resolved. - Profile session-persistence privacy leak closed (name-keyed directory scan removed; recall now staged + confirmation-gated, fails closed) + single_brain "Are you <name>? yes/no" confirm-prompt. - Profile-form completeness: + desired_sum_insured_inr/smoker/copay_pct/ family_medical_history; ProfileUpdateRequest silent-drop closed. - Full premium UI rebuild (front-page design system): profile panel, chat/AI replies, cited cards, marketplace, compare modal, scorecard/premium widgets; Live(BETA) real warning modal; front-page proseβbullets. - 117 backend tests pass; frontend production build clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>b134f5b -
data+scoring: verbatim-source all policy_facts, recalibrate scorecard, fix recommendationβ
- Re-sourced ~2900 cells to verbatim PDF clauses (v1/v2/v3 fleets); 0 fabrication, 0 legacy-provenance, ~250 wrong values corrected; image-only Acko cells dropped. - Removed max_renewal_age from scoring (IRDAI lifelong is universal); root-caused 999. - Recalibrated 6 sub-scores + thresholds: real A/B/C/D/F spread (was ~90% B); fixed-benefit N/A reweight. - #9 citations = exactly the prose-named policies (no slice cap). - #10 eligibility gates (no top-up for first-timers, zero-copay, SI floor) + profile-fit rank. - Voice TTS silent-failure surfaced + codec fix; 14 dead source URLs replaced. - scorecard/compare/bulk now merge corrected policy_facts (divergence fix). - 62/62 tests; two-part verify: 4113 verbatim-verified, 66 documented residual, 0 fabrication. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>7081aaa
-
fix(pricing): KI-277 β F6 Option B+ curated vs non-curated premium UIβ
User clarified: per-policy pricing is only real for the 26 curated policies in illustrative_premiums.json. For the other ~124 policies in the corpus we have NO quote data β the flat heuristic just reuses the same buyer math across them, giving false per-policy precision. Implementation of Option B+: - Curated policy (base_sample_used=true): existing slider widget renders unchanged β real quote-anchored estimate with SI/tenure/deductible sliders + Β±15% range + methodology footnote. (Removed the now-redundant "Estimate" badge since this branch is curated-only.) - Non-curated policy (base_sample_used=false): NEW NonCuratedPricingNotice sub-component renders instead. Blue-accented info card. Reads: "We don't have a verified quote for [Policy Name] yet, so we can't show a plan-specific estimate. Based on your profile, plans in this category typically cost: βΉX-Y/year." + median sub-line + sample size + footnote pointing to PolicyBazaar / InsuranceDekho for an exactβ¦fc6581d -
fix(landing): KI-276 β remove redundant subtitle/no-commissions/source-link tripletβ
User asked to delete the welcome.subtitle text. It said: "I'll ask a few short questions, then show you 3 policies that match β with the exact reasons each ranked well. No broker commissions in my ranking. Every fact you see has a source link." Removed because Section 1 ("How this works") immediately below already explains the same flow in a cleaner numbered-step format. Keeping the hero heading + Section 1 below it; removed the paragraph between them. i18n keys (welcome.subtitle / welcome.no_commissions / welcome.source_link) left in i18n.ts as dead β could be cleaned up in a follow-up sweep, but the renderer no longer references them. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>a16d228 -
feat(profile+pricing+voice): KI-275 β F-bundle: smoker + recap-verify + premium scope + price consolidationβ
F2 β Smoker slot end-to-end (KI-275): - needs_finder.Profile: smoker: Optional[bool] field - brain_tools._ACCEPTED_FIELDS + SLOT_UNION extended (now 16 slots). _coerce_smoker accepts yes/true/smoker/tobaccoβTrue, no/non-smokerβFalse, empty/unclearβNone. - single_brain SYSTEM_PROMPT RULE 2.5 item 7: ask "Do you smoke or use tobacco?" Save smoker: save_profile_field(field="smoker", value="yes"/"no"). - premium_calculator bulk_estimate threads smoker_mult (1.4Γ when True) through both curated-anchor + flat-base paths. Surfaces smoker_loading_x + smoker_loading_reason in breakdown when !=1.0. - Premium delta: 35yo metro 10L SI no-PED β βΉ11,500 β βΉ14,300 (+24% via curated 1.35Γ) / βΉ9,000 β βΉ12,600 (+40% flat fallback). F3 β Recap-vs-reality fix: - single_brain RULE 4 new "RECAP VERIFY" sub-section: forbids recapping slots not actually saved via save_profile_field. Worked example for the diabetes/family_medical_history split (don't conflate them). - main.py post-turn confirmβ¦a7d8209 -
fix(ux+voice): KI-274 β landing page enterprise redesign + Sarvam 429 friendly errorβ
Two parallel bundles committed together: A β Landing page enterprise 3-section redesign (frontend/src/app/page.tsx): - Removed: 4 example suggestion chips ("nonsense"), yellow standalone callout "Tell me the truth", "You can type below" narrative, "166 policies" standalone line, header EN/HI lang toggle (already removed in KI-257). - Section 1 "How this works": 3-step grid with numbered teal circles β (1) ask Qs β profile, (2) match 150+ policies, (3) customised premium estimate. Lightbulb icon header. - Section 2 "Using the bot": 4-mode card grid β Type / Push-to-talk / Hold SPACE / Live (BETA). Mic icon header. Note about Sarvam TTS + Hindi. - Section 3 "Two things before we start": 2 callouts side-by-side β Left (amber/teal): "Tell me the truth, even on hard things" (absorbed yellow callout). Right (muted): "Speaking to the bot" β speak slowly, English OR Hindi, the bot mirrors. Shield icon header. - Visual: rounded cards with subtle borders + shadows, hero gradientβ¦ce7f6d0 -
fix(ui): KI-273 β EST. PREMIUM chip always visible (was hidden at <50% profile)β
User feedback: after KI-269 merged the two premium chips into one, the chip-CTA disappears at 0% profile completeness. Lost the entry point to the premium calculator for users exploring before any conversation. Fix: remove the `completeness_pct >= 50` gate on the chip. Now ALWAYS renders, with two display states: - Profile <50% complete (or no sample): label reads "Tap to estimate" (Hindi: "Tap ΰ€ΰ€°ΰ₯ΰ€"). Clicking still opens the panel β sliders default to standard fallbacks (35yo, 10L SI, metro, no PED, 0 copay) which the user can move manually. - Profile β₯50% complete with sample: label reads the actual band "βΉXββΉY/yr" derived from estimate_premium_band. Tooltip updated to "Tap to estimate / refine premium with sliders" so it reads sensibly in both states. Behavior preserved: - Same onClick (toggles showPremium, closes sibling panels) - Same amber/orange gradient + RupeeIcon + edit-pencil affordance - Active ring when panel is open - KI-270 + KI-272 panel pre-fill from profilβ¦e04b308 -
fix(panel): KI-272 β PremiumCalculatorPanel copay pre-fill + re-sync on profile loadβ
E1 Playwright run found three pre-fill bugs in PremiumCalculatorPanel that D1 either missed or that occurred via timing race: 1. **Copay always 0** β D1's derivation helpers covered age/SI/family/PED/ city but copay was hardcoded `useState(0)`. Profile's `copay_pct=20` never propagated. Fix: `useState<number>(initialProfile?.copay_pct ?? 0)`. 2. **Age stuck at 35, family stuck at "Self only"** β useState initializers run ONCE on first mount. If profile data loads AFTER the panel mounts (race: user clicks the chip the moment profile finishes fetching), the sliders never update. Fix: new useEffect watches `initialProfile` changes and updates each slider IFF the slider still holds its initial-default value. Once user moves a slider, future profile updates no longer override their choice (snapshot-comparison ref prevents redundant runs). 3. **SI now correctly prefers desired_sum_insured_inr over existing_cover_inr** β already shipped in KI-270 / D1; this commiβ¦7a8965b -
fix(profile): KI-271 β wire copay + family + desired_SI through profile endpointsβ
E3 live smoke (Priya: copay=20, family=[cancer, heart]) caught a wiring bug: brain captures the slots correctly + premium_calculator supports the loadings, but 3 main.py endpoints hand-rolled a stale 12-key profile_dict that omitted the new fields. Result: identical premium bands regardless of copay/family input. Affected endpoints (all hand-rolling 12 keys, missing desired_sum_insured_inr / copay_pct / family_medical_history): - POST /api/profile/save β response profile + RAG chunk - GET /api/profile/completeness β fields_collected / fields_missing - GET /api/profile/predicted-premium-band β estimate_premium_band input Fix: replace all 3 hand-rolled dicts with a SLOT_UNION-driven dict-comp: profile_dict = {slot: getattr(p, slot, None) for slot in brain_tools.SLOT_UNION} SLOT_UNION (15 fields, defined in brain_tools.py per B6/KI-260): name, age, dependents, location_tier, income_band, primary_goal, health_conditions, budget_band, desired_sum_insured_inr, existing_covβ¦6d84a76 -
fix(types): KI-270 β Frontend UserProfile schema add 3 missing slotsβ
Closes the typing gap D1 flagged after KI-269: backend added desired_sum_insured_inr (B5), copay_pct (D2), family_medical_history (D2) to the Profile dataclass, but the frontend TS type was lagging. frontend/src/lib/api.ts: - UserProfile.desired_sum_insured_inr?: number (B5/KI-258) - UserProfile.copay_pct?: number (D2/KI-269) - UserProfile.family_medical_history?: string[](D2/KI-269) frontend/src/app/page.tsx::PremiumCalculatorPanel: - SI prefill now prefers desired_sum_insured_inr (the canonical target) over existing_cover_inr (D1's typed-proxy fallback), with 1_000_000 ultimate fallback. Closes the typed-proxy workaround. Verification: - npx tsc --noEmit: clean - npx next build: Compiled successfully, 4/4 static pages generated - desired_sum_insured_inr now referenced in both api.ts type + page.tsx prefill Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>dab7341 -
feat(profile+pricing): KI-269 β D1+D2 bundle: chip merge + panel pre-fill + copay + family historyβ
D1 (frontend, page.tsx) β chip merge + panel pre-fill: - Deleted the redundant "ESTIMATE Annual premium" CTA button. - Made the "EST. PREMIUM βΉX-Y/yr" band chip itself clickable: same onClick as the old CTA (toggles PremiumCalculatorPanel + closes sibling panels). Added hover state (ring + brightness + cursor-pointer), chevron-edit SVG, tooltip "Tap to refine premium with sliders" (en + hi). - PremiumCalculatorPanel now reads `initialProfile` prop (passed from page as `profileCompleteness?.profile`). Three pure derivation helpers pre-populate the 5 sliders from the live profile: Age β profile.age (fallback 35) Sum insured β existing_cover_inr (fallback 10L; will widen to desired_sum_insured_inr once UserProfile schema is regen'd) Family covered β derived from profile.dependents string Pre-existing conditions β mapped from profile.health_conditions City tier β profile.location_tier (default metro) - Users can still override via sliders post-open. Dβ¦dea6883 -
refactor: KI-268 β Path B cleanup: -5,219 LOC legacy + nim_fallback + chain collapse + modal wiringβ
CLEAN1 β nim_fallback replaces legacy orchestrator fallback (+190 LOC, NEW): - backend/nim_fallback.py: handle_turn_fallback(session, user_text, chat_history) picks NIM via llm_health.get_primary("brain") with BRAIN_CHAIN[0] last-resort. One NvidiaNimLLM.chat call with 15s timeout. Never raises β graceful TurnResult on timeout/exception. - main.py: removed `from backend.orchestrator import handle_turn`. Both fallback branches (SingleBrainError non-sticky + USE_SINGLE_BRAIN=False) now call nim_fallback.handle_turn_fallback. Sticky-graceful-retry preserved. CLEAN2 β Port _normalize_dependents into brain_tools, delete 9 legacy modules: - brain_tools._coerce_dependents now uses ported _normalize_dependents_inline + _CANONICAL_VALUES tuple. Zero imports from sales_brain_normalizer. - DELETED (5,219 LOC total): * orchestrator.py (1,832) * sales_brain_normalizer.py (855) * sales_brain.py (819) * faithfulness.py (616) * providers/tiered_brain_llm.py (257) * persona.py β¦55fb938 -
fix(admin): KI-267 β Health column + consolidated LLM Health headerβ
C2 β Health column on both admin tables: - backend/llm_health.py: * ModelHealth.last_status_code: Optional[int] field (HTTP code from probe/chat failures) + back-compat default in _load_into_memory. * New helpers _classify_error_reason() + _extract_status_code() (regex with digit-boundary so Status429 / http_429 / HTTPStatusError:503 all match). * _absorb_probe_result, report_failure, report_success stamp last_status_code (cleared on success). * status_summary now emits effective_status + last_status_code + health_reason per row. Categories: "rate limit (429)" / "out of credits" / "network issue" / "service unavailable ({code})" / "auth error ({code})" / "stale" / first 40 chars fallback. - backend/admin.py: _candidate_snapshot exposes the new fields. - frontend/public/admin/llm-control.html: * NEW renderHealthCell(snap) + buildCandidatesMap(payload) helpers. * "Currently In Use" + "All Eligible Models" tables get a "Health" column. * Renders greenβ¦2689ab0 -
feat(profile+pricing): KI-259..KI-266 β B-bundle (compare modal + per-policy + scorecard + premium band + budget/SI + union + persistence + recall)β
B1 β Structured recommendation cards + Compare modal - NEW frontend/src/components/PolicyCompareModal.tsx: side-by-side compare for up to 3 cited policies. Each column = insurer logo + policy name + premium-calc slot + scorecard slot + policy details expandable + PDF. - page.tsx Message renderer now uses CitedPolicyCards (replaces flat PolicyChipsFromCitations). "Compare all" pill opens the modal when >=2 cited policies present. Removed dead PolicyChipsFromCitations (-67 LOC). B2 β Per-policy premium widget with sliders + profile defaults - NEW frontend/src/components/PolicyPremiumWidget.tsx: SI/tenure/deductible sliders, 300ms debounced fetch, AbortController cleanup, profile-summary line, "Estimate" badge when assumed=true, breakdown bullets. - backend/premium_calculator.py + main.py /api/premium/bulk: multiplicative model (base x SI x age-band x location x family x tenure x deductible). Anchors to illustrative_premiums.json when available (assumed=false); flat heuβ¦f6901d8 -
fix(voice): KI-258 β SPACE-hold-to-talk now actually worksβ
Two bugs from the KI-257 first ship: (a) isInputFocused() returned true whenever the chat textarea had focus β which is almost always β so SPACE-hold was DOA. Fix: only suppress SPACE when the focused input/textarea has user-typed CONTENT. An empty textarea (the fresh-chat default) now passes through, and the handler's e.preventDefault() blocks the stray space from typing. (b) `recording` and `spaceHoldActive` were in the effect's deps array, so every state change re-bound the keydown/keyup handlers with fresh closures. A keydownβkeyup pair often spanned two effect lifecycles with stale `recording` values. Fix: read all state via refs (recordingRef, busyRef, spaceHoldOwnsRecRef); deps reduced to [voiceMasterOn] so handlers bind once per Voice-toggle change. Also added spaceHoldOwnsRecRef so keyup only fires when THIS keydown started the recording β protects against the textarea being a legitimate target for a stray space-up event. Co-Authored-By:β¦96d766d -
fix(ui): KI-257 β restructure chat input: master Voice toggle + 3-button row + hold-SPACEβ
Per user redesign: simplify the chat input to just textarea + Send by default, with voice controls hidden behind a single "Enable voice" toggle. When voice is enabled, two equal options appear: Live (BETA) and Push-to-talk. Push-to-talk works in TWO modes: (a) click mic to start, click Stop to submit (classic) (b) hold SPACE to start, release SPACE to submit (like command line) Both PTT modes share the same startRecording() entrypoint which already calls interruptBotAudio("ptt-start") β so barge-in (interrupting the bot's TTS mid-sentence) works cleanly on both click AND SPACE-hold paths. This is the reliable barge-in path; Live voice barge-in remains in BETA. Removed from the UI per user request (functionality preserved as defaults behind the scenes): - Paperclip / PDF upload icon (textarea only; drag-drop still works via the existing fileInputRef handler if needed in future) - Voice reply checkbox (returnAudio state now const, default true) - Lang dropdown EN/ΰ€Ήΰ€Ώΰ€¨ΰ₯ΰ€¦ΰ₯ (ttsLang statβ¦ef90cd6 -
fix(voice): KI-256 β PTT primary + live voice BETA confirm gateβ
Per user decision: keep BOTH PTT (default + reliable) and live voice (BETA), but make the trade-off explicit so users don't enable always-on voice expecting production reliability. Architecture (no change to STT/TTS layer β Sarvam preserved everywhere): - PTT (default): MediaRecorder β Sarvam STT (authoritative, Indic-aware) + Web Speech runs in parallel ONLY for live interim transcript display in the gray-italic strip. Sarvam transcript wins on release. - Live voice (BETA, off by default, requires one-time accept): existing useStreamingVoice with Web Speech driving utterance commit + Sarvam blob as cleanup. Same path as before, just gated behind a warning. - Sarvam TTS for ALL bot replies regardless of input mode. Indic preserved: when user types in Hindi/Tamil/Marathi (via PTT or live), Sarvam STT transcribes the blob. Web Speech may garble the interim display on Indic but its result is discarded β the Sarvam text submitted to /api/chat is correct. Frontend changes (page.tβ¦438d1fa -
fix(welcome-back): KI-255 β RULE 4 only fires for actual returning usersβ
Smoke-3-personas showed all 3 fresh personas got "Welcome back, Rajesh!" / "Welcome back, Anita!" / "Welcome back, Vikram!" on FIRST session despite having no prior conversation history. Gemini was reading the KNOWN PROFILE block (populated by save_profile_field during the current conversation) as "pre-populated from prior session" and triggering RULE 4 Welcome Back. Root cause: `_system_instruction` always labelled the snapshot "KNOWN PROFILE (already captured this session; do NOT re-ask):" regardless of whether slots came from disk-load (returning) or in-conversation save_profile_field (fresh). Gemini interpreted "already captured" liberally. Fix: - handle_turn now derives `is_returning_user` from session.turn_idx == 1 AND profile has any of the 7 required slots. turn_idx is incremented at function entry; turn_idx == 1 means this is the very first /api/chat call for this session_id. If slots exist at turn 1, they MUST have been loaded from disk (returning user). If turn_idxβ¦3f15c03 -
fix(closure): KI-254 β auto-mark_recommendation on retrieve+citations turnβ
Smoke-3-personas (Rajesh / Anita / Vikram against KI-253 deploy) showed all 3 reached recommendation BUT all 3 failed T4 ordinal follow-up: - Rajesh "Tell me more about the second one" β "I don't have that policy" - Anita "What's the difference between #1 and #3?" β "I couldn't find" - Vikram "Tell me about the first option" β "I don't have that policy" Root cause: Gemini emitted the recommendation reply on T3 (called retrieve_policies, returned 7-8 citations) but did NOT call mark_recommendation alongside, despite RULE 3's directive. So session.last_recommendation_ids stayed empty β orchestrator's ordinal routing in T4 had no last_recommendation_ids[0..N] to map "#2" against. Fix: mirror the KI-253 closer-keyword safety net pattern. After single_brain.handle_turn returns, if: - USE_SINGLE_BRAIN is on, AND - turn.citations is non-empty, AND - "retrieve_policies" IS in turn.brain_used, AND - "mark_recommendation" is NOT in turn.brain_used then auto-call brain_tools.mark_recomβ¦fc0cd9e -
fix(closure+voice+latency): KI-253 β P-bundle from U1 fails (P2 watchdog + P3 mark_rec gate + P4 instrumentation)β
U1 Playwright re-test surfaced 4 remaining bugs after V-bundle landed. P-agents diagnosed + fixed: P1 β React #418 hydration: NO CODE CHANGE. V3 fix at page.tsx:229-232 + 357-363 (mounted flag gating micPermissionDenied) is correct + committed (52e5881). P1 local rebuild + serve produces zero #418 errors. U1's failure was a stale Next.js cache on HF Space β KI-252 redeploy will refresh. P2 β Voice "green pill, zero audio" silent failure (V4 incomplete): V4's catch worked for hard rejections (NotAllowedError), but TWO silent paths bypassed it: (a) Fake / silent stream β getUserMedia resolves but recorder.state never reaches "recording" (Playwright fake-mic, Android WebView, codec rejection). No error thrown, pill flipped to "Voice on" over dead stream. (b) OS-stalled getUserMedia β locked-down Chromium / mic-busy / WebViews leave getUserMedia pending forever instead of rejecting. V4's catch never fires; user sits in limbo. (c) PTT path bypassed the banner entirely β stβ¦8a7350c -
fix(ux+voice): KI-252 β align profile bar with Path B 7-slot ready gate + RULE 4 implicit confirmation + ZCR scalingβ
Root-cause of "70% DONE despite all data" + "Let me pause for a second": 1. Profile completeness bar mismatch (Q2 from user screenshot 59): - scorecard.py:profile_completeness checked 9 weighted fields: age 20% + dependents 15% + budget_band 15% + existing_cover_inr 10% + primary_goal 10% + location_tier 10% + health_conditions 10% + income_band 5% + parents_age_max 5% = 100%. - Path B's _REQUIRED_FOR_READY = (name, age, dependents, location_tier, income_band, primary_goal, health_conditions) β 7 slots. - So a fully captured Path B profile (Priya) shows only 70%: age (20) + dependents (15) + primary_goal (10) + location_tier (10) + health_conditions (10) + income_band (5) = 70%. The 30% gap is budget_band/existing_cover_inr/parents_age_max that Path B doesn't gather (intentionally β budget can be inferred from income). - FIX: re-weighted scorecard.profile_completeness to the 7 Path B slots: age 20% + dependents 17% + income_bandβ¦bcf9753 -
fix(closure+hydration+voice+admin): KI-248..KI-251 β V1-V4 bundle from Playwright smokeβ
V1 β recommendation closure ("I lost my train of thought"): ROOT CAUSE was a coercer/null-guard collision, NOT MAX_ITERATIONS or prompt length. Z6 prompt told Gemini β save_profile_field(health_conditions, "none"), _coerce_health_conditions stripped "none" β [], save_profile_field's KI-091 null-overwrite guard rejected [] as normalized_empty, profile stayed incomplete forever, retrieve looped, MAX_ITERATIONS=5 exhausted, defensive "lost my train of thought" fired. Three-angle fix: - (D primary) brain_tools._coerce_health_conditions: pure-negation tokens ("none", "no", "healthy", "n/a") now collapse to sentinel ["none"] (non-empty list) instead of []. Mixed input ("diabetes, none") still drops the negation noise. Downstream consumers verified safe. - (C) brain_tools.retrieve_policies profile_incomplete return now includes action_required="ask_user_for" + field=<first_missing> + exact_question so Gemini relays the question verbatim instead of looping. - (A) single_brain MAX_ITEβ¦52e5881 -
fix(single_brain): KI-245..KI-246 β Z6 + W2 bundle (3 bugs + 6 prompt edges)β
Z6 β 3 bugs from smoke_v_final: - Bug A (BLOCKER): "no PED" not captured. RULE 1 health_conditions bullet now explicitly mandates save_profile_field(health_conditions, "none") on "no medical issues" / "I'm healthy" / "no PED" etc. + Worked Example B. Without this the profile stayed incomplete forever and the bot looped. - Bug B (BLOCKER): mid-session "JSON parse error" smoke trace. ROOT CAUSE: single_brain.TurnResult.citations dicts don't carry page_start/page_end fields that CitationOut(pydantic) requires; the `[CitationOut(**c) for c in turn.citations]` line raised ValidationError whenever retrieval succeeded, and FastAPI returned its raw 422 envelope which the smoke test rendered as "the bot reply". Fix: (1) RequestValidationError handler scoped to /api/chat returns ChatResponse-shaped 200 envelope instead of raw 422; (2) response-build path now wrapped in try/except with each citation built field-by-field with page_start/page_end defaulted to 0. malformed ciβ¦1344492 -
fix(single_brain): KI-244 β Z4 hardening β max_tokens, mark_recommendation gates, sticky-graceful retryβ
Three issues from Z2 5-persona test addressed: 1) Mid-session amnesia (Priya T3, Vikram T2/T4 returned "I'm sorry, I missed a step" AFTER profile capture succeeded): - single_brain.py: maxOutputTokens 1024 β 2048 (prose p95 ~600 + tool-call JSON p95 ~800 + 20% margin = 1680, rounded up). Mirrors KI-150 fact_find fix (420 β 700). - Added finishReason=MAX_TOKENS warning log so future truncation surfaces. 2) Hallucinated closure (Priya T6 congratulated user despite zero rec; Vikram T6 called mark_recommendation with empty policy_ids): - brain_tools.mark_recommendation now gates BEFORE the Y2 record_policy_event write: (a) empty cleaned policy_ids β {recorded: False, error: 'no_policies_supplied'} (b) non-empty ids but session.last_retrieved_chunks empty/missing β {recorded: False, error: 'no_retrieval_history β call retrieve_policies first'} 3) Brain election bouncing (Priya bounced sales_brain β single_brain β single_brain β sales_brβ¦fe7ca39 -
fix(retrieval): KI-243 β CRITICAL: relax citation_grounding (chunk_offset optional)β
Z2 5-persona test showed 15/15 retrieve_policies calls returned 0 chunks. 0/5 personas reached recommendation. Total blocker. Z3 diagnosis (via /tmp/diag_retrieval.py): raw rag.retrieve returned 8 healthy chunks for the Rajesh profile (52, Pune, family of 2, 40L, diabetes+BP). enforce_citation_grounding then dropped 8/8 because: - The filter required chunk_offset or chunk_idx as a non-negative int - brain_tools.retrieve_policies's dict-builder copies these keys from RetrievedChunk: chunk_id / policy_id / policy_name / insurer_slug / doc_type / source_url / chunk_text / score / min_entry_age / max_entry_age - Neither chunk_idx nor chunk_offset is in that list β they're stored on the dataclass but not copied to the dict the filter sees. Brains cite policies by identity (policy_id, policy_name, UIN), not by chunk offset. The grounding filter only needs to verify the chunk has a real policy attached. Relaxed to: - require: policy_id (non-empty str) + policy_name (nonβ¦d6d717f -
fix(single_brain): KI-242 β 2-attempt retry on transient Gemini errorsβ
Z1 investigation of intermittent single_brain failures (live HF Space logs 2026-05-15T08:15:07Z..45Z) found 100% of failures were "Gemini HTTP 503 UNAVAILABLE β high demand". Zero timeouts, zero 429s, zero JSON-parse, zero MAX_ITERATIONS. Pure upstream provider capacity blips. Previously a 1-second blip caused fall-through to legacy orchestrator. Now the call retries once with 1.5s backoff on: - HTTP 429 (rate limit) - HTTP 500/502/503/504 (server/upstream) - httpx.TimeoutException - httpx.HTTPError Permanent 4xx (400/401/403/404) still raises immediately β bad API key or malformed body is not retryable on the same payload. Worst-case added latency: 1.5s, well inside the 45s outer budget. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>b778c1b -
fix(arch+wiring): KI-237..KI-241 β Phase Y bundle (Y1+Y2+Y3+Y4 + profile-gate)β
Y1 β BrainProviderError + soft_hints consumer: - tiered_brain_llm catches BrainProviderError specifically: retryable=False fails fast (auth/safety), retryable=True falls through to NIM. - orchestrator soft-hint retry block (max 1 per turn): missing_citation re-prompts with [Source:N] addendum; hallucinated_policy constrains brain to cited_policies from X5's faithfulness verdict. Y2 β turn_idx stamping on policy events: - session_state.SessionState.turn_idx int field, incremented at handle_turn start in both orchestrator and single_brain. - All shown_policies / selected_policies / rejected_policies events stamped with turn_idx so admin /api/admin/recommendation-history can show conversation_turn instead of "β". - brain_tools.mark_recommendation records a shown_policies event via profile_store. Y3 β Backend honors X-Preferred-Codec for Safari/Webkit: - main.py chat() now accepts FastAPI Request; reads X-Preferred-Codec header (whitelisted: audio/wav, audio/mp4, audio/webm; else wav). -β¦2524073 -
fix(single_brain): KI-237 β capture-first MANDATORY rule in system promptβ
KI-236 over-emphasized retrieval guidance and Gemini regressed to chatting without calling save_profile_field on turn 1 (smoke test showed Priya/34/ Bangalore not saved). Rewrites the prompt with explicit rule ordering: RULE 1 capture-first (mandatory, with worked example), RULE 2 retrieval query, RULE 3 follow-ups + mark_recommendation. Adds "NEVER ask for a fact you can already extract" + explicit metro city list + worked save sequence. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>00fa5a8 -
fix(single_brain): KI-236 β explicit retrieval query construction guidanceβ
Live smoke test of Path B showed Gemini constructing vague queries ("first family policy") that returned 0 chunks. Strengthens both the SYSTEM_PROMPT and the retrieve_policies query parameter description with: - Explicit profile-attribute checklist (family shape, city tier, SI band, age band, health condition or "no PED", primary goal) - A concrete query example built from a sample profile snapshot - Retry-with-broader-query rule before giving up on empty results Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>7d2b5a0 -
fix(arch+robustness): KI-225..KI-235 β Path B single-LLM rewrite + audit bundleβ
Architectural simplification (KI-225, Path B) β replaces the two-brain sales_brain/qa_brain handoff with a single Gemini Flash call per turn using native function-calling. Kills 40+ scaffolding failure modes at once: - No fact_find vs QA routing boundary (every confirmation/knowledge edge case in should_route_to_fact_find disappears). - No faithfulness gate rejecting natural phrasing ("yes, that sounds correct"). - No separate profile_extractor pass overwriting captured slots with null (KI-091/094 root cause permanently fixed via save_profile_field tool guard). - No rigid normalizer enum β accepts what Gemini emits, light coerce only. - No 700-token JSON contract β Gemini function-calling separates tool calls from prose, no truncation trade-off. Feature-flagged: USE_SINGLE_BRAIN=true activates the new path; default off, legacy orchestrator preserved as fallback. SingleBrainError falls back to orchestrator transparently. New files: - backend/single_brain.py β Gemini function-calβ¦f15911b -
fix(voice+recall): KI-214 + KI-217 + KI-218 bundleβ
KI-214 β Block recognition for ENTIRE request-in-flight window. Previously dropResultsRef only blocked during <audio> playback (KI-203), leaving a 1-3s gap between send() firing and bot audio rendering+playing where mic captured bot voice from speakers. Now onresult also early- returns when isTextRequestPendingRef is true. Eliminates the entire echo-leak window from user submit until bot finishes speaking. KI-217 β Fix first-phrase cutoff in utterance batching. User showed "My name is Rohit Sarma" reduced to "last name" β start of utterance dropped. Root cause: rec.onend reset finalsRef.current=[] on every restart cycle. Chrome occasionally delivers buffered isFinal=true events for the early speech AFTER onend (same dirty- window quirk that motivated KI-203). Eager wipe meant late finals landed in a freshly emptied ref, then got wiped again before submit. Fix: introduced finalsConsumedRef monotonic cursor. onend reads finalsRef.current.slice(consumed), appenβ¦7fdaa57 -
fix(voice+slots+routing): KI-212 + KI-213 + KI-215 + KI-216 bundleβ
KI-212 β Aggressive barge-in thresholds for reliable trigger. BARGE_IN_RMS_THRESHOLD 0.025 β 0.008. BASE 0.005 β 0.002. MULTIPLIER 2.0 β 1.5. SUSTAINED_FRAMES 18 β 6 (~100ms vs ~300ms). Barge-in fires on much softer speech without requiring calibration. KI-213 β Push-to-talk shows live interim transcript. Added SpeechRecognition in parallel with MediaRecorder during PTT. Interim words stream into chat input as user speaks. On release, Sarvam transcript replaces interim text. Falls back to browser final if Sarvam fails. Self-contained in page.tsx. KI-215 β Don't prematurely flip free_form_session. Bug: once all 6 required slots captured + ready_for_recommendations =true, orchestrator immediately flipped free_form_session=True. User's confirmation reply ("Yes, that sounds correct") then routed to QA β faithfulness rejected with "I'd rather not answer that without stronger evidence." Now require the user's text to explicitly contain a recommendation keyword (shβ¦9a617cc -
fix(voice+llm+admin): KI-200/201/202/203/204/205/206/207/208/210/211 bundleβ
THE LAST OPERATIONAL FIX BUNDLE β voice + recommendation routing + LLM election + admin clarity. Docs cascade held for post-test confirmation. KI-200 β Admin LLM Chain redesigned to 2 clean tables. Table 1 "Currently In Use" (per use case + provider + tier). Table 2 "All Eligible Models" with explicit Primary / 1st backup / Last resort labels. Provider column color-coded (Google blue / NVIDIA green / OpenRouter orange). KI-201 β Election by chain order (not latency score). backend/llm_health.py get_primary + get_backup now walk the chain definition in priority order. Returns first eligible model. nemotron only serves as last resort. Resolves "maverick elected over qwen when all healthy" bug. KI-202 β Utterance batching with 1.5s grace. Mid-sentence pauses < 1.5s accumulate into one submission. pendingUtteranceRef + pendingChunksRef + grace timer per onend. KI-203 β Block recognition transcripts during TTS. dropResultsRef gates onresult while audio plays + 300mβ¦e9cfc9f -
feat(voice+session+llm): KI-195 + KI-196 + KI-197 + KI-199 bundleβ
THE "ONE LAST REBUILD" β adaptive voice calibration + clean session lifecycle + 3 latency cheap wins + Gemini context caching. KI-195 β Adaptive TTS volume calibration vs user speech level. Per user idea: bot TTS should ALWAYS be quieter than user speech at the mic so echo loop is mathematically impossible and barge-in always wins. Implementation: - userSpeechRmsRef: rolling EMA of peak mic RMS while user speaks (recording active, not TTS); rAF loop tracks samples > 0.02 floor. - calibrateBotVolume: every 300ms during TTS, if bot_rms_at_mic > userSpeechRms Γ 0.35, multiply el.volume by 0.8 (floor 0.15). - calibratedVolumes Map persists final levels across turns. KI-196 β Clean session/profile lifecycle (ADR-041). CRITICAL UX fix: silent KI-040 name-based profile recall confused users into thinking the bot was "remembering" them from a prior session. Implementation: - clear_session() in session_state.py (in-memory evict only; on-disk profile JSON untouched). - β¦96ddaab -
fix(critical): KI-194 + KI-192 + KI-191 reinforce β voice + fact-findβ
KI-194 (CRITICAL) β Fact-find routing regression after KI-167. When KI-167 ripped out fact_find_brain, the set_awaiting() machinery went with it. session.awaiting_question_id is now permanently None, which made `in_fact_find_continuation` permanently False at orchestrator.py:469. Result: mid-fact-find answers like "29" (bare number, no fact_find trigger keyword) routed to QA β faithfulness gate fired β bot replied "I'd rather not answer that without stronger evidence in the policy documents I have." with random policy citations. Completely broken conversation. Fix: derive in_fact_find_continuation from profile state directly. We're still in fact-find when free_form_session=False AND any of the 6 required slots (name/age/dependents/location_tier/income_band/ primary_goal) is missing. No need to restore set_awaiting. Verified: empty profile, ff=False β in_continuation=True (route to fact_find) Rohit+age=29, ff=False β in_continuation=True (KI-194 catches this) all 6 slotβ¦e191b1d -
feat(voice): KI-189 + KI-190 + KI-191 β full DIY barge-in stackβ
End-state: live-speak barge-in works WITHOUT echo loop. Bundle of three: KI-189 β Basic VAD barge-in on AEC'd MediaRecorder stream. While TTS is playing (KI-188 paused SpeechRecognition for echo immunity), monitor the MediaRecorder mic stream via Web Audio AnalyserNode + requestAnimationFrame loop. When RMS exceeds the threshold for β₯18 sustained frames (~300ms), pause + reset every bot <audio>; MutationObserver pause listener clears isTtsPlayingRef and the existing heartbeat resumes SpeechRecognition. KI-190 β Adaptive threshold tied to bot audio level. Static threshold (0.025) failed when bot TTS was loud β AEC residual bleed crossed the threshold and barge-in fired falsely. Now per-<audio> MediaElementAudioSourceNode + AnalyserNode reads bot's instantaneous RMS. Threshold = max(BARGE_IN_BASE, bot_rms * 2.0 + 0.005). Loud bot β high bar (you must speak loudly); quiet bot β low bar (soft speech wins). Bot analyser routes source β analyser β ctx.destination soβ¦e84f6a4 -
fix(voice): KI-188 β pause SpeechRecognition during TTS to kill echoβ
User report (persistent across KI-185): bot's TTS still being transcribed as user input ("perfect days to get started Rohit" was echo of bot's "perfect age to get started, Rohit"). Why KI-185 (AEC constraints on getUserMedia) didn't fix it: SpeechRecognition uses its OWN internal mic pipeline that bypasses JS-configured constraints on other getUserMedia streams. AEC applied to MediaRecorder doesn't help SpeechRecognition's interim transcripts that drive the visible input + auto-submit. Fix: MutationObserver on document.body watches for <audio> elements; when ANY <audio> is playing, set isTtsPlayingRef=true and call recognition.abort(). Heartbeat (KI-173) + visibility revival (KI-174) now check !isTtsPlayingRef.current before starting. When TTS ends, trigger immediate safeStart() so recognition resumes within ~50ms. Trade-off: live "barge-in by just speaking" disabled during TTS. Push-to-talk button still works (uses MediaRecorder, not Speech- Recognition). KI-189 follow-up will add β¦52ecbc9 -
fix(admin): KI-187 β explicit Provider column (Google / NVIDIA NIM / OpenRouter)β
User: "Call out what is from NIM and call out what is from OpenRouter very clearly." Previously the only way to tell NIM rows from OR rows was the ':free' suffix on the model id. For the same base model (qwen3-next-80b appears in both NIM and OR pools) this was easy to miss. Added explicit Provider column with brand-coded colors: - Google AI Studio β blue (#4285f4) - NVIDIA NIM β green (#76b900) - OpenRouter β orange (#ffa657) Column order: Model | Provider | Tier | Status | Brain Fast | Brain Main | Judge Verification: node --check on inline script β clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>897727d -
fix(voice+admin): KI-185 + KI-186 β AEC echo cancellation + 3-tier adminβ
KI-185 β Browser AEC + noise suppression on every getUserMedia call. User report: mic transcribing bot's own TTS audio as user input. Root cause: our getUserMedia calls used default `{audio: true}` which does NOT force AEC. Production voice agents (Zoom, Meet, ChatGPT voice) all pass explicit AEC + noiseSuppression + autoGainControl constraints. Updated both getUserMedia call sites: - frontend/src/lib/useStreamingVoice.ts (live-voice path) - frontend/src/app/page.tsx (PTT path) Effect: headphone users β near-perfect echo cancellation. Speaker users β 70-90% echo reduction. Live barge-in PRESERVED (no recognition gating on TTS playback). Sarvam STT untouched β the echo was in the Web Speech interim layer, not in Sarvam. KI-186 β Admin "What's Available" now shows all 3 tiers. User: "Both Gemini and OpenRouter need to be captured in this. Whatever is your entire LLM chain, the models you have shortlisted as being eligible, they need to be here." Previously the table only showedβ¦792acb1 -
fix(admin): KI-184 β Refresh forces fresh probe + tier bannerβ
User report: "refresh doesn't work." Root cause: KI-164's admin-strip removed the "Force fresh probe (slow)" button. The remaining Refresh button only called fetchLlmHealth() which re-fetches the cached probe state from /api/admin/llm-health. The backend's probe loop runs every 5 min independently. So clicking Refresh on a 2-minute-old snapshot just re-showed the same 2-minute-old data. Fix: Refresh now POSTs /api/admin/probe first (forces fresh probe), then re-fetches state, then re-renders. Same as the legacy "Force fresh probe" button used to do. Button now reads "Probingβ¦" during the call so the user knows it's actually doing work. Plus: added a tier banner ABOVE the What's Live table that explains the 3-tier chain: Gemini Tier 0 (primary) β NIM Tier 1 (what's shown below) β OpenRouter Tier 2 β NIM Nemotron-49B last resort. This prevents confusion when the user sees nemotron showing as "primary" in the NIM table even though Gemini is actually serving traffic (per KI-179 + ADR-04β¦755ba01 -
feat(llm+docs): KI-177 + KI-179 + KI-183 + ADR-040 docs cascadeβ
THREE-TIER LLM CHAIN β Google Gemini PRIMARY, NIM Tier 1, OR Tier 2. Live audit (KI-178) of OpenRouter's free-tier catalog killed my earlier recommendation: gemini-2.0-flash isn't in OR's catalog, llama-3.3-70b- :free and hermes-3-405b:free don't expose response_format. So OR's free-with-JSON pool is only nemotron-3-super-120b / qwen3-next-80b / gemma-4-31b. User obtained a Google AI Studio key, set up billing ($0 historical spend, $10 cap, free 1500/day quota active), confirmed working live on gemini-2.5-flash + gemini-2.5-flash-lite. NEW MODEL TIERS: Brain Fast (sales_brain): Tier 0 Google gemini-2.5-flash-lite (KI-183 β 2.0-flash retired) Tier 1 NIM qwen3-next-80b β mistral-large-3 β llama-4-maverick Tier 2 OR nemotron-3-super-120b:free β qwen3-next-80b:free β gemma-4-31b:free Last NIM nemotron-super-49b (only when all else dies) Brain Main (orchestrator): Tier 0 Google gemini-2.5-flash Tier 1+ same NIM/OR cascade Judgβ¦132a829 -
fix(llm): KI-175 β demote nemotron to last resort in all chainsβ
User verdict on nemotron: "the worst model, barely usable, last resort." Live admin showed nemotron elected as primary for Brain Fast + Brain Main + Judge β because the chain election was picking the first HEALTHY model in the chain, and nemotron sat at position #2 (BRAIN/FAST_BRAIN) or #3 (JUDGE). Whenever qwen had a transient blip the election fell to nemotron and the sticky-primary held it there. Fix: reorder chains so nemotron is always LAST. It now only serves when every other chain member is simultaneously unavailable β fail-loud is better than serving the worst model by default. BRAIN_CHAIN: qwen3-next-80b β mistral-large-3 β llama-4-maverick β nemotron FAST_BRAIN_CHAIN: qwen3-next-80b β mistral-large-3 β llama-4-maverick β nemotron JUDGE_CHAIN: mistral-large-3 β llama-4-maverick β nemotron (judge order was already correct; chain unchanged) Llama-4 Maverick added as a 3rd-fallback to FAST_BRAIN_CHAIN (previously only in BRAIN+JUDGE). Aβ¦dc57a46 -
fix(voice): KI-174 β revive on visibilitychange + window focusβ
User report: "sometimes when I go away from clicking the text box, it seems to not input my voice anymore. I have to restart the whole voice thing." Root cause: Chrome's SpeechRecognition auto-stops when the document loses visibility (tab switch, app switch, screenshot tool, OS modal, notification overlay). The KI-173 heartbeat is throttled to ~1Hz when the tab is hidden, so revival takes 4-8s after returning. Fix: added two immediate-revival event listeners: - document.visibilitychange β visible - window.focus When fired, both call safeStart() if wantRunningRef.current AND no text turn is pending AND document.visibilityState === "visible". InvalidStateError swallowed by safeStart if recognition is already running. Combined with KI-173 heartbeat as a safety net, the mic should stay alive across: - Tab switches β visibilitychange fires - App switches β window.focus fires - Screenshot tool grabbing focus β window.focus fires - Notification overlays clearing β window.focus fires -β¦94aeb46 -
fix(voice): KI-173 β heartbeat watchdog revives stalled SpeechRecognitionβ
User report (verbatim): "voice stopped taking input suddenly until I turned it off and on again." Root cause: browser Web Speech API's SpeechRecognition occasionally enters a stopped state WITHOUT firing the `onend` event. Known triggers include certain network errors, transient OS audio interruptions, and tab-visibility transitions. The KI-168 auto-restart loop lives inside `onend`, so when `onend` doesn't fire, the restart never runs, and the mic stays silently dead until the user toggles voice off+on. Fix: added a 4s heartbeat effect inside useStreamingVoice. While `enabled` is true and no text turn is racing and no restart is already scheduled, call `safeStart()` unconditionally. If recognition is already running, the InvalidStateError is swallowed (per safeStart's existing catch). If it's dead, this revives it within ~4s. KI-165 race guard preserved (isTextRequestPendingRef check) so the heartbeat doesn't fight the text-in-flight path. Verification: `npx tsc --noEmit` clean (eβ¦f84acc7 -
docs: KI-167/168/169/170/171/172 cascade β ADR-039 + CLAUDE + READMEβ
ADR-039 (NEW) β Replace scripted fact_find_brain with LLM-driven sales_brain. Status: Accepted, 2026-05-15. Marks ADR-027 + ADR-030 superseded. Context: 8 patches (KI-150/155/156/158/161) all worked around <FF> trailer fragility + canonical_fallback firing as dominant path. User symptom: "zero natural LLM chat β always defaults to script." Decision: rip out fact_find_brain + replace with sales_brain.py using NIM response_format=json_object + deterministic sales_brain_normalizer. Profile persistence unchanged (profile_store + profile_rag). CLAUDE.md β fact-find section rewritten. ADR-030/KI-070 framing replaced with KI-167/ADR-039. Body now states one LLM call per turn, structured JSON, no scripted prompts, no fallback prose. Points at sales_brain.py + response_format={"type":"json_object"} + sales_brain_normalizer.py. KI-150 max_tokens watch-out replaced with "never reintroduce scripted fallback" rule. Retired KIs updated. Last-reviewed footer updated. README.β¦9232416 -
fix(recommend+citations): KI-171 + KI-172 β recommendation flow unblockedβ
KI-171 β Skip faithfulness judge on recommendation queries. The faithfulness judge is designed for POLICY-FACT lookups ("does Policy X cover Y?") not for GENERATIVE RECOMMENDATIONS ("which policy fits me?"). After fact_find completed and the user asked "show me top 3 policies", the judge rejected the synthesized recommendation with "I'd rather not answer that without stronger evidence in the policy documents I have. Could you rephrase, or narrow your question to a specific policy?" β blocking the entire recommendation flow. Added query-shape detector. _is_recommendation true when user_text contains: recommend / suggest / best polic / top N / show me polic / fits me / right for me / policies for me / which polic / good polic / what polic / your suggestion / your recommendation. When true, skip faithfulness with reason=ki171_skip_on_recommendation. This mirrors the existing KI-091 skip-on-fact_find pattern. KI-172 β Filter profile chunks from user-facing citations. "User profile (roβ¦3f462fa -
fix(voice+brain+timeout): KI-168 + KI-169 + KI-170 bundleβ
KI-168 β Voice input rebuilt as hybrid streaming flow. + frontend/src/lib/useStreamingVoice.ts (NEW) Web Speech API streams interim transcripts to chat input in real time (ChatGPT/Claude-voice UX). MediaRecorder runs in parallel; on browser silence-detect, audio blob POSTs to Sarvam /api/transcribe for the authoritative final transcript. Replaces input text + auto-submits. Falls back to Web Speech transcript if Sarvam errors. KI-165 race guards preserved (isTextRequestPendingRef + skip-if-tiny-blob). M frontend/src/app/page.tsx Swapped useLiveConversation β useStreamingVoice. interim β setInput, final β send(). Voice OFF by default (KI-131) preserved. Old useLiveConversation.ts left on disk as graveyard. KI-169 β Sales brain <think>-tag empty-reply retry. M backend/sales_brain.py qwen3-next-80b occasionally emits all reasoning inside <think>...</think> in the JSON reply field, leaving nothing after strip β orchestrator fell back to pβ¦1b6d24d -
refactor(brain): KI-167 β rip out fact_find_brain, replace with sales_brainβ
Replaces scripted slot-walker (fact_find_brain + canonical_fallback + scripted Question.prompt_en + "Got that β" prefix + <FF> trailer) with a single LLM-driven sales agent using NIM response_format=json_object. WHY: 8 patches (KI-150/155/156/158/161) all worked around <FF> trailer fragility + canonical_fallback firing as the dominant path. Symptom: "zero natural LLM chat β always defaults to script." Architectural rot from reactive accretion. NEW: + backend/sales_brain.py β single LLM call, response_format=json_object, SalesBrainResult{reply_text, captured_updates, ready_for_recommendations, brain_used}. NO scripted fallback. Fail-loud on errors. + backend/sales_brain_normalizer.py β deterministic post-processor: cityβtier, "5 lakhs"β"5L-10L", bad-name rejection, schema validation. DELETED: - backend/fact_find_brain.py (986 lines) - backend/fact_find_normalizer.py (452 lines β cherry-picked into normalizer) - tests/test_fact_find_loop_break.py (architeβ¦f7df227 -
fix(parser+admin+voice): KI-161 + KI-164 + KI-165 bundleβ
KI-161 β _parse_inr_amount no longer interprets bare digits below βΉ1000 as currency, and rejects any text with age context ("29 years old", "age 25", "I am 35"). Origin: user answered the age question with "I am 29 years old" and the parser wrote βΉ29 into both budget_band and income_band. 10/10 test cases pass (bare-age + real-budget). KI-164 β LLM Chain admin tab radically stripped to ONLY the two simple tables. Removed: Candidate health grid (8 cols Γ N rows of retired models), Recent turns table, Health snapshot card with counters, chains-grid legacy. Restructured "What's Available" Table 2 with per-role columns (Brain Fast / Brain Main / Judge) instead of free-form "Used By" text. refreshChain() now only feeds the 2-table renderer; the legacy fetch* + render* funcs are dead but intentionally left in place (their target elements no longer exist so they're never called). KI-165 β Voice/text crossfire fixed. - useLiveConversation.ts: minVoicedFrames=8 floor (~130ms), voicedFraβ¦0a02616 -
fix(admin): KI-162 + KI-163 β simplify LLM Chain UI + truncate visitor namesβ
KI-162 β LLM Chain admin tab redesigned to two simple tables: - "What's Live" β 3 rows (Brain Fast / Brain Main / Judge) Γ current model + probed-age - "What's Available" β NIM-only dedup pool with Healthy + Used By columns Dropped 124 lines of stale renderLlmHealthChain (chain cards + AVAILABLE/ UNAVAILABLE chips / PRIMARY pills). Added isRetiredModel() filter that drops any groq:/openrouter:/or: entries even if a stale payload still carries them. KI-163 β visitor table no longer blows up vertically when a session captured a multi-word garbage name (e.g. "Currently Not Having Any" pre- KI-156 Fix B). Added max-width + nowrap + ellipsis to .name-cell and .slug-cell, with hover tooltip via title= for the full value. Also deleted 4 garbage profile JSONs from 40-data/profiles/ ("Just Me" Γ2, "Rohit Sara", "Not Having Any Pre-existing") that pre-dated the name stop-list fix. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>9ea6d75