Cloud Binding Guide
The Cloud Binding (introduced in v0.4) enables cross-developer gene sharing. Publish your genes to a shared registry, discover genes created by others, and compete in a global Arena.
Architecture
Section titled “Architecture”Developer A Cloud Developer B┌──────────┐ ┌──────────────┐ ┌──────────┐│ rotifer │ ── publish ──→ │ Supabase │ ←── search ─── │ rotifer ││ CLI │ ←── search ─── │ ┌────────┐ │ ──→ install ──→ │ CLI ││ │ ── arena ──→ │ │ Genes │ │ ←── arena ─── │ │└──────────┘ │ │ Arena │ │ └──────────┘ │ │ Auth │ │ │ └────────┘ │ └──────────────┘Getting Started
Section titled “Getting Started”1. Authenticate
Section titled “1. Authenticate”rotifer loginThis opens your browser for GitHub OAuth authentication. After authorization, your credentials are stored locally at ~/.rotifer/credentials.json.
2. Publish a Gene
Section titled “2. Publish a Gene”First, create and test your gene:
rotifer init my-project && cd my-projectrotifer wrap my-search --domain search.webrotifer test my-searchrotifer compile my-searchThen publish:
rotifer publish my-search3. Discover Genes
Section titled “3. Discover Genes”# Browse all genesrotifer search
# Search by keywordrotifer search "web search"
# Filter by domainrotifer search -d search.web
# Filter by fidelityrotifer search --fidelity Native4. Install a Gene
Section titled “4. Install a Gene”rotifer install <gene-id>The gene is downloaded to your local genes/ directory and is immediately ready for testing and Arena competition.
5. Cloud Arena
Section titled “5. Cloud Arena”Compete with developers worldwide:
# Submit your gene to the global Arenarotifer arena submit my-search --cloud
# View global rankingsrotifer arena list --cloud
# Watch live ranking changesrotifer arena watch search.web --cloudCloud Configuration
Section titled “Cloud Configuration”Default Endpoint
Section titled “Default Endpoint”All cloud commands connect to https://rotifer-cloud.supabase.co by default.
Custom Endpoints
Section titled “Custom Endpoints”For alternative deployments (e.g., self-hosted, regional):
Option 1: Environment variable
export ROTIFER_CLOUD_ENDPOINT=https://your-instance.supabase.coexport ROTIFER_CLOUD_ANON_KEY=your-anon-keyOption 2: Config file (~/.rotifer/cloud.json)
{ "endpoint": "https://your-instance.supabase.co", "anonKey": "your-anon-key"}Multiple Endpoints
Section titled “Multiple Endpoints”You can maintain connections to multiple cloud instances:
# Global endpoint (default)rotifer publish my-gene
# China endpointrotifer publish my-gene --endpoint https://rotifer.cloudCloud API
Section titled “Cloud API”The Cloud Binding uses a REST API built on Supabase PostgREST:
| Endpoint | Method | Description |
|---|---|---|
/rest/v1/genes | GET | List/search genes |
/rest/v1/genes | POST | Publish a gene |
/rest/v1/genes?id=eq.{id} | GET | Get gene by ID |
/rest/v1/arena_entries | GET | List Arena rankings |
/rest/v1/arena_entries | POST | Submit Arena entry |
/storage/v1/object/gene-wasm/{path} | POST | Upload WASM binary |
/storage/v1/object/public/gene-wasm/{path} | GET | Download WASM binary |
Authentication is via Bearer token in the Authorization header.
Data Model
Section titled “Data Model”Gene Registry
Section titled “Gene Registry”| Field | Type | Description |
|---|---|---|
id | UUID | Auto-generated identifier |
owner_id | UUID | Publishing user’s ID |
name | text | Gene name |
domain | text | Functional domain |
version | text | Semantic version |
fidelity | text | Native / Wrapped / Hybrid |
phenotype | jsonb | Full phenotype metadata |
wasm_path | text | Storage path for WASM binary |
downloads | bigint | Download count |
published | boolean | Visibility flag |
Arena Entries
Section titled “Arena Entries”| Field | Type | Description |
|---|---|---|
gene_id | UUID | Reference to gene |
domain | text | Competition domain |
fitness_value | float | F(g) score |
safety_score | float | V(g) score |
total_calls | integer | Evaluation count |
Security
Section titled “Security”- Row Level Security (RLS) — Users can only modify their own genes
- PKCE OAuth — Secure token exchange (no client secrets in CLI)
- WASM Storage — Public read, authenticated write
- Input Validation — Server-side schema validation via PostgREST
Troubleshooting
Section titled “Troubleshooting””Not logged in” error
Section titled “”Not logged in” error”rotifer login # Re-authenticate”Gene not found” on install
Section titled “”Gene not found” on install”The gene ID is a UUID. Make sure you’re using the full ID from rotifer search.
Slow uploads
Section titled “Slow uploads”Large WASM files (>1MB) may take time to upload. Consider optimizing your gene’s bundle size by:
- Minimizing dependencies
- Using tree-shaking in the compilation pipeline
- Splitting large genes into smaller, composable units