Supervisor event stream
One log, read three ways:
| Reader | How |
|---|---|
| A program | Server-Sent Events: GET /api/events/stream, resuming after the Last-Event-ID header |
| A program that would rather poll | JSON: GET /api/events?since={cursor}&wait={seconds} |
| An agent | MCP: await_events(since) |
All three read the same events with the same cursor. The stream is contract version 1: every event carries "v": 1. A kind is added, never renamed; a field is added, never removed or retyped.
An event
{
"id": "1843.27.3fa9c2d1",
"v": 1,
"type": "activity",
"kind": "checks-failed",
"ephemeral": false,
"at": "2026-11-30T14:02:11.204Z",
"summary": "JasperFx/wolverine#5475 CI failed at 9c2e41b",
"nodes": [{ "plan": "net11-train", "node": "wolverine-tfm", "status": "pr-open" }],
"source": "github",
"repository": "JasperFx/wolverine",
"pr": 5475,
"url": "https://github.com/JasperFx/wolverine/pull/5475",
"sha": "9c2e41b7d0…",
"state": "failed",
"from": "running"
}The first eight fields are on every event. The rest are left out when they do not apply.
| Field | |
|---|---|
id | The event's cursor. Pass it back to resume after this event. |
v | The contract version. |
type | activity, need, snapshot or log. |
kind | What happened; see Kinds. |
ephemeral | true for a fact kept only in memory: never stored, never replayed after a restart. |
at | When critterstack saw it. |
summary | One line a person can read. |
nodes | The plan nodes it affects, across plans, each with its status when the event was made. Empty for a fact about no node. |
source | github, feed, plans, sessions, bobcat, assertion or stream. |
repository | owner/name. |
pr, issue | The number. |
url | The pull request, issue or run. |
sha | The commit: a PR's head, the commit a merge made, the commit a default branch turned red at. |
branch | A PR's base, a default branch, the branch a pin was read from. |
feed, package, version | A package on a feed, or a pin. |
session | A Claude Code session id. |
runId, tag | A Bobcat run and its BOBCAT_RUN_TAG. |
state, from | The state now and the state before, in the source's words. |
need, actor, command | On a need: its kind, who acts on it, and the command when the action is one. |
by | Who said it: the agent behind an asserted observation, a claim's holder. |
until | On sweep-throttled: when the rate limit resets. |
counts | { running, passed, failed, total }: a PR's checks, or a run's scenarios. |
detail | More words: the failing checks, a sweep's error, what a contradicting sweep saw. |
snapshot | On a snapshot: the present, as events with no id. |
Activity and needs
Activity is a fact: CI went red, a version shipped, a claim stalled. Needs are things to act on. A need appears (need-appeared) and later clears (need-cleared), and both are stored, so a reader that resumes knows which are still open.
The needs are the plan's own (what the plan page's needs panel lists, node by node), and two more a supervisor acts on:
need | actor | Open while |
|---|---|---|
question, go-ahead, fix-base, merge, partial, findings, person, publish, bump, align, bind | person | The node owes a person that action, as the needs panel says. A merge carries the PR's pr and url. |
claim | agent | The node is ready and free to take: its launch is next. |
broken | any | The node's stance is broken (a stalled or orphaned claim, red CI nobody is on). detail says why. |
The events derive from the same status the plan page shows (plan_status), so the stream never says something the page does not.
Kinds
GitHub
Read from what the GitHub sweep observed. Each carries repository, pr or issue, url, and the nodes whose issue or pull requests they are.
| Kind | When | Also |
|---|---|---|
pr-opened | A pull request is first seen open (or as a draft). | sha (head), branch (base), state |
pr-pushed | An open PR has a new head. | sha, from (the old head) |
pr-ready | A draft PR is marked ready for review. | sha |
checks-passed | Its CI turned green, or a push came back green. | sha (the head the checks ran on) |
checks-failed | Its CI turned red, or a push came back red. | sha |
pr-conflicting | It conflicts with its base. | sha, branch |
pr-mergeable | It no longer conflicts. | sha |
pr-reviewed | Its review decision changed. | state: approved, changes_requested, review_required |
pr-merged | It merged. | sha (the merge commit), branch |
pr-closed | It closed without merging. | |
pr-reopened | It reopened. | |
issue-closed, issue-reopened | An issue's state changed. | |
base-red | A repository's default branch turned red. | sha (where it turned), branch, detail (failing checks) |
base-green | It is green again. | branch |
Feeds and pins
| Kind | When | Also |
|---|---|---|
package-published | A version is listed on its feed (NuGet or npm) that was not before. Nodes: the publish nodes for the package on that feed, and the consume nodes that pin it. | feed, package, version |
pin-moved | A repository's committed pin for a package changed. Nodes: the consume nodes on it. | repository, package, version, from, branch |
The sweeps
| Kind | When | Also |
|---|---|---|
sweep-throttled | GitHub's rate limit is spent; nothing is read until it resets. | until |
sweep-resumed | The GitHub sweep reads again. | |
sweep-failing | The GitHub sweep fails for a repository (or has no token), or a feed cannot be read. | repository or feed and package, detail |
sweep-recovered | It reads again. |
Plans, claims and sessions
| Kind | When | Also |
|---|---|---|
node-status | A node's derived status changed. | state, from |
node-claimed | Someone claimed it, or another holder took it. | by, session |
node-released | Nobody holds it any more (released, or the lease ran out). | by (who held it) |
claim-health | The holder's session stalled or is gone, or is back. | state: stalled, orphaned, held; by, session, detail |
session-state | A session is blocked on a prompt, is no longer, or stopped. | session, state, from, detail (what it waits on, or how it stopped) |
Asserted observations
| Kind | When | Also |
|---|---|---|
assertion-recorded | A supervisor asserted a fact (below). | by, tag (the assertion's kind), the subject's fields, session |
assertion-confirmed | A sweep observed it. | detail |
assertion-contradicted | A sweep read the subject after the assertion and did not observe it. | detail (what the sweep saw) |
Ephemeral
Kept only in memory, so ephemeral: true, never stored, and never replayed after the server restarts.
| Kind | When | Also |
|---|---|---|
ci-progress | An open PR's check counts moved. | counts, sha |
run-started, run-progressed, run-finished | A Bobcat run tagged for a node started, moved or finished. | runId, tag, session, state, counts, url |
session-activity | A session did something; at most once a minute a session. | session, detail (when) |
The stream's own
| Kind | Type | When |
|---|---|---|
snapshot | snapshot | The present, for a reader the stream cannot replay to (below). |
truncated | log | Stored events after the reader's cursor were dropped by retention. |
The cursor
An event's id is {stored}.{ephemeral}.{epoch}:
- stored counts stored events from 1. The count is in the store, so it survives a restart.
- ephemeral counts ephemeral events in memory, within one run of the server.
- epoch names that run of the server.
A plain number (1843) is a stored position with no ephemeral one. Pass the id of the last event you processed, or the cursor a read returned.
| You pass | You get |
|---|---|
| Nothing | One snapshot: the open needs, and the latest of each ephemeral fact (each open PR's check counts, each run in flight, each session's activity). Then everything from now on. |
| A cursor from this run of the server | Every event after it, stored and ephemeral, in the order they happened. Nothing twice, nothing skipped. |
| A cursor from an earlier run, or a plain number | A snapshot of the ephemeral facts in place of the ephemeral events you missed, which are gone; then every stored event after your stored position, with no gap and nothing twice. |
| A cursor behind the retention floor | A truncated event saying which stored events are gone, a snapshot that also carries the open needs, then the stored events that are left. |
Ephemeral events are held in memory for the latest 2,000 events; a cursor older than that is answered like one from an earlier run.
Retention
Stored events are kept for 7 days and at most 20,000 of them, whichever keeps fewer, trimmed once an hour. CritterStack:EventRetentionDays and CritterStack:EventRetentionCount change them. A reader that falls behind gets a truncated event, never a silent gap.
Server-Sent Events
GET /api/events/stream
Last-Event-ID: 1843.27.3fa9c2d1?since= stands in for the header (the header wins), and ?plan= and ?type= filter as below. Each event is one frame:
id: 1843.28.3fa9c2d1
event: activity
data: {"id":"1843.28.3fa9c2d1","v":1,"type":"activity","kind":"pr-merged",…}event is the type (activity, need, snapshot, log). The server sends retry: 3000 first and a : keep-alive comment every 15 seconds while nothing happens. A client that reconnects with Last-Event-ID resumes as the cursor table says. An unreadable cursor is a 400.
Long poll
GET /api/events?since=1843.27.3fa9c2d1&wait=240&max=100&plan=net11-train&type=need| Parameter | |
|---|---|
since | The cursor. Left out: the snapshot and the end. |
wait | Seconds to wait when nothing is there yet. Default 0, at most 240 (CritterStack:AwaitEventsSeconds). |
max | Most events in one answer. Default 100, at most 500. |
plan | Only events about that plan's nodes, and events about no node. |
type | Only activity or only need. A snapshot or log event always comes. |
The answer is { events, cursor, timedOut }. Pass cursor as the next since: when filtering skipped everything, it has moved past what was skipped.
MCP tools
| Tool | |
|---|---|
await_events | since, timeoutSeconds, max, plan, type, as the long poll. Waits at most 240 seconds, under the time an MCP client commonly lets a tool call run, and answers { events, cursor, timedOut }; on a timeout, call again with the cursor. |
assert_observation | Record a fact the monitors have not seen yet (below). |
Asserted observations
A supervisor that knows a fact before the monitor does (it merged the PR a minute ago; the GitHub API is throttled) tells critterstack with assert_observation, or POST /api/observations/asserted with the same fields as JSON.
kind | Fields | Advances |
|---|---|---|
pr-merged | subject: owner/name#n | The pr node for it, and an issue node it is a closing PR of. The issue it closes reads closed when its base is the repository's default branch. |
issue-closed | subject: owner/name#n | The issue node for it. |
package-published | package, version, feed (default nuget.org) | The publish node for the package on that feed: its feed reads as listing the version. |
Every assertion takes by (who is asserting), and optionally at (when it happened, ISO 8601; default now), note and session. It is recorded as asserted, on its own stream, with who and when.
- Pending: it counts at once. The node reads as if the monitor had observed the fact, and carries the assertion in its
assertedlist (kind,subject,version,by,at,state,note,session), so it is plain the node believes it because an agent said so. - Confirmed: a sweep observed the fact. The observation decides from then on, and the node no longer lists it.
- Contradicted: a sweep read the subject after the assertion and its grace, and did not observe the fact. It stops counting: the node goes back to what was observed, and lists the assertion as
contradicted, with what the sweep saw indetail, for a day. A later sweep that does observe it confirms it.
Only a sweep that reads the subject after the assertion's at plus a grace judges it: 30 seconds for GitHub (CritterStack:AssertedGitHubGraceSeconds), 15 minutes for a feed, which can take that long to list a version (CritterStack:AssertedPackageGraceMinutes). A sweep that cannot read (a spent rate limit, a feed that does not answer) judges nothing. Each step is an event: assertion-recorded, assertion-confirmed, assertion-contradicted. The stream's GitHub and feed events report what the sweeps observed, never an assertion: an asserted merge that is contradicted never reads as a PR reopening.
Asserting the same fact again while it is pending records nothing, and so does asserting one a sweep confirmed. Asserting a contradicted fact again records it again, and the next sweep judges it again.
POST /api/observations/asserted | |
|---|---|
| 200 | { recorded, id, assertion }: recorded is false when nothing new was recorded. |
| 400 | { error, errors }: an unknown kind, a subject that is not owner/name#n, a version that is not a version, no by. |
