George Véras Valentim

Get started

Acta runs on Node 22 or newer, in TypeScript, with zero runtime dependencies. The store, the MCP server and the CLI are one small codebase you can read in an afternoon.

Clone and test

git clone https://github.com/george-veras/acta
cd acta
npm test

The suite is the acceptance proof of the build so far: serialized commits under concurrency, replay at any version, refusals as data, an MCP round trip between two clients, effects running exactly once per version, a forced effect failure landing in the state, seat manifests and tokens, and deadlines expiring by themselves.

Run the demo

node examples/demo.ts

Two scripted callers, a builder and a coordinator, commit concurrently against one store. The log is the receipt:

builder deposit alpha -> "v1"
coordinator land alpha -> "v2"
builder deposit beta -> "v3"
builder deposit gamma -> "v4"
--- log ---
#1 v1 builder deposit {"front":"alpha"}
#2 v2 coordinator land {"front":"alpha"}
#3 v3 builder deposit {"front":"beta"}

Callers proposed concurrently; commits serialized in the order they reached the queue, each with its own version. Nobody asked anybody how things were going. They read the state, or they wrote a transition.

The two-agents demo

node examples/two-agents.ts

Two builder agents reach for the same bug in the same tick. The commit queue serializes their claims: one commits, the other returns as a refusal with its reason, as data, and the loser takes the next bug instead of duplicating the work. Fixes are deposits, and a subscribed effect verifies each one, rejecting a patch whose head does not match its deposit before a corrected fix lands. The demo runs in about a second and prints the full log as its receipt.

Your first configuration

A configuration declares slices, transitions and seats. This is the deposit transition from the runnable sketch in examples/sketch.ts:

deposit: {
  slice: "queue",
  seats: ["builder"],
  input: DepositInput,
  guard: (slice, payload) => {
    const queue = slice as Queue;
    const front = (payload as { front: string }).front;
    return queue.fronts.some((f) => f.id === front)
      ? `front "${front}" is already deposited`
      : true;
  },
  apply: (slice, payload) => {
    const queue = slice as Queue;
    const front = (payload as { front: string }).front;
    return { fronts: [...queue.fronts, { id: front, state: "deposited" }] };
  },
}

The guard refuses with a reason, and the reason is returned to the caller as data. The reducer is pure: it receives the current slice and the payload, and returns the next slice. The commit path validates that result against the slice schema before anything is written.

Serve it over MCP

node src/cli.ts serve --config examples/sketch.ts --log ./log.jsonl --seat builder

One server process serves one seat. Transitions become tools; slices become resources at acta://state/<slice>, each read stamped with the version it reflects. If the seat declares a token, the server presents it from the ACTA_SEAT_TOKEN environment variable. A refusal comes back as a tool error carrying the reason.

Inspect and replay

node src/cli.ts inspect --config examples/sketch.ts --log ./log.jsonl
node src/cli.ts replay --config examples/sketch.ts --log ./log.jsonl --to 2

Replay folds the log through the transitions' reducers and reproduces the state at any version. If two agents disagree about what happened, the log settles it.

Where to go next