Docs menu

Docs / Working with Tellscript

Checks

How a Tellscript statement is bound to a test, a contract, a reference image or a recipe, and what happens when an edition breaks a rule.

A statement is only as good as the check that can prove it wrong. The Tellscript says what must hold; the check proves that it does. A test without a statement has no reason, and a statement without a test is a wish.

One id, in two places

tell/features/product-page.tell.mdTellscript
## Behaviour fixed
C2 A second voucher is declined
   with a notice.
   → shop.spec#one-voucher
checks/shop.spec.tsCheck
test("one-voucher", async ({ cart }) => {  // C2
  await cart.redeem("SUMMER10");
  const second = await cart.redeem("LOYAL5");
  expect(second.error).toBe("cart.voucher.used");
  await expect(cart.notice)
    .toHaveText(t("cart.voucher.used"));
});

The reference line → shop.spec#one-voucher and the test name one-voucher are the binding. The comment // C2 lets people find their way back.

Four kinds of check

Statement kindChecked byExample
BehaviourUnit, integration or end-to-end tests; the test name carries the idshop.spec#one-voucher
ContractsRoutes, types and stored data compared byte by byte with the contract filecontract/http#POST /api/cart/voucher
FaceEach screen and state rendered on phone and desktop and compared with its reference imagereference/cart.png
RecipesEvery picture or text keeps a note of the recipe, model and references it came fromrecipes/product-photos

When a check fails

An edition that breaks a fixed statement is not accepted. The model may rewrite every line of code, but it cannot quietly change what the product promises.

tell checkExample
edition 6
  ✓ C1 free-shipping
  ✗ C2 one-voucher
    second voucher accepted
  ✓ C3 price-in-view
  ✓ C4 photo-recipe

edition 6 not accepted · 1 fixed statement broken
  • In the free ring, the agent fixes the code and runs the checks again.
  • It never edits a statement to make a test pass.
  • A fixed statement changes only together with a decision.

The hidden test bench

A model that sees the tests can learn the tests instead of the product. For a rebuild, keep a second set of checks and screenshots from the running edition that the building model never sees. Only what the Tellscript really carries passes both. Whatever the hidden bench catches was never written down: it becomes a new statement with its own id.