Reference
The whole surface, as built. Anything not listed here does not exist yet; the specification's construction notes record where the build completed or amended the sketch.
defineActa(config)
Validates and returns a configuration: slices, transitions,
seats, optional effects. Validation is strict and happens at
declaration time: a transition writing an undeclared slice, a seat no transition has
heard of, an effect subscribing to an undeclared transition, or a manifest promising
a transition that does not allow the seat are all configuration errors, thrown before
the store opens.
Slices
{ schema, initial }. The schema is a documented JSON Schema subset
(types, required, properties, additionalProperties, enum, minLength, items). The
initial value is validated against the schema at construction. Every commit's result
is validated against the target slice's schema; an invalid result is a refusal.
Transitions
{ slice, seats, input, guard?, apply }.
input: the payload schema. An invalid payload is refused with the validation errors as the reason.guard(sliceValue, payload): returntrueto admit, or a string to refuse; the string is the reason.apply(sliceValue, payload): the pure reducer. It is the only code that ever computes a slice's next value.baseVersion: a caller may propose against the version it read. A stale base version is refused, so a decision made on old state cannot silently overwrite newer state.
The store
propose(seat, transition, payload, opts?)returns{ ok: true, version, record }or{ ok: false, reason }. Proposals are serialized through a single commit queue in arrival order.read(slice)returns{ value, version }: the value, and the version it reflects.settle()resolves when every effect due for the versions committed so far has run, cascades included.snapshot()andActa.replay(config, records, { toVersion, fromSnapshot })reproduce the state at any version.
Effects
{ name, reads, after?, seat, failureTransition?, run(ctx) }. An effect
subscribes to one slice, optionally only after named transitions. It runs once per
state version, under the idempotency key (effect, version), persisted beside the log
in <log>.effects.json. Versions committed before a crash, or before
the effect existed, are caught up at boot: at-least-once delivery, made safe by the
keys. The context offers version, the triggering record,
read(slice) and emit(transition, payload), which proposes as
the effect's seat through the same commit path. If run throws, the failure
is committed through failureTransition with payload
{ effect, version, error }. An unbroken cascade of effects retriggering
each other is capped at 64 runs; anything past the cap is recorded as failed with the
cap as its reason.
Seats
{ token?, manifest? }. When a token is declared, a proposal as that
seat must present it (opts.token, or ACTA_SEAT_TOKEN for the
MCP server) or the commit refuses with the reason. The manifest,
{ transitions: [...] }, is the seat's own declared scope, enforced on top
of each transition's seat list: a seat narrowed by its manifest is refused even where
the transition would otherwise allow it.
Deadlines
registerDeadline({ name, dueAt, awaiting, matchPayload?, expiryTransition, seat, payload? })
registers a deadline against the current version. A commit of the awaited transition
after the registration version satisfies it forever; matchPayload narrows
satisfaction to records whose payload carries the declared subset, so one front's
deposit does not satisfy another front's deadline. Satisfaction is derived from the
log and survives restarts; the registry persists beside the log in
<log>.deadlines.json. checkDeadlines() is the server's
one clock act, called by the embedder on its own cadence: each open, due, unsatisfied
deadline writes its expiry transition through the commit queue, exactly once. A
refused expiry stays open and is retried at the next check, in the open.
deadlineStatus(name) returns open, satisfied or
expired.
The log
Append-only JSONL. Each record carries seq, version,
at, seat, transition, slice,
payload and baseVersion. The log is the receipt for every
claim the state makes.
CLI and MCP surface
acta inspect --config <config.ts> --log <log.jsonl> [--tail N]: current version, slices, transitions, seats, and the last records.acta replay --config <config.ts> --log <log.jsonl> [--to N]: the state at a version.acta serve --config <config.ts> --log <log.jsonl> --seat <seat>: the MCP server over stdio (JSON-RPC 2.0, newline-delimited). Tools are the transitions; resources are the slices atacta://state/<slice>. One process, one seat.