Spaces:
Sleeping
Sleeping
Commit History
-
#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
-
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(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
-
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