Skip to content

Behavior Engine

The behavior engine turns API descriptions and recordings into executable state.

Traditional mock libraries answer, “given this request, return this response.” Carbon also tracks what changes after the request.

A POST /customers creates a customer. A subsequent GET /customers/:id returns that customer. Deleting it removes the referenced resource. Updating it changes later reads. Real APIs are state machines. Carbon models that behavior.

  • Nodes are resources — Customer, Order, Repository.
  • Edges are relationships — owns, belongs-to, references.

Each mutating endpoint is compiled into one or more transitions — small, deterministic effects the State Engine applies. Transitions are how the graph becomes executable.