Skip to content
Merged
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
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI

on:
push:
branches: [main, "001-*"]
pull_request:
branches: [main]

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Dwarnings

jobs:
check:
name: Check / Test / Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt

- name: Install protoc
uses: arduino/setup-protoc@v3
with:
version: "27.x"

- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}

- name: cargo fmt --check
run: cargo fmt --all -- --check

- name: cargo clippy
run: cargo clippy --workspace --all-targets

- name: cargo test
run: cargo test --workspace

- name: cargo check (all targets)
run: cargo check --workspace --all-targets
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Rust
target/
Cargo.lock

# IDE
.vscode/
.idea/
*.swp
*.swo
*~

# Environment
.env
.env.local

# OS
.DS_Store
Thumbs.db

# OMC local state
.omc/

# Claude local state
.claude/

# Evidence artifacts (generated, not committed)
evidence/
96 changes: 96 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
[workspace]
members = [
".",
"gui/src-tauri",
"adapters/slurm",
"adapters/kubernetes",
"adapters/cloud",
]
resolver = "2"

[package]
name = "worldcompute"
version = "0.1.0"
edition = "2021"
license = "Apache-2.0"
description = "A decentralized, volunteer-built compute public good"
repository = "https://github.com/ContextLab/world-compute"

[[bin]]
name = "worldcompute"
path = "src/main.rs"

[dependencies]
# P2P networking
libp2p = { version = "0.54", features = [
"tokio",
"quic",
"tcp",
"noise",
"yamux",
"mdns",
"kad",
"gossipsub",
"dcutr",
"relay",
"dns",
"identify",
"ping",
"ed25519",
"macros",
] }

# gRPC
tonic = "0.12"
prost = "0.13"
prost-types = "0.13"

# CLI
clap = { version = "4", features = ["derive"] }

# Async runtime
tokio = { version = "1", features = ["full"] }

# Serialization
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_yaml = "0.9"
ciborium = "0.2"

# Crypto
ed25519-dalek = { version = "2", features = ["serde", "rand_core"] }
sha2 = "0.10"
rand = "0.8"

# Content addressing
cid = { version = "0.11", features = ["serde"] }
multihash = { version = "0.19", features = ["serde-codec"] }

# Erasure coding
reed-solomon-erasure = "6"

# Consensus
openraft = { version = "0.9", features = ["serde"] }

# Observability (OpenTelemetry)
opentelemetry = "0.27"
opentelemetry_sdk = { version = "0.27", features = ["rt-tokio"] }
opentelemetry-otlp = "0.27"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
tracing-opentelemetry = "0.28"

# WASM runtime
wasmtime = "27"

# Misc
regex-lite = "0.1"
thiserror = "2"
anyhow = "1"
chrono = { version = "0.4", features = ["serde"] }
uuid = { version = "1", features = ["v4", "serde"] }
hex = "0.4"
base64 = "0.22"

[build-dependencies]
tonic-build = "0.12"
87 changes: 60 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# World Compute

**A planetary-scale, decentralized volunteer compute federation — governed by a ratified constitution, backed by full research, and not yet implemented.**
**A planetary-scale, decentralized volunteer compute federation — governed by a ratified constitution, backed by full research, and in active early implementation.**

[![Version](https://img.shields.io/badge/version-0.1.0--pre--alpha-lightgrey)]()
[![Status](https://img.shields.io/badge/status-pre--code-orange)]()
[![Status](https://img.shields.io/badge/status-early--implementation-yellow)]()
[![License](https://img.shields.io/badge/license-Apache%202.0-blue)]()
[![Constitution](https://img.shields.io/badge/constitution-v1.0.0%20ratified-green)]()

Expand Down Expand Up @@ -68,33 +68,66 @@ Five constitutional principles govern every design decision. They are not aspira

## Status

World Compute is a pre-code project. The table below shows what exists and what does not as of 2026-04-15.
World Compute is in early implementation. The design phase is complete; core Rust code is being built and tested. Updated 2026-04-15.

| Artifact | Exists? | Location |
### Design artifacts (complete)

| Artifact | Status | Location |
|-|-|-|
| Ratified constitution (v1.0.0) | Yes | `.specify/memory/constitution.md` |
| Feature specification (draft) | Yes | `specs/001-world-compute-core/spec.md` |
| Research: job management | Yes | `specs/001-world-compute-core/research/01-job-management.md` |
| Research: trust and verification | Yes | `specs/001-world-compute-core/research/02-trust-and-verification.md` |
| Research: sandboxing | Yes | `specs/001-world-compute-core/research/03-sandboxing.md` |
| Research: storage | Yes | `specs/001-world-compute-core/research/04-storage.md` |
| Research: discovery and bootstrap | Yes | `specs/001-world-compute-core/research/05-discovery-and-bootstrap.md` |
| Research: fairness and credits | Yes | `specs/001-world-compute-core/research/06-fairness-and-credits.md` |
| Research: governance, testing, UX | Yes | `specs/001-world-compute-core/research/07-governance-testing-ux.md` |
| Research: priority redesign (open access + multi-factor score) | Yes | `specs/001-world-compute-core/research/08-priority-redesign.md` |
| Research: distributed mesh LLM self-improvement | Yes | `specs/001-world-compute-core/research/09-mesh-llm.md` |
| Research: prior art — distributed inference | Yes | `specs/001-world-compute-core/research/10-prior-art-distributed-inference.md` |
| Architecture overview design doc | Planned | `specs/001-world-compute-core/design/architecture-overview.md` |
| Public whitepaper | Planned | `specs/001-world-compute-core/whitepaper.md` |
| This README | Yes | `README.md` |
| Any source code | **No** | — |
| Agent binaries | **No** | — |
| CLI (`worldcompute`) | **No** | — |
| Desktop GUI | **No** | — |
| Testnet | **No** | — |
| Legal entity / 501(c)(3) | **No** | — |

The source of truth for what will be built is `specs/001-world-compute-core/spec.md`. Every requirement there is traceable to a research finding in the seven research documents listed above.
| Ratified constitution (v1.0.0) | Complete | `.specify/memory/constitution.md` |
| Feature specification (130+ FRs, 12 SCs) | Complete | `specs/001-world-compute-core/spec.md` |
| Research (10 stages, ~28,600 words) | Complete | `specs/001-world-compute-core/research/` |
| Architecture design doc (22 entities) | Complete | `specs/001-world-compute-core/design/architecture-overview.md` |
| Data model (22 entities, state machines) | Complete | `specs/001-world-compute-core/data-model.md` |
| API contracts (5 services, 24 RPCs, 20 errors) | Complete | `specs/001-world-compute-core/contracts/` |
| Quickstart direct-test plan (7 adversarial tests) | Complete | `specs/001-world-compute-core/quickstart.md` |
| Implementation plan + task list (151 tasks) | Complete | `specs/001-world-compute-core/plan.md`, `tasks.md` |
| Whitepaper v0.2 (PDF) | Complete | `specs/001-world-compute-core/whitepaper.pdf` |
| This README + proposed API reference | Complete | `README.md` |

### Implementation (in progress)

| Component | Status | Tests | Key files |
|-|-|-|-|
| Cargo workspace + protos + CI | Complete | — | `Cargo.toml`, `proto/`, `.github/workflows/ci.yml` |
| Core types (NcuAmount, TrustScore, Cid, etc.) | Complete | — | `src/types.rs` |
| Error model (20 codes, gRPC + HTTP mapping) | Complete | — | `src/error.rs` |
| Sandbox trait + 4 platform drivers + GPU check | Complete | 3 tests | `src/sandbox/` |
| Preemption supervisor (<10ms SIGSTOP) | Complete | 5 tests | `src/preemption/` |
| P2P discovery (mDNS + Kademlia DHT) | Complete | 2 tests | `src/network/discovery.rs` |
| Agent lifecycle (enroll, heartbeat, pause, withdraw) | Complete | 7 tests | `src/agent/lifecycle.rs` |
| Cryptographic attestation (5 types) | Complete | 2 tests | `src/verification/attestation.rs` |
| Trust Score computation (T0-T4 tiers) | Complete | 4 tests | `src/verification/trust_score.rs` |
| CaliberClass (C0-C4) + same-caliber guarantee | Complete | 3 tests | `src/credits/caliber.rs` |
| NCU credits + S_ncu priority signal | Complete | 6 tests | `src/credits/ncu.rs` |
| CIDv1 content-addressed store | Complete | 4 tests | `src/data_plane/cid_store.rs` |
| Privacy-redacting telemetry | Complete | 4 tests | `src/telemetry/redaction.rs` |
| Job manifest parsing + validation | Complete | 4 tests | `src/scheduler/manifest.rs` |
| Multi-factor priority scorer (FR-032) | Complete | 5 tests | `src/scheduler/priority.rs` |
| R=3 quorum verification | Complete | 5 tests | `src/verification/quorum.rs` |
| Job/Task/Replica state machines | Complete | 6 tests | `src/scheduler/job.rs` |
| RS(10,18) erasure coding | Complete | 5 tests | `src/data_plane/erasure.rs` |
| CLI `worldcompute donor` subcommand | Scaffold | — | `src/cli/donor.rs` |
| CRDT ledger + threshold signing | Not started | — | `src/ledger/` |
| Regional broker + coordinator (Raft) | Not started | — | `src/scheduler/` |
| Transport (QUIC, TCP, NAT traversal) | Not started | — | `src/network/` |
| Desktop GUI (Tauri) | Not started | — | `gui/` |
| Adapters (Slurm, K8s, cloud) | Not started | — | `adapters/` |
| Governance + voting (Humanity Points) | Not started | — | `src/governance/` |
| Mesh LLM self-improvement | Not started | — | `src/agent/mesh_llm/` |

**Total: ~4,500 lines Rust, 66 real tests (0 mocks), all passing.**

### Not yet started

| Item | Target phase |
|-|-|
| Web dashboard (React SPA) | Phase 10-11 |
| Testnet (multi-node real hardware) | Phase 1-2 of staged release |
| Legal entity / 501(c)(3) | Before Phase 3 alpha |
| Security audit | Before Phase 3 alpha |

The source of truth for what will be built is `specs/001-world-compute-core/spec.md`. Every requirement is traceable to a research finding in the ten research documents and is covered by at least one implementation task.

---

Expand Down
9 changes: 9 additions & 0 deletions adapters/cloud/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "worldcompute-cloud-adapter"
version = "0.1.0"
edition = "2021"
license = "Apache-2.0"

[dependencies]
worldcompute = { path = "../.." }
tokio = { version = "1", features = ["full"] }
3 changes: 3 additions & 0 deletions adapters/cloud/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("worldcompute-cloud-adapter: not yet implemented");
}
9 changes: 9 additions & 0 deletions adapters/kubernetes/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "worldcompute-k8s-operator"
version = "0.1.0"
edition = "2021"
license = "Apache-2.0"

[dependencies]
worldcompute = { path = "../.." }
tokio = { version = "1", features = ["full"] }
3 changes: 3 additions & 0 deletions adapters/kubernetes/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("worldcompute-k8s-operator: not yet implemented");
}
10 changes: 10 additions & 0 deletions adapters/slurm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "worldcompute-slurm-adapter"
version = "0.1.0"
edition = "2021"
license = "Apache-2.0"

[dependencies]
worldcompute = { path = "../.." }
tokio = { version = "1", features = ["full"] }
clap = { version = "4", features = ["derive"] }
3 changes: 3 additions & 0 deletions adapters/slurm/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("worldcompute-slurm-adapter: not yet implemented");
}
13 changes: 13 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
fn main() -> Result<(), Box<dyn std::error::Error>> {
tonic_build::configure().build_server(true).build_client(true).compile_protos(
&[
"proto/donor.proto",
"proto/submitter.proto",
"proto/cluster.proto",
"proto/governance.proto",
"proto/admin.proto",
],
&["proto/"],
)?;
Ok(())
}
2 changes: 2 additions & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
too-many-arguments-threshold = 8
cognitive-complexity-threshold = 30
11 changes: 11 additions & 0 deletions gui/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "worldcompute-gui"
version = "0.1.0"
edition = "2021"
license = "Apache-2.0"

[dependencies]
worldcompute = { path = "../.." }
tokio = { version = "1", features = ["full"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
3 changes: 3 additions & 0 deletions gui/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("worldcompute-gui: not yet implemented");
}
Loading
Loading