Projects-Portfolio

The Paradox Engine

Four instruments that break your own reasoning — entirely in your browser.

Reasoning fails in predictable, repeatable ways: beliefs rest on circular justifications, arguments borrow the shapes of famous fallacies, some sentences about truth can never be decided, and your own preferences can contradict themselves. The Paradox Engine is a museum of those failures — four interactive instruments, each built around one small, honest algorithm. No AI, no network, no opinions: every verdict is computed on your machine.

Live demo: richard-ws.github.io/Projects-Portfolio/experiments/paradox-engine/app/

Paradox Engine interface preview

The four instruments

Instrument What it breaks How
Socratic Interrogator Circular and contradictory reasoning Builds a justification tree from your answers, then flags restatements, contradictions, and unexamined assumptions
Fallacy Foundry Fallacious argument shapes Scans pasted text against a local library of 12 classic fallacy patterns, highlighting the offending spans inline
Self-Reference Lab Truth itself Evaluates systems of sentences that claim truth values about each other, returning TRUE / FALSE / UNGROUNDED / PARADOX per sentence
Preference Paradox Lab Your own consistency Runs a head-to-head tournament on your tastes and reports the Condorcet winner — or the cycles where you contradict yourself

How it works

app/selfref.js       Self-Reference Lab — Kripke-style fixed-point truth engine
app/fallacies.js     Fallacy Foundry    — 12-pattern heuristic library, span-level flags
app/interrogator.js  Socratic Interrogator — justification trees + structural findings
app/preferences.js   Preference Paradox Lab — round-robin tournament, Condorcet, cycles
app/app.js           browser viewer (tabs, hash routing, shareable #selfref/… URLs)

All computation is pure client-side JavaScript with zero dependencies — no build step, no server, no API calls, no AI. The viewer runs on GitHub Pages. Self-Reference Lab systems are shareable: the sentence list lives in the URL hash (…/app/#selfref/…).

Reproduce

# Tests — hermetic golden-value + invariant suite (node:test) + DOM smoke test
bash scripts/test.sh

48 golden-value tests pin the four engines’ outputs (verdicts, findings, cycles), and a 22-check stubbed-DOM smoke test drives the full viewer — tabs, interrogation flow, fallacy highlighting, the liar paradox, and a completed tournament. The promise “identical inputs, identical verdicts, forever” is enforced by CI.

Results

Novelty notes

A scan of the public landscape (web searches across all four concept areas) found no exact equivalent to the museum as a whole — and one clear standout:

Exhibit Verdict Closest public equivalent
Socratic Interrogator Partial overlap “Why machine” / Five Whys apps — repeated-why loops, no tree analysis
Fallacy Foundry Partial overlap yourlogicalfallacyis.com — a static infographic, not a detector
Self-Reference Lab No direct equivalent found Single-paradox explainer pages — one sentence at a time
Preference Paradox Lab Partial overlap civs.cs.cornell.edu — academic ballot counting, not casual pairwise ranking

Design notes