fix: forward sentiment-adjustment fields in the scores API response
get_score computed base_score / sentiment_score / sentiment_adjustment / max_sentiment_adjustment, but the router's _map_composite_breakdown built the response model from only the five original keys and silently dropped the rest — so the API always returned null for them. That's why the ticker page showed neither the "Composite = Base + Sentiment" caption nor the ± marker on the sentiment row despite the frontend and scoring service both supporting it. Pass the fields through, with a guard test so they can't be dropped again. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -39,6 +39,10 @@ def _map_composite_breakdown(raw: dict | None) -> CompositeBreakdownResponse | N
|
||||
missing_dimensions=raw["missing_dimensions"],
|
||||
renormalized_weights=raw["renormalized_weights"],
|
||||
formula=raw["formula"],
|
||||
base_score=raw.get("base_score"),
|
||||
sentiment_score=raw.get("sentiment_score"),
|
||||
sentiment_adjustment=raw.get("sentiment_adjustment"),
|
||||
max_sentiment_adjustment=raw.get("max_sentiment_adjustment"),
|
||||
)
|
||||
|
||||
router = APIRouter(tags=["scores"])
|
||||
|
||||
Reference in New Issue
Block a user