Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions scientific-bounty-system/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PORT=3001
SCIBASE_BOUNTY_DEMO_MODE=true
ESCROW_PROVIDER=stripe_treasury_demo
ARBITRATION_SECRET=demo-arbitration-secret
PAYOUT_APPROVER_EMAIL=operations@scibase.ai
5 changes: 5 additions & 0 deletions scientific-bounty-system/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
dist/
coverage/
.env
.DS_Store
77 changes: 77 additions & 0 deletions scientific-bounty-system/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# SCIBASE.AI Scientific Bounty System

Self-contained implementation for issue #18. The module turns SCIBASE into a research challenge marketplace with sponsor-funded prizes, standardized submissions, arbitration, and payout routing.

## What is included

- Challenge posting data model with scientific context, visibility, NDA flag, IP terms, milestones, and rubrics
- R&D templates across biotech, climate, ML, materials, chemistry, and quantum domains
- Submission package builder with artifact hashes, reproducibility commands, audit logs, and team payout shares
- Automated arbitration using weighted reviewer criteria and package-validity checks
- Escrow validation to ensure prize funds are available before a challenge is accepted
- Payout routing across solver team members with release conditions and IP-transfer handling
- Sponsor dashboard UI plus JSON APIs for challenge review, arbitration, and payout previews
- Tests for challenge validation, manifest creation, scoring, arbitration, incomplete-package rejection, payout splitting, and service workflows

## Run locally

```bash
cd scientific-bounty-system
npm install
npm run dev
```

Open `http://localhost:3001`.

## Verify

```bash
npm run typecheck
npm test
npm run build
```

## Demo API

Sponsor dashboard:

```bash
curl -s http://localhost:3001/api/dashboard | jq .
```

Run arbitration:

```bash
curl -s http://localhost:3001/api/arbitration/challenge_biomarker_rna | jq .
```

Build payout instructions:

```bash
curl -s http://localhost:3001/api/payouts \
-H 'content-type: application/json' \
-d '{"challengeId":"challenge_biomarker_rna"}' | jq .
```

## Demo artifact

- `docs/demo/dashboard.png`
- `docs/demo/scientific-bounty-system-demo.mp4`

The MP4 is intentionally small so it can be linked directly from a pull request while still showing the runnable sponsor dashboard.

## Production integration notes

The module isolates the risky workflows behind explicit service methods:

- `validateChallenge` prevents underfunded or malformed challenges from opening.
- `createSubmissionManifest` records artifact hashes, reproducibility commands, and team payout splits.
- `arbitrateChallenge` ranks submissions using the challenge rubric, then checks the winning package before payout.
- `buildPayoutInstruction` maps solver shares to payout routes and release conditions, including IP assignment when required.

Recommended production follow-ups:

- Persist challenges, submissions, reviews, escrow records, and payouts in the SCIBASE database.
- Connect escrow state to Stripe Treasury, bank partner APIs, or institutional invoice reconciliation.
- Add sponsor/reviewer authentication and immutable audit logs.
- Add file scanning, malware checks, and sandboxed reproducibility execution before arbitration approval.
20 changes: 20 additions & 0 deletions scientific-bounty-system/docs/demo-script.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Demo script

1. Start the app with `npm run dev`.
2. Open `http://localhost:3001`.
3. Show the sponsor dashboard metrics:
- Open challenges
- Escrowed prizes
- Submissions
- Ready winners
4. Click `Run arbitration` on the biomarker challenge.
5. Show the arbitration result:
- Weighted ranking
- Winner
- Automated checklist
- Human approval flag
6. Show the payout instruction:
- Team member payout routes
- IP release condition
- Sponsor approval requirement
7. Run `npm test` to verify the core workflows.
Binary file added scientific-bounty-system/docs/demo/dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading