Verification examples
Start with the question you want to answer about a process, the execution
protocol, or the TypeScript code. Follow the
local setup before running commands in the
TypeScript workspace. Build the workspace with pnpm build before running
the individual Vitest examples. Open the named test files to see the input
models, exact assertions, and any traces the tests expect. Evidence records
identify the original revision and configuration for each result.
Check a decision table at its boundary
Section titled “Check a decision table at its boundary”Consider a DMN table with one row for amounts below 10000 and one for
amounts greater than or equal to 10000. If the second row uses > instead
of >=, no row covers exactly 10000. If the first row also includes the
boundary, both rows apply. The BPMN importer rejects each variation in the
supported UNIQUE table profile. The workflow tests exercise the actual output
at the boundary and immediately below it.
pnpm exec vitest run packages/bpmn/decision.test.ts packages/workflow/test/decision.test.tsThe static result concerns the table’s supported interval rules. The workflow tests show how specific table inputs become task outputs. Decision table evidence
Check a BPMN process
Section titled “Check a BPMN process”Run the checker tests against models that differ in one important detail.
pnpm exec vitest run packages/model-check/test/behavior.test.ts packages/model-check/test/call-activity.test.ts| Model | Finding to look for |
|---|---|
Exclusive gateway with two false guards and no default |
xor-route-coverage is violated. The concrete trace reaches the gateway and shows that no route can be selected. |
Exclusive gateway with guards approved and approved = false |
xor-route-coverage is unknown. The potential missing route depends on an abstract data choice. |
Activity in a loop with a constant true condition |
deadlock-freedom is proven and option-to-complete is violated. The activity can run again, and the end is unreachable. |
| Call Activity whose bound target has a blocked route | A concrete finding identifies the route, the caller’s scope and the bound target version. |
These outcomes depend on the control-flow abstraction, the checker budget and the assumptions in the report. A smaller purchase order deadline fixture checks both gateway successors in the control-flow model.
pnpm exec vitest run apps/server/test/message-race.test.ts -t 'the gateway validates both native branches'The full purchase order walkthrough exercises an on-time reply and a late reply after a timeout. It observes delivery, correlation and persisted outcomes at runtime. Checker evidence · Purchase order evidence
Explore server schedules with Quint
Section titled “Explore server schedules with Quint”In each model, run the fixed tests first and then inspect the output of the seeded simulation. Look for the named invariants and the schedules reached.
| Case | Run | What to look for |
|---|---|---|
| Task completion races a deadline | pnpm --filter @getriebe/server verify:deadline |
One winner at the deadline, a stale activation ignored and a readback after an unconfirmed outcome. Evidence |
| Reviewers complete in a different order | pnpm --filter @getriebe/server verify:parallel-review |
Results are published in input order after all votes, including across restart. A previous round’s ID cannot complete the new round. Evidence |
| An embedded Sub-Process restarts with one branch open | pnpm --filter @getriebe/server verify:embedded-subprocess |
The outer flow advances once the inner work finishes. The fixed schedules vary the branch completion order. Evidence |
| A confirmation scope closes while a reminder is running | pnpm --filter @getriebe/server verify:confirmation-deadline |
Closing the scope settles one exit. A withdrawn reminder or stale timer cannot advance it later. Evidence |
Each result is about sampled executions of an abstract model. The evidence records specify the bounds and corresponding tests of the server.
Prove a dispatch property and reproduce a counterexample
Section titled “Prove a dispatch property and reproduce a counterexample”Attempt A is unresolved after restart. An administrator retries, starting
attempt B. If A now returns while B is running, only B may advance the
workflow. Run the Lean proof and then simulate the model’s faultyStep,
which permits the old result to be accepted.
pnpm --filter @getriebe/server verify:dispatchquint run apps/server/verification/dispatch.qnt --backend=rust --step=faultyStep --max-samples=100 --max-steps=12 --seed=42 --verbosity=2The second command is expected to exit with an onlyCurrentResult
violation. The Lean proof covers reachable states of the model with one task,
up to two attempts and one orderly restart. Run the shared scenario against
the maintained server to observe the corresponding HTTP behavior.
pnpm exec vitest run apps/server/test/worker.test.ts -t 'a late result cannot advance'Dispatch proof and runtime evidence
Replay sampled firing traces against TypeScript
Section titled “Replay sampled firing traces against TypeScript”pnpm --filter @getriebe/petri verify:firingThe driver replays selected traces from three fixed Petri nets against the
TypeScript library. On the first net, look for a split, a join and disabled
attempts. On the self-loop, binding 7 replaces it with 8, while binding
the absent 6 leaves the marking intact. On the weighted join, two input
places supply explicit token IDs, and a duplicate ID is rejected while
the transition is enabled. The documented run compared 1,440 attempts
across 140 traces. The agreement covers the replayed attempts.
Firing and replay evidence
Check firing invariants in Veil and Lean
Section titled “Check firing invariants in Veil and Lean”pnpm --filter @getriebe/petri verify:veilUse the pinned Veil setup from the local guide.
Follow a token through firing or draining. The model records issued and
retired identities. Its fire action requires a fresh identity, and the
invariants include that retired tokens are absent from the live places.
The command explores the four-identity instance and checks inductive
invariants. It also compares two runtime traces from a fixed two-place
TypeScript net. Each observed ID has a fixed model name across the steps in
its trace. For the negative control, the driver substitutes a drained ID for
the fresh output ID in a copy of an observed trace. The set sizes stay the
same. Veil accepts the altered trace with per-state renaming and rejects it
with fixed names.
Veil model and trace evidence
Check contracts on TypeScript token operations
Section titled “Check contracts on TypeScript token operations”pnpm --filter @getriebe/petri verify:lemmaTake a current allocation position of 8 and a limit of 10. Requesting
two positions succeeds with the counter at 10. Requesting three fails and
leaves it at 8. LemmaScript translates the source and its contract to
Dafny, which checks these rules for all inputs satisfying the stated
precondition.
The same command checks which IDs the allocation helper returns and
which IDs the place update retains. In a self-loop with tokens {3, 7},
binding 7 and allocating 8 gives {3, 8}. The place helper’s
contract specifies membership for every ID. A runtime regression checks
the complete PetriNet.fire call for this example.
Implementation check
Observe an uncertain PostgreSQL commit
Section titled “Observe an uncertain PostgreSQL commit”The recorded integration case interrupts a loopback connection immediately
before PostgreSQL receives COMMIT, or after PostgreSQL commits and before
the server receives the acknowledgement. Both requests report
503 commit-unknown. An API read then shows either the old state or the
entire committed update, including workflow progress and an audit event.
Use the recorded revision and command for this historical fixture.
PostgreSQL fault test and reproduction