Skip to main content
A mutation runs as one transaction under one label, its under. Its writes, its submits and its grave acts commit together, or the transaction refuses and nothing happens.
bijection/notes.ts
rename needs no existence check of its own: patch assumes the note is present, and a deleted note refuses the transaction with the host code Absent.

Writes

Four writes are strict: each assumes something, and its assumption is part of the transaction’s read set. Two are blind: they read nothing and never conflict. A series or timeline fact is written at a timed point: ctx.put(prices(sku).over({ from, to }), fact). See Writing data. The sys tables are read-only to all six writes; only the grave acts change them.

Effects and grave acts

A mutation’s ctx also has:
  • ctx.submit(target, args, { once, then, due, within }), which commits intent toward a target atomically with the writes;
  • the grave acts: grant, revoke, open(sealed, { release }), erase, branch, land, discard, pin, unpin, answer and withdraw.
Nothing outside the transaction happens inside it. A target’s work starts after the commit, as a task.

Conflicts and retries

Every read, and every strict write’s assumption, joins the read set. The host checks the read set at commit and runs the mutation again when something it read changed. A change hidden above the mutation’s label never aborts it. See Transactions and conflicts. The transaction must commit by ctx.frame.now.entry + ctx.frame.within; past that it refuses Expired.

Run a mutation from a client

client.mutate answers a Result. A committed result carries the commit version; pass it as seen to a later read to read your own write. once is the call’s identity: the same once and args return the original result, and the same once with other args refuses Invalid. When a reply is lost the result is Unknown. Retry with the original arguments and the refusal’s once. With React’s useMutation, pass { once } as the second argument to the callable.

Reactions

A mutation with on is a reaction: the host runs it for each firing of a standing source (a clock, a route or a change log), holding the roles it declares. See Reactions.