Scion Triggers: how the pieces fitState as of 2026-11-17 18:17 UTC

One pipeline for every “when X happens, do Y”

Scion already had one trigger: the scheduler (“when the clock says X, run Y as Z”). The Triggers work lifts the scheduler’s fire-and-authority machinery into a source-agnostic core, then plugs new event sources into it: generic webhooks, GitHub App events, and later chat and agent lifecycle events. Rules are written in CEL. System One (model-backed decisions) can plug in later as a second rule dialect. Actions are the same ones schedules already use: message an agent, dispatch a new agent, or run a command in an agent.

1. Sources Webhook endpoint/api/v1/hooks/{id} GitHub App/api/v1/webhooks/github Later sourceschat, lifecycle (Stage 4) Schedule (clock)own tables, shared core 2. Ingress • verify signature / token • rate limits, body caps • normalise to an Event • resolve project(s) • dedup per source • store + enqueue (one tx) • answer 202, never fire   inline 3. Durable inbox trigger_eventsEvent row, pendingpayload ≤ 64 KiB pkg/durablequeueleased-row work itemkind “trigger.event” 4. Drainer: match for each candidate trigger: ① event type prefilter ② match rule (CEL dialect) ③ derive subject ④ claim fire (event, trigger) ⑤ subject policy new / skip    (reuse in Stage 3) 5. Fire core (shared) resolve recorded authority frozen effect ceiling live authorization of action standing (creator, target) denied → “refused” schedules fire through the same core (no inbox) 6. Action → target message→ existing agent dispatch_agent→ new agent from template exec→ argv in an agent github.comment→ PR/issue, posted as App trigger_firesfired | failed | refused |skipped (+ audit, history) Green = shared core and queue. Blue = sources. Purple = actions. Amber = durable records.
End to end. Ingress only writes; a drainer on any hub replica does the matching and firing, so provider timeouts never sit on the action path. Schedules keep their own tables and evaluator (decision D1 = shared core, separate rows) but run their actions through the same fire core.

Two sides of a boundary: what Scion curates and what users create

Platform-curated (Go code, not a public API) Source kindswebhook, github, schedule;later chat, agent_lifecycle Normalisersraw delivery → Event type,subject, attributes Action typesmessage, dispatch_agent,exec, github.comment Rule dialectscel (now); system_one(registered, not wired to triggers) Machinerydurable queue + drainer · fire core (authority, ceiling, standing)signature modes · rate limits · experiments · GitHub presets (server-side)templating grammar and its trusted/untrusted rule User-created (rows via API, CLI, web) Source instancesa webhook endpoint (URL +secret), a schedule GitHub associationproject ↔ App installation(already exists today) Triggers (rules), project-scoped source selector · event types · match rule {dialect, expr} subject rule + mode · action type + payload · enabled / paused authority = the creator’s, recorded and frozen at authoring; re-checked at every fire Presets and forms (Stage 3) are UX that compile to event types + CEL.
Settled by ptone on 2026-11-16: Scion curates the set of source kinds; users create source instances and triggers. The raw Trigger CRUD API stays public (behind hub.triggers); composed surfaces such as --to-self and GitHub presets sit on top of it.

Read on

Functional milestones

What a user can do at each step (F0–F8), how to demo it, live status, critical path, risks.

Core model

Source → Event → Trigger → Action → Fire, subjects and policies, the durable inbox, where authority is checked.

Sources and ingress

Generic webhooks and their signature modes, GitHub App events, schedules, Jira, what comes later.

Rules, CEL and System One

The CEL engine and its limits, the dialect registry, and how System One plugs in.

Actions and targets

message, dispatch_agent, exec in an agent, github.comment, and the templating trust rule.

Cross-cutting

Authority, security, durability, history, experiments, hosted vs workstation hubs.

Status

Stages 1–4 by phase: merged upstream, built but not merged, designed only.

Glossary

Trigger, source, event, subject, action, fire, dialect, seam, endpoint.

The stages in one line each