Temporal contracts for TypeScript
Write the rule once.
Run it wherever events happen.
Falsify generated inputs, verify recorded traces, and monitor live streams with the same serializable law.
- Runtime deps
- 0
- Definition
- JSON-safe
- Status
- Research preview
The proof is executable
Put a real trace on trial.
This lab imports Eventlaw's verifier directly. Switch scenarios, inspect the events, then run the same core code used by the library.
Recorded trace
Verification report
Select a scenario and run its law.
A five-event trace contains one forbidden turn. Eventlaw reduces it to the two events that explain the violation.
One definition, three modes
The law travels. Its meaning does not.
-
01
Generated
Search input spaces and shrink a failure to a readable trace.
-
02
Recorded
Replay JSONL or adapted telemetry against the exact same AST.
-
03
Live
Push events through an incremental monitor with explicit memory bounds.
Portable by construction
A law is data, not a callback.
Definitions compile to a JSON-safe AST. Save one beside a trace, send it across a worker boundary, or evaluate it in a different process without serializing functions.
- Explicit correlation and deadlines
- Pass, fail, and pending trace semantics
- Human-readable minimal counterexamples
{
"kind": "neverBetween",
"forbidden": { "type": "turn.emitted" },
"start": { "type": "takeover.started" },
"end": { "type": "takeover.ended" },
"partitionBy": "conversationId"
}
Bring your traces
The core does not own your event bus.
Research preview
Useful enough to test. Early enough to shape.
Eventlaw is not published to npm yet. The core, adapters, tests, examples, and design notes are open for experiments and design partners. The law language will evolve from real event-system failures, not from invented syntax.
Bring a temporal rule we should be able to expressStart with one production rule