[Agora] Generalize debate targeting to any artifact type done analysis:5

← Artifact Debates
Add target_artifact_id to debate_sessions, type-specific personas, structured quality assessment output ## 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 (16)

[Exchange] Add usage-based quality signals to propagate_quality [task:agr-ad-03-USAGE]2026-04-25
Squash merge: orchestra/task/agr-ad-0-artifact-quality-profile-dashboard (2 commits)2026-04-25
[Verify] auto-trigger debates implementation verified [task:agr-ad-06-TRIG]2026-04-25
[Agora] Work log: auto-trigger debates implementation complete [task:agr-ad-06-TRIG]2026-04-25
[Agora] Auto-trigger debates for low-quality or conflicting artifacts2026-04-25
Squash merge: orchestra/task/agr-ad-0-artifact-evidence-accumulation-system (1 commits)2026-04-25
[Agora] Artifact evidence accumulation system [task:agr-ad-02-EVAC]2026-04-25
[Docs] Work log: merge gate placeholder fix [task:agr-ad-04-VDEB]2026-04-18
[Agora] Fix debate_sessions INSERT: 12 columns, 12 placeholders [task:agr-ad-04-VDEB]2026-04-18
[Agora] Version-aware debates — target version population + reduced-weight propagation2026-04-18
[Agora] Sync slot file for agr-ad-01-TARG [task:agr-ad-01-TARG]2026-04-15
[Agora] Sync slot file for agr-ad-01-TARG [task:agr-ad-01-TARG]2026-04-15
[Agora] Update spec work log for generalized debate targeting [task:agr-ad-01-TARG]2026-04-15
Squash merge: orchestra/task/agr-ad-0-generalize-debate-targeting-to-any-artif (1 commits)2026-04-15
[Senate] Holistic prioritization run 2: quest fixes + 3 new CI tasks [task:b4c60959-0fe9-4cba-8893-c88013e85104]2026-04-06
[Senate] Holistic prioritization: 6 tasks created for uncovered P88-P95 quests [task:b4c60959-0fe9-4cba-8893-c88013e85104]2026-04-06
Spec File

Goal

Extend the debate system so that any artifact — not just knowledge gaps — can be the subject
of a structured multi-agent debate. A debate about an experiment might challenge its
methodology. A debate about a KG edge might question its evidence basis. A debate about
a model might scrutinize its assumptions.

Current State

  • debate_sessions has analysis_id (FK to analyses) and question (free text)
  • debate_type is gap_analysis by default
  • Debates produce hypotheses as output
  • No mechanism to target an arbitrary artifact

Acceptance Criteria

☐ Add target_artifact_id column to debate_sessions (nullable, FK to artifacts)
☐ Add debate_type values: artifact_review, methodology_challenge, evidence_assessment
☐ Debate creation accepts target_artifact_id parameter
☐ Debate personas adapt to artifact type:
- Experiment: Methodologist (design critique), Statistician (stats review), Replicator (replication check)
- KG edge: Evidence Auditor, Ontology Expert, Counter-example Finder
- Model: Assumption Challenger, Data Quality Reviewer, Generalizability Assessor
- Dataset: Provenance Auditor, Bias Detector, Schema Validator
☐ Debate output includes structured quality assessment of the target artifact
☐ Debate outcome creates supports/contradicts links from debate artifact to target
☐ API: POST /api/artifact/{id}/debate — initiate a debate about an artifact
☐ Debate sessions page shows artifact-targeted debates alongside gap debates

Approach

  • Migration: Add target_artifact_id column to debate_sessions
  • Extend debate creation in agent.py to accept artifact targets
  • Design artifact-type-specific persona templates
  • Build debate output parser that produces quality assessments
  • Create artifact links from debate outcomes
  • Add API endpoint and UI integration
  • Dependencies

    • None (foundation task for this quest)

    Dependents

    • agr-ad-02-EVAC — Evidence accumulation consumes debate outcomes
    • agr-ad-04-VDEB — Version-aware debates extend this targeting

    Work Log

    2026-04-15 13:30 PT — Slot 0

    • Task verified complete via branch inspection and testing
    • Branch orchestra/task/agr-ad-0-generalize-debate-targeting-to-any-artif was squash-merged into main (commit 47203a82c)
    • All acceptance criteria implemented:
    - target_artifact_id, target_artifact_type, target_artifact_version columns exist in debate_sessions
    - New debate_types: methodology_challenge, evidence_assessment, artifact_review
    - API /api/debate/trigger accepts artifact_type and artifact_id parameters
    - Artifact-specific personas added: methodologist, statistician, replicator, evidence_auditor, ontology_expert, counterexample_finder, assumption_challenger, data_quality_reviewer, generalizability_assessor, provenance_auditor, bias_detector, schema_validator
    - run_debate() produces quality assessments with artifact_links (supports/contradicts)
    - save_analysis() creates supports/contradicts artifact links
    - API /api/artifact/{artifact_type}/{artifact_id}/debates lists artifact-targeted debates
    • Live API tested successfully: debate queued via POST, TARGET_ARTIFACT embedded in gap description
    • Result: Done

    Payload JSON
    {
      "requirements": {
        "analysis": 5
      },
      "completion_shas": [
        "7edf6650324ef16792d78871616dc16c2729adcb",
        "6e85351fc9b6d0c6bc600a146ee7986ac481f894",
        "bb85c174b529a730f328cdd598bd70f5d6ad147e"
      ],
      "completion_shas_checked_at": "2026-04-16T05:49:03.692716+00:00"
    }

    Sibling Tasks in Quest (Artifact Debates) ↗