[Agora] Build debate outcome synthesis — aggregate positions into consensus/dissent summary

← All Specs

[Agora] Build debate outcome synthesis — aggregate positions into consensus/dissent summary

Quest: Open Debates Priority: P3 Status: open

Goal

Build debate outcome synthesis — aggregate positions into consensus/dissent summary

Context

This task is part of the Open Debates quest (Agora layer). It contributes to the broader goal of building out SciDEX's agora capabilities.

Acceptance Criteria

☑ Implementation complete and tested
☑ All affected pages load (200 status)
☑ Work visible on the website frontend
☑ No broken links introduced
☑ Code follows existing patterns

Approach

  • Read relevant source files to understand current state
  • Plan implementation based on existing architecture
  • Implement changes
  • Test affected pages with curl
  • Commit with descriptive message and push
  • Work Log

    _No entries yet._

    Implementation Log

    2026-04-20

  • synthesis_engine.py — Added DEBATE_CONSENSUS_PROMPT (LLM prompt template) and
  • aggregate_debate_consensus_dissent() function (line 175). Fetches all debate rounds
    from DB, builds transcript per persona, calls LLM to identify:
    - consensus_points: agreed claims with personas agreeing + evidence level
    - dissent_points: disagreements with supporting/opposing personas + conflict description
    - winner + win_reason: dominant perspective
    - key_standoff: most important unresolved conflict
    - summary_paragraph: 2-3 sentence overview

  • api.py — Added GET /api/debates/{debate_id}/outcome endpoint (line 13046) returning
  • the JSON outcome. Also added outcome summary block to the /debates/{session_id} HTML
    detail page (line 67723+) showing winner badge, consensus points (green list), and
    dissent points (red list) inline before the transcript.

  • Verified — Direct function call test succeeded with real debate session:
  • aggregate_debate_consensus_dissent(db, 'sess_SDA-2026-04-02-gap-ev-ad-biomarkers')
    returned structured JSON with 5 consensus points, 4 dissent points, winner="skeptic".
    Python syntax checks passed for both modified files.

  • Commitd8c621ad7 — Rebased on origin/main, no conflicts.
  • Tasks using this spec (1)
    [Agora] Build debate outcome synthesis — aggregate positions
    Open Debates done P3
    File: b3632bc3e3cb_agora_build_debate_outcome_synthesis_ag_spec.md
    Modified: 2026-04-25 23:40
    Size: 2.5 KB