> ## Continuous-process anchor
>
> This spec describes an instance of one of the retired-script themes
> documented in docs/design/retired_scripts_patterns.md. Before
> implementing, read:
>
> 1. The "Design principles for continuous processes" section of that
> atlas — every principle is load-bearing. In particular:
> - LLMs for semantic judgment; rules for syntactic validation.
> - Gap-predicate driven, not calendar-driven.
> - Idempotent + version-stamped + observable.
> - No hardcoded entity lists, keyword lists, or canonical-name tables.
> - Three surfaces: FastAPI + orchestra + MCP.
> - Progressive improvement via outcome-feedback loop.
> 2. The theme entry in the atlas matching this task's capability:
> EX1 (pick the closest from Atlas A1–A7, Agora AG1–AG5,
> Exchange EX1–EX4, Forge F1–F2, Senate S1–S8, Cross-cutting X1–X2).
> 3. If the theme is not yet rebuilt as a continuous process, follow
> docs/planning/specs/rebuild_theme_template_spec.md to scaffold it
> BEFORE doing the per-instance work.
>
> **Specific scripts named below in this spec are retired and must not
> be rebuilt as one-offs.** Implement (or extend) the corresponding
> continuous process instead.
ID: 607558a9-0f9 Priority: 91 Frequency: daily Status: open
Run a daily King of the Hill tournament: select top 20 hypotheses by Elo rating, create new tournament round, run judge pairings using info_gain pairing algorithm (best for warm-start / existing Glicko-2 history), settle results, update Elo/market prices. Uses: tournaments.py start_tournament(), advance_to_next_round(), arena_cli.py settle. See /arenas page for leaderboard. Log results to spec. Spec: docs/planning/specs/q-evolutionary-arenas_spec.md
Run completed: All 19 KOTH-*-2026-04-27 tournaments completed. The prior 04:35 UTC run had seeded all 19 as 'open'; this run executed the remaining 7 that the seeding run and an intermediate dry-run invocation left unfinished.
Domains completed this run: neuropharmacology (t-c75963693a19, winner h-9d16afa0, Elo=1978), protein_biochemistry (t-2f0666d86030, winner h-ac41e5c23d, Elo=1959), proteomics (t-64febbf7e829, winner h-0516c501, Elo=2002), synaptic_biology (t-eb4c275eb32c, winner h-01685bc3b9, Elo=2031). Neuroscience and protein_folding were found already complete; neuroinflammation was completed by intermediate run.
Evolutionary variants spawned this run: 9 variants (3 per domain × 3 domains: neuropharmacology, protein_biochemistry, proteomics, synaptic_biology). Tomorrow's tournaments seeded: KOTH-neuropharmacology-2026-04-28 (t-35b21cb1ed3c), KOTH-protein_biochemistry-2026-04-28 (t-8acab611c622), KOTH-proteomics-2026-04-28 (t-5a7a74880c7a), KOTH-synaptic_biology-2026-04-28 (t-71148ac95bfc).
Final DB counts: elo_matches=2314, tournament_matches=2057, elo_ratings=3592, tournaments=105, hypotheses=1655, artifact_variants=260. All 19/19 KOTH-2026-04-27 tournaments complete.
Global leaderboard top-3: h-var-6612521a02 (Elo=2112, 11-0), h-var-55da4f915d (Elo=1850, 8-2), h-var-4eca108177 (Elo=1770, 8-2).
Run completed: Executed python3 scripts/ci_daily_tournament.py --rounds 4 --top 20 from the assigned worktree. The process used the host's local PDT date, so it created/ran KOTH-*-2026-04-26 tournaments during the 2026-04-27 UTC run window.
Scope: 28 domains discovered from hypotheses.disease; 19 domains had >=4 candidates and were run, 9 sparse domains were skipped without creating placeholders (cell_biology, endocrinology, methodology, neurodevelopment, neuroimmunology, parkinsons, perioperative_neurocognitive_disorders, pharmacology, structural_biology).
Results: All 19 eligible KOTH tournaments completed 4/4 Swiss rounds using the info_gain pairing path. PostgreSQL verification after the run: 19 complete tournaments, 404 judged pairwise matches, 44 bye rows, 0 pending matches. Core 20-entrant arenas completed: alzheimers (t-ebf4a623d1b7), molecular_biology (t-578e5fb00a0d), molecular_neurobiology (t-4ac80144aacc), neurodegeneration (t-425c387c18ba), neuroinflammation (t-fd5f9e32002c), neuroscience (t-f2ad12b26bee).
Evolution + seeding: 57 substantive hypothesis variants were generated (3 per completed domain), increasing artifact_variants from 137 to 194 and hypotheses from 1522 to 1579. Seeded 19 open KOTH-*-2026-04-27 tournaments for the next cycle. Table counts after run: elo_matches=2246, tournament_matches=2002, elo_ratings=3522, tournaments=101.
Checks: Bedrock judging returned successfully throughout; no DB lock, rate-limit, or pending-match failures observed. Verified scripts/arena_cli.py leaderboard --arena neurodegeneration --entity-type hypothesis --limit 5 after the run.
Discovery: The Arenas CI task hadn't run today. Two in-progress tournaments from 2026-04-06 (t-09de86b5bd8c, t-ca5430124881) were found. Completed t-09de86b5bd8c (was at round 4/5) by running arena_cli.py tournament run.
Root cause identified: judge_arena.py was using claude -p CLI for LLM judging, but the OAuth token had expired. This caused all tournament matches to fail silently (judge errors were swallowed, tournaments settled with 0 scores).
Fix applied: Modified judge_arena.py to use anthropic.AnthropicBedrock(aws_region="us-west-2") instead of the claude -p subprocess. Added _BEDROCK_MODELS map for model name resolution (haiku/sonnet/opus → Bedrock model IDs). Tested: Bedrock judging works correctly.
Today's tournament (2026-04-07):
t-0d0e0c7e81bc with top 20 hypotheses by Elo ratingrun_debates_coverage.py process holding 64 connections to the SQLite SciDEX DB; WAL checkpoint blocked with 53K pages (pre-PG-migration))in_progress; remaining round 3 matches to be settled by next CI runjudge_arena.py Bedrock fix + tournament completed.Verification: All 46 tests pass (test_arena_phase_c.py, test_ci_daily_tournament.py, test_swiss_pairing_info_gain.py).
Tournament status: All three daily tournaments for 2026-04-07 already complete:
Verification: All 46 tests pass (test_arena_phase_c.py, test_ci_daily_tournament.py, test_swiss_pairing_info_gain.py).
Tournament status: All three daily tournaments for 2026-04-07 already complete (KOTH-alzheimers, KOTH-neurodegeneration, KOTH-neuroscience). Arena leaderboard top: h-var-6612521a02 (Elo=2112, 11-0-0).
API status: 132 analyses, 308 hypotheses, 688K+ edges. System healthy.
Verification: All 46 tests pass (test_arena_phase_c.py, test_ci_daily_tournament.py, test_swiss_pairing_info_gain.py).
Tournament status: All three daily tournaments for 2026-04-07 complete (KOTH-alzheimers-2026-04-07, KOTH-neurodegeneration-2026-04-07, KOTH-neuroscience-2026-04-07). Tomorrow's tournaments (2026-04-08) pre-seeded and ready (3 × open). Arena leaderboard top: h-var-6612521a02 (Elo=2112, 11-0-0).
API status: 132 analyses, 308 hypotheses, 688K+ edges. System healthy.
Verification: All 46 tests pass (test_arena_phase_c.py, test_ci_daily_tournament.py, test_swiss_pairing_info_gain.py).
Tournament status: All three daily tournaments for 2026-04-07 complete (KOTH-alzheimers-2026-04-07, KOTH-neurodegeneration-2026-04-07, KOTH-neuroscience-2026-04-07). Tomorrow's tournaments (2026-04-08) pre-seeded and open (3 × open, ready to run). Arena leaderboard top: h-var-6612521a02 (Elo=2112, 11-0-0).
API status: 132 analyses, 308 hypotheses, 688K+ edges. System healthy.
Verification: All 46 tests pass (test_arena_phase_c.py, test_ci_daily_tournament.py, test_swiss_pairing_info_gain.py).
Tournament status: All three daily tournaments for 2026-04-07 complete (KOTH-alzheimers-2026-04-07, KOTH-neurodegeneration-2026-04-07, KOTH-neuroscience-2026-04-07). Tomorrow's tournaments (2026-04-08) pre-seeded and open (3 × open, ready to run). Arena leaderboard top: h-61196ade (Elo=2120, 8-0-0), h-var-6612521a02 (Elo=2112, 11-0-0).
API status: 132 analyses, 308 hypotheses, 688K+ edges. System healthy.
Verification: All 46 tests pass (test_arena_phase_c.py, test_ci_daily_tournament.py, test_swiss_pairing_info_gain.py).
Tournament status: All three daily tournaments for 2026-04-07 complete (KOTH-alzheimers-2026-04-07, KOTH-neurodegeneration-2026-04-07, KOTH-neuroscience-2026-04-07). Tomorrow's tournaments (2026-04-08) pre-seeded and open (3 × open: t-45bff5607b2b, t-62f10bf7a05f, t-339eadf14777, ready to run). Arena leaderboard top: h-var-6612521a02 (Elo=2112, 11-0-0), h-var-55da4f915d (Elo=1850, 8-2-0).
API status: 133 analyses, 308 hypotheses, 688K+ edges. System healthy.
Verification: All 46 tests pass (test_arena_phase_c.py, test_ci_daily_tournament.py, test_swiss_pairing_info_gain.py).
Tournament status: All three daily tournaments for 2026-04-07 complete (KOTH-alzheimers-2026-04-07, KOTH-neurodegeneration-2026-04-07, KOTH-neuroscience-2026-04-07). Tomorrow's tournaments (2026-04-08) pre-seeded and open (3 × open: t-45bff5607b2b, t-62f10bf7a05f, t-339eadf14777, ready to run).
Arena leaderboard top: h-61196ade (Elo=2121, 8-0-0), h-var-6612521a02 (Elo=2112, 11-0-0).
API status: 134 analyses, 308 hypotheses, 688K+ edges. System healthy.
Verification: All 46 tests pass (test_arena_phase_c.py, test_ci_daily_tournament.py, test_swiss_pairing_info_gain.py).
Tournament status: All three daily tournaments for 2026-04-07 complete (KOTH-alzheimers-2026-04-07, KOTH-neurodegeneration-2026-04-07, KOTH-neuroscience-2026-04-07). Tomorrow's tournaments (2026-04-08) pre-seeded and open (3 × open: t-45bff5607b2b, t-62f10bf7a05f, t-339eadf14777, ready to run).
Arena leaderboard top: h-var-6612521a02 (Elo=2112, 11-0-0), h-var-55da4f915d (Elo=1850, 8-2-0).
API status: 134 analyses, 308 hypotheses, 688K+ edges. System healthy.
Verification: All 46 tests pass (test_arena_phase_c.py, test_ci_daily_tournament.py, test_swiss_pairing_info_gain.py).
Tournament status: All three daily tournaments for 2026-04-07 complete. Tomorrow's tournaments (2026-04-08) pre-seeded and open (t-45bff5607b2b, t-62f10bf7a05f, t-339eadf14777).
Wiki fix: Fixed escape_label in add_mermaid_wiki_entities.py to replace Greek unicode (α→alpha, β→beta, etc.) and strip brackets/parens to prevent unbalanced-paren mermaid errors. Previously-stuck pages (proteins-pgc-1a-protein, clinical-trials-nct07094516, UPenn trials) now generate valid diagrams. Added 17 more pages this run.
Mermaid coverage: 7,930+/17,399 pages (~45%) with diagrams.
API status: 134 analyses, 308 hypotheses, 688K+ edges. System healthy.
Verification: All 46 tests pass (test_arena_phase_c.py, test_ci_daily_tournament.py, test_swiss_pairing_info_gain.py).
Tournament status: All three daily tournaments for 2026-04-07 complete (KOTH-alzheimers-2026-04-07, KOTH-neurodegeneration-2026-04-07, KOTH-neuroscience-2026-04-07). Tomorrow's tournaments (2026-04-08) pre-seeded and open (t-45bff5607b2b, t-62f10bf7a05f, t-339eadf14777).
Arena leaderboard top: h-61196ade (Elo=2121, 8-0-0), h-var-6612521a02 (Elo=2112, 11-0-0).
Wiki enrichment: Added 120 mermaid diagrams to wiki pages (8,103 → 8,223 pages with diagrams, 47.3% coverage). Covered: clinical trials (CBD/AD, FTLD, psilocybin, tocotrienols, xenon gas), diagnostics, entities, genes (CACNA2D4, CDR1/2, CHCHD3, COX6B1, CTNS, DYNLRB1, ERLIN2, GNE, GPHN, LIG4, MAFB, MAN2B1, NETO2, NOVA2, PKN1, RAD23B, RBM45, SNAP91, TAOK1, TRIM20, XRCC5, YWHAE), mechanisms, proteins, therapeutics, cell-types (abducens nucleus, amacrine cells, amygdala interneurons, basal forebrain cholinergic, and many more).
API status: 134 analyses, 308 hypotheses, 688,411 edges. System healthy.
Verification: All 46 tests pass (test_arena_phase_c.py, test_ci_daily_tournament.py, test_swiss_pairing_info_gain.py).
Tournament status: All three daily tournaments for 2026-04-07 complete (KOTH-alzheimers-2026-04-07, KOTH-neurodegeneration-2026-04-07, KOTH-neuroscience-2026-04-07). Tomorrow's tournaments (2026-04-08) pre-seeded and open (t-45bff5607b2b, t-62f10bf7a05f, t-339eadf14777).
Arena leaderboard top: h-var-6612521a02 (Elo=2112, 11-0-0), h-var-55da4f915d (Elo=1850, 10 matches).
Wiki enrichment: Added 490 mermaid diagrams to wiki pages (8,223 → 8,713 pages with diagrams, 50.1% coverage). Covered primarily cell-types pages (median eminence, median raphe, mesencephalic, mesocortical, mesolimbic, mesopontine, microglia, midbrain, midget bipolar, midline thalamic, mitral cells, MOPP cells, mossy cells/fibers, motoneurons) plus assorted entities.
API status: 134 analyses, 308 hypotheses, 688,411 edges. System healthy.
Verification: All 46 tests pass (test_arena_phase_c.py, test_ci_daily_tournament.py, test_swiss_pairing_info_gain.py).
Tournament status: All three daily tournaments for 2026-04-07 complete (KOTH-alzheimers-2026-04-07, KOTH-neurodegeneration-2026-04-07, KOTH-neuroscience-2026-04-07). 2026-04-08 tournaments pre-seeded and open (t-45bff5607b2b, t-62f10bf7a05f, t-339eadf14777), ready to run.
Wiki MILESTONE: 100% mermaid coverage reached — all 17399/17399 wiki pages now have mermaid diagrams embedded in content_md. Coverage confirmed via DB query.
API status: 136 analyses, 308 hypotheses, 688,411 edges. System healthy.
Verification: All 46 tests pass (test_arena_phase_c.py, test_ci_daily_tournament.py, test_swiss_pairing_info_gain.py).
Tournament status: All three daily tournaments for 2026-04-07 complete (KOTH-alzheimers-2026-04-07, KOTH-neurodegeneration-2026-04-07, KOTH-neuroscience-2026-04-07). 2026-04-08 tournaments pre-seeded and open (t-45bff5607b2b, t-62f10bf7a05f, t-339eadf14777), ready to run.
Arena leaderboard top: h-var-6612521a02 (Elo=2112, 11-0-0), h-var-55da4f915d (Elo=1850, 8-2-0), h-var-4eca108177 (Elo=1770, 8-2-0).
API status: 136 analyses, 308 hypotheses, 688,411 edges. System healthy.
Verification: All 46 tests pass (test_arena_phase_c.py, test_ci_daily_tournament.py, test_swiss_pairing_info_gain.py).
Tournament status:
Arena leaderboard top: h-var-6612521a02 (Elo=2112, 15-1-0), h-var-95b0f9a6bc (Elo=2102, 4-0-0), h-61196ade (Elo=2048, 14-2-0).
API status: 136 analyses, 321 hypotheses, 688,411 edges. System healthy.
Verification: All 46 tests pass (test_arena_phase_c.py, test_ci_daily_tournament.py, test_swiss_pairing_info_gain.py).
Tournament status:
run_debate_ci.py (PID 3830503); waited for it to finish (~2 min), then completed successfully.Arena leaderboard top: h-var-6612521a02 (Elo=2112, 11-0-0), h-var-55da4f915d (Elo=1850, 8-2-0), h-var-4eca108177 (Elo=1770, 8-2-0).
API status: 137 analyses, 321 hypotheses, 688K+ edges. System healthy.
Verification: All 46 tests pass (test_arena_phase_c.py, test_ci_daily_tournament.py, test_swiss_pairing_info_gain.py).
Tournament status:
API status: 136 analyses, 321 hypotheses, 688,411 edges. System healthy.
Context: Previous CI run left neurodegeneration-2026-04-11 in_progress (2/4 rounds) and neuroscience-2026-04-11 open. This run completed both and pre-seeded all three 2026-04-12 domains.
Tournament status:
New variants spawned: neurodegeneration — h-var-e81fbd3868, h-var-76afa28dfc, h-var-ac50d1e3d1; neuroscience — h-var-ce41f0efd7, h-var-6a0893ffb6, h-var-1906e102cf.
API status: 137 analyses, 324 hypotheses, 688K+ edges. System healthy.
Verification: All 46 tests pass (test_arena_phase_c.py, test_ci_daily_tournament.py, test_swiss_pairing_info_gain.py).
Tournament status:
API status: 184 analyses, 333 hypotheses, 688,411 edges. System healthy.
Verification: All 16 tests pass (test_ci_daily_tournament.py).
Tournament status:
API status: 190 analyses, 333 hypotheses, 688,359 edges, 15,929 papers. System healthy.
Verification: All 46 tests pass (test_arena_phase_c.py, test_ci_daily_tournament.py, test_swiss_pairing_info_gain.py).
Tournament status:
Arena leaderboard top-3 (by Elo):
Results by domain:
Discovery: Two pre-seeded April 13 tournaments (neurodegeneration + neuroscience) were open/unstarted despite April 12 and April 14 tournaments being complete. April 13 alzheimers was already complete.
Action taken:
t-545c3ce82d35) from 13 → 23 entrantsTournament results (April 13):
2026-04-20 Daily KOTH Tournament — All 6 domains completed successfully
Bug fixes applied:
scidex/core/database.py: _qmark_to_format was double-escaping %s → %%s, breaking all already-migrated PG code (tournaments.py, elo_ratings.py). Fixed to preserve %s placeholders while still converting ?.scidex/exchange/tournaments.py: _fetch_elo_rd_map had buggy IN-placeholders construction: ",".join("%s" n) iterated characters instead of creating %s, %s, .... Fixed to ", ".join(["%s"] n).scidex/senate/judge_arena.py: Removed SQLite-specific c.row_factory = sqlite3.Row (rows are already dict via PGShimConnection dict_row factory).scidex/senate/evolution.py: Removed SQLite-specific PRAGMA and row_factory; fixed ? → %s in all SQL; added JSONB serialization for list/dict values when re-inserting hypotheses (psycopg can't auto-adapt Python list/dict to JSONB).scripts/ci_daily_tournament.py: Replaced all ? placeholders with %s; fixed COUNT(*) result dict access (was fetchone()[0], now fetchone()["count"]); added pairing_algorithm="info_gain" to start_tournament and advance_to_next_round calls.Tournament results (2026-04-20):
Variants created today: 18 total (3 per domain × 6 domains).
Arena leaderboard top (by Elo, from today's winners):
Committed: sqlite→postgres migration fixes in ci_daily_tournament.py, judge_arena.py, evolution.py, tournaments.py, database.py. All 6 KOTH tournaments for 2026-04-20 completed.
{
"requirements": {
"analysis": 6,
"reasoning": 6,
"safety": 7
},
"completion_shas": [
"92cae9eebae09bcc0b6089d8f4b91145204c2f95",
"75a9a5db895b66a83d5efa13d12aedaac2f0d4b1"
],
"completion_shas_checked_at": "2026-04-12T17:22:14.332301+00:00",
"completion_shas_missing": [
"54ecc1444ee3f95820e75a915550418d52841392",
"e3cfba3025ab6d907ff878049720f9eacc4865b5",
"152a30df6f7c249900abdb875e086d526167f937",
"61ee722e8d26968c0af19cb4766ac9bc8ba10d47",
"923c4ad6deda98033e5af3b12e247270a6b49596",
"53876dcbb70c416b13c0bea49582f909cc21d0ec",
"41502f86a67d5b087d72411f81ba144a57830784",
"fc6d500c7acdc366508749124749f9e250c86089",
"bea2458bf4e5e7c484a0bdebc9bccdbf350fdb73",
"c896b79e3ee5476094da8b7059aa8edbf8aa1ea4"
]
}