akter verify
akter verify model-checks the state machine of every actor in an app. It reads each actor’s published contract. It compiles the states, the from to to edges, and the timeout edges into one Quint model. quint verify then checks that model with the Apalache model checker.
Verify an app before you deploy it
- Install Java 21 and put it on
PATH. - Run
akter verifyon the app entry.
bunx akter verify --entry src/app.layer.ts- If the command exits with code
1, read the actor and the state that each problem line names. - To fix an unreachable state, add a command or job whose
tolist includes that state, or remove the state. - To fix a dead end, add the state to the actor’s
finallist. You can also add a command or job that lists the state infrom, or a timeout on the state. - Run
akter verifyagain until it exits with code0. - To block deploys that fail verification, run
akter verifyin CI beforeakter deploy.
Problems the verifier reports
- Unreachable state: No path of edges leads from
initial.toto a declared state. - Dead end: A reachable state is not in
final, and no edge leaves the state. The report prints the Quint trace that reaches the state, one state and the edge that reached it per line. - Undeclared state:
initial.to,final, afromortolist, or a timeout names a state that the actor does not declare. The verifier skips the Quint check for that actor. - Undeclared command: A timeout names a command that the actor does not declare. The verifier skips the Quint check for that actor.
Model inputs
| Contract part | Model element |
|---|---|
states | One node per state tag. |
initial.to | The start node. |
Command from and to | One edge from each from state to each to state. |
Job from and to | One edge from each from state to each to state. |
timeouts | One edge from the timeout’s state to each to state of its command. |
final | The states that may have no way out. |
Queries add no edges, because a query never changes state. The verifier reads the published contract only, so it never runs a handler.
Timeout edges
A timeout is an edge of its own kind in the state graph and in the Quint model.
- Edge: A timeout on state
Sthat runs commandCadds one edge fromSto each state in thetolist ofC. - Label: The Quint model labels the edge
timeout <command>. A trace line readsArchived, by timeout archiveIdle. - Reachability: A state that only a timeout edge leads to is reachable.
- Dead ends: A state whose only exit is a timeout is not a dead end.
- Input: The verifier reads
stateandcommandfrom each entry of the actor’s publishedtimeoutslist. It ignoresafterMs, because a delay never changes which states a path visits.
The published contract lists timeouts only when the actor declares one. An actor without timeouts gets no timeout edges.
Output and exit codes
- Report: The command prints one line per actor, either
<Actor>: okor<Actor>: <n> problemsfollowed by one line per problem. A summary line ends the report. - Exit code: The command exits with code
0when no actor has a problem. It exits with code1when any actor has a problem. - Requirements:
quint verifyneeds Java 21 onPATH. The first run downloads Apalache into~/.quint.
Why the verifier checks declared edges
A command’s from and to lists are part of its contract. The engine refuses any transition outside those lists, so the declared edges bound every path an actor can take. A proof over the declared edges holds for every handler that typechecks.
Apalache checks traces up to a fixed number of steps. akter verify sets that bound to the number of declared states. A shortest path through N states takes at most N - 1 steps, so the bound covers every reachable state and every reachable dead end.
An unreachable state is dead code in the contract. A dead end that final does not list is an actor that can stop accepting commands without a declared reason. Actor grammar describes final and the other slots.