Skip to main content
On event day Mira is the on-call operator for the EduFest hall (showcase.ieeai.net/edufest). The edufest-sentinel job in Cron Control reads hall health every minute, turns SLO breaches into incidents, routes alerts, and runs bounded automatic recovery. Mira handles every alert with the tuturuuu-edufest-oncall skill (plugins/tuturuuu/skills/tuturuuu-edufest-oncall), which has one runbook per scenario.

Health contract

The hall serves GET /api/obs/health (bearer EDUFEST_SENTINEL_OBS_TOKEN, JSON, at most 64 KiB, no personal data). Every section is optional; a missing section leaves its incidents firing for alerting and provides no recovery authorization. The producer supplies a strictly increasing sequence across deployments and stamps each new observation with its server time. The sentinel rejects malformed reads, sequences it has applied, and timestamps more than 45 seconds from its own clock. The Hall and Mira desk implement the receiver contracts.

SLOs

Rate baselines are EWMAs that learn only from calm reads, so a sustained flood never becomes the new normal. An incident fires after two warn reads or one critical read, escalates once to critical, and resolves after three clean reads in a row, so a signal hovering at a threshold alerts once.

Alerts

  • Dedupe: each message id is delivered at most once per sink (12 hours).
  • Storm: more than four new incidents in one tick collapse into one storm alert.
  • Rate limit: a critical alert over the limit waits in the outbox; anything else is counted and folded into one digest when capacity returns.
  • Retries: a failed delivery retries on the next ticks, at most three attempts.
  • Signature: X-Edufest-Signature is the hex HMAC-SHA256 of ${X-Edufest-Timestamp}.${body} with EDUFEST_SENTINEL_MIRA_WEBHOOK_SECRET (at least 32 characters). The receiver rejects stale timestamps and deduplicates on Idempotency-Key.

Automatic recovery

A new action requires a fresh critical observation of the affected service in the current tick. Rollback uses the sentinel clock for deployment age. Recovery stops starting new actions at the configured event end.
  1. Writes persist before dispatch. The sentinel confirms each effect before adding a temporary action to active cleanup or starting effectiveness checks.
  2. Reverts retain their original key until confirmed. After three attempts, the sentinel keeps the unresolved item and alerts the owner.
  3. Reverts are exempt from the action enable list so existing leases can be cleaned up. Act mode and the human hold still apply.
The sentinel also enforces these operational guards.
  1. Mode EDUFEST_SENTINEL_MODE: observe (default; alerts only), dry-run (plans and audits, executes nothing) or act.
  2. Human hold: the store key edufest:sentinel:hold ({ by, reason, until }) blocks actions and reverts; alerts continue. The sentinel checks the hold again after the ledger fence and starts the request in that same continuation. An unreadable hold blocks dispatch. A hold cannot cancel a Hall or Cloudflare request whose fetch has already started. After placing a hold, check the sentinel log or ledger for an in-flight dispatch and, if one is present, verify or revert its effect manually.
  3. Enable list EDUFEST_SENTINEL_ACTIONS (comma-separated kinds).
  4. Circuit breaker: an action that failed, or whose incident is still critical three minutes later, counts once; two open the breaker for that kind until a human writes it to edufest:sentinel:reset-breakers. A rollback breaker re-arm requires explicit owner confirmation. The reset is consumed only after the sentinel state compare-and-set succeeds.
  5. Cooldown: five minutes per kind and subject.
  6. Limit: three shard actions, two rate-limit or kill-switch actions per 30 minutes; one rollback per day.

Reconcile an in-flight dispatch

Keep the hold in place while you reconcile. Match the active slot or most recent run in the Cron Control ledger to lastSlot in edufest:sentinel:state. Check all three recovery collections:
  • recovery.pending: an entry with attempts > 0 may have reached the receiver.
  • recovery.active[].revertAttempts: a nonzero value means a revert was attempted. Look up the original action ID with the :revert suffix in the Hall audit and confirm whether it released the lease.
  • recovery.audit: check this window for completed actions and reverts, including entries that have already left recovery.pending.
An empty recovery.pending list is not evidence that nothing reached a receiver. For a pending or active record, use the request ID, action kind, subject, and any stored parameters to check the Hall audit or Cloudflare deployment history. For an audit-only record, correlate using only its request ID (id), action kind (kind), and subject (subject). The request parameters cannot be recovered from recovery.audit alone. Obtain them from the matching receiver record if a manual change requires them.

Read-only fallback for the installed CLI

TTR 0.33.0 reports Unknown help topic: edufest. Until your installed ttr help edufest lists recover and ops, use these read-only calls. Set the origins and credentials from approved operator configuration. The health origin includes the Hall base path, such as /edufest. The Mastermind POST contains only an mget operation.
If the CLI commands below are unavailable, ask the Hall owner to reconcile limit and switch changes using the Hall operator controls and audit. Use the existing Cloudflare release workflow for deployment changes. Every manual rollback still requires explicit owner confirmation. When the CLI commands are available, use --confirm-production and --reason "<incident and action ID>" for production mutations, and add --yes for destructive commands.

Help attendees rejoin after a shard restart

Hall health reports shard IDs, connections, capacity, and heartbeats (packages/edufest-ops/src/snapshot.ts:7). The documented read-only interfaces expose neither a room-to-shard mapping nor room join links. Use health to verify the restarted shard and the organiser to recover the attendee link.
  1. Ask the room host to open the original attendee join link in an attendee session and confirm that it opens the intended room.
  2. Once the host confirms it opens, have the organiser re-share the original link through the event’s existing attendee channel.
  3. If the link fails, keep the hold in place and escalate to the Hall owner with the shard ID and latest heartbeat.
Record the verified outcome and any manual change in the incident before releasing the hold.

Cost and stop evidence

  • One hall read, three Mastermind store calls (read, write-ahead, settle) and at most three actions and eight deliveries per tick; each call has a 4-second timeout and no redirects. Response bodies are streamed with caps of 64 KiB for health and Cloudflare deployment responses and 16 KiB for Hall actions. Each action adds two state writes and two hold reads. Calls stop six seconds before the 25-second deadline, so the settle write always has time.
  • One attempt per slot and a 55-second lease, inside the one-minute cadence.
  • Idempotent progress: the planned state, including the slot, is written with compare-and-set before any side effect. A retried or concurrent run of the same slot is a no-op, and a lost settle write leaves undelivered alerts in the outbox and recovery intents available for reconciliation with the same keys.
  • Stop fence: checked before the store read and before every action and delivery. POST /control/jobs/edufest-sentinel/stop (operator token) stops the job; /resume continues from the stored state.
  • The job is off until edufest-sentinel is in CRON_CONTROL_ENABLED_JOBS. Enable it for the event window with observe first, then act after the rehearsal. Once the event ends plus one hour of grace, the processor dispatcher skips the job before claiming a ledger slot. Four consecutive unhealthy ticks or exhausted recovery attempts report a failed run to Cron Control and trigger a deduplicated owner alert.

Configuration

Game-day drills

Two suites inject every scenario and assert the result:
  • packages/edufest-ops/src/drill.test.ts runs the pure sentinel against the simulated rehearsal hall on a virtual one-minute clock: an hour of a healthy hall sends nothing; every scenario is detected within two minutes (three for warn-level signals), Mira is alerted in the same tick with its runbook, recovery (automatic or a runbook fix three minutes after the alert) lands within ten minutes, the incident resolves, and it fires exactly once. It also covers the breaker opening on a stubborn fault, observe mode, a human hold, rate-limit revert and slot replay.
  • apps/cron-control/src/edufest-sentinel.test.ts runs the real Cron Control dispatch against a local rehearsal stack (hall, hall ops endpoint, Mastermind store, signed Mira webhook, operator alert RPC and Cloudflare deployments API in one fetch): auto-recovery per action kind, rollback to the pinned version once, a stuck tally that never triggers an action, a blind sentinel, the operator stop fence and resume, the hold and breaker reset keys, a failing owner channel and the request budget per tick.
Run them with bun run test in each package. Before the event, repeat the drills against the staged hall: set EDUFEST_SENTINEL_HALL_ORIGIN to the rehearsal hall, the Mira webhook to a test sink, and leave EDUFEST_SENTINEL_OWNER_ALERTS unset so no owner alert is sent.