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.
What I Delivered

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.

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.

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.

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.

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.

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).
Skills & Tools
The stack behind this build — tap any to see related work.
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.
Image credits: “Historical globe Austrian National Library Prunksaal Vienna 2024” by Furkan Akkurt (CC BY-SA 4.0) · “Ballot dropped into ballot box 2024 Swedish EU election at Stångenässkolan, Brastad” by W.carter (CC BY-SA 4.0)


