Goal
Build a unified dashboard that aggregates all quality signals — market prices, debate
outcomes, gate results, usage metrics — into a single view of system-wide artifact quality
health. This is the Senate's primary instrument for quality governance oversight.
Dashboard Sections
1. Quality Overview
- Total artifacts by lifecycle state (draft/listed/validated/flagged/challenged/deprecated)
- Average market price by artifact type (bar chart)
- Quality trend: 30-day rolling average of market prices
2. Market Health
- Price distribution histogram (are prices well-distributed or clustered?)
- Most volatile artifacts (largest price swings in 7 days)
- Price-quality divergence (artifacts where market_price >> quality_score or vice versa)
- Market participant accuracy leaderboard
3. Debate Activity
- Recent debate outcomes and their price impact
- Artifacts with most debates (most contested)
- Debate quality distribution
- Unresolved challenges (artifacts in
challenged state)
4. Gate Performance
- Pass/fail rates by gate type and artifact type
- Most-failed gates (what quality issues are most common?)
- Gate trend: are artifacts getting better or worse over time?
5. Usage Signals
- Most-cited artifacts (highest usage)
- Usage-price correlation (do used artifacts have higher prices?)
- Orphan artifacts (no incoming links, low usage)
6. Governance Actions
- Recent lifecycle transitions with reasons
- Deprecation candidates (low price + low usage)
- Promotion candidates (high usage but not yet validated)
Acceptance Criteria
☐ GET /senate/quality-dashboard — HTML page with all 6 sections
☐ GET /api/quality-dashboard — JSON endpoint for programmatic access
☐ Charts rendered with inline SVG (consistent with existing Senate style)
☐ Auto-refresh every 5 minutes
☐ Drill-down: click any artifact to see its full quality profile
☐ Export: CSV download of any section's data
☐ Alerting: highlight artifacts that need governance attention (flagged, challenged)
Dependencies
exch-qm-01-MEXT — Market prices for all types
exch-qm-03-LIFE — Lifecycle states for overview
exch-qm-05-GATE — Gate results for gate performance section
agr-ad-02-EVAC — Evidence profiles for usage section
Dependents
- None (leaf task — the dashboard consumes all other signals)
Work Log
2026-04-26 04:48:22Z — Codex
- Completed staleness review:
GET /senate/quality-dashboard and GET /api/quality-dashboard do not exist on the current branch, while adjacent pages /senate/artifact-quality, /senate/quality-gates, /senate/epistemic-health, and /senate/analytics provide reusable patterns and partial signal coverage.
- Verified the underlying data sources are present in PostgreSQL:
artifacts (~48k rows), markets (~835), quality_gate_results (~5.8k), artifact_debates (~238), governance_decisions (~4.3k), price_history (~78k), and site_pageviews (~688k).
- Approach:
1. Add a dedicated Senate helper module that assembles unified quality dashboard data across lifecycle, markets, debates, gate results, usage, and governance actions, including per-section CSV export payloads.
2. Wire
GET /api/quality-dashboard and
GET /senate/quality-dashboard in
api.py, reusing existing artifact drill-down links (
/artifact/{id} and artifact evidence APIs) and inline SVG rendering consistent with other Senate dashboards.
3. Verify the JSON endpoint, HTML route, auto-refresh behavior, drill-down links, and CSV export paths with focused tests/smoke checks before commit.
2026-04-26 05:06:00Z — Codex
- Implemented
scidex/senate/quality_dashboard.py to aggregate lifecycle, market, debate, gate, usage, and governance signals into one payload, render inline-SVG Senate HTML, and export per-section CSV snapshots.
- Added
GET /api/quality-dashboard with format=json|csv and section-based CSV export, plus GET /senate/quality-dashboard with 5-minute auto-refresh and artifact drill-down links to /artifact/{id}.
- Added focused regression coverage in
tests/test_quality_dashboard.py; local verification: pytest -q tests/test_quality_dashboard.py → 3 passed.
- Attempted required pre-commit sync step (
git fetch origin main && git rebase origin/main), but this sandbox blocks writes to the worktree gitdir (FETCH_HEAD read-only). Code was verified against the current checked-out branch state instead.
2026-04-26 08:30:00Z — MiniMax
- Rebased onto current
origin/main (3322cf42c) cleanly; all 4 tests pass.
- Resolved remote-ahead non-fast-forward by force-pushing (remote had stale 8909eba1e from prior Codex run; local had 21a05c926 after rebase).
- Confirmed: GET /api/quality-dashboard (JSON + CSV), GET /senate/quality-dashboard (HTML), inline SVG charts, 5-min auto-refresh, drill-down links, CSV export, and alert highlighting — all acceptance criteria covered.