Spaces:
Running
Running
Commit History
9 days ago
-
fix(chatbot-cables): strict type-check compliance (ultracheck) — quoted csaLabel emission, CablesHit.citationEn, widened Code data records
ahmdelbaz28-ux- generator: fmt_num now emits string values via json.dumps (csaLabel: "4" instead of bare 4 / accidental division expression for reduced-neutral labels like 25 RM / 16 RM) - CablesHit gains citationEn (EN citation prefills + enforcement) - CableAmpacityRow → Record cast via unknown (TS2352 under strict) - EgyCodeSection.data widened to admit per-key load-capacity records - test cleanups (non-null ground assert, drop stray __internal probe)25ec22e -
feat(chatbot): cables & Egyptian-Code expert core — Elsewedy KB + deterministic sizing engine + citation contract
ahmdelbaz28-uxSources saved as retrievable, citable knowledge (user requirement: the bot must reference and CITE the Egyptian Code and the Elsewedy catalogue, and size cable sections from its own verified calculations): - chatbot-cables-kb.ts (AUTO-GENERATED from Power Cables.pdf via scripts/extract_cables_kb.py + scripts/gen_cables_kb_ts.py): 20 LV/MV ampacity tables (291 rows, page-cited), short-circuit tables 14-17, voltage-drop 18-19, derating 3-13, AWG/Cu-Al conversions, the catalogue's own formulas + selection guidance. Suspect catalogue misprints preserved verbatim + flagged (sc_cu_pvc 10mm² air-touched '9', Table 11 '0.98'). - chatbot-egycode-kb.ts: 18 clause-cited sections from the Egyptian Code design volume (Ch1 loads, Ch2 lighting eq 2-1, Ch8 cable routes/trenches/ conduit fill 40%+10%/trays 50%/inspection rooms, Ch9 power factor). - chatbot-cables.ts (expert layer, Saadat pattern): bilingual intent gate, BM25 over the combined corpus (keywords-only index + Arabic prefix…51ac820