Spaces:
Sleeping
Sleeping
Commit History
-
docs: Cluster A (count drift) + Cluster B (deleted-module refs) sweepβ
Cluster A β Align pre-ADR-044 count snapshots with current 148/21 state: - CLAUDE.md L7: "19 insurers / 166 cards / 4-gate faithfulness" β "21 insurer slugs / 148 catalogued cards / structural grounding" - README.md L61: "~150 plans across 20 insurers" β "~148 plans across 21 insurers" - rag/README.md L30: "19 insurers" β "21 insurer slugs; dedup to 148 marketplace cards" - 70-docs/80-audit/reviews-source-map.md Γ4: "20 insurers" β "21" - ADR-002 + ADR-009 + 60-decisions/README.md: kept historical scope numbers as ADR history-of-record; added forward-pointer footnotes to current 21/148 per ADR-044 Cluster B β Replace references to modules deleted in KI-225 single-brain consolidation: - kb/AUDIT_TRAIL.md: faithfulness.py / persona.py / fact_find_brain.py / sales_brain.py / qa_brain.py / translator.py / profile_extractor.py / orchestrator.py β single_brain.py - backend/providers/README.md L13: removed translator.py reference (sarvam_llm.py now used directly by β¦4c728a9 -
docs: stale-references sweep β align legacy docs with ADR-044 + 8-gate stateβ
11 files fixed per 2026-05-27 docs-audit (P0 / P1 / P2 / one P3): P0 β Upload pipeline most-likely-to-mislead: - 70-docs/20-data-pipeline/ingestion-policy.md: wholesale Β§"Exception β user uploads" rewrite; dual-write table row; date bumped + ADR-044 cross-ref - kb/security/INDEX.md: "5 gates" β "8 gates" with full table extension P1 β Status inversions: - 70-docs/60-decisions/ADR-003-curated-corpus.md: "Locked" banner now says "partially superseded by ADR-044"; counts 190/19 β 148/21; quarantine-only framing flipped to dual-write - 70-docs/60-decisions/README.md: ADR-003 status row updated - 70-docs/10-architecture/safety-architecture.md: F-13 "Not applicable β D-003" β "LIVE per ADR-044, mitigated by 8 gates" (resolved internal contradiction) - 70-docs/00-overview/problem-statement.md: Β§5.4 qualified as v1 intent + ADR-044 update; Β§7 non-goal bullet replaced with cross-session-retrieval caveat P2 β Architecture summaries omitted dual-write: - ARCHITECTURE.md: explicitβ¦21e4b2a
-
feat(upload-extract): Tier-1 Gemini stability + new ADR-044 + README rewritesβ
UPLOADED_DOCS Gemini retry hardening (extract_one_for_upload): - Gemini retry count 1 β 3 with jittered exp backoffs (2s/4s/8s Β±25%), mirroring ADR-042's _TRANSIENT_RETRY_BACKOFFS_STICKY pattern that handles Gemini's 429/5xx tail in single_brain. - NIM moved to FINAL fallback (after Gemini exhausts retries). - Raw LLM responses persisted to UPLOADED_DOCS_DIR/<pid>/llm_raw_<n>_<label>.txt on every attempt (success or failure) β gives the operator visibility into WHY a Gemini call failed (was it 429, truncation mid-emission, markdown fence around the JSON, schema mismatch?). Previously a black box. DOCS: - New 70-docs/60-decisions/ADR-044-uploaded-pdf-parity.md β the architectural record for the entire upload-PDF parity effort (LLM extraction + insurer detection + status endpoint + sequence lock + backfill). Includes verification fingerprints from the live e8ccfa0 audit. - README Β§2.1 user-journey diagram extended with the new upload β¦be7234d -
feat!: remove cross-session profile recall (ADR-043) β net β3700 LOCβ
Sessions are now in-memory only. ADR-041's name-slug + persona_id two-tier on-disk store and ADR-042 v3+v4's two-fact gate + extended extractors are removed entirely. Closing the tab discards the profile. CONTEXT βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Two-week arc of recall hardening (ADR-041 β KI-196 β Bug #25 β Bug #26 β ADR-042 v1 β v2 β v3 β v4) kept exposing new failure modes. Each pass was a real bug class, but after v4 the live audit still showed seeded-test failures because the name-slug pointer was being overwritten between tests β the structural truth a name-only key cannot safely disambiguate two visitors who share a name. The workarounds were accumulating without converging. Cost/benefit was wrong for an insurance-shopping product (rare- purchase, return sessions uncommon): ~1500 LOC + 100+ profile JSONs + 2 ADRs + 5 test files + ongoing audit-time state drift, for a feature whose value is "the bot remembers you next visit." Minimum-data- reβ¦6d5684e -
docs: ADR-042 + README + CLAUDE.md updates for the 4-fix bundleβ
- new: 70-docs/60-decisions/ADR-042-privacy-hardening-and-sticky-retry.md (full record of v1 + v2 with the live 8/8 audit results) - README Β§2.4 (LLM brain): new "Sticky-session retry policy" paragraph documenting non-sticky vs sticky retry budgets + the honest canned copy - README Β§2.6 (Profile / recall): redacted-prompt + match-before-merge flow on the diagram + supporting prose - README Β§4 (Safety): admin LLM Chain refresh wiring note (KI-296) - CLAUDE.md "Session & profile lifecycle" updated for ADR-042 + KI-296 - CLAUDE.md "Admin panel" updated for the LLM Chain refresh wiring fix Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>128fac1
-
recovery: integrate stalled-session work + de-stale/cleanup (pytest 215 green) [build-fix]β
Resumes the session whose 3 background agents stalled on the 600s watchdog; captures the prior session's uncommitted #42β#110 work + data exercise plus this session's verified recovery changes. (Rebuilt from the first attempt to store frontend/public/insurer-logos/*.png via Git LFS β HF Spaces' pre-receive hook requires it; .gitattributes updated, tools/.pdf_text_cache gitignored.) Prior-session work captured (was uncommitted, behaviourally live-tested): - single_brain rewrite, full frontend rebuild, compare/scorecard/premium UI, ~77 40-data/policy_facts sourced-data edits, new tests/tools, render.yaml drop. This session's recovery (surgical, verified, behaviour-preserving): - Fix app-wide HTTP 500: a `*/` inside a CSS comment killed the stylesheet. - Remove dead get_judge_llm everywhere (judge retired in single-brain rewrite). - eval/run.py: repair imports + hard-guard against stale results.json. - Centralize ~13 hardcoded "40-data" literals to one settings.DATA_DIR (resolves idβ¦b87bd2d
-
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 -
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 -
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(voice+chat+llm+docs): KI-155 + KI-156 + KI-157 + KI-158 + KI-159 + KI-160 bundleβ
Six conversation-pipeline + LLM-chain fixes addressing every live-test defect surfaced today, plus the documentation cascade. KI-155 β enforce <FF> trailer emission. Strengthened fact_find_brain system prompt with absolute final-instruction block + edge-case few-shots ('Hi' β still emit trailer, 'ok' β still emit trailer) so Groq Llama-3.3 (was elected as cross-provider fallback, was silently dropping the trailer) now complies. Smoke: My name is Rohit / I am 29 years old / to buy a health insurance policy β all three return fact_find_brain:: continue, no more ::fallback:no_trailer. KI-156 β fix bot non-response + 'not having any policy' uncaptured. Three sub-fixes: Fix A: extend negation regex in fact_find_normalizer._parse_existing_cover to cover 'not having', 'not got', 'not have', 'without (any|a)'. Fix B: stop-list in fact_find_brain._validate_capture for name field β reject hallucinated names that start with 'currently', 'not', 'no', 'looking', etc. (live bug: LLβ¦1c5baae
-
docs: KI-101..KI-107 β audit + CLAUDE.md + ADR syncβ
Document the seven KIs landed today across the production-readiness register, project memory, and affected ADRs: - KI-101 (66eb4ed) β drop 6 function-local `import logging` lines from orchestrator.py; module-level import is the sole binding so the asyncio wait_for TimeoutError branch no longer raises UnboundLocalError. - KI-102 (4bb8da0) β profile RAG cross-session isolation. session_id stamped on every chunk; main retrieve() excludes doc_type=profile; per-session lookup triple-checks meta.session_id == session_id in Python; legacy chunks without session_id fail-closed. ADR-022 extended with a session-isolation subsection. - KI-103 (8ef5c43) β _canonical_fallback no_trailer loop-breaker. New session._ff_failed_attempts + _ff_skipped_slots; after 2 failed attempts on the same slot, mark skipped and advance. - KI-104 (407f2a1) β voice_format.tts_preprocess strips chain-of-thought leakage: <think> blocks, **Reasoning:** labels, [INTERNAL] blocks, sentence-anchored CoTβ¦1d10432 -
fix(admin): KI-096 + KI-097 β public /api/version + password-only adminβ
KI-096: add unauthenticated GET /api/version (git SHA + uptime). Lets any caller verify which commit HF Space is serving without admin auth. KI-097: rip out admin IP allowlist. ADMIN_IP_ALLOWLIST env, _ip_allowed(), and the dual-gate 404-to-hide-existence behavior are gone. _check_admin now only verifies the X-Admin-Password header; bad/missing password β 401 Unauthorized. Operational rationale: changing networks locked the operator out without adding meaningful security beyond a strong password. ADR-023 superseded; ADR-010 secret count 8 β 7. Also includes test_name_persistence.py (4 deterministic regression cases pinning KI-091/094/095) and the KI-094 mistakes-log entry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>d37a6cf -
docs: KI-091 + KI-094 β extractor gates + None-guard added to audit + CLAUDE + ADR-032β
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>d547d5a -
docs: ADR-032 LLM chain architecture reference + KI-080..KI-087 doc syncβ
Adds new architecture reference ADR consolidating KI-079..KI-087: - 70-docs/60-decisions/ADR-032-llm-chain-architecture.md (NEW, 435 lines) - TL;DR + ASCII data flow diagram - Component reference (every ModelHealth field) - Election algorithm pseudo-code + score formula - Probe loop cadence + OpenRouter credits polling - Per-provider credit signal table (Groq headers / OR endpoint / NIM rate-meter) - Per-phase httpx timeout justification - Failure classification table - KI-079 escalation path - Telemetry surface (brain_used variants) - Performance characteristics + operational runbook Updated docs: - CLAUDE.md "LLM stack" section: KI-080..KI-087 full coverage + NIM-first preference (KI-087), credit gating (KI-085), per-phase timeouts (KI-084), admin tab (KI-086), HF Space secrets (KI-081) - 80-audit/ENTERPRISE_AUDIT.md: 5 new rows (KI-081, KI-084, KI-085, KI-086, KI-087) appended to "Fixes shipped today" table - backend/proviβ¦6a47549 -
docs: KI-080 β sync CLAUDE.md + ENTERPRISE_AUDIT + new ADR-031 + 11 stale KI-025/50-50 surface sweepβ
Documents the KI-080 architectural shift from "iterate every chain candidate per call" (ADR-026 / KI-025 50/50 NIM β Groq rotation) to "probe-elected sticky primary with cross-provider backup" (ADR-031). Files updated: - CLAUDE.md β "LLM stack" section rewritten for KI-080 election; KI-025 rotation marked deprecated. - 80-audit/ENTERPRISE_AUDIT.md β KI-078/KI-079/KI-080 rows added to "Fixes shipped today" table; executive-scorecard UX-latency + test- coverage rows updated to cite KI-080 (supersedes KI-025). - 70-docs/60-decisions/ADR-031-sticky-primary-election.md β NEW. Full ADR following ADR-030 shape: Context, Decision, Alternatives, Consequences, Files touched, Revisit at scale. - 70-docs/60-decisions/ADR-026-provider-load-balancing.md β header updated to "Superseded by ADR-031"; body retained as historical record per ADR convention. - 70-docs/60-decisions/ADR-030-llm-driven-fact-find.md β pointer to ADR-026 swapped for ADR-031. - READMEβ¦c592055 -
docs: KI-071 β reconcile docs with code reality (Qwen 80B / Nemotron 30B / Mistral 675B as current primaries)β
Source-of-truth audit found the production code on `main` runs Qwen 3-Next 80B (brain primary) + Nemotron Nano 30B (fast brain primary) + Mistral Large 3 675B (judge primary) per the D-022 inline brain swap on 2026-05-14 (NIM DeepSeek + Llama-4 Maverick pools were timing out for hours). The ADR-019 decision text + multiple docs still referenced DeepSeek V4-Pro / V4-Flash + Llama-4 Maverick as primaries. This commit aligns 12 files with the actual chain definitions in `backend/providers/nvidia_nim_llm.py`. DeepSeek V4-Pro / V4-Flash + Llama-4 Maverick are correctly documented now as **fallback chain entries** that re-enter rotation when NIM's pools recover. Files reconciled (+64 / -45): - `README.md` β Β§1.2 "Honest model picks" paragraph + Β§4.3 Model stack table rewritten. Heavy brain row now: "Qwen 3-Next 80B *or* Groq Llama-3.3-70B (50/50 rotation)". Fast brain: "Nemotron Nano 30B". Judge: "Mistral Large 3 675B". Full fallback chains documented. - `70-docs/60-decisioβ¦2e60476 -
fix(fact-find): KI-072 β canonical fallback now captures user's answer + doc sync (CLAUDE.md / ADR-030 / ENTERPRISE_AUDIT)β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ KI-072 β P0 fallback wedge fix (backend/fact_find_brain.py) βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Live user screenshot showed the bot stuck asking "First β what should I call you? I'll save your profile so the next time you visit, you won't have to answer all this again." FOUR times in a row while the user answered "I am Don" / "Don" / "Don Jon". Every answer dropped on the floor. Root cause: when KI-070's `drive_fact_find()` brain call fails (timeout, malformed JSON trailer, chain exhaustion), it falls back to a canonical question via `next_question(profile).prompt_en`. But the original fallback just returned the question text β it never tried to APPLY the user's current message to whichever slot was last being asked. So under any sustained LLM degradation (NIM rate limit / pool timeout), fact-find wedges into an infinite re-ask. Fix: `_canonical_fallback` now takes `session` + `user_text`, reβ¦e098e1b -
refactor: KI-047 β bucket reorg (Option A safe subset)β
User picked numbered-bucket layout. Executing the SAFE subset that does NOT touch Python imports or string path refs: β’ docs/ β 70-docs/ β’ audit_results/ β 80-audit/ Kept as-is (renaming would need ~25 Python files of string-path updates β deferred to follow-up): β’ data/ β code-referenced (backend/{premium_calculator, session_state, profile_store, scorecard, admin, llm_health, main}, rag/build_kb, tools/{check_link_rot, info_source_map, curate_*, refresh_premiums, generate_policy_facts}). β’ backend/, frontend/, rag/, tools/, eval/, tests/, kb/ β Python directly forbids leading-digit / hyphen package names. All references to the moved folders updated in one sed pass across *.md, *.py, *.sh, *.ts, *.tsx, *.json, Dockerfile. Verified by: β’ tests/test_routing_regression.py β 15/15 still pass. β’ No residual (docs/ or [docs/ or /docs/ or ^docs/ refs. β’ Same for audit_results/. Docβ¦e2d09f9