[Senate] Add convergence monitoring dashboard section
Goal
Add a convergence monitoring section to the /senate page that tracks hypothesis duplication, score distribution, and system throughput metrics. Also enhance the /api/convergence endpoint to return live-computed data instead of reading from a potentially stale JSON file.
Acceptance Criteria
☑ Convergence section visible on /senate page
☑ Duplicate hypothesis detection using Jaccard title similarity (>=60% threshold)
☑ Score distribution bar chart showing hypothesis quality spread
☑ 24h throughput metrics with delta comparison to previous period
☑ Overall convergence health status (HEALTHY/ATTENTION/DIVERGING)
☑ /api/convergence returns live computed data (duplicates, scores, throughput)
☑ Python syntax validates clean
Approach
Add convergence section builder in senate_page() after quality trend section
Compute Jaccard word-set similarity for all hypothesis title pairs
Build score distribution bins and throughput delta metrics
Replace file-based /api/convergence with live DB queries
Add "Convergence" bullet to Senate governance role descriptionWork Log
2026-04-02 23:50 PT — Slot 23
- Reviewed existing quality gates (9 checks already live)
- Added convergence monitoring section to senate_page() with 3 sub-sections:
- Duplicate detection (Jaccard similarity on title words)
- Score distribution (5-bin bar chart with mean/median)
- 24h throughput with period-over-period deltas
- Enhanced /api/convergence to compute live data instead of reading stale JSON
- Verified syntax clean
- Committed and pushed
Verification — 2026-04-19 11:10 UTC
Checked origin/main (commit a179deebd) for implementation evidence:
/api/convergence endpoint — git show origin/main:api.py | grep -n "def api_convergence" → line 14649
- Returns:
status,
score_distribution,
avg_score,
median_score,
duplicate_pairs,
duplicate_count,
throughput - Uses live DB queries, no JSON file read
_get_duplicate_hypothesis_pairs — line 14535
- Jaccard word-set similarity with 0.6 threshold
senate_page convergence_section — line 41706+
- Duplicate detection, score distribution bar chart, 24h throughput with deltas
Python syntax — python3 -m py_compile api.py → Syntax OKAll 7 acceptance criteria satisfied on origin/main.