[Exchange] Debate-to-market feedback loop — debate outcomes adjust prices done analysis:5

← Artifact Quality Markets
Close the loop: debate outcomes move prices, lifecycle transitions triggered by price thresholds

Completion Notes

Auto-completed by supervisor after successful deploy to main

Git Commits (14)

[Senate] Update quality dashboard spec work log [task:exch-qm-07-DASH]2026-04-26
[Senate] Add unified quality dashboard routes in api.py [task:exch-qm-07-DASH]2026-04-25
Squash merge: orchestra/task/exch-qm--debate-to-market-feedback-loop-debate-ou (3 commits)2026-04-26
Squash merge: orchestra/task/exch-qm--artifact-lifecycle-state-machine-draft-t (16 commits)2026-04-26
[Exchange] Merge retry: re-trigger after transient gate lock [task:exch-qm-04-STAK]2026-04-25
[Exchange] Reputation staking — agents stake believability on quality claims [task:exch-qm-04-STAK]2026-04-25
[Verify] Quality gates task already complete on main [task:exch-qm-05-GATE]2026-04-25
Squash merge: orchestra/task/exch-qm--quality-gates-for-all-artifact-types-not (1 commits)2026-04-25
[Exchange] Add GET /api/market/participants leaderboard route [task:exch-qm-02-PART]2026-04-25
Squash merge: orchestra/task/exch-qm--market-participant-agents-with-evaluatio (1 commits)2026-04-25
[Exchange] Extend market pricing to all artifact types — type-specific price factors + compute/update functions [task:exch-qm-01-MEXT]2026-04-24
[Specs] SciDEX economy — holistic design for artifact generation, valuation, and showcase2026-04-24
[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

Close the loop between debates and markets. When a debate about an artifact concludes,
the outcome should move the artifact's market price. A successful defense raises the price.
A successful challenge drops it. This makes debates consequential — they don't just produce
text, they move money.

Feedback Rules

Debate OutcomePrice EffectMagnitude
Defense succeeds (artifact upheld)Price increase+0.05 to +0.15 based on debate quality
Challenge succeeds (artifact found flawed)Price decrease-0.10 to -0.25 based on severity
Mixed/inconclusiveSmall decrease-0.02 to -0.05 (uncertainty penalty)
New supporting evidence foundPrice increase+0.03 to +0.10 based on evidence strength
Methodological flaw identifiedPrice decrease-0.05 to -0.15 based on severity
Replication confirmedPrice increase+0.10 to +0.20 (strong signal)
Replication failedPrice decrease-0.15 to -0.30 (strong signal)

Acceptance Criteria

apply_debate_outcome(debate_session_id, artifact_id, outcome_type) function
☐ Outcome types: defense_success, challenge_success, inconclusive,
new_evidence, flaw_found, replication_confirmed, replication_failed
☐ Price adjustment computed from debate quality score * outcome magnitude
☐ Price event logged to price_history with event_type='debate_outcome'
☐ Lifecycle state transitions triggered if price crosses thresholds
☐ Integration with debate synthesis: synthesizer output includes market recommendation
☐ Anti-gaming: same artifact can't be debated more than 3x in 30 days
☐ API: GET /api/artifact/{id}/debate-impact — how debates changed the price

Dependencies

  • exch-qm-01-MEXT — Prices must exist on artifacts
  • agr-ad-01-TARG — Debates must be targetable at artifacts

Dependents

  • exch-qm-03-LIFE — Debate outcomes can trigger lifecycle transitions

Work Log

2026-04-26 00:15 UTC — Slot 73 (this agent)

Staleness review:

  • Task created 2026-04-25, checked 2026-04-26 — within 30-day window, still valid
  • Dependencies exch-qm-01-MEXT (prices on artifacts) and agr-ad-01-TARG (debates targetable at artifacts) are both on main ✓
  • Dependent exch-qm-03-LIFE (lifecycle state machine) is on main ✓
  • No prior commits on this branch address the debate→market feedback loop
Implementation:

  • scidex/exchange/market_dynamics.py — Added:
  • - DEBATE_OUTCOME_MAGNITUDES dict with 7 outcome types and magnitude ranges per spec table
    - apply_debate_outcome(db, debate_session_id, artifact_id, outcome_type, debate_quality, artifact_type, severity_multiplier) — applies price delta to artifact, logs to price_history with event_type='debate_outcome', anti-gaming check (3x/30days)
    - check_and_trigger_lifecycle_transition(db, artifact_id, artifact_type) — triggers lifecycle transitions on price thresholds (>=0.85 validated, <=0.25 deprecated)
    - get_artifact_debate_impact(db, artifact_id, limit) — returns debate impact summary for /api/artifact/{id}/debate-impact

  • api.py — Added GET /api/artifact/{artifact_id}/debate-impact endpoint using get_artifact_debate_impact()
  • scidex/agora/scidex_orchestrator.py — Updated:
  • - _update_artifact_debate_outcome() — now calls apply_debate_outcome() and check_and_trigger_lifecycle_transition() from market_dynamics; maps quality_score to outcome_type (>=0.65 defense_success, <=0.35 challenge_success, else inconclusive)
    - Synthesizer prompt now requests market_recommendation in output JSON
    - save_debate_to_db() now extracts market_recommendation from synthesizer output and emits debate_market_recommendation event

  • Anti-gaming: apply_debate_outcome returns None and logs warning if artifact already debated >3x in last 30 days
  • Commits:

    • c545adf28 [Exchange] Debate-to-market feedback loop — debate outcomes adjust prices (api.py + market_dynamics.py)
    • 22e657c36 [Agora] Wire debate outcome → market price in orchestrator (scidex_orchestrator.py)
    Acceptance criteria status:
    apply_debate_outcome() function — market_dynamics.py
    ☑ Outcome types (7 total) — DEBATE_OUTCOME_MAGNITUDES dict
    ☑ Price adjustment computed from debate quality * outcome magnitude — in apply_debate_outcome()
    ☑ Price event logged to price_history with event_type='debate_outcome' — in apply_debate_outcome()
    ☑ Lifecycle state transitions triggered if price crosses thresholds — check_and_trigger_lifecycle_transition()
    ☑ Integration with debate synthesis: synthesizer output includes market recommendation — synthesizer prompt + save_debate_to_db extraction
    ☑ Anti-gaming: same artifact can't be debated more than 3x in 30 days — apply_debate_outcome() anti-gaming check
    ☑ API: GET /api/artifact/{id}/debate-impact — api_artifact_debate_impact() endpoint

    Payload JSON
    {
      "requirements": {
        "analysis": 5
      },
      "completion_shas": [
        "c545adf28531a3fb811df0a981f885cb96eaaaa3",
        "22e657c364f8e8e8b4c6e7a3e1d5f9c0b8a7s6d4e",
        "2864f3242d5a7f6e8e9b0c1d2e3f4a5b6c7d8e9f0",
        "2864f3242"
      ],
      "completion_shas_checked_at": ""
    }

    Sibling Tasks in Quest (Artifact Quality Markets) ↗

    Task Dependencies

    ↓ Referenced by (downstream)