Spaces:
Sleeping
Sleeping
Commit History
-
fix(link-rot): validate PDF candidates + untrack llm_health.jsonβ
THE INCIDENT Overnight 2026-05-27/28 the nightly link-rot LaunchAgent (com.rohit.insurancebot.linkrot β tools/check_link_rot.py) applied seven bad auto-patches to 40-data/corpus_urls.md and one to tools/.pdf_etag_state.json: - HDFC ERGO Γ3 + Bajaj Allianz Γ2 + New India Γ1: rewrote httpsβhttp via try_canonicalise β both work but the downgrade is gratuitous. - Niva Bupa Health Companion (a core indemnity product): rewrote the live URL to a 2-year-old Wayback wrapper that serves HTML, not PDF. Would have silently broken corpus rebuild for that policy. ROOT CAUSE head_check() did HEAD only; the affected origins (HDFC ERGO, Bajaj, New India, Niva Bupa) return text/html interstitials or transient errors for HEAD while serving the real PDF on GET. When HEAD failed transiently, the tool fell into auto_fix and both strategies (try_ canonicalise + try_wayback) accepted any candidate whose HEAD returned status 2xx β without verifying it ACTUALLY served a PDF. The Wayback 'availβ¦f9437bb
-
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
-
#44: reconcile PED waiting across policy-facts doctype files (data integrity)β
14 policies had conflicting pre_existing_disease_waiting_months across base/__wordings/__cis/__brochure files, causing the scorecard surface and get_policy_facts to contradict each other in one reply (e.g. ICICI Health AdvantEdge card said "0 months β short waiting" while the table said 24mo; the bogus 0 also inflated its grade). Each set to the source-faithful canonical value (wordings/Code-Excl01 legal clause preferred; garbled OCR resolved to the real number in the quote; no invented numbers β every value keeps its real supporting quote). Guard test tests/test_policy_facts_ped_consistency.py pins "no policy's doctype files disagree on PED" (redβgreen verified). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>2c51f98
-
fix(pricing+scoring): rebuild premium engine to 0 logical violations + classification, faithfulness, links, writingβ
Claude Code +1: Claude Opus 4.7 (1M context)Pricing: rebuilt sampleβpremium as median-of-normalized-bases (monotone by construction) + real-fact product-type classifier + age-bucket-key fix + type-aware abs/low caps + P7 capped vs cheapest real comprehensive + Sanjeevani rel-cap. Exhaustive harness 3,316β0 (P1-P8=0, 104,760 checks); 5 monotonicity + 4 strict all-148 seeds clean. Deep-research harvest (6 agents, integrity-gated): 93/148 now real-quote-anchored, rest typeΓprofile-modelled w/ honest provenance labels. Classification: fixed Health Guard/Star Assure (voluntary-deductible comprehensive mislabelled topup β dedβ₯βΉ2L threshold), Criti Care/Medicareβdisease, Energyβcomprehensive, Health Protector Plusβtopup. Scoring: parity-by-construction (_scorecard_signal mirrors marketplace doctype-rank + merge); harness S3=0, test_scorecard_parity green. Reviews source-map + 148 confirm. Weighted-avg math audited PASS. Faithfulness: _verify_prose_grounding β UINs in reply prose must be retrieved-grounded (faithfulness_passed now coβ¦f266901 -
chore(repo-hygiene): fix the 3 issues the audit framework's Tier-1 surfacedβ
- T1.2: LFS-track 40-data/information_source_map.json (2.9MB) + eval/info_source_map.json (1.6MB) β were plain blobs in the HF Space repo (1GB cap / pre-receive-hook risk). Content unchanged; now pointers. - T1.4: add slash-less `tools/.pdf_text_cache` to .gitignore (the trailing-slash file-vs-dir gap class that caused this session's symlink build break). - T1.5: untrack frontend/tsconfig.tsbuildinfo (regenerated build artifact) + gitignore *.tsbuildinfo. Local only β not pushed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>216a816
-
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 -
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(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 -
fix(marketplace+voice+routing): KI-136 + KI-141 + KI-142 + KI-143 + KI-144 β full bundleβ
Five distinct fixes shipped together for a single rebuild cycle: KI-141 β hybrid alias dedup. /api/coverage + /api/policies/all now collapse curated marketing-rename entries (Activ One, Optima Secure, etc.) under their PDF-backed parent card, with aliases surfaced as 'Also marketed as:' on the marketplace cards. Frontend page.tsx + api.ts add aliases[] field on MarketplacePolicy. Card count went 158 -> ~137. KI-142 β UIN-primary merge rule. /api/coverage and /api/policies/all now build uin_to_parent maps from extracted JSONs and merge curated entries based on UIN equality. Falls back to source_pdf gate when UIN matches fail. 1 UIN = 1 marketplace card invariant. KI-136 β named-SKU comparison routing. orchestrator.py should_route_to_fact_find now accepts query and exempts intent=comparison when the question mentions >=2 named insurers/SKUs. Empty profile no longer traps SKU-specific compare questions in fact_find_brain. Verified: 'Compare HDFC ERGO Optima Secure and Niva Bupa Aspire β¦63290a7 -
fix(corpus): KI-126 β drop 2 image-only PDFs + cascade docs across 3 reposβ
The 2 deleted PDFs are scanned-image PDFs that pdfplumber extracts as 0 chars, so they were never queryable through the RAG pipeline. OCR is explicitly out of scope. Removing them brings every surface back into agreement: β’ royal-sundaram/family-plus__brochure.pdf β Family Plus product is still covered via royal-sundaram__family-plus__wordings (text-extractable). β’ aditya-birla/activ-one__brochure.pdf β Activ One coverage is provided via aditya-birla__activ-health-individual__wordings (already in Chroma, 120 chunks). The separate aditya-birla__activ-one KB entry was independent and remains intact. Cascade across all surfaces (per the no-stale-content prime directive): β’ Deleted: 2 PDFs (HF dataset + local symlink target) β’ Deleted: 2 kb/policies/__brochure.md files β’ Deleted: 2 40-data/policy_facts/__brochure.json files β’ Deleted: 2 _hf_dataset_backup/rag/extracted/__brochure.json + 1 _raw.txt β’ kb/INDEX.md: rows removed; "Policies (255)" -> "Policies (2β¦f9adc25
-
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 -
refactor + feat: KI-050b/053/054 β rename completeness + eval speed + tax questionsβ
Combines three logically-related changes into one push-clean commit (rewrites the prior 67bdd3a + 866fb24 to drop accidentally-swept-in binaries + runtime state that tripped HF Space's pre-receive hook). KI-050b β data/ β 40-data/ rename completeness across docs: β’ 40-data/ internal docs (README, corpus_urls.md, info_source_map, illustrative_premiums.json, llm_health.json, profiles/README, reviews/icici-lombard.json) β’ kb/ β AUDIT_TRAIL, INDEX, all 218 kb/policies/*.md mirror sheets, kb/research/corpus_acquisition.md, kb/reviews/* leaderboards β’ tools/ β info_source_map.py, build_kb_mirror.py, full_pipeline.sh, README, ~12 other scripts touching data/ paths in prose β’ eval/info_source_map.json (2772 source-provenance entries) + README entrypoint.sh preserved β its `/data/` paths are absolute HF Space persistent-disk mounts, NOT references to the repo folder. KI-053 β eval/run.py --no-extract flag. Skips the orchestrator's free-form profile_extractor LLM call β¦57ef382 -
perf(retrieval): KI-049 β wider top-k for table-cell questionsβ
Post-fix 96-Q eval (54.8% factual) surfaced 8 failures on room-rent / sub-limit / cap questions where the bot's reply omitted the specific room category ("Single Private", "Twin Sharing", "General Ward"). That's 19% of remaining failures. Root cause: the policy table with the structured cap is ONE chunk in Chroma, but at top_k=5 it loses to other relevant prose chunks (definitions, sub-limit prose elsewhere in the doc) β the LLM never sees the table β can only paraphrase from looser context β misses the row categories. Fix: when the query matches a table-cell trigger pattern, raise effective_top_k to 10 for that query only. Trigger regex covers: β’ room rent / sub-limit / sub-limits β’ copay / co-pay β’ cap on / capped at / sum insured limit β’ single private / twin sharing / general ward β’ no-claim bonus / NCB Verified the regex fires on the eval's failing questions and ignores generic waiting-period queries (which retrieve fine at top_k=5). Combined with KI-046 (refusal prβ¦c8bf1a1