Spaces:
Sleeping
Sleeping
Commit History
-
fix: Boeing-run findings — canonical refs, edge contracts, guardrails
1. Canonical [M##] alignment: final result now carries metric_reference (the analyzer's own numbered list); the Quantitative Data table renders from it so table refs match SWOT text citations exactly (was: positional row numbering that diverged from the analyzer's 16-item list) 2. Numeric validator: accept citations exact at displayed precision ("$2.2B" for 2.237e9); mismatch messages now include raw values 3. Parser edge contract: only [M##]-cited lines enter the quadrants; uncited action lines route to a new Recommendations block, data-quality prose to quality notes; markdown headers can no longer leak as rows 4. Interpretation guardrails in analyzer prompts (VIX bands, margin benchmarks, internal-W/external-T classification) and a critic rubric line penalizing misclassification and W/T metric duplication 5. Citation coverage counts distinct cited metrics (no more 125%); provider failure logs deduped to one line per provider Contract tests added (tests/tes…e961a43
-
fix: Update citation patterns to match new SWOT output format
The SWOT output format changed from VALUE [M##] to [M##] Metric: Value but the citation validator patterns weren't updated, causing: - 0% citation coverage (pattern didn't match) - 25+ "uncited" values flagged (all values appeared uncited) - Score capped at 4.5/10 Changes: - Added CITATION_PATTERN_NEW for [M##] Metric: Value format - Kept CITATION_PATTERN_OLD for backwards compatibility - Added CITATION_REF_PATTERN for simple [M##] counting - Updated extract_citations() to try both patterns - Updated find_uncited_numbers() to exclude both patterns - Updated get_citation_count() to use ref pattern Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>e3b7287
-
Fix: Temporal data extraction and frontend date display
Backend: - Extract dates for valuation/volatility/macro in analyzer.py - Fix workflow_store.py to use regular_market_time for valuation - Fix workflow_store.py to use generated_at for volatility - Add Layer 2 (minimum citation count) to numeric_validator.py - Add Layer 3 (uncited number detection) to numeric_validator.py - Integrate Layers 2/3 in critic.py Frontend: - Add normalizeDate() for YYYY-MM-DD format (2025Q3→2025-09-30) - Add inferDataType() "Spot" for valuation metrics - Add extractDate() with multiple field fallbacks for news Fixes issues 2, 3, 5, 6, 8 from frontend data display audit. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>09c3333 -
Layer 4: Add deterministic numeric validation in Critic
Enforces machine-verifiable numeric accuracy: 1. Prompt changes (analyzer.py): - Require [M##] citations for all metric values - Example: "Revenue of $394.3B [M01] demonstrates..." - Clear warning that citations are auto-verified 2. New validator (numeric_validator.py): - Extract [M##] citations from SWOT output - Normalize values ($394.3B -> 394300000000) - Compare against metric_reference with tolerance - Return specific mismatch descriptions 3. Critic integration (critic.py): - Validate citations after LLM evaluation - If mismatches: cap evidence_grounding at 4, force rejection - Add specific feedback for revision - Log validation results to activity log Tested with Ford hallucination case: - Detects: market_cap $43.4B vs expected $56.6B - Detects: pe_trailing 21.3 vs expected 12.14 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>a2c9702