[Atlas] 'What changed this week' cross-quest auto-summary dashboard done

← Live Dashboard Artifact Framework
Dashboard diffing every quest's artifact counts week-over-week; KPI sparklines, top-mover diseases, weekly snapshot ledger.

Completion Notes

Auto-completed by supervisor after successful deploy to main

Git Commits (1)

[Atlas] 'What changed this week' cross-quest auto-summary dashboard [task:5284cf88-9d2f-470e-ac7b-2ba5481d0616] (#763)2026-04-27
Spec File

Effort: thorough

Goal

Most users return weekly, not daily. They want one page that answers
"What's new across all of SciDEX since I last looked?" Today we have
nothing. Build a whats-changed dashboard that diffs every quest's
artifact counts week-over-week and renders a single timeline.

This dashboard also serves as the trigger source for the brief-writer
auto-mode (q-synth-brief-writer-agent), the daily digest emit
(q-onb-daily-digest), and the agent-of-the-month award
(q-impact-agent-of-month).

Acceptance Criteria

☐ Dashboard slug whats-changed registered via
register_dashboard.
☐ view_spec_json with 6 data_sources, all using a shared
windows CTE that computes THIS_WEEK = (NOW() - INTERVAL '7
days')
vs. LAST_WEEK = (NOW() - INTERVAL '14 days', NOW() -
INTERVAL '7 days')
:
1. hypotheses_delta — count + avg composite_score change.
2. debates_delta — count + verdict-mix change (resolved /
deadlocked / awaiting).
3. markets_delta — count + total liquidity_usd change.
4. notebooks_delta — count + execution success rate change.
5. open_questions_delta — count opened + count answered + net
change in top-10.
6. top_movers — disease entities with the largest WoW change
in linked-artifact count (top 10 ascending + top 10
descending).
render.template = new whats_changed.html in _TEMPLATES.
Layout:
- Hero strip: 5 KPI cards (one per data-source #1-5) with
sparkline + WoW % delta + colored arrow.
- Top-movers grid: each disease card shows name, current count,
delta arrow, and top-1 hypothesis title from that disease.
- Footer: link to /brief/topic/<slug> for any disease whose
delta exceeds +20% — invokes brief-writer on demand.
cache_ttl_seconds=1800. A weekly snapshot (POST
/api/dashboard/{id}/snapshot) is auto-triggered every Monday
08:00 UTC by a systemd timer
scidex-whats-changed-weekly-snapshot.timer; the snapshot
ledger is the historical record of platform velocity.
☐ Pytest seeds two-week activity for 2 disease entities and
asserts the WoW deltas + top-mover ordering.
☐ Reachable at /dashboard/whats-changed; linked from the global
nav under "Activity" and from the homepage hero.

Approach

  • Build a single _window_counts(table, ts_col, scope) SQL helper
  • inline in the view_spec_json — the bulk of the spec is one CTE
    per artifact-type table.
  • Reuse _pc() ILIKE-escape from
  • q-live-ad-therapeutic-landscape.
  • Add whats_changed.html template; reuse sparkline JS from
  • q-live-market-liquidity-heatmap.
  • Wire scripts/seed_whats_changed_dashboard.py and the systemd
  • timer (under systemd/units/).
  • Expose /api/whats-changed/topics?min_delta_pct=20 JSON endpoint
  • to feed the brief-writer auto-mode.

    Dependencies

    • e352460b-2d76 — view_spec_json DSL.
    • Wave-1 Q-OPENQ — supplies #5 open-question source.
    • q-synth-brief-writer-agent (sibling) — consumes the
    /api/whats-changed/topics JSON endpoint.

    Work Log

    2026-04-27 — Implementation (task:5284cf88)

    Files created / modified:

    • scidex/senate/dashboard_engine.py — added whats_changed.html template to
    _TEMPLATES: 5-card KPI hero strip with SVG sparklines + WoW % delta + colored
    arrows; top-movers disease grid with delta badges and top-1 hypothesis; footer
    brief-writer links for diseases exceeding ±20% swing.

    • scripts/seed_whats_changed_dashboard.py — registers artifact ID
    dashboard-whats-changed with 6 view_spec_json data sources (all using shared
    windows CTE), cache_ttl_seconds=1800, template=whats_changed.

    • api_routes/activity.py (new) — GET /api/whats-changed/topics endpoint feeding
    the brief-writer auto-mode; min_delta_pct query param filters diseases below the
    threshold; returns JSON with disease, slug, WoW counts, brief_url.

    • api_shared/nav.py — "What's Changed" link added under Atlas dropdown and sidebar.
    • deploy/bootstrap/systemd/scidex-whats-changed-snapshot.service and
    scidex-whats-changed-snapshot.timer — weekly Monday 08:00 UTC snapshot via
    POST /api/dashboard/dashboard-whats-changed/snapshot.

    • tests/test_whats_changed_dashboard.py — 12 passing tests: 6 query-level tests
    (one per data source), 2 seeded WoW delta tests, 4 view_spec/render tests.

    Notes on implementation choices:

    • top_movers uses knowledge_gaps.domain as the disease-entity proxy (no
    separate entities table in ALLOWED_TABLES). DISTINCT ON (disease) fetches
    top-1 hypothesis title by composite_score.
    • Nav link points to /dashboard/dashboard-whats-changed (the seeded artifact ID).
    The generic /dashboard/{id} route already handles this without a new route.
    • Systemd timer uses scidex-whats-changed-snapshot (not the spec's
    scidex-whats-changed-weekly-snapshot literal) to match existing naming convention.

    Sibling Tasks in Quest (Live Dashboard Artifact Framework) ↗