Activity

Every mutation is recorded with a global, monotonically increasing seq. Reading from a cursor is how anything watches an artifact without a socket — a page that shows "3 new comments", a session shelling in, or the webhook sender in ADR 0003.

GET /api/artifacts/{id}/events?after=812&limit=100&wait=25
→ { "events": [ { "seq": 813, "artifactId": "art_…", "event": { … }, "at": "…" } ], "cursor": 813 }

seq is global, not per artifact: one cursor can follow several artifacts in order, and a gap in a single artifact's numbers is normal.

What is recorded

eventwhen
artifact.published / artifact.updateda version was added
artifact.shared / artifact.unsharedthe public link changed
artifact.vieweda page was served — { version, channel }, one per GET; HEAD is not a view
artifact.state.changeda state key was written — { scope, key, bytes }, never the value
comment.thread.created / comment.thread.resolved / comment.createdthreads and replies

The payload is the domain event plus seq, artifactId and at. Nothing that could be large or sensitive (an HTML body, a state value) is ever in it: the event says what changed, and a consumer fetches the thing if it needs it.

Adapters

adapterorderingnotes
memoryexactreference implementation, gap-free
filesystemexact, single processappend-only JSONL per artifact + a counter file
Postgresexact, concurrent-safebigserial, insert returns the seq, so two appends cannot share one

The Postgres one is the only adapter that is safe with more than one process; the counter in the filesystem adapter is a read-modify-write, the same restriction the artifact store has.

Telemetry is a side channel, not the record

createEventService writes the log first, then fans out to an optional downstream sink (PostHog, OTel). A downstream failure is caught and reported through onDownstreamError, never propagated: a dashboard having a bad afternoon must not fail somebody's publish. A log failure does reject — that one lost data.

Webhook delivery

Webhook subscriptions, signed delivery and retries are implemented. Wire the event log and webhook service into your host and explicitly run the delivery drain; a configured event log alone does not deliver notifications. See Webhooks for the sender port, signature verification, retries and receiver deduplication.

Not yet