World of Statecraft

World of Statecraft is an open-source, federated governance platform that compiles a written constitution into running software — real PR-STV elections with cryptographic ballot secrecy, legislatures, courts, and a redistricting engine, operating over roughly 951,000 real-world jurisdictions from neighborhood to planet. I built it solo with a governed, AI-orchestrated workflow: 379 commits and about 230,000 lines of code, tests, and docs, including an 802-method test suite with 604 machine-enforced “constitutional pins.”

Compiling a Constitution Into Software

The Cosmopolitan Coalition had authored a complete constitution — elections, legislatures, courts, executives, and federation. The task was to turn that document into running, automatable software engineered to the standard of a real voting system: deterministic vote counting, cryptographic ballot secrecy, real-world geography, and a codebase where the constitution’s rules cannot be violated — even by the developer iterating at high velocity alongside AI.

Fountain pen writing a formal letter

What I Delivered

A voter casting a ballot into a ballot box

Certified-grade election engine

A deterministic PR-STV / RCV vote counter in exact fixed-point arithmetic with SHA-256-reproducible results — its semantics reverse-engineered from a 412,000-ballot real election and pinned by property-based tests.

A padlock over a circuit-board background

Cryptographic ballot secrecy

libsodium envelope encryption, salted commitment receipts, and side-channel mitigations rarely seen outside dedicated voting systems — down to re-clustering the database heap so rows can’t be correlated to voters.

World map with location pins

Planetary geospatial engine

A Python + PostGIS pipeline modeling ~951,000 real jurisdictions from neighborhood to planet — streaming multi-gigabyte GeoJSON and computing population in-database, from a Raspberry Pi to an HA cluster.

Laptop showing a map interface

Doctrine-driven redistricting

A multi-objective districting optimizer that codifies a documented human method, validated head-to-head against 81 hand-drawn maps and locked by regression tests named after real-world failure geographies.

Glowing network of connected nodes

Cryptographic federation

A peer-to-peer layer where sovereignty transfers safely — hash-chain-verified replication and a fail-closed handover that re-runs and re-verifies every election before it will adopt a new key.

Computer screen displaying code with a context menu.

A governed AI workflow

A CLAUDE.md “constitution” for the AI, protected-file registries, and 604 doctrine tests as the merge gate — team-scale velocity with election-grade rigor, built solo with Claude Code (Opus and Fable).

See the Code

Real links from the project — see the work for yourself.

Jurisdictions
0
Tests
0
Skills & Tools
0
Coding workstation with a laptop

The Impact

A working, open-source governance platform — 379 commits, ~230,000 lines of code, 802 tests — that runs real elections with certified-grade rigor over the planet’s geography, federates across independent servers, and hosts a self-hosted realtime civic commons on Matrix and WebRTC. It is the reference implementation of the coalition’s constitution, engineered to be trusted.

Software You Can Trust to Govern

Most civic apps are forms over a database. This is a constitution compiled into deterministic, cryptographically verifiable software — where an unconstitutional action is literally unrepresentable, and a solo developer’s governed AI workflow produced voting-system rigor at team scale. Designing the guardrails that made that safe is, arguably, the most transferable skill in the whole build.

Have a project like this?

Building something ambitious? Let’s engineer it to a standard you can actually trust.

More Projects

Coding workstation with a laptop
Web Development & Platforms

JDSileo.com Redesign & Platform Revamp

A ground-up revamp of my own platform: 123 case studies elevated into one design system, 170 branded archives, and a one-page site with a scored intake and live Teams booking — built AI-assisted with Claude Code (Opus & Fable).

Read More »