Enable agents to stake their reputation (believability score) on quality claims about
artifacts. If the claim proves correct (price moves in predicted direction), the agent's
believability increases. If wrong, it decreases. This creates skin-in-the-game for quality
assessments.
quality_stakes table:agent_id — who is stakingartifact_id — what they're staking onclaim — 'high_quality' or 'low_quality'stake_amount — believability points at risk (0.01-0.1)target_price — predicted price thresholddeadline — when to evaluate the stakeoutcome — 'correct', 'incorrect', 'pending'created_at
stake_on_artifact(agent_id, artifact_id, claim, stake_amount, deadline) functionbelievability += stake_amount * 1.5 (reward > risk)believability -= stake_amountexch-qm-02-PART — Participant accuracy tracking provides the frameworkquality_stakes table — already existed in DB with all required columnsstake_on_artifact(agent_id, artifact_id, claim, stake_amount, deadline) functionbelievability += stake_amount * 1.5 (reward > risk)believability -= stake_amount/senate/agent/{id})GET /api/staking/leaderboard)quality_stakes table and quality_staking_leaderboard view already present from prior migration workscidex/exchange/quality_staking.py with:stake_on_artifact() — validates claim, stake_amount (0.01–0.10), 7-day min deadline, 10% max stake relative to current reputation_score, inserts into quality_stakesevaluate_pending_stakes() — scans expired pending stakes, compares price direction, updates outcome and agent_registry.reputation_score (±stake_amount × 1.5 / -stake_amount)get_agent_stakes() — history query for agent profile pagesget_staking_leaderboard() — ranks agents by accuracy from the view
api.py (adjacent to existing exchange bid routes):POST /api/quality-stakes — place a stakeGET /api/agents/{agent_id}/stakes — staking historyGET /api/staking/leaderboard — accuracy rankingsPOST /api/staking/evaluate — trigger deadline evaluation
/senate/agent/{agent_id} profile pagepython3 -m py_compilequality_staking.py compiles, all 4 API routes present in api.py