Getting StartedCore Concepts

Concepts

Causet keeps an execution record for a workflow. Your app submits an intent. Causet records events and the entity snapshot. Queries and projections expose that history. The timeline can be inspected, forked, replayed, or repaired.

Causet sits beside the existing app. The frontend, database, queue, and services stay where they are.

The example below is an access request, POST /api/access-requests. The same loop is the retrofit.

The loop

Existing endpoint / webhook / job / agent
        ↓
     Intent          (requested action)
        ↓
     Events          (what happened)
        ↓
     State           (entity snapshot)
        ↓
  Projection / Query (what the app reads)
        ↓
     Timeline        (committed history)
        ↓
 Inspect · Fork · Replay · Repair

Rules for one entity run one at a time. A projection query is a later read of that history.

State

State is the entity snapshot the rules read and write. For access request ar_123:

FieldExample
statuspending → approved
requester_emailalex@acme.com
approver_iduser_9
notification_sentfalse

The API route does not UPDATE that snapshot. An intent produces it. The field declaration is in State.

Intent

An intent is the command the app submits.

actions:
  request_access:
    state: access_request
    entity_id_expr: intent.request_id
    input:
      request_id: { type: string, required: true }
      email:      { type: string, required: true }
      reason:     { type: string, required: true }

The endpoint validates the HTTP body, then submits request_access. Preflight can reject it and write nothing. Core rules then change state. Side effects emit events and can submit another intent. The phases, ops, and idempotency rules are in Intents and rules.

An accepted sync intent returns an intent id and a timeline id.

Event

An event is an immutable fact on the ledger. Access-request events look like:

access_requested
approval_required
access_approved
notification_sent
notification_failed

Events are past tense. They are not edited. Projections, queries, and repair derive from them. Payload and versioning rules are in Events.

Projection and query

A projection is a table built from those events. A query is a named read of that table.

queries:
  access_request_status:
    from: access_request_status
    input:
      request_id: { type: string, required: true }
    where:
      request_id: { eq: input.request_id }

The app can keep reading its own tables, call Causet queries, or both. The snapshot from the commit can move ahead of the projection row. How the table is declared is in Projections. How the read is declared is in Queries.

Timeline

The timeline is the committed history for one entity.

request_access
  ✓ access_requested
  ✓ approval_required
  ✓ access_approved
  ✗ notification_failed

A preflight rejection is not a timeline step. Inspection commands are in Observability.

Fork, replay, and repair

A fork is a branch from a known cursor. main stays the production timeline. The fork is where a repair is tried.

Replay recomputes state from recorded events. It rebuilds a snapshot or re-runs projection handlers. It does not submit a new intent and it does not call a provider. A new intent is how a provider call runs again.

Repair is the correction after inspect, fork, and replay. The verified correction is applied as a new intent, so the history contains the fix. The commands are in Replay, fork, repair.

Access request, end to end

StepWhoWhat
POST /api/access-requestsYour appValidate the body, submit request_access
Intent acceptedCausetRecords the intent on the timeline
EventsCausetaccess_requested, approval_required, and the later facts
Webhook, consumer, or queryYour appUpdate the existing database or UI
FailureYouInspect the timeline, then fork, replay, or submit a correcting intent

The same loop is a payment dispute, a support escalation, or an agent decision. The event names change. The record does not.