This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index at /llms.txt, or add .md to any page's URL.
Recipe: properties beside the tests
In app.test.contract, state what should hold across the app's interactions.
In app.test.contract, state what should hold across the app's interactions:
Add properties to my tests
Paste this into Claude, Cursor, Codex, or another agent.
contract-test
always "the phone is on one of its five screens"
expect state screen in "lock" "home" "settings" "display" "messages"
always "the counter is a whole number of at least one"
expect state counter whole
expect state counter >= 1
always "a probe's result is absent or an answer"
expect state tsResult in none some
always "once the photo has loaded it stays loaded"
expect state ready stays true
after "increment" "increment adds one"
expect state counter == old + 1
after "rotate" "rotating touches nothing but the turns"
only writes turns
after "done" "done writes nothing and focuses the button"
writes none
command focus "done"
never refuses "reset"
Read root states or derives by name. Use Component.action for a child action.
Derives may read state, pure functions and, in always, resources. A refusal
shows the dependency chain. Once true, stays true must hold at each observed
step. after checks an input's handler and its landed continuations from the
state it met; after clock checks the work due when the input arrived.
Other commits make a line counted only. The grammar
defines each form.
Run bun exact.mjs contract verify app.contract. It delivers test prefixes, explores
controls and searches 20 walks of up to 40 chosen events, plus automatic clock
advances. Set --walks, --steps and
--walk-seed to reproduce another search; --confirm sets how many walks Lean
confirms, alongside delivered tests, explore and shrunk findings. Without lake,
or with --runner-only, the runner still searches. --js also runs the scripts
on the web JS target and checks always there.
The receipt gives the command, source digests, delivery, steps, stores, action
coverage, property results, refusals, timings and evaluators. Properties may hold,
be false, be counted only or remain unexercised. Suggestions are observed and
code-consistent, not proved: the static walk widens frames, drops unsupported claims
and counts both in the receipt. Suggestions never edit tests. Keep the receipt
unchanged in your diary; its digests identify the sources.
“In the semantics' world” means seeded source answers arrive synchronously and
never fail. Scripts can tap, type, land continuations, advance the clock and change
a source’s answer. Reloads, late answers and host inputs are outside that world. A property
about a mutation result is therefore about the seeded answer, and a successful
search establishes only what those scripts observed.
bun exact.mjs test web (or test ios) checks always at boot, after inputs and
reloads, and after every clock step.
verify runs both checks; either failure fails it. Its verdict gives counts and
the report and receipt's path, .exact/verify/properties.txt. Device and
headless JS runs count unchecked after, frame, command and never refuses lines:
neither exposes the commit trace they need.
Is this helpful
Last updated November 22, 2026