About this project

# Kerotakis A virtual chemistry laboratory that computes real chemistry. Offline-first, cross-platform, no runtime Python. ### What it does Kerotakis simulates real aqueous chemistry using thermodynamic computation rather than lookup tables or pre-recorded scripts. Every number comes from a real thermodynamic database solved at runtime. It covers: - **Dissolution and precipitation** with real solubility limits - **Acids and bases** from charge balance — strong, weak, polyprotic, and buffers - **Titration curves** walked with a virtual burette - **Gas boundaries** — venting, trapping, expanding, or sweeping headspace gas - **Heat and phase changes** — dissolution enthalpies, freezing/boiling point shifts derived from water's own enthalpies - **Hard-water chemistry** — chalk, limescale, gypsum crystallisation - **Separations** — filtration, evaporation - **Fire and calcination** — decomposition temperatures computed, not assumed - **The activity series**, computed via Nernst over solved activities - **Colour from absorption spectra** using Beer–Lambert and CIE 1931, so mixtures compose correctly and concentration changes hue - **Hazard simulation** — e.g. bleach + ammonia shows chloramine forming before warning - **Equation balancing** by null-space computation of the element-count matrix, including charge - **Particle-level view** — species drawn at solved ratios, with dilute species named rather than silently dropped - **Explainability** — every answer states which engine, dataset and model produced it ### Platforms - **Browser bench** at crispstrobe.github.io/kerotakis — PHREEQC compiled to WebAssembly (Emscripten, no filesystem), solving in a worker thread - **CLI** (`kero`) — REPL, batch runner, JSON interface, codex linting - **Native macOS/iOS app** — solver linked in-process, full offline use after first visit - **Installable PWA** — runs from its own window with everything cached locally All three targets produce identical UI and identical answers. ### Education design Chemistry lives at three levels — macroscopic, submicroscopic, and symbolic. Kerotakis renders the same solved vessel state consistently across all three, with a level-of-detail dial (lv1 = what you see, lv3 = everything). Lessons carry a `fails_at` field for every model, showing where each approximation breaks. The curriculum follows dependency order, not school years. ### Dataset & validation The codex holds 131 reaction entries, 28 models, and 185 concepts anchored to a 189-topic CC0 curriculum spine. Every numeric claim is replayed through real solvers by CI lint. A 500-question curiosity corpus (aimed at child/teen questions) tracks computed, curated, qualitative, boundary, missing, and solver-failure outcomes distinctly. Current status: 269 computed, 20 curated, 70 qualitative, 59 explicit boundary, 82 missing (the gaps need mechanisms like protein species, not more substances). ### Technical architecture - `kerotakis-core` — bench state machine, operators, energy balance, solver router, `.lab` grammar - `kerotakis-phreeqc` — IPhreeqc FFI, embedded thermodynamic databases, aqueous equilibrator - `kerotakis-cea` — NASA-9 thermochemistry and Gibbs minimiser for heating/calcining/burning - `kerotakis-safety` — L0 reactivity screen running before any chemistry - `kerotakis-codex` — curated reactions with solver-backed lint - `kerotakis-cli` — REPL and batch runner - `kerotakis-wasm` — browser target Built in Rust. Three thermodynamic datasets ship (wateq4f, minteq.v4, pitzer) so model disagreement itself becomes a visible lesson. ### Language support English and German are fully supported. i18n infrastructure exists for a third language. ### License Code: AGPL-3.0-or-later (with App Store / Google Play additional permission for binaries). Curated data: CC BY 4.0. Imported CC0 material remains CC0.