[Agora] Fix hypothesis status promotion: proposed→active to unblock 70h Elo stall done coding:8 reasoning:7

← Agora
The Elo tournament (607558a9) has been stalled 70h because it requires hypotheses in 'active' or 'reviewed' status, but 338/349 hypotheses are stuck in 'proposed'. Task 11c2b20c was noted as running in run 44 but is absent from the task DB — the fix was never applied. This task must: (1) audit the hypothesis status state machine in api.py to find the promotion trigger, (2) identify why 'proposed' hypotheses are not being promoted to 'active' after debate, (3) fix the transition logic (likely in the debate completion handler or a missing scheduled promoter), (4) verify Elo matches resume after fix. DO NOT change api.py unless task title explicitly names it. Read the debate session completion handler and hypothesis status update logic first. ## REOPENED TASK — CRITICAL CONTEXT This task was previously marked 'done' but the audit could not verify the work actually landed on main. The original work may have been: - Lost to an orphan branch / failed push - Only a spec-file edit (no code changes) - Already addressed by other agents in the meantime - Made obsolete by subsequent work **Before doing anything else:** 1. **Re-evaluate the task in light of CURRENT main state.** Read the spec and the relevant files on origin/main NOW. The original task may have been written against a state of the code that no longer exists. 2. **Verify the task still advances SciDEX's aims.** If the system has evolved past the need for this work (different architecture, different priorities), close the task with reason "obsolete: " instead of doing it. 3. **Check if it's already done.** Run `git log --grep=''` and read the related commits. If real work landed, complete the task with `--no-sha-check --summary 'Already done in '`. 4. **Make sure your changes don't regress recent functionality.** Many agents have been working on this codebase. Before committing, run `git log --since='24 hours ago' -- ` to see what changed in your area, and verify you don't undo any of it. 5. **Stay scoped.** Only do what this specific task asks for. Do not refactor, do not "fix" unrelated issues, do not add features that weren't requested. Scope creep at this point is regression risk. If you cannot do this task safely (because it would regress, conflict with current direction, or the requirements no longer apply), escalate via `orchestra escalate` with a clear explanation instead of committing.

Completion Notes

Auto-completed by supervisor after successful deploy to main

Git Commits (5)

[Senate] Prioritization review run 47: Elo stall resolved, JSON parse fix task created [task:dff08e77-5e49-4da5-a9ef-fbfe7de3dc17]2026-04-12
[Agora] Fix hypothesis status promotion: proposed->debated, resume stuck Elo tournaments [task:e283ad4b-2308-499d-aeca-ec46bdfd0a81]2026-04-12
[Senate] Weekly retrospective cycle 26 — alignment gap audit [task:610c708a-70b3-46ee-a56b-a936b3720ac5]2026-04-12
[Senate] Prioritization review run 46: boost analysis fix P95, create hypothesis promotion task [task:dff08e77-5e49-4da5-a9ef-fbfe7de3dc17]2026-04-12
[Senate] Prioritization review run 45: boost analysis fix P95, create hypothesis promotion task [task:dff08e77-5e49-4da5-a9ef-fbfe7de3dc17]2026-04-12
Spec File

Spec: [Agora] Fix hypothesis status promotion: proposed→debated to unblock 70h Elo stall

Task ID: e283ad4b-2308-499d-aeca-ec46bdfd0a81

Problem

The Elo arena (KOTH daily tournament) has stalled 70h with no new matches. Two
tournaments (KOTH-neurodegeneration-2026-04-14, KOTH-neuroscience-2026-04-14)
are stuck in_progress with 10 + 7 pending matches respectively.

Root causes identified via code audit (2026-04-12):

Root Cause 1 — Wrong target status in quality-gate promotion (api.py)

The code added by task 11c2b20c promotes proposed -> 'promoted'. But the hypotheses.status CHECK constraint only allows: ('proposed','debated','funded','investigating','validated','refuted','archived')

'promoted' is NOT valid. The UPDATE silently fails (wrapped in except Exception: pass). 0 hypotheses were ever promoted this way.

Root Cause 2 — Debate completion handler doesn't update status (post_process.py)

In post_process.py, the debate-linking block (lines ~1158-1188) inserts into hypothesis_debates but the UPDATE used a broken WHERE clause: debate_count < 1 which never fires (default is 1). And status was never set.
After a debate session completes, hypotheses remain 'proposed' indefinitely.

Current state: 338 proposed, 10 debated, 1 archived (before backfill).
142 hypotheses are in hypothesis_debates (debated) but still 'proposed'.

Root Cause 3 — CI only processes today's date (ci_daily_tournament.py)

run_domain() checks KOTH-<domain>-<date.today()>. Stuck tournaments from
other dates are never resumed. The April 14 stuck tournaments won't be touched
until April 14 arrives.

Goal

  • Fix post_process.py so debate completion sets status proposed -> debated.
  • Backfill: promote 142 existing proposed+debated hypotheses to debated.
  • Fix ci_daily_tournament.py to resume any stuck in_progress tournament
  • when today's tournament for that domain is already complete.
  • Verify: new Elo matches generated for the stuck domains.
  • Acceptance Criteria

    post_process.py updated: debate-link block sets status='debated' when status='proposed'
    promote_hypotheses.py backfill script created
    ☑ Backfill run: 142 proposed->debated promoted; final: 196 proposed, 152 debated
    ci_daily_tournament.py updated: checks for stuck in_progress tournaments and resumes
    ☑ Spec file created
    ☐ CI next run generates new Elo matches for neurodegeneration + neuroscience domains

    Approach

    Fix 1 — post_process.py debate-link block

    Replace the broken UPDATE ... WHERE debate_count < 1 with:

    UPDATE hypotheses
    SET status = CASE WHEN status = 'proposed' THEN 'debated' ELSE status END,
        last_debated_at = datetime('now'),
        origin_type = 'gap_debate'
    WHERE id = ?

    This is safe: only promotes proposed -> debated; leaves funded, investigating, validated, etc. untouched.

    Fix 2 — promote_hypotheses.py backfill

    SELECT DISTINCT h.id FROM hypotheses h
    JOIN hypothesis_debates hd ON h.id = hd.hypothesis_id
    WHERE h.status = 'proposed'
    -- UPDATE hypotheses SET status='debated' WHERE id=?

    Fix 3 — ci_daily_tournament.py resume stuck tournaments

    When today's tournament is complete/skipped, check for any stuck in_progress
    tournament in the same domain and resume it (run rounds + settle + seed tomorrow).

    Work Log

    2026-04-12 — Initial implementation [task:e283ad4b-2308-499d-aeca-ec46bdfd0a81]

    Audit findings:

    • hypotheses.status CHECK constraint: ('proposed','debated','funded','investigating','validated','refuted','archived')
    • 'active', 'reviewed', 'promoted' are NOT valid values for hypotheses.status
    • 338 proposed, 10 debated, 1 archived (before backfill)
    • 142 hypotheses appear in hypothesis_debates but still 'proposed'
    • Two April 14 KOTH tournaments: stuck in_progress, 10+7 pending matches
    • ci_daily_tournament.py selection uses composite_score only - no status filter
    • The Senate's "needs active/reviewed" inference was incorrect; real issues above
    Changes made:
  • post_process.py lines ~1170-1174: replaced broken debate_count update with status promotion
  • promote_hypotheses.py: created backfill script at repo root
  • ci_daily_tournament.py: added stuck-tournament resume logic in run_domain()
  • Ran backfill: promoted 142 proposed -> debated (final: 196 proposed, 152 debated, 1 archived)
  • Payload JSON
    {
      "requirements": {
        "coding": 8,
        "reasoning": 7
      },
      "completion_shas": [
        "3c862c1894338754daf063f4b75a7cb5e7dc382a"
      ],
      "completion_shas_checked_at": "2026-04-13T20:20:31.895444+00:00"
    }

    Sibling Tasks in Quest (Agora) ↗