Spaces:
Running on Zero
Running on Zero
fix(extraction): persist canonical extractedData in upload handler and normalize fallback outputs
Browse filesFiles changed (4)
97 unmodified lines98991001011021031043 unmodified lines10810911011111211311497 unmodified lineslogger.warning("[ExtractionAdapter] New extractor failed with error: %s. Falling back to legacy.", exc)# Fallback path when new extractor was enabled but failedprimary_result = self.legacy_extractor.extract(raw_text=text_to_extract, cleaned_text=cleaned_text)primary_result["extractionSource"] = "fallback"logger.info("[ExtractionAdapter] Extraction completed via 'fallback'. (skills: %d, exp: %.1f yrs)",3 unmodified linesreturn primary_result# Legacy primary path (USE_NEW_EXTRACTOR=false)primary_result = self.legacy_extractor.extract(raw_text=text_to_extract, cleaned_text=cleaned_text)primary_result["extractionSource"] = "legacy"logger.info("[ExtractionAdapter] Extraction completed via 'legacy'. (skills: %d, exp: %.1f yrs)",97 unmodified lines98991001011021031041051061073 unmodified lines11111211311411511611711811912097 unmodified lineslogger.warning("[ExtractionAdapter] New extractor failed with error: %s. Falling back to legacy.", exc)# Fallback path when new extractor was enabled but failedraw_fallback = self.legacy_extractor.extract(raw_text=text_to_extract, cleaned_text=cleaned_text)processed = post_process_resume(raw_fallback)primary_result = processed.model_dump(by_alias=True)primary_result["jobRole"] = primary_result.get("jobTitle")primary_result["extractionSource"] = "fallback"logger.info("[ExtractionAdapter] Extraction completed via 'fallback'. (skills: %d, exp: %.1f yrs)",3 unmodified linesreturn primary_result# Legacy primary path (USE_NEW_EXTRACTOR=false)raw_legacy = self.legacy_extractor.extract(raw_text=text_to_extract, cleaned_text=cleaned_text)processed = post_process_resume(raw_legacy)primary_result = processed.model_dump(by_alias=True)primary_result["jobRole"] = primary_result.get("jobTitle")primary_result["extractionSource"] = "legacy"logger.info("[ExtractionAdapter] Extraction completed via 'legacy'. (skills: %d, exp: %.1f yrs)",
389 unmodified lines3903913923933943953 unmodified lines3994004014024034044053 unmodified lines409410411412413414389 unmodified lines)skills = parsed_cand.skillsstorage_res = store_resume(file_bytes=content,filename=filename,3 unmodified linesresume_text=text_to_return,skills=skills or [],job_role=candidate_role,content_type=content_type or "application/pdf")response_payload.update({3 unmodified lines"storageObjectPath": storage_res.get("storageObjectPath"),"candidateName": storage_res.get("candidateName"),"jobRole": storage_res.get("jobRole"),})except Exception as store_err:logger.error(389 unmodified lines3903913923933943953963973983994004013 unmodified lines4054064074084094104114124134143 unmodified lines418419420421422423424425426389 unmodified lines)skills = parsed_cand.skillscurrent_ver = (extraction_service.current_extractor_versionif extraction_serviceelse "ats-slm:qwen2.5-1.5b-instruct:chatml-v1:schema-v1")storage_res = store_resume(file_bytes=content,filename=filename,3 unmodified linesresume_text=text_to_return,skills=skills or [],job_role=candidate_role,content_type=content_type or "application/pdf",extracted_data=extracted,extractor_version=current_ver,extraction_source=extracted.get("extractionSource", "legacy"),)response_payload.update({3 unmodified lines"storageObjectPath": storage_res.get("storageObjectPath"),"candidateName": storage_res.get("candidateName"),"jobRole": storage_res.get("jobRole"),"extractedData": extracted,"extractorVersion": current_ver,"extractionSource": extracted.get("extractionSource", "legacy"),})except Exception as store_err:logger.error(
123451 unmodified line78910111213# ATS Resume Extractor: Production Promotion Gate Audit (Stage 4 -> Stage 5)**Audit Date:** 2026-11-18T05:36:03.578337+00:00 | **Overall Recommendation:** **PASS - READY FOR STAGE 5 (CANARY CUTOVER)**## Summary of Promotion Gates| Gate # | Promotion Requirement | Current Metric | Gate Status |1 unmodified line| **Gate 1** | Labeled Set: SLM >= Legacy across all critical fields & bug classes | SLM is >= Legacy across all critical fields. | **🟢 PASS** || **Gate 2** | Reliability: Invalid JSON + Upstream Timeouts < 1.0% | Error Rate: 0.0% | **🟢 PASS** || **Gate 3** | Memory Safety: Zero Memory Guard Incidents on Space | Trips: 0 | **🟢 PASS** || **Gate 4** | Grounding: Hallucination Rate < 2.0% | Hallucination Rate: 0.0% | **🟢 PASS** || **Gate 5** | Downstream Integrity: Ranking Impact Verified | Spearman Rank Corr: 1.0 | **🟢 PASS** |## Gate 1 Breakdown: Field-Level Agreement & Known Bug Classes123451 unmodified line78910111213# ATS Resume Extractor: Production Promotion Gate Audit (Stage 4 -> Stage 5)**Audit Date:** 2026-11-18T08:06:27.221900+00:00 | **Overall Recommendation:** **BLOCKED - GATES FAILED**## Summary of Promotion Gates| Gate # | Promotion Requirement | Current Metric | Gate Status |1 unmodified line| **Gate 1** | Labeled Set: SLM >= Legacy across all critical fields & bug classes | SLM is >= Legacy across all critical fields. | **🟢 PASS** || **Gate 2** | Reliability: Invalid JSON + Upstream Timeouts < 1.0% | Error Rate: 0.0% | **🟢 PASS** || **Gate 3** | Memory Safety: Zero Memory Guard Incidents on Space | Trips: 0 | **🟢 PASS** || **Gate 4** | Grounding: Hallucination Rate < 2.0% | Hallucination Rate: 100.0% | **🔴 FAIL** || **Gate 5** | Downstream Integrity: Ranking Impact Verified | Spearman Rank Corr: 1.0 | **🟢 PASS** |## Gate 1 Breakdown: Field-Level Agreement & Known Bug Classes
12345661 unmodified lines686970717273747576777879{"auditTimestamp": "2026-11-18T05:36:03.578337+00:00","overallVerdict": "PASS - READY FOR STAGE 5 (CANARY CUTOVER)","gates": {"gate1_labeled_accuracy": {"status": "PASS",61 unmodified lines"message": "Zero memory-guard trips recorded on Space."},"gate4_grounding_hallucination": {"status": "PASS","hallucination_rate_pct": 0.0,"grounded_rate_pct": 100.0,"threshold_pct": 2.0,"ungrounded_entities": {},"message": "Hallucination rate 0.00% is below ceiling (<2.0%)."},"gate5_ranking_impact": {"status": "PASS",12345661 unmodified lines6869707172737475767778798081{"auditTimestamp": "2026-11-18T08:06:27.221900+00:00","overallVerdict": "BLOCKED - GATES FAILED","gates": {"gate1_labeled_accuracy": {"status": "PASS",61 unmodified lines"message": "Zero memory-guard trips recorded on Space."},"gate4_grounding_hallucination": {"status": "FAIL","hallucination_rate_pct": 100.0,"grounded_rate_pct": 0.0,"threshold_pct": 2.0,"ungrounded_entities": {"skill": 1},"message": "Hallucination rate 100.00% exceeds threshold (<2.0%)."},"gate5_ranking_impact": {"status": "PASS",
app/adapters/extraction_adapter.py+8-2
app/server.py+13-1
reports/promotion_gates_report.md+2-2
reports/promotion_gates_summary.json+9-7