Business logic that explains itself.
Payroll, pricing, tax, financial models — Balkis turns them from code scattered across your app into typed, versioned data with deterministic execution, a full audit trail for every number, and native access for AI agents.
* measured live on this page below · † published benchmark
Your most important numbers live in your least inspectable code
Every calculation-heavy system rots the same way: formulas buried in route handlers, implicit ordering, no validation, and no answer to the only question that matters — “why did this number come out this way?”
😵 Before — logic buried in code
A tax rule, a discount, a rounding decision… somewhere in 400 lines of handler.
✨ After — logic as data
Each calculation declares its inputs, outputs, dependencies, and version. The framework derives execution order, validation, audit trails, docs — and the graph below is real.
Watch Balkis run, right now, in this tab
The actual engine is loaded on this page. Below it computes a payroll — rule-driven bonus included — and you watch the dependency graph execute, the audit trace assemble, and the run explain itself. Numbers are measured, not scripted.
⚖ = a rule group: the bonus policy is JSON conditions with priorities, not code.
The proof lab: every claim runs on your machine
Marketing pages say “blazing fast” and “rock solid”. This one hands you the lab. Each experiment below executes the real engine in your browser and prints what it measured.
⚡ Speed: a 1,000-calculation graph
Builds a 1,000-node dependency chain — validation, tracing, everything on — and times one full run. Then re-runs it through the incremental cache.
🏁 Parallel vs sequential — live race
Three independent async calculations (~250 ms each, think API calls). Sequential pays the sum; parallel overlaps them. Watch the bars — they move in real time.
🛡️ Reliability: determinism & validation
Runs the same calculation three times and compares results byte-for-byte, then feeds it garbage and shows the structured rejection.
Lab-recorded numbers (Node 24, Apple Silicon) from the published benchmark suite — the same shape you just measured:
| scenario | sequential | parallel | speedup |
|---|---|---|---|
| async fan-in, width 4 (5 ms/leaf) | 22.7 ms | 5.8 ms | 3.9× |
| async fan-in, width 16 | 91.0 ms | 6.0 ms | 15.3× |
| async fan-in, width 64 | 363.2 ms | 6.4 ms | 56.8× |
| sync chain, 1,000 nodes (engine overhead) | 0.55 ms | — | ~0.6 µs/node |
Honesty clause: parallel mode helps async work. On pure synchronous math it’s ~0.8× (single-threaded JS), so sequential stays the default. That trade-off is written down (D14), like the other 21 design decisions.
One catalog. Every surface.
Define your logic once as data. Balkis derives everything else — for developers, for auditors, for finance teams, and for AI agents.
balkis mcp ./payroll.js
🌐Instant HTTP APICatalog → endpoints + generated OpenAPI. balkis serve ./payroll.js
📊Escape from ExcelImport workbooks: formulas → calculations with inferred dependencies + an honest coverage report.
👥Shadow deploymentsRun candidate logic against real inputs next to production. Field-level diffs before you ship.
⚖️Rules as JSONCondition trees with priorities — storable, diffable, generatable. Compile to ordinary calculations.
🔮What-if & Monte CarloScenario overlays, sensitivity sweeps, seeded simulations — same seed, same result, bit for bit.
💰Exact money mathbigint fixed-point, banker’s rounding. 0.1 + 0.2 = 0.3, invoices to the cent.
🧾Audit sinksEvery run recorded — including failures. In-memory, JSONL, or your own sink.
📈Finance formulasNPV, IRR, amortization, depreciation — golden-tested against textbook tables.
📐Architecture (D1–D22)Every design decision written down with its trade-offs. Disagree with the reasoning, not a mystery.
🤝Contributepnpm install && pnpm test → 193 green tests in seconds. Formula packs make great first PRs.