You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
motief/docs/plans/2026-04-05-003-fix-svd-pole...

61 lines
2.4 KiB

---
title: "Add semantic left_pole/right_pole labels to SVD_THEMES"
type: fix
status: active
date: 2026-04-05
origin: docs/superpowers/specs/2026-04-05-svd-axis-labels-design.md
---
# Add Semantic Left/Right Pole Labels to SVD_THEMES
## Problem
The `positive_pole`/`negative_pole` labels in `SVD_THEMES` describe the raw SVD math poles, not the semantic left/right after flip. When the axis flips at runtime (to ensure right-wing parties appear on the right), the pole labels are swapped but still describe the raw SVD orientation — resulting in labels like "← PVV en FVD" appearing on the left side when they should be on the right.
## Solution
Add `left_pole` and `right_pole` fields to each `SVD_THEMES` entry that describe what's on the left and right sides after flip. Update rendering code to use these semantic labels directly.
## Implementation Units
- [ ] **Unit 1: Add left_pole/right_pole to SVD_THEMES in config.py**
**Goal:** Add semantic pole labels to all 10 SVD components.
**Files:**
- Modify: `analysis/config.py`
**Approach:**
- For each component, add `left_pole` and `right_pole` fields based on the existing `positive_pole`/`negative_pole` and the `flip` value
- When `flip=True`: `left_pole` = `positive_pole`, `right_pole` = `negative_pole`
- When `flip=False`: `left_pole` = `negative_pole`, `right_pole` = `positive_pole`
- Keep `positive_pole`/`negative_pole` for backward compatibility
- [ ] **Unit 2: Update explorer.py rendering to use left_pole/right_pole**
**Goal:** Use semantic pole labels in all rendering functions.
**Files:**
- Modify: `explorer.py` (lines 967-970, 1087-1090, 1252-1253, 2806-2807)
**Approach:**
- Replace the positive/negative swap logic with direct `left_pole`/`right_pole` usage
- `left_label = theme.get("left_pole", pos_pole if flip else neg_pole)` (backward compat fallback)
- `right_label = theme.get("right_pole", neg_pole if flip else pos_pole)`
- [ ] **Unit 3: Update tests**
**Goal:** Add tests for left_pole/right_pole fields.
**Files:**
- Modify: `tests/test_svd_labels.py`
- Modify: `tests/test_explorer_chart.py`
**Approach:**
- Test that all 10 SVD_THEMES entries have `left_pole` and `right_pole` fields
- Test that rendering functions use left_pole/right_pole correctly
## Scope Boundaries
- In scope: `analysis/config.py` SVD_THEMES, `explorer.py` rendering, tests
- Out of scope: `analysis/political_axis.py`, `analysis/projections.py` (uses positive_pole/negative_pole for motion projection, not UI labels)