Documentation · Reference

What works today

kalku is pre-alpha: which pieces are done and which are not yet.

kalku is pre-alpha. Everything this documentation describes runs today, except what this page marks as pending. The table comes from the README of the repository, which is where it is updated first.

Not yet

PieceState
Parallel workers in an Elixir project (one build path, so one worker)not yet
--watch and --cinot yet
merge: combining sharded reportsnot yet
macOS on Intel, Linux on arm64 (waiting on a kaikai toolchain for them)not yet

Commands and core

PieceState
kalku init: detects the language, writes .kalku.toml and the summoning scriptdone
kalku run <files>: measures those files and reports survivorsdone
kalku cast <wekufe>: re-cast one wekufe, and kalku show to read it backdone
kalku propose-equivalent: an agent proposes, a person acceptsdone
kalku info: spells, outcomes, formats and the agent loop, in the binarydone
kalku mcp: the four agent tools, over stdiodone
kalku serve: the client protocol on a 0600 Unix socket, streaming a run as it happensdone: one client at a time
Warm sessions: the pool a project was measured with survives the run, and is replaced when the project changesdone
Protocol: both directions, canonical NDJSON, fixtures for every messagedone
Core: planner, test selection, outcomes, score, gate, equivalents, .kalku.toml, sharding, changed linesdone
Reports: human, JSON, GitHub annotations, and agent NDJSON with per-spell hintsdone
Orchestrator: kalku pool, scheduler, timeout escalation (abort → reset → kill), restart budget, cancellationdone
--since <ref>: measure what a change touched, and block on holes it introduceddone
[score] ratchet: the score of the whole project may not drop below the baseline stored with --store-baselinedone
--all and --shard i/n: the whole project, in parts, for a nightly rundone: a shard says it is one and is not held to the threshold

The kalku of each language

PieceState
Elixir kalku: sites, prepare, baseline with per-test coverage, cast, abort, reset, reloaddone: every protocol message but delegate
kaikai kalku: the one kalku measures itself withdone
Rust kalku: sites for arm, compare, connect, negate, literal from syn, behind the kalku protocoldone: finds sites
Rust kalku: prepare, baseline and cast in the reni, abort, per-test coverage with LLVMdone
Rust kalku: kalku init for Cargo projects, shipped in the releasedone
Python kalku: sites from ast, prepare/baseline/cast in forked children, abort, per-test coverage with sys.monitoring, kalku init, shipped in the releasedone
Java kalku: sites for arm, compare, connect, negate, literal, call from javac, behind the kalku protocol, on Java 11, 17, 21 and 25done: finds sites
Java kalku: prepare, baseline and cast in the reni for a Maven projectdone
Java kalku: kalku init for Maven and Gradle projects, shipped in the releasedone
Java kalku: abort, by ending the JVM the tests run indone
Java kalku: per-test coverage, counted by JaCoCo and withheld wherever it cannot be trusteddone
Java kalku: Maven projects of several modules; a site is judged by the tests of every module that uses its owndone
Java kalku: Gradle builds, asked by running them with a script added from outside the projectdone
Java kalku: projects that test with JUnit 4 or with TestNG, run through their JUnit Platform enginesdone
Per-test coverage used by a run: a wekufe is cast against the tests that reach itdone: Elixir, Rust, Python, Java

Distribution

PieceState
kalku_elixir on Hex: the Elixir kalku installs like any dependencydone
Release binaries: brew install, or a tarball per platform, built and checksummed by CIdone

kalku measured by kalku

kalku uses kalku to test its own code: it casts wekufe in its own sources through the kaikai kalku and reports what its suite did not notice. This is a report of that run:

kalku/core/shard.kai:30  literal  shard.wrap32/1
  - 4294967296
  + 0
  covered by 189 tests
  No test depends on the exact value `4294967296` in `shard.wrap32/1`.

score 40% · 2 killed · 3 survived · 1 compile error