Scion Triggers: how the pieces fitState as of 2026-11-19 00:57 UTC

Sources and ingress

Every source does the same narrow job: authenticate the inbound thing, bound it, normalise it into an Event, resolve its project(s), and hand it to the inbox. Sources never run actions.

Source kindInstanceStageState
schedulea schedule or one-shot scheduled eventexists; fires through the core from Stage 1 PR 1a1a merged (GoogleCloudPlatform/scion#4969)
webhooka project webhook endpoint (URL + secret)Stage 1 slice, completed in Stage 2definitions merged (#5004) ingress built, waiting on CI
githubthe hub’s one GitHub App, scoped by installation ↔ project associationStage 3normaliser, readiness, comment client, presets core merged G1 slice in development, rest designed
chata conversation/channel pattern (ptone/scion#994)Stage 4plan only
agent_lifecyclehook events of agents in the projectStage 4plan only

Generic webhooks

Experimenthub.triggers off→ 404 Rate limitsper IP and endpoint,before body read Lookupunknown or disabled→ same 404 BodyJSON, ≤ 64 KiB(S2: ≤ 1 MiB) Signaturescion_v1 HMAC,fail closed → 401 Verified capsper project, hub,pending ≤ 5000 Store, enqueueone tx, dedup onX-Scion-Delivery 202queued orduplicate Stage 1 design §8.1. Refusals are content-free. Signature failures are audited at most once per endpoint per minute; every accepted event gets a receipt audit record. Endpoint id in the URL is an unguessable locator, not a credential. Secret: a hub-scoped internal secrets row, shown once at creation (S2 adds rotation with a 24 h grace).

Endpoints are project-owned, with an optional agent binding (decision D2). The project is the only owning scope: there are no hub-level or user-profile endpoints; hub-wide inputs are curated sources such as the GitHub App route (triggers-arch, 2026-11-19; hub-level endpoints could be added later if wanted). The one-call scion trigger webhook create --agent/--message or --to-self form (endpoint plus a default message rule) was pulled forward into Stage 1 PR 5 by ptone on 2026-11-16; endpoint lifetime binding (delete with the agent, or --persistent) stays in Stage 2 P3.

Signature and auth modes

ModeWhat is verifiedReplay-protectedStage
scion_v1X-Scion-Signature: t=…,v1=…, HMAC-SHA256 over version, timestamp, delivery, event and subject headers and the body; ±300 syes1 (only mode in Stage 1)
hub_tokena Scion bearer (session, UAT, agent or dev token) plus new permission webhook_endpoint.sendcounts as protected2 (P4a)
stripe_v1Stripe-style t.body signatureyes2 (P4b, deferrable)
github_v1X-Hub-Signature-256 over the body onlyno → message rules only2 (P4b, deferrable)
jira_v1X-Hub-Signature: sha256= over the body; routing defaults /webhookEvent, /issue/key; dedup by content hash (Jira sends no delivery id)no → message rules only2 (added to P4b, 2026-11-16)

Other Stage 2 additions: configurable replay window (default 300 s), routing hints (JSON pointers for type, subject and dedup key), per-endpoint rate limits that may only be lowered, bodies above 64 KiB stored via pkg/storage (up to 1 MiB), and caps on endpoints, fires per minute and live trigger-created agents.

Rule worth knowing: a trigger that creates an agent or runs a command must use a replay-protected source (scion_v1, stripe_v1, hub_token, or the github source). This is enforced at authoring, at fire time and on endpoint edits (Stage 2 §7.3).
Sources differ: the plan (§4.1) sketches X-Scion-Signature-256: sha256=… over the body. The Stage 1 design replaced it with scion_v1 (timestamped, headers signed) and did not build a body-only mode (D-S1-5). The issue title for P4b (ptone/scion#8062) names only github_v1 and stripe_v1; jira_v1 was added by a later scope note.

GitHub App events (Stage 3)

GitHub deliveryexisting route, HMAC withApp secret (unchanged)needs hub.triggers +hub.github_triggers Ingress checkstarget = this Appverified rate bucketactive installationdrop own App’s events Repo → project(s)projects bound to theinstallation, remote matches(case-insensitive); fan out,or only the primary project Normalisergithub.<event>.<action>attributes, lists, subject@app /command parsingpayload projection ≤ 64 KiB One event per projectdedup delivery id and sha256(body)per project; 24 h freshness→ same inbox and drainer aswebhooks; 202 Drainer-side enrichment (not at ingress)for comments on PRs, one GET /pulls/{n} adds head/base ref and SHA,only when an active rule could match Stage 3 design §4–§5, §8.4. A repository associated with several projects becomes several events, unless a hub admin names a primary project (decision D-S3-7 b).

Schedules: the clock source

Schedules keep their own tables, API, CLI and web pages (decision D1 = shared core, separate rows). Stage 1 PR 1a moves their action, authority and fire-tracking code into the shared core with no behaviour change; Stage 1 PR 4 adds identifiers (schedule id, name, event id, fire time) to the schedule.fired envelope, which today carries none. Showing schedules as triggers, and a later migration, are Stage 4.

Later sources