State the guarantee
“This payment happens once.” “Only one writer wins.” “Recovery never repeats completed work.”
Model time, scheduling and infrastructure outcomes in .NET 10. Explore rare orderings, verify business invariants, then replay and minimize the failures you find.
Core package for .NET 10. Add only the adapters your service actually uses.
A retry arrives after a commit. Two workers save the same version. A process dies between durable steps. Ordinary tests often see one friendly ordering. Causalia explores the unfriendly ones on purpose.
“This payment happens once.” “Only one writer wins.” “Recovery never repeats completed work.”
Control virtual time, scheduling, retries and modeled failure semantics instead of waiting for a race to happen.
Capture the replay, fix the code, rerun that same path and keep it in the regression suite.
Start from a real symptom, model one boundary, write one invariant and let deterministic exploration find the ordering that breaks it.
Follow a failure across the business operation, broker settlement and recovery. The timeline is an illustration; the code below shows the real .NET API.
The durable write succeeds, its acknowledgement is lost, and retry must not repeat the business effect.
Move the slider to inspect each operation and the guarantee it challenges.
—Use the core runtime to explore schedules and virtual time. Add adapters for the boundaries your application actually crosses. Keep the invariant about your business behavior.
Run concurrent work under controlled scheduling. Advance timers, deadlines and retries without sleeping in wall time. Express invariants and explore competing executions.
Explore scheduling →Target events and outcomes with typed rules. Model delays, dropped messages, ambiguous commits and rejected settlements without a second fault engine.
See a fault rule →Model Storage, EF Core, Dapr, Kafka, RabbitMQ and Azure Service Bus: redelivery, offsets, locks, subscriptions, state and ambiguous acknowledgements.
Choose an adapter →Control logical HTTP requests, host behavior, unary calls, deadlines, partitions and retries at application-visible boundaries.
Explore network packages →Capture failing schedules and fault sequences. Reproduce the execution, reduce it to essential decisions and inspect its causal trace.
See reproduction code →Inspect existing services, generate compiling test scaffolds, catch nondeterministic APIs, and integrate with your test framework or Reqnroll.
Follow the workflow →Causalia tests the guarantees you model. A successful Service Bus Complete removes the message even when its acknowledgement is lost; redelivery requires an unsettled lock or rejected settlement. Keep real-provider integration tests for SDK and protocol compatibility.
An AI coding agent is much more useful when “test failed” means the same execution can be replayed after its change. Causalia can turn nondeterministic debugging into a tighter inspect → reproduce → patch → replay loop.
Run the Causalia CLI in JSON mode so an agent can work from structured findings: likely boundaries, deterministic seams and risky APIs.
dotnet causalia inspect MyService.slnx --format json
Use this as a starting instruction for an agent working in a .NET solution that can install or already uses Causalia.
When investigating timing, retry, duplicate-delivery, restart, or concurrency risk in this .NET solution: 1. Run "dotnet causalia inspect <solution> --format json" and use the findings as leads, not conclusions. 2. Choose one high-value production boundary and state the business invariant that must hold. 3. Prefer normal .NET seams such as TimeProvider, CancellationToken and narrow dependency interfaces. 4. Run "dotnet causalia generate <solution> --project <service.csproj>", then connect the real handler and replace TODOs. 5. Add a focused deterministic Causalia simulation around that boundary. 6. If a failure is found, preserve the replay token and reduced failure sequence. 7. Make the smallest production fix supported by the evidence. 8. Replay the exact failure, then run broader exploration and the existing test suite. 9. Keep real infrastructure integration tests; do not claim modeled provider semantics prove the real provider. Do not spread Causalia runtime types through the domain/application layer unless the simulation boundary genuinely requires it.
Causalia does not promise to eliminate incidents. Its value is narrower and more defensible: reduce the engineering drag around failures whose timing is difficult to reproduce, and keep their reproductions after the fix.
Replace “try it again until it fails” with a controlled scenario and an exact replay path.
Keep the once-rare failure as an executable test instead of only documenting the incident.
Give developers and agents a stable pass/fail signal after concurrency or retry logic changes.
Move the inputs. This estimates current engineering exposure only — not guaranteed Causalia savings.
How to evaluate business value properly →Causalia complements unit, integration and end-to-end tests. Use the tabs to see what each layer is good at.
Model the semantics that matter, control time and scheduling, inject ambiguity, then assert domain invariants across many executions.
Choose an example: start small, inspect an application, model a provider outcome or reproduce a failure. Generated tests compile; connect your handler and replace domain TODOs.
The CLI ranks likely simulation boundaries and points out useful seams such as TimeProvider and propagated cancellation.
Full guide →Commit succeeds, acknowledgement is lost, retry follows.
Open recipe →Redelivery, offset ambiguity, acknowledgements and duplicates.
Open recipe →ETags, CAS loops, leases and competing workers.
Open recipe →Failures between durable records and external effects.
Open recipe →Crash after partial progress and prove recovery behavior.
Open recipe →Advance virtual time and verify convergence invariants.
Open recipe →Core is always first. Select from the runtime, test integration, network, storage, broker and visualization packages your scenario needs. The CLI is installed as a separate .NET tool.
All commands target 2.3.0. Start with core, then choose the boundaries you need.
dotnet add package Causalia --version 2.3.0
Start with core and add an adapter only where your test models that boundary.
See every package →No. Causalia verifies the semantics you model under controlled timing and failure conditions. Keep real-provider integration tests for actual databases, brokers, HTTP stacks and infrastructure.
Prefer not to. Use normal .NET seams such as TimeProvider, CancellationToken and narrow storage/messaging/HTTP interfaces, then place simulated adapters in the test project.
The simulation controls relevant sources of time and scheduling so a discovered execution can be replayed instead of depending on wall-clock luck.
Yes, when the agent can run commands and tests in the workspace. Structured inspection output plus exact replay gives the agent a more stable debugging loop than repeatedly chasing a flaky failure.
Simple CRUD with no meaningful concurrency or partial-failure behavior, provider certification, and real performance/load benchmarking are usually better served by ordinary tests and provider-specific tooling.
No. It is evidence. Failure minimization and analysis can help identify what the reproduction depends on, but the trace should not be treated as an automatic causal claim.
Install, inspect and create the first deterministic simulation.
Messaging, storage, lifecycle, consistency, failure intelligence and more.
A safe inspect → simulate → patch → replay workflow for coding agents.
Evaluate whether deterministic simulation is worth adopting for your team.
Concise machine-readable map to the canonical Causalia documentation.
See Causalia integrated into a concrete .NET example.
Free, open source and MIT licensed.