Introducing civilsort

I often say that I am a single-issue voter. I'm half-kidding, but that means I'm also half-serious: I think a lot of the problems we see in our political process are a result of polarization from first-past-the-post voting.

Maybe it's naive, but I have a lot of hope for ranked-choice voting systems. In the most recent election, when neither major candidate was sufficiently able to rise above my cynicism, I voted for the Approval Voting Party candidate as a protest vote.

But people don't have enough experience with alternative voting systems. Voting for who you like, and selecting whoever got the most votes, just seems intuitive and familiar to most people. By contrast, ranked-choice voting systems seem strange and complex to many people, and that makes it difficult for many people to trust them.

Alternative voting systems, like ranked-choice or instant-runoff systems, are substantially more complex to tally, and that makes them legitimately impractical for hand-tabulated elections. Official elections shouldn't have a problem using available software to tabulate from ranked ballots, but to change people's experiences I wanted to have software that was easy to call up and use whenever a group of friends is deciding where to go for dinner. Or what to watch on movie night. Or what board game to play.

I've wanted to try building something like this for a while, but I never committed enough time to it to make it usable by the general audience that I want it to serve. (Implementing a voting algorithm is easy enough, but I don't have as much experience with frontend web development, and people's expectations for user interfaces have only increased over time.) But with agentic coding tools as capable as they are now, this seemed like a good opportunity to see just how far I could get without actually doing the programming myself.

The result of this experiment is civilsort, a small web application for making group decisions, which I'm hosting at civilfritz.net.

How it works

civilsort computes its results using the Schulze method, a ranked voting method devised by Markus Schulze and also known as "beatpath." It considers every pair of items head-to-head and counts how many voters prefer each one over the other. If one item beats every other item in these pairwise contests, it wins.

This doesn't always produce a clear winner: group preferences can be cyclic even when every individual's preferences are perfectly consistent. Consider nine voters choosing among three items:

  • 4 voters rank A > B > C

  • 3 voters rank B > C > A

  • 2 voters rank C > A > B

Head-to-head, A beats B 6–3, B beats C 7–2, and C beats A 5–4. Every item loses to some other item, so there's no winner.

The Schulze method resolves this by looking at paths between items. A path from A to C through B is only as strong as its weakest link, so A reaches C with strength 6 (the lesser of A's 6 votes over B and B's 7 votes over C), while C's direct win over A has only strength 5. Computing the strongest path between every pair of items, the final result is A > B > C.

The Schulze method is a particularly good fit for group decisions:

  • Incomplete rankings are fine. You don't have to rank everything. Items you rank are preferred over items you don't, and the items you leave unranked are tied with each other. That lets you say "I care about these three, and I'm indifferent to the rest."

  • Ties are reported as ties. If the group genuinely doesn't distinguish between two items, they share a rank in the results.

How to use civilsort

Anyone can create a new ballot at https://sort.civilfritz.net. This generates a unique address for the ballot, which you can share with others to invite them to participate.

The civilsort home page, with fields for a ballot title and your name, and a Create Ballot button.

Participants can then propose items to be voted on and rank them according to their preferences. The combined results are updated live as everyone makes changes, and civilsort retabulates the result whenever items and rankings change.

A ballot titled "Going out to lunch." with Indian, Thai, and Sushi ranked in order of preference.

There are no accounts and no passwords: each ballot remembers its participants with a browser cookie, so participants can return to the ballot and continue updating their rankings or adding items to the ballot at any time.

The code

civilsort is written in Go and TypeScript. It builds into a single binary with its templates and static files embedded, and stores its data in SQLite. The source is available on GitHub under the BSD 3-clause license. Bug reports and suggestions are welcome there.

It is absolutely 100% vibe-coded, so take that for what it is. But it's progressed to the point where it's useful to me, and I'll keep polishing it while I use it myself. I wouldn't recommend this level of hands-off development for a larger project; but for this kind of personal-use app, it sure was a good experience to go from "something that I've wanted to have for years" to "something that I can use with friends."