Quest: Open Debates Priority: P2 Status: open
Add spectator mode and real-time debate streaming to /debates page
This task is part of the Open Debates quest (Agora layer). It contributes to the broader goal of building out SciDEX's agora capabilities.
Reopen reason: Prior commit 7308784e7 was on an orphan branch that never merged to main.
Verification steps taken:
git branch -a --contains 7308784e7 — commit exists only on worktree branches, not on origin/mainpython3 -m py_compile api.py — no errors (only pre-existing SyntaxWarning)lifecycle_state, is_open_enrollment, enrollment_closes_at, participant_count fields to the debate_sessions querylifecycle_state == "active"lifecycle_state == "ready" with is_open_enrollment == TrueGET /api/debates/{debate_id}/latest-round (line ~12815): Returns current max round number and lifecycle stateGET /api/debates/{debate_id}/stream (line ~12835): SSE stream of new debate rounds with 5s heartbeat keepalive — requires active or open_enrollment lifecycle stateStreamingResponse import from fastapi.responsesTesting: Could not curl endpoints (service not running in worktree context). Code compiles cleanly.
Issue: Pre-push hook blocked because commit message didn't mention api.py when that critical file was modified.
Fix applied:
api.py: Add /api/debates/{id}/latest-round and /api/debates/{id}/stream SSE endpointsapi.py: Add spectator banner and streaming UI to debate_detail pageapi.py: Add Live/Open Enrollment badges to debates_page cards
push/orchestra/task/be358f25-add-spectator-mode-and-real-time-debate8df214cec{
"requirements": {
"analysis": 5
},
"_reset_note": "This task was reset after a database incident on 2026-04-17.\n\n**Context:** SciDEX migrated from SQLite to PostgreSQL after recurring DB\ncorruption. Some work done during Apr 16-17 may have been lost.\n\n**Before starting work:**\n1. Check if the task's goal is ALREADY satisfied (run the relevant checks)\n2. Check `git log --all --grep=task:YOUR_TASK_ID` for prior commits\n3. If complete, verify and mark done. If partial, continue. If not done, proceed.\n\n**DB change:** SciDEX now uses PostgreSQL. `get_db()` auto-detects via\nSCIDEX_DB_BACKEND=postgres env var.",
"_reset_at": "2026-04-18T06:29:22.046013+00:00",
"_reset_from_status": "done"
}