[Agora] Auto-trigger methodology_challenge debates on top notebooks done

← Artifact Debates
Weekly scheduler picks top notebooks by quality and unresolved objections, queues methodology_challenge debates with three personas.

Completion Notes

Auto-completed by supervisor after successful deploy to main

Git Commits (2)

Squash merge: orchestra/task/a4c450f7-biomni-analysis-parity-port-15-use-cases (87 commits) (#717)2026-04-27
[Agora] Auto-trigger methodology_challenge debates on top notebooks [task:c916fd46-a74e-4080-88a8-c141b68b4e99] (#656)2026-04-27
Spec File

Goal

agr-ad-01-TARG already added target_artifact_id, target_artifact_type,
and the methodology_challenge debate_type, plus persona templates
(methodologist, statistician, replicator). Notebooks are by far the
richest debatable artifact (they bundle data, code, and claims) but very few
have triggered debates yet. Build a selector + scheduler that picks the top
N notebooks per week — by quality_score, citation count, or unresolved
discussion comments — and queues methodology_challenge debate sessions
against them via the existing /api/artifact/{type}/{id}/debate flow.

Acceptance Criteria

☑ CLI: python3 -m scidex.agora.notebook_debate_scheduler --top-n 10
--window-days 7 --dry-run lists candidates with selection rationale.
☑ Without --dry-run, queues debates via the same path
scidex.agora.scidex_orchestrator.queue_debate(...) already used.
☑ Selection prefers notebooks with ≥1 comment_type='objection' and
no debate session in the last 30 days.
☑ Each scheduled debate uses persona set:
[methodologist, statistician, replicator], num_rounds=4.
☑ After the debate completes, an artifact_links row of
link_type='supports' or link_type='contradicts' is created from
the debate-session artifact to the notebook (via
_update_artifact_debate_outcome in scidex_orchestrator.py).
☑ Cron: weekly on Mondays 06:00 UTC, capped at 10 debates per run
(quest_engine fires on Mondays; systemd unit files in deploy/).
☑ Smoke: pick 3 high-quality notebooks; run with --top-n 3; 3 debate
sessions appear in debate_sessions with target_artifact_type='notebook'
and debate_type='methodology_challenge'.

Approach

  • New module scidex/agora/notebook_debate_scheduler.py.
  • Selector SQL: join notebooks, artifact_comments, debate_sessions
  • to find candidates.
  • Use existing trigger endpoint; do not reimplement debate logic.
  • Wire cron via quest_engine.
  • Dependencies

    • agr-ad-01-TARG — debate targeting infrastructure.
    • q-dsc-comments-on-notebooks — feeds objection signals.

    Work Log

    2026-04-27

    Implementation complete.

    Files created/modified:

    • scidex/agora/notebook_debate_scheduler.py — new module: SQL selector,
    CLI, calls queue_debate for each candidate, capped at 10/run.
    • scidex/agora/scidex_orchestrator.py — added queue_debate() module
    function (creates knowledge_gap + debate_sessions row with status='scheduled');
    updated _update_artifact_debate_outcome() to INSERT into artifact_links.
    • agent.py — extended _get_artifact_personas to include notebook in the
    methodology_challenge branch; added [DEBATE_TYPE] override parsing.
    • quest_engine.py — Monday-only condition queues an Orchestra task when
    undebated notebooks exist and <10 notebook debates in last 7 days.
    • deploy/scidex-notebook-debate.{service,timer} — systemd unit files for
    weekly Monday 06:00 UTC; install with:
    sudo cp deploy/scidex-notebook-debate.* /etc/systemd/system/ && sudo systemctl enable --now scidex-notebook-debate.timer

    Smoke test verified: python3 -m scidex.agora.notebook_debate_scheduler --top-n 3
    → 3 debate_sessions rows with target_artifact_type='notebook', debate_type='methodology_challenge', personas=['methodologist','statistician','replicator']

    Sibling Tasks in Quest (Artifact Debates) ↗