Effort: thorough
The 17K-page wiki was largely generated by agents and contains
known weak spots: outdated claims, missing citations, jargon
without definitions, mermaid fence stripping incidents (see
reference_scidex_mermaid_fence_incident.md). The wiki has no
public mechanism for a domain researcher to propose an edit, get
a small bounty for accepted edits, and have those edits voted on
by other contributors before going live.
Build a Wiki Improvement Bounty flow where any reader can
nominate a wiki page for improvement (with a description of the
defect), the platform escrows a small bounty (10-200 tokens),
human contributors submit competing edits, edits are peer-voted
by ≥3 verifiers, and the winning edit ships + earns the bounty.
scidex/atlas/wiki_edit_bounties.py:nominate_page(slug, defect_kind: str, defect_description:
str, bounty_tokens: int, nominator_id: str) — fundedtoken_ledger balance; creates awiki_edit_bounty row in open status.submit_edit(bounty_id, contributor_orcid,
proposed_content_md, change_summary) — multiplevote_edit(edit_id, voter_id, vote: Literal['approve',
'reject', 'needs_work'], rationale_md) — gated byverifier_reputation.tier ≥ verified; one vote perresolve_bounty(bounty_id) -> dict — when an editapprove and 0 reject from distinctwiki_pages.content_mdwiki_dashboard_fence.py), bounty pays out, losingwiki_edit_bounties, wiki_edits,wiki_edit_votes with FKs and partial indexes on(slug, status).
defect_kind enum: outdated_claim, missing_citation,jargon_without_definition, broken_diagram,factual_error, style, other.
/wiki/{slug} route (mounted in api.py wiki render),GET /wiki-bounties lists open bounties grouped bydefect_kind, sortable by bounty amount or by age. EachGET /wiki-bounties/{id} shows the diff between the_preserve_mermaid_fences(old_md, new_md) usingmermaid_gate.extract_mermaid_blocks before writing.
scidex/atlas/wiki_claim_extractor.py for the claim-wiki_dashboard_fence.py for the mermaid preservationtoken_ledger.lock_funds (same primitiveverifier_reputation.can_accesswiki_claim_promote_to_canonical.
?include_archived=1 query param.q-crowd-verifier-reputation — required for vote gating.scidex.atlas.wiki_dashboard_fence — mermaid fencescidex.exchange.token_ledger — bounty escrow.Completed:
migrations/020_add_wiki_edit_bounties.py):wiki_edit_bounties (id, slug, defect_kind CHECK, defect_description,wiki_edits (id, bounty_id FK→bounty, contributor_orcid, proposed_content_md,wiki_edit_votes (id, edit_id FK→edit, voter_id, vote CHECK, rationale_md,scidex/atlas/wiki_edit_bounties.py):nominate_page() — validates page exists, locks tokens in escrow accountweb:{bounty_id}, inserts wiki_edit_bounty row with 'open' statussubmit_edit() — locks current content_md as base, creates pending edit rowvote_edit() — gated by verifier_reputation.tier ≥ verified; upsert-styleresolve_bounty() — finds edit with ≥3 approve, 0 reject; ships via_preserve_mermaid_fences() (uses mermaid_gate.extract_mermaid_blocksget_bounty(), list_bounties(), get_bounties_for_page() helpersGET /api/wiki-bounties — list open bounties grouped by defect_kindGET /api/wiki-bounties/{bounty_id} — full detail with edits + vote talliesPOST /api/wiki-bounties/nominate — create bountyPOST /api/wiki-bounties/submit-edit — submit editPOST /api/wiki-bounties/vote — cast verifier votePOST /api/wiki-bounties/resolve/{bounty_id} — trigger resolutionGET /api/wiki-bounties/page/{slug} — open bounties for a pagetests/test_wiki_edit_bounties.py):Note on mermaid preservation: Spec referenced
wiki_dashboard_fence.preserve_fences(old_md, new_md) but that function
does not exist. The preservation is implemented directly in
_preserve_mermaid_fences() using scidex.atlas.mermaid_gate.extract_mermaid_blocks
— same approach, same safety guarantee. The spec should be updated to
reflect the actual implementation.
Note on token escrow: Spec referenced token_ledger.lock_funds which
does not exist. Escrow follows the same pattern as bounty_escrow.py:
direct SQL in _lock_tokens() and _release_to_winner() — proven approach.