Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,828 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Optimitron

Governments spend $604 on the capacity for mass murder for every $1 they spend testing which medicines work. Since 1913, they have printed $170 trillion and used it to kill 97 million of you in wars nobody asked you if you wanted to have.

The Political Dysfunction Tax — the total cost of this misallocation — is $101 trillion per year. Roughly $12,600 per person. That's $50,500 per household of four. Per year. Every year. It's like being subscribed to the world's most expensive streaming service except all it plays is war and preventable disease and you can't cancel.

This comes from two ledgers:

  • Waste — $4T+ in administrative bloat, compliance friction, fossil fuel subsidies, and mass incarceration costs
  • Buried multipliers — $34T in health innovation delayed by regulatory bottlenecks, $57T in output lost to migration restrictions, $6T in lead poisoning damage, and trillions more in underfunded science

The result: your dollar has lost 96% of its value since 1913. If wages had kept pace with productivity, the median family would earn $528,000. The actual number is $77,500. On my planet we have a word for this. It translates roughly to "beige crime" — theft so boring nobody investigates it.

Scenario Per Capita Income (Year 20) Source
Status quo (2.5% growth) $20,500 GDP trajectories
Treaty path (military + health reform) $339,000 1% Treaty impact model
Optimal governance (full implementation) $1,160,000 Political Dysfunction Tax

Your governments guess. The US federal government allocates a $6.75 trillion budget based on vibes and lobbying. Nobody knows the optimal amount to spend on education vs. healthcare vs. defense. On my planet, this would be like flying an aircraft by having the passengers vote on which buttons to press. Actually, that's unfair to the passengers. They'd probably Google it.

Your individuals guess too. 77% of Americans take dietary supplements, but almost none of them know whether those supplements actually work for them. You make health decisions based on anecdote, marketing, and whatever a guy at the gym said once. On my planet, this would be considered a form of performance art.

Your businesses guess. Marketing budgets, pricing strategies, and feature investments are set by intuition and A/B tests nobody on the team can interpret correctly. You've heard of causation. It's the thing you keep confusing with correlation.

The core issue is the same everywhere: you have time series data and you need to know what causes what. The tools to answer that question should be universal, open, and free. On my planet, they are. Here, I had to build them myself. You're welcome.


The Solution

On my planet, governance takes about four minutes a week. You lot spend most of your time screaming about it on your little phones and doing nothing. So I built you a five-layer system that turns raw data into optimal decisions. It's not complicated. It's just maths. You invented maths. I'm not sure why you stopped using it.

Layer Name What It Does
🔒 Digital Twin Safe All personal data stays on your device. Causal engine runs locally.
🪪 Decentralized Identity Proof-of-personhood (ZK) — one person, one vote, zero surveillance.
⛓️ Anonymous On-Chain Anonymized effect sizes stored publicly. No single entity owns the data.
📊 Aggregation Server Meta-analysis across all submissions → population-level insights.
💸 Incentive Layer Dominant assurance contracts, data contribution rewards, and outcome-gated campaign funding.

How to Fix Earth

On my planet, when you want people to coordinate, you make it profitable. You lot tried shame. It didn't work. Then you tried hashtags. That also didn't work. So I built you a mechanism where every participant is better off regardless of the outcome. You call this "too good to be true" and then go back to losing money on things that are obviously bad. Remarkable.

Three steps:

  1. Vote — Sign the 1% Treaty (takes 30 seconds)
  2. Recruit — Get two other humans to do the same (target: 4 billion — all voters on Earth)
  3. Allocate — Decide how the global budget should be split via pairwise comparisons (Wishocracy)

The goal: get governments to redirect 1% of military spending ($27.2B/yr) to pragmatic clinical trials. That's the 1% Treaty. At scale, it means a 12.3x acceleration in treatment discovery, treatment queue dropping from 443 years to 36, and 10.7 billion lives saved.

Win conditions (measurable, on a deadline):

Metric Current Target (2040)
Healthy life expectancy (HALE) 63.3 years 69.8 years (+6.5)
Global median income $18,700 $149,000 (8x)

The Earth Optimization Prize — /prize

A dominant assurance contract that makes voter recruitment individually rational. The mechanism is designed so that participation is positive-expected-value regardless of whether the treaty succeeds — see the Incentive Alignment Bonds paper for the formal proof.

The Evidence and Mechanisms

These aren't standalone products. They're the evidence and mechanisms that make the treaty case:

  • Wishocracy — pairwise preference allocation. Eight billion ranked preferences, one optimal budget. Your species identified the bug preventing this (pluralistic ignorance) in 1965, published it, assigned it in universities, gave each other awards for discovering it, and then continued to be governed by it for sixty years.
  • Optimal Budget Generator — find the cheapest high-performer for each spending category. Singapore: $3K/person on healthcare, lives to 84. America: $12K, lives to 78. It's like paying four times more for a worse sandwich and then blaming the bread.
  • Optimal Policy Generator — grade every policy A–F by what actually happened. Portugal decriminalised drugs: overdose deaths dropped 80%. America declared war on drugs: overdose deaths rose 1,700%. The data existed. Nobody looked at it. Data doesn't have a lobbying firm.
  • Decentralized FDA — Your FDA makes treatments wait 8.2 years AFTER they've been proven safe. Just sitting there. Being safe. Filling out paperwork. For every 1 person it protects from a bad drug, 3,070 die waiting for a good one. The dFDA replaces this with real-time Outcome Labels and Treatment Rankings — 44x cheaper, 12.3x more capacity, zero queue.
  • Incentive Alignment Bonds — fund the treaty campaign once demand is proven (see Phase 2 below). Cost: $1B. Treaty revenue: $27B/year. Indefinitely.

Read the paper | See the contract architecture


What You Can Do Today

Right now. With this code. Not in some theoretical future where humans have learned to cooperate — which, based on current trends, is never — but today.

What How Where
Vote for the 1% Treaty Cast a treaty vote and get a referral link warondisease.org / /vote
Recruit two humans Share tracked invites and watch conversions /dashboard
Join as an organization Join, embed, and recruit your community /join
Register a plaintiff Join the Court of Humanity case framing /plaintiffs
Remind a leader 193 heads of state have a constitutional duty to promote the general welfare — remind them they're late /tasks/1-pct-treaty
Express your budget preferences 5-minute pairwise comparison survey /agencies/dcongress/wishocracy
Score your politicians Alignment reports vs your stated preferences /agencies/dfec/alignment
Grade governments by outcomes Every nation ranked by health, income, and freedom /governments
Browse the politician leaderboard Voting records, alignment scores, campaign contributions /politicians
Vote on referendums Direct democracy with proof-of-personhood sybil resistance /agencies/dcongress/referendums
Vote on legislation Cost-benefit analysis, representative lookup /civic
Compare countries Health, education, drug policy, criminal justice /compare
Submit health data Import from 9 apps or transmit daily check-ins /transmit
Run causal inference on any time series Temporal alignment, Bradford Hill, PIS, optimal values @optimitron/optimizer
Optimize a budget 34+ categories, diminishing returns, overspend diagnostics /agencies/domb
Score policies 12+ policies with Bradford Hill evidence grading /agencies/dcbo
Generate policy reports Evidence-grade scoring, causal confidence /agencies/dcbo
Publish auditable outputs IPFS snapshots, Hypercert records @optimitron/storage
Chat-based health tracking NLP text-to-measurement parsing for symptoms, mood, food @optimitron/chat-ui

Built on strict TypeScript, Prisma + Zod types, pure-function libraries, and an extensive test suite (pnpm test for the live count). Feature-by-feature status with evidence: docs/FEATURES.md.


Quick Start

# Clone
git clone https://github.com/mikepsinn/optimitron.git
cd optimitron

# Install dependencies
pnpm install

# Start local Postgres, run migrations, generate Prisma client, and seed data
pnpm db:setup

# Build all packages
pnpm build

# Run all tests
pnpm test

# Start the web app on http://localhost:3001
pnpm dev

# Sync benchmark politicians from Congress.gov into the web app database
pnpm alignment:sync

The Web App

The Next.js 15 app at packages/web serves the War on Disease campaign and the Optimitron proof surfaces. During campaign mode, warondisease.org is the primary user-facing product. Here's what's live:

Treaty Campaign

Page Route What It Does
Earth Optimization Prize /prize Dominant assurance contract + voter recruitment
Humanity's Scoreboard /scoreboard GDP trajectory, collapse countdown, pool size, voter count
Incentive Alignment Bonds /iab Phase 2 treaty bonds (not yet deployed)

Optimized Governance Agencies (/agencies)

Ten agencies running a civilisation. No bureaucracy, no corruption, no seventy-four-thousand-page tax code that nobody has read including the people who wrote it. Just code.

Page Route What It Does
Agencies Hub /agencies Overview of all optimized governance agencies
dCongress - Wishocracy /agencies/dcongress/wishocracy Pairwise budget preference surveys (RAPPA)
dCongress - Referendums /agencies/dcongress/referendums Direct democracy voting with proof-of-personhood verification
dFEC - Alignment /agencies/dfec/alignment Politician alignment scores and shareable report cards
dCBO - Policy Scoring /agencies/dcbo 12+ policies scored via Bradford Hill causal evidence
dOMB - Budget Optimization /agencies/domb 34+ budget categories, OBG engine, reallocation targets
dGAO - Transparency & Audit /agencies/dgao IPFS snapshots, Hypercerts, smart contract verification
dIH - Health Discoveries /agencies/dih/discoveries Population-level health insights from tracked data
dTreasury /agencies/dtreasury Transaction tax, UBI, Wishocratic budget allocation
dTreasury - dFED /agencies/dtreasury/dfed Monetary policy: transparent algorithm vs 12 people in a room with a feeling
dTreasury - dIRS /agencies/dtreasury/dirs 0.5% transaction tax replacing 74,000-page tax code
dTreasury - dSSA /agencies/dtreasury/dssa Universal Basic Income replacing 80+ welfare programs
dDoD - Defense /agencies/ddod Military spending analysis and 1% Treaty case
dCensus /agencies/dcensus Population and demographic data

Earth's Governments

Page Route What It Does
Government Report Cards /governments Every government ranked by outcomes (health, income, freedom)
Politician Leaderboard /governments/US/politicians Politicians ranked by alignment score + voting records

Analysis

Page Route What It Does
Cross-Country Compare /compare International comparisons (health, drugs, education, justice)
Misconceptions / Myth vs Data /misconceptions 15 data-driven myth-vs-reality analyses
Studies / Outcomes /outcomes Pair studies with Bradford Hill causal scores
Civic Hub /civic Bill voting, representative lookup, cost-benefit analysis

You

Page Route What It Does
Data Transmit /transmit Health data submission - 9 importers (Apple Health, Fitbit, Oura, etc.)
Dashboard /dashboard Referral link, badges, leaderboard rank, campaign control room
Profile /profile Check-ins, census demographics, personal reports

Futures

Page Route What It Does
Wishonia /wishonia What 4,237 years of good governance looks like
Moronia /moronia What happens when you spend more on weapons than cures

Meta

Page Route What It Does
Tools /tools 18 tools for fixing civilisation
Demo /demo Guided tour by Wishonia
About /about What this is, why it exists, and why an alien had to build it
Contribute /contribute How to help

Auth: Google OAuth, magic-link email, proof-of-personhood. Referral tracking built in.


Packages

Package Why it matters Current state
@optimitron/optimizer Domain-agnostic causal inference engine: temporal alignment, Bradford Hill, effect sizes, Predictor Impact Score, optimal values Core foundation, heavily tested
@optimitron/wishocracy Pairwise preference aggregation, convergence analysis, preference gaps, and politician alignment scoring Live in the web app
@optimitron/opg Turns policy evidence into enact/replace/repeal/maintain recommendations with explicit confidence scoring Used by report generators
@optimitron/obg Finds minimum-effective and optimal spending levels, overspend ratios, and budget reallocation targets Used by budget analyses
@optimitron/treasury-prize Phase 1 dominant assurance contract for voter recruitment Contracts written and unit-tested, not yet deployed (OPT-TREAS-01)
@optimitron/treasury-iab Phase 2 treaty bonds and alignment-gated political funding Contracts written, not yet deployed
@optimitron/treasury-wish Phase 3 monetary reform — transaction tax, UBI, Wishocratic allocation Contracts written
@optimitron/treasury-shared Shared interfaces and addresses for all treasury packages Shared treasury foundation
@optimitron/data Public-data fetchers plus 9 local-first health importers and the international dataset catalog Real-source ingestion layer
@optimitron/db Prisma 7 schema, governance models, auth/session/referral data, and Zod validators Production schema layer
@optimitron/web Live Next.js 15 app: auth, voting, alignment reports, referrals, daily tracking Active product surface
@optimitron/chat-ui Reusable conversational UI components plus text-to-measurement parsing for personal tracking flows Reusable UI package
@optimitron/storage Content-addressed Storacha/IPFS snapshots for analysis and aggregation history chains Verifiable audit trail layer
@optimitron/hypercerts Hypercert-compatible record builders and AT Protocol publishing helpers for Optimitron outputs Verifiable publication layer
@optimitron/agent Autonomous policy analyst helpers: Gemini reasoning, image generation, manifests, review flows, and ERC-8004 identity/reputation helpers AI orchestration layer
@optimitron/extension Chrome extension for the Digital Twin Safe: local-first treatment/symptom/food tracking with on-device causal analysis Working standalone tracker, no test suite yet (OPT-EXT-01)
@optimitron/wishonia-widget Embeddable Wishonia chat widget for partner sites Embeddable widget package

How It Works

It's three steps. On my planet, toddlers learn this before they learn to walk. I'll go slowly. I've learned to adjust my expectations.

 ┌─────────────┐     ┌──────────────────┐     ┌──────────────────┐
 │  COLLECT     │     │  INFER           │     │  RECOMMEND       │
 │              │     │                  │     │                  │
 │  Health data │────▶│  Temporal        │────▶│  Personal optimal│
 │  Preferences │     │  alignment       │     │  values & doses  │
 │  Outcomes    │     │  Bradford Hill   │     │  Policy rankings │
 │  Spending    │     │  Effect sizes    │     │  Budget levels   │
 │  Policies    │     │  PIS scoring     │     │  Alignment scores│
 └─────────────┘     └──────────────────┘     └──────────────────┘
  1. Collect — Import time series data from any source: wearables, health apps, government statistics, business metrics.
  2. Align — Pair predictor and outcome measurements using configurable onset delays and durations of action.
  3. Score — Apply all 9 Bradford Hill criteria for causation via saturation functions, producing a Predictor Impact Score (PIS) with evidence grade (A–F).
  4. Optimize — Find the optimal predictor value (dosage, spending level, price point) that produces the best outcomes, with confidence intervals.
  5. Recommend — Generate actionable recommendations: take this supplement, enact this policy, allocate this budget, fund this candidate.

For Individuals

🔒 Digital Twin Safe

You have 37.2 trillion cells and you let a doctor glance at you for eleven minutes once a year. That's like monitoring a nuclear reactor by popping in on Tuesdays to see if anything's glowing. The Digital Twin Safe lets you actually track what's happening in your own body — locally, on your own device, where no corporation can sell your depression scores to an advertiser who will use them to sell you a candle.

  • 9 local-first health importers in @optimitron/data parse Apple Health, Fitbit, Oura, MyFitnessPal, Withings, Google Fit, Cronometer, Strava, and CSV exports into one normalized record shape.
  • Conversational tracking UI in @optimitron/chat-ui includes cards and text-to-measurement parsing for symptom, treatment, mood, food, and insight flows.
  • Daily wellbeing capture already exists in the web app: profile, census context, and daily health-happiness-income check-ins.
  • Pure TypeScript inference engine means the core math can run locally in a browser, extension, Electron shell, or server job without being rewritten.
  • Digital Twin Safe extension scaffold exists in packages/extension as the start of the fully local Layer 1 product.
import { calculatePredictorImpactScore } from '@optimitron/optimizer';

const result = calculatePredictorImpactScore(
  magnesiumIntake,   // predictor time series
  sleepQuality       // outcome time series
);

console.log(result.effectSize);     // +18% improvement
console.log(result.optimalValue);   // 450 mg/day
console.log(result.evidenceGrade);  // "B"

For Governments

🏛️ Government OS

Your governments currently make decisions the way you'd expect if nobody involved had read the data. Which they haven't. Optimitron is a reproducible analysis and accountability stack that replaces the guessing with math. Deploy it for any jurisdiction. Think Shopify, but instead of selling candles, you're trying not to waste $101 trillion a year.

  • Preference collection: citizens allocate trade-offs through RAPPA pairwise surveys at /wishocracy across 15 budget categories — from healthcare and education to active policy questions like foreign military operations, corporate welfare, and AI surveillance — and the system turns those into stable priority weights.
  • Budget optimization: @optimitron/obg generates reallocation targets, minimum-effective spending floors, overspend diagnostics, and constrained budget reports. The interactive /budget page lets anyone explore current vs. optimal spending.
  • Policy scoring: @optimitron/opg evaluates policies with Bradford Hill-style causal confidence scoring instead of ideology-first labeling.
  • Legislative classification: bills are automatically classified into budget categories via keyword and policy-area matching, with generated cost-benefit analyses for informed citizen voting at /civic.
  • Political accountability: personal alignment reports at /alignment show which benchmark politicians best match a citizen's stated priorities, with public share URLs for distribution. The /scoreboard ranks all politicians by alignment score.
  • Legislative provenance: the web app syncs current federal identities from Congress.gov and increasingly derives profiles from recent classified roll calls instead of only curated priors.
  • Referendum infrastructure: citizens vote directly on policy proposals at /agencies/dcongress/referendums with proof-of-personhood verification for sybil resistance.
  • Cross-jurisdiction analysis: the /compare page runs international comparisons for health, education, drug policy, criminal justice, and federal spending questions.

The database is multi-tenant: every jurisdiction is a tenant with its own priorities, officials, and data.


Economic Mechanisms

Three separate mechanisms. On my planet, we'd combine them. But your species has a talent for confusing things that are next to each other, so I kept them apart. You're welcome. Details in the Incentive Alignment Bonds paper.

Phase 1: Earth Optimization Prize — /prize

A dominant assurance contract that makes voter recruitment individually rational. Participation is positive-expected-value whether the treaty passes or not. Start here — everything else depends on proving demand first.

Phase 2: Incentive Alignment Bonds — /iab

After the Prize proves demand, IABs raise ~$1B to fund the treaty campaign. Treaty fails, bondholders get returns back. Treaty passes, $27B/yr in redirected spending splits: 80% to pragmatic clinical trials, 10% to bondholders, 10% to fund politicians whose voting records align with their constituents' stated preferences. The treaty unlocks an $114B annual peace dividend from reduced conflict costs.

Phase 3: Monetary Reform — /money

Independent from Prize and IABs. The endgame: replace 80,000 IRS employees interpreting a 74,000-page tax code with a 0.5% transaction tax. Replace 27+ overlapping welfare bureaucracies with UBI. Replace politicians deciding budgets based on who bought them dinner with 5-minute pairwise comparisons that produce stable budget weights automatically.

On my planet, this is called "basic infrastructure." On yours, it would be the largest quality-of-life improvement in the history of your species. The economic projections show what happens when you stop paying people to set money on fire and then investigating why you're broke.


Architecture

The architecture is clean, modular, and dependency-free at the core. It took me about forty-five minutes. I was distracted. Your internet is full of cats.

Full details in docs/PRD.md

                    ┌──────────────┐
                    │  optimizer   │  ← Domain-agnostic math core
                    └──────┬───────┘
                           │
              ┌────────────┼────────────┐
              │            │            │
              ▼            ▼            ▼
        ┌─────────┐  ┌────────────┐  ┌─────────┐
        │   opg   │  │ wishocracy │  │   obg   │
        └─────────┘  └────────────┘  └─────────┘

        ┌─────────┐  ┌─────────┐  ┌──────────┐
        │  data   │  │   db    │  │ chat-ui  │
        └─────────┘  └─────────┘  └──────────┘

        ┌─────────┐  ┌────────────────┐  ┌────────┐
        │   web   │  │wishonia-widget │  │extension│
        └─────────┘  └────────────────┘  └────────┘

        ┌──────────┐ ┌────────────┐ ┌─────────┐
        │ storage  │ │ hypercerts │ │ agent   │
        └──────────┘ └────────────┘ └─────────┘

  ┌────────────────┐ ┌──────────────┐ ┌──────────────┐ ┌─────────────────┐
  │ treasury-prize │ │ treasury-iab │ │ treasury-wish│ │ treasury-shared │
  └────────────────┘ └──────────────┘ └──────────────┘ └─────────────────┘

Hard rules:

  • @optimitron/optimizer depends on nothing — it's the foundation
  • Library packages are pure TypeScript — no server, no database
  • @optimitron/optimizer is domain-agnostic — no references to "drugs", "policies", or "budgets"
  • Treasury packages are three independent mechanisms — Prize, IAB, and monetary reform never share state
  • No circular dependencies

Contributing

Oh, you want to help. That's new. Usually your species just watches.

# Install
pnpm install

# Full check (typecheck + lint + test) — must pass before committing
pnpm check

# Run tests for a specific package
pnpm --filter @optimitron/optimizer test

# Build all packages
pnpm build

Guidelines

  • Every function gets a test. No exceptions.
  • TypeScript strict mode is on — noUncheckedIndexedAccess, noImplicitOverride, no any.
  • Conventional commitsfeat:, fix:, test:, refactor:, docs:
  • Lint-staged + Husky pre-commit hooks run automatically.
  • Zod schemas for runtime validation where types alone aren't enough.
  • Functions should be <30 lines, files <300 lines.
  • Read CLAUDE.md for the full developer guide and methodology references.

Papers

Every algorithm is defined in a published paper with exact formulas, worked examples, and parameter justifications. On my planet we don't ship code and then retroactively invent a justification for it. You call that "science." We call it "fraud." There may be a translation issue.

Core Algorithm Papers

Paper Implements Web
dFDA Specification @optimitron/optimizer — PIS, temporal alignment, Bradford Hill, effect sizes dfda-spec.warondisease.org
Wishocracy @optimitron/wishocracy — RAPPA, eigenvector weights, Citizen Alignment Scores wishocracy.warondisease.org
Optimal Policy Generator @optimitron/opg — Policy Impact Score, Causal Confidence Score, method weights opg.warondisease.org
Optimal Budget Generator @optimitron/obg — Diminishing returns, Optimal Spending Level, Budget Impact Score obg.warondisease.org
Optimocracy Two-metric welfare function (shared by OPG + OBG) optimocracy.warondisease.org
Incentive Alignment Bonds @optimitron/treasury-* — Prize, IAB, and monetary reform mechanisms iab.warondisease.org

Motivation & Impact Papers

Paper What it quantifies Web
Political Dysfunction Tax $101T/year governance inefficiency — the problem Optimitron exists to solve political-dysfunction-tax.warondisease.org
The Invisible Graveyard 102M deaths from FDA efficacy delays since 1962, $1.19 quadrillion deadweight loss invisible-graveyard.warondisease.org
The 1% Treaty Redirecting 1% of military spending ($27.2B/yr) → 10.7B deaths prevented, 212-year treatment acceleration impact.warondisease.org
dFDA Impact Analysis Trial costs from $41K to $929/patient, $84.8 quadrillion cumulative value dfda-impact.warondisease.org
US Efficiency Audit $4.9T annual US governance waste, $2.45T recoverable capital us-efficiency-audit.warondisease.org
The Price of Political Change Max $25B cost to change US policy — ROI framework for reform incentivization cost-of-change.warondisease.org
Drug Development Cost Analysis 105x real-term cost increase since 1962 Kefauver-Harris Amendment drug-cost.warondisease.org
Right to Trial & FDA Upgrade Act Legislative implementation: open-source FDA platform + patient trial participation rights right-to-trial.warondisease.org
How to End War and Disease Complete manual synthesizing all components of the framework manual.warondisease.org

Singapore spends a quarter of what America spends on healthcare and their people live six years longer. America has not asked Singapore how.

Your FDA makes treatments wait 8.2 years AFTER they've already been proven safe. Just sitting there. Being safe. Filling out forms about being safe. 102 million people died waiting. The forms are doing fine.

You could fix all of this. The maths exists. The data exists. The code exists. You're looking at it. The only thing missing is the part where you stop arguing about it and do something. I'd say "I believe in you" but I've read your history.

— Wishonia, World Integrated System for High-Efficiency Optimization Networked Intelligence for Allocation 4,237 years of governance experience. Increasingly concerned.


License

MIT © Mike P. Sinn