Skip to content
Like what we’re building? Star on GitHub

ADR-168 — An event source is a connector package: a pinned verification contract, a sanitized event, a durable intake, and a subscription that maps the event onto a bot's vars ​

  • Status: Accepted — the operator decided it on 2026-11-14. Direction: native connector packages rather than an app aggregator at runtime; a first wave of Slack, Mattermost, Jira, Linear, Sentry, Alertmanager and polled RSS/Atom and Jira; delivery to a bot's parked run in scope, its semantics left to #3135, where the operator chose a standing bot as an address over rotating runs. After two rounds of plan review by codex gpt-6-astra (xhigh), 22 findings each with dispositions at the end, the operator accepted the record's four departures from the approved plan: board refused on connector subscriptions; polling promising the revisions it observes; one Slack app per connection; Linear's setup manual.
  • Date: 2026-11-14
  • Amended: 2026-11-14, by the intake and pair lot of #3271 — §8.3 and §8.4 state the launch as built: an idempotent submission keyed by (pair, epoch), the epoch a spent run id advances, a completion that is a new queue attempt, replays that never start a second run, and claims any worker reclaims past their expiry, so no elected reconciler is needed. 2026-11-15, by the ingress lot of #3271 — §3 states the lane as built: a binding that cannot vouch refuses before verification, the monthly quota is charged only for a delivery the intake stores, an ingress binds no bot, its pin moves only by explicit consent, and the dedup identity is the signed body alone (a timestamp signed apart made every re-signed vendor retry a second intake). 2026-11-19, by #3396 — §7 states the answer's order: order: oldest_first lets a scan that stops before its last page move a timestamp checkpoint, and an opaque cursor requires it. 2026-11-19, by #3396 — §8.2 builds every pair through intake.PairFor, a polled pair carrying its item's key, and §8.3 does not launch a polled pair whose subscription already holds a launched pair of that revision, so a subscription moved to another query is not delivered a revision twice; pair ids stay (intake, subscription). 2026-11-19, by #3396 — §5 declares type: list filters, which match by membership, and a package may ship setup-poll.md, the notes the studio shows for a polled trigger.
  • Deciders: jo (direction, the three arbitrations), Claude (the design), codex gpt-6-astra (the plan review)
  • Extends: ADR-098 — this is the "trigger ingress family" its triggers.yaml section defers to a later lot of #1072: event filters, payload mapping, durable polling cursors and the studio surfaces. ADR-046 — the spine's envelope, subscriptions and evaluator are the binding this record extends.
  • Relates to: ADR-094 (effects durable before the cursor moves) · ADR-117 (an elected replica per net, which is not mutual exclusion) · ADR-034 (webhook authentication) · ADR-138 (provisioned hook identities and epochs) · ADR-051 and ADR-081 (the parked run an event will reach) · ADR-139 (no code loaded in process)
  • Serves: #3269 (the event-source catalog) · #1072 (its P2 inbound half and its P3 polling cursors) · #3133 (standing crews) · the live-agents study

Context ​

An operator wants to connect event sources — a chat tool, a ticket tracker, a monitor, a feed — and plug one into a bot in one click, from a catalog where each source carries its logo. OpenMausBot offers this by delegating its "connected apps" to Composio, a hosted aggregator that handles the OAuth and relays the events of hundreds of applications.

iterion has the pieces of this and not the whole:

  • One inbound lane, one event. ADR-098's connector lane (#2761, pkg/server/webhooks_connector.go) believes a delivery through a connection's trigger grant and the package's declared events. It is entered from the Forgejo route only, and it parses one payload into a Go struct (forgejoIssueComment) whose fields become hardcoded vars (forgejo_event, issue_number, comment_id…).
  • Closed sets where the next variant should be data. trigger.Source (pkg/trigger/event.go), webhooks.Provider (pkg/webhooks/types.go) and the manifest's invocations.kind (pkg/bundle/manifest.go, its DTOs and studio/src/api/triggers.ts) are each a closed list — the smell philosophy §2 names.
  • Five binding stores. A bot is bound to an event through webhooks.Config (and its BotRules), cloudsched.ScheduledBot, trigger.Subscription, schedules.yaml or iterion.dispatcher.yaml. The connector lane picks its bot from the webhook config's default, so one webhook launches one bot. The local trigger.Subscription store is in memory and is rebuilt from manifests with fresh ids at every start (pkg/cli/trigger.go).
  • Nothing to show. connector.yaml has no icon or category, no route lists the packages or their triggers, and the studio types a connector's name as free text.
  • No filter, mapping or polling. triggers.yaml carries id, event and description; ADR-098 left the rest deferred on purpose, each being a field invented before its reader.
  • Admission before authentication. On an HMAC-signed webhook, the middleware charged the per-webhook rate bucket and the tenant's durable monthly counter before the provider handler verified the signature, so anyone holding a hook's URL could spend a tenant's quota. #3276 fixes the existing lanes; this record states the rule for the new one.

This record is the reader ADR-098 waited for.

Decision ​

1. A source plugin is a connector package ​

The catalog's unit is an ADR-098 package and nothing else: no new artifact kind, no plugin.yaml contribution (ADR-098 refused that manifest's lifecycle and tenancy for connectors). A package that declares triggers is a source, resolved through the same tiers — baked, platform, team, git — under the same maturity rule: a spotted package is listed and inert.

The measure of the seam. Once this record is implemented, adding a source whose wire contract fits the declared vocabulary is files under connectors/<id>/ and no Go. Each package of the first wave is checked for it — an empty git diff --stat outside connectors/, the package's own tests aside. A vendor that needs a new verification scheme, body encoding or response format adds it in Go, argued on its own: those are the vocabulary, not a source.

2. What a package shows: connector.yaml's presentation fields ​

Optional fields at the package's constant schema version (ADR-098's growth rule):

  • icon: — a file of the package (icon.svg), sanitized once at load: script, foreignObject, every on* attribute, every external reference (href/xlink:href and url() outside a #fragment) and anything that is not SVG are removed. A file above ITERION_CONNECTOR_ICON_MAX_BYTES (64 KiB by default; 0 removes the cap) or that the sanitizer cannot parse fails the package's validation, naming the file.
  • brand_color: — a #rrggbb for the monogram fallback and the tile's accent, contrast-checked against the surface tokens.
  • category: — an open vocabulary (chat, tickets, monitoring, forge, feeds, calendar, …); an unknown value is a C1xx warning, never a refusal (philosophy §1).
  • homepage:, docs_url:, and provenance.icon: — where the logo comes from (the vendor's press kit, or simple-icons under CC0). A brand's mark is used nominatively, to name the service.

GET /api/v1/connectors/{id}/icon serves the sanitized bytes as image/svg+xml with Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; sandbox, X-Content-Type-Options: nosniff and an ETag equal to their digest. The studio renders a logo as an <img>, never inline: the sanitizer and the image context are two defences, so neither has to be perfect alone. A package with no icon gets a monogram tile.

3. The verification contract: triggers.yaml's ingress: block ​

A document-level block, optional, at schema_version: 1. Every reader of a delivery for this package reads it, so the lane holds no vendor's name:

yaml
ingress:
  body: json                       # json | form — decoded once, under the body cap
  credential:                      # what proves the sender
    scheme: hmac-sha256            # hmac-sha256 | hmac-sha1 | token | bearer | basic
    in: header                     # header | body | query
    name: X-Forgejo-Signature
    encoding: hex                  # hmac only: hex | base64
    prefix: ""                     # Slack: "v0="
    signed: "{body}"               # hmac only; Slack: "v0:{timestamp}:{body}"
    secret: minted                 # minted (iterion generates it) | vendor (the operator pastes the vendor's)
  timestamp:                       # optional replay window
    in: header                     # header (Slack) | body (Linear: webhookTimestamp)
    name: X-Slack-Request-Timestamp
    unit: s                        # s | ms
    tolerance: 5m
  installation: 'payload.team_id'  # optional: the authenticated identity a delivery must carry (§6)
  event: { header: X-Forgejo-Event }          # or { from: 'payload.type' }
  delivery_id: { header: X-Forgejo-Delivery } # metadata only (see "identity")
  headers: [X-Forgejo-Event, X-Forgejo-Delivery]   # the only headers an expression may read
  redact: [token]                             # body fields removed from the event
  handshake:
    when: 'payload.type == "url_verification"'
    respond: 'payload.challenge'
  ack: { status: 200, body: "" }
  • Bounded extraction, then verification, then nothing else. The lane reads at most the body cap, decodes it once when a credential, a timestamp or an installation lives in the body, extracts exactly the declared fields — refusing a body where one is missing, repeated or not a scalar — and verifies the signature over the raw bytes and the timestamp within its tolerance. A delivery that fails answers 401, is logged, and changes no durable state: no intake row, no monthly counter, no per-webhook rate bucket. Before verification only a per-source-IP limit applies.
  • The signed-string template is validated. signed must contain {body}. It must contain {timestamp} exactly when the timestamp is read from a header — a timestamp in the body is already authenticated by {body}, as Linear signs it. A template that drops a required component fails the package's validation.
  • Identity comes from authenticated material. The intake's dedup identity is the digest of the signed body. A timestamp signed apart from it is not part of it: a vendor re-signs each retry at its own instant — Slack's third retry comes five minutes after the first attempt, past a window that kept the first instant — and a retry must meet the row of the delivery it repeats, not open a second one and launch a second run. The window already refuses an old timestamp, and the body's digest absorbs a replay inside it, so the timestamp adds no replay protection to the identity. A vendor's delivery-id header is unsigned, so it is kept as metadata and never trusted for dedup: changing it on a captured request must not open a second intake. A captured request replayed within the dedup retention is absorbed; a vendor without a signed timestamp gets no stronger replay protection than that, and the setup matrix (§6) says which ones. A vendor that changes the signed body on a retry (Linear's webhookTimestamp lives in the body) is not deduplicated by this identity; a package-declared key over the authenticated body is the follow-up that covers it.
  • The installation is authenticated, not routed. A vendor whose one endpoint serves several installations (a Slack app's single request URL) declares installation:, an expression over the authenticated body. Binding records the value the operator's connection belongs to, and a delivery carrying another value is refused. The URL says which ingress was hit; only the signed body says whose event it is.
  • The consented contract is pinned. Binding an ingress records the digest of the package's ingress: block as the operator consented to it. A delivery whose package now resolves to a different contract — a team override of a baked package, a new version — is refused with a typed error naming both digests until the operator re-binds. This is the inbound twin of the outbound resolver's refusal of a changed credential placement (pkg/connection/resolve.go).
  • The secret's origin is declared. minted: iterion generates the secret, shows it once and gives it to the vendor (or provisions it, §6). vendor: the vendor generates it (a Slack app's signing secret, a Mattermost outgoing webhook's token) and the operator pastes it; the ingress route accepts it on creation and on rotation. It is sealed like every webhook secret, and rotation opens an ADR-138 epoch.
  • The answer is declared, and admission precedes it. An authenticated delivery is admitted against the tenant's quota and against a per-tenant cap on unprocessed intake (ITERION_CONNECTOR_INTAKE_BACKLOG_MAX, 0 removes it): over the cap it answers 503 so the vendor retries later. Admitted, it is answered with the package's ack (200 and an empty body by default) as soon as its intake row is durable (§8), never after matching: a vendor's deadline (Slack's three seconds) does not wait for a run to start, and a vendor that reads any other status as a failure (Linear) gets exactly what it expects.
  • As built (pkg/server/webhooks_ingress.go). Verification needs the pinned contract, so the binding is resolved first: a connection that is gone, names another connector, lacks the trigger grant or is not live, and a contract that changed, answer 409 before verification and write nothing; a store that cannot answer is 503. Before the proof nothing decodes the body into a tree: a credential or a timestamp that lives in the body is read by a top-level scan, and the per-source-IP limit is keyed by the resolved ingress as well, since a vendor delivers every tenant's hooks from one shared pool — after the ingress is read, so an id a sender invents creates no limiter state. A handshake is answered before the installation is checked — Slack's endpoint verification carries none — and the installation is read from the signed body only. The quota is the one admission step that writes, so it runs last and counts what the intake stores: a handshake, a filtered delivery and a redelivery that meets its row are answered without it, the backlog cap is read before it (a soft bound under concurrency), and a write that meets a twin's row, or fails with its row proven absent, gives its unit back. An ingress binds no bot — a subscription does (§6) — so the webhook's bot scope is refused on it. The pin moves only by explicit consent: a PATCH restating the contract_digest the package resolves to, a re-bind or an echoed row moving nothing; the ingress records its connector and its secret's origin, so it keeps its vendor when its connection is gone, and a contract that changes the origin needs a rotation first.

4. The sanitized event ​

What an expression, a preview, the intake store, the bus and a launched run see is the event, never the request: event.<output> (the declared outputs, §5), event.payload (the decoded body without the redact fields and the credential field) and event.headers (only the headers listed in headers:; Authorization, Cookie and the credential header are never listable). The raw body and the full headers exist only inside verification and dedup, and are never persisted, logged, published or passed on. An event's text reaches a prompt as untrusted input, in the same class as a forge comment today.

5. What a trigger declares ​

Per trigger, every field optional beside ADR-098's id, event and description:

  • display_name: — the catalog's label.
  • delivery: webhook | poll — webhook by default.
  • outputs: — { name, from: <expr>, description, type: string | int | bool | list | map }, what the studio offers for mapping and what a run receives by default. Reserved names, each with a fixed type, fill the trigger.Event envelope and the launch: subject, subject_state, actor, repo, thread (strings), labels (list of strings), and repo_url, repo_ref (strings), which become the launch's clone target. A repo_url is believed only when its host is the connection's base URL host or is in the ingress's repository allowlist; otherwise the delivery is refused, naming the host. thread keys the conversation a delivery belongs to (a Slack channel and thread_ts, a Mattermost root_id, an issue key), which the deliver mode reads.
  • filters: — { id, from: <expr>, type: string | enum | bool | list, options, default, selector }, predicates over the event. A subscription stores the chosen values; a string, enum or bool filter matches when the event's value is one of them, a list filter when any element of the event's list is, each value converted as a launch converts it (§9). The type is declared so the studio picks its input before any event exists, and the sample proves it at load: where it carries the value, a list filter reads a list. A scalar filter over a list compares the list's JSON text; type: list is the membership reading. selector: names an operation of the same package whose result fills a picker.
  • ignore: — an expression that drops an event before matching: the loop guard (a bot's own Slack message), stated by the package because only the package knows the vendor's markers.
  • sample: — a file under samples/, a real delivery with its secrets removed, which the preview and the package's tests read.
  • provision: — §6.
  • poll: — §7.

6. The binding is a trigger.Subscription ​

No sixth store. The ingress and the binding are split along what each owns.

The ingress is a webhooks.Config with Provider: connector, the last value of the closed provider set; the vendor is read from the connection, the route is POST /api/webhooks/c/{ingress_id}. An ingress is one per (connection, registration scope): a Forgejo connection that serves three repositories has three ingresses, each with its own hook and secret, because Forgejo registers hooks per repository (pkg/forge/admin.go). An ingress holds the sealed secret and its origin, the pinned contract digest, the bound installation value, the operator's allowlists and hold-label veto, and its provisioning state.

The binding is a trigger.Subscription:

  • The event carries where it came from. trigger.Event gains ConnectionID and IngressID (or PollerID), set by the server, never read from a payload. A connector subscription stores a scalar connector_key (<connection id>/<trigger id>), and ListCandidates filters on tenant, enabled and connector_key over a Mongo index on those three scalar fields — two array fields cannot share one compound index — so two connections to one vendor never fire each other's bots.

  • trigger.SourceConnector is the last constant of the closed source set: what follows is Kind, the trigger id, which is data.

  • One discriminator, refused where it is unsupported. The existing Mode stays the only field that says what a match does, and gains deliver. Every constructor and dispatcher that reads it — the From*Invocation builders (which today force direct for schedule and keepalive, and default board invocations to board), EffectiveMode, the evaluator, the forge dispatch — refuses a kind and mode it cannot honour, with a typed unsupported result, before any subscription is built; nothing defaults an unknown mode to a launch. deliver stays refused until #3136 ships it. board is refused on a connector subscription: the board effect promotes an existing native card (pkg/server/trigger_cloud.go), and turning an external event into a card is a contract of its own.

  • The rest of the binding: filters (chosen values, plus an optional when: expression), var_map (a var name to an expression over the event), for a polled trigger the poller it listens to (§7), and no_live_run: launch | drop, stored now and read by #3136. With no var_map, each output named like a declared var of the bot is passed under that name. Saving a subscription validates the map against the bot's declared vars (botregistry.EntryWithSchema.Vars) and answers 400 on an undeclared target or an unfilled required var.

  • Durable everywhere, bootstrapped idempotently. The local subscription store becomes persistent under the run store (.iterion/), beside the Mongo store and a memory store kept for tests; intake, pairs and poll state follow the same three-way rule. Manifest-derived subscriptions get stable ids (from bot, kind, trigger and connection) and are reconciled, not regenerated: an operator's disable or delete leaves a tombstone the next start honours. The workers start from durable state whether or not the manifest scan finds anything.

  • The manifest suggests, the operator binds. invocations accepts kind: connector with { trigger, mode, filters, vars }. A manifest-derived subscription's identity is (bot, kind, trigger id, connection), so a bot written for Slack and Jira gets two; the from-invocation route gains a connector builder and stops refusing a second subscription of one kind. Every consumer of the kind enumeration — manifest validation, the registry DTOs, the studio types — accepts it. The .bot text gains nothing (ADR-046).

  • As built (L1d). bundle.ResolveMode is the one reading of a mode: the From*Invocation builders, the evaluator and the effect worker, forge provisioning (rules, command map, cloud schedules), command discovery, the webhook dispatch, the fork gesture, the trigger routes and the lint (C215) refuse deliver, an unknown mode and board on a connector, typed. ConnectorKey is derived by every store write; the candidate query for a connector event selects tenant, enabled, key and poller over the tenant_enabled_connector_key index, sorted by id, and every other source's query excludes keyed rows, the evaluator refusing any keyed or connector-kind row a store hands it. The local store is a file journal (<store>/dispatcher/trigger-subscriptions.json, the row version kept for the CAS) reconciled at each start: it refreshes what a manifest owns, keeps the operator's enabled flag, pins and guard, and removes a derived row only when its bot was discovered and its invocation is gone, without a tombstone; a connector row is never derived, refreshed or removed there. Tombstones live in trigger_subscription_tombstones in cloud; a Mongo insert re-reads the tombstone after it lands, so a racing delete wins. A connector subscription is judged at save (binding.ValidateSubscription) against its connection (tenant, connector, trigger grant), the package's trigger and filters, the bot's declared vars and required ones; an edit that changes none of the binding is not judged again, so a subscription whose connection is gone stays pausable. The local scope's connections and intakes live under the tenant local, its subscriptions under "" (binding.SubscriptionTenant / ConnectionTenant). The routes ship under /api/v1/ on the request's team; the /api/teams/{id}/… family follows.

The routes the wizard needs, team-scoped in cloud; locally the same handlers under /api/v1/ on the local tenant, as /api/v1/triggers already is, because a local process has no team (pkg/server/server_routes.go):

RouteWhat it does
GET …/sourcesthe catalog (§10)
POST …/connectionsa connection; accepts auth kind: none and basic, and the trigger + action grants
POST …/connections/{cid}/selectors/{filter}runs a filter's selector operation through the resolver
POST …/ingressesan ingress for a connection and a registration scope; mints a secret or accepts the vendor's
POST …/ingresses/{iid}/provision · DELETE …the provisioning lifecycle below
GET/POST/PATCH/DELETE …/triggers*subscriptions
POST …/triggers/previewthe filter verdict and the vars a run would receive, against a pasted payload or the sample; launches nothing
GET …/intakes?state=dead · POST …/intakes/{id}/replaythe dead-letter view and replay (§8)

Provisioning follows ADR-138's discipline. A package that provisions declares create, delete and list operations, a match: expression that recognises its own hook in a list result, and id_from:. Their params see a registration context: the ingress URL and secret, the epoch, a marker unique to the epoch, the scope, and on delete the remote hook id. The ingress records the desired state, the epoch, the remote id once known, and the cleanup owed by a retired epoch. A create whose response is lost is resolved by list: one match is adopted; none means the create may still land, so the epoch stays pending and the reconciler lists again before it creates; several are an error naming the remote ids. A late create of a retired epoch is deleted by its cleanup obligation. A package without list cannot provision: its setup is manual.

Which first-wave source is one click:

SourceCredentialReplay protectionHook setup
ForgejoHMAC header, mintedbody digestprovisioned per repository
JiraHMAC header (X-Hub-Signature), mintedbody digestprovisioned through the webhook REST API
SlackHMAC with header timestamp, vendortimestamp window + digestmanual (setup.md): one app per connection, its team_id/api_app_id bound as the installation
Mattermosttoken in the body, vendorbody digestmanual in the first wave
LinearHMAC header, body timestamp in ms, mintedtimestamp window + digestmanual in the first wave: its hook API is GraphQL, which the executor does not speak yet
SentryHMAC header, vendorbody digestmanual (setup.md)
Alertmanagerbearer or basic, mintedbody digestmanual (setup.md)
RSS/Atom, Jira JQLnone, or the connection's—polling

7. Polling ​

A trigger with delivery: poll declares a query and how to read it:

yaml
poll:
  operation: jira.search.issues          # paginated by the operation's own contract
  params: { jql: 'concat(query.jql, " AND updated >= \"", cursor.value, "\" ORDER BY updated ASC")' }
  query: [ { id: jql, type: string } ]   # what an operator writes; part of the poller's identity
  items: 'response.issues'
  item_id: 'item.key'
  item_version: 'item.fields.updated'
  cursor: { from: 'item.fields.updated', kind: timestamp, overlap: 1m }
  order: oldest_first                    # the answer's order; a cut scan still moves a timestamp checkpoint
  interval: { default: 5m, min: 1m }
  • A poller is a query. Its identity is (tenant, connection, trigger, the digest of its query values). A subscription to a polled trigger names its poller, and an intake from a poller is matched only against that poller's subscriptions — two overlapping queries never deliver one item twice to one subscription. query values shape the request; filters stay predicates over each item.

  • Pages follow the operation's contract. The scan uses the operation's declared pagination (CursorParam/PageParam, pkg/connector/spec/package.go) through exec.CallPaged. A scan that ends incomplete — a page error, a repeated token, complete=false — keeps what it accepted, does not prime, and records why for the next tick. order: oldest_first, the one order a poll declares, says the operation answers oldest first: the pages a cut scan read are then the oldest of the answer, so every instant before the last one it read is read in full, and on a timestamp cursor the scan moves the checkpoint to the latest of those — never back, never past the tick's clock — and the next tick reads on from there, missing nothing whatever its overlap. Undeclared, an incomplete scan moves nothing. An opaque cursor takes the last item's token, so it requires the declaration.

  • What polling promises: the revisions it observes. A tick re-reads overlap before the checkpoint so equal timestamps and late-visible records are seen again, and a seen set of (item_id, item_version) removes what was already accepted. An entity changed twice between two ticks yields one event, its observed revision; a record that becomes visible later than overlap is missed. That is the honest contract of snapshot polling, and the catalog states it per trigger. Completeness needs a change-history source (see "Not decided here").

  • Feeds. An RSS or Atom item's identity falls back from guid to link to the digest of its canonical content; its version is that content digest. The seen set retains an identity while its entry is still in the feed, plus ITERION_CONNECTOR_POLL_SEEN_RETENTION after it leaves, so an item is seen once for as long as it is observable.

  • Accept, then checkpoint, under a fence. Every observed item becomes an intake row, idempotent on (poller, item_id, item_version), before the checkpoint moves (ADR-094's order). pkg/lease elects a holder but issues no fencing token, so the poller's own record carries one: a holder that takes over increments a generation by compare-and-swap, every checkpoint write carries it, and a write from an older generation — or a lower checkpoint — is refused. Two holders overlapping produce duplicate intake attempts, which the identity absorbs.

  • Eligibility is iterion's sequence, not the vendor's clock. Intake rows carry a per-poller sequence number. A subscription records the sequence at its activation and receives only intakes above it, so a late-visible item whose source timestamp predates the activation is still delivered. A new poller's first scan records its intakes as primed — durable, matched to nothing — so enabling a source never replays a backlog. backfill: N on a subscription makes the last N primed or earlier intakes of its poller eligible for it alone.

  • Outbound authority. Polling, provisioning and selectors spend the connection's credential, which the trigger grant does not authorize (pkg/connection/connection.go). They go through the connection resolver like an action: node — status, expiry, maturity, origin and placement checked — and need the action grant; the wizard asks for both in one consent.

  • Guards and bounds. The operation runs server-side through pkg/connector/exec behind the cloud client's SSRF-guarded dialer, which refuses a private address. exec gains a format: feed decoder (RSS 2.0, Atom 1.0, encoding/xml, no new dependency). interval.min holds unless ITERION_CONNECTOR_POLL_MIN_INTERVAL lowers it.

  • As built (L4-1). spec.Trigger gains delivery and poll (pkg/connector/spec/poll.go), validated at load with the package against what exec.CallPaged actually does: the operation is a read of the same package; the walk owns the page and cursor parameters (keyed through spec.ParamKeyForWire, which the walk reads too), so poll.params may not build them, a required parameter the walk does not send on the first page is refused, and a required size counts as built only when the pagination declares a default size; every param is evaluated at load as the first tick sees it and, with a cursor, as a later tick does; params read query.<field> and cursor.value by name, a cursor: block is read by some param and vice versa; a paginated operation's items are its pagination's (poll.items refused there, required otherwise) and its identity reads item only; item_id is required, numbers are canonical decimals and refused at 2^53; a cursor is timestamp (read by spec.ParseInstant, numeric zones or RFC 822's named ones at their own offset) or opaque (a scalar); interval.min is at least a second. A polled trigger declares no event; both lanes that route a delivery by event name go through spec.WebhookTrigger, which skips polled triggers and matches nothing on an empty name, and binding.Matcher.Trigger refuses an event that did not come the way its trigger is fed (ingress versus poller). Two webhook triggers on one event are refused. The sample is {"response": …}, each item an object proven for identity and cursor, each output reading something on some item. HTTPBinding.response_format: feed decodes a 2xx answer through exec's RSS 2.0 / Atom 1.0 decoder (pkg/connector/exec/feed.go): a bounded token pre-pass (ITERION_CONNECTOR_FEED_MAX_ITEMS, ITERION_CONNECTOR_FEED_MAX_DEPTH, refused past either), RSS fields matched in their own namespace, the header's charset over the document's, WHATWG's UTF-8 and windows-1252 labels, a version hashing every field a reader sees; a feed cannot carry a JSON response contract. spec.Package.DeliverableTriggers (webhook triggers of a package with an ingress) is what the catalogue offers and what an ingress bind requires; a subscription to a polled trigger, or to a trigger of a package with no ingress, is refused at save until pollers ship (L4-2).

  • As built (L4-2). pkg/connector/poller holds the record and its fence in three twins (memory, a journal under the run store, Mongo connector_pollers and connector_poller_seen): Acquire takes the next generation by compare-and-swap, and Reserve (the intake sequence) and Complete (the checkpoint, never moved back for a timestamp; the priming, once, with the sequence it reached) refuse a lost generation. pkg/connector/polling is the tick, run by the elected net connector-pollers: the subscribers listed by poller, the trigger re-read from the tenant's catalog, the operation resolved through Resolver.ResolveActionByConnection under connection.TrustOfTenantConfiguration (the action grant, the connection's own origin), its params from binding.PollQueryValues and the checkpoint less the overlap (cursor.value, and cursor.epoch_ms for a timestamp), the walk on the tier's guarded client with JSON numbers kept as literals (exec.Executor.PreciseNumbers), each unseen item read through ingress.ReadItem and accepted — primed until the first complete scan — then the seen set marked, then the checkpoint. binding.ValidateSubscription derives Poller from poll_query on every save; the server ensures the poller before the subscription and sets PollerSince at each activation; binding.Eligible keeps a polled intake for the subscriptions activated below its sequence; a backfill is paired by the tick once the poller is primed, through Matcher.Rejudge and intake.PairsOf, then marked done. Connections gained the scheme kind none and the route-created basic; an operation at_base_url is sent to the connection's URL as written. A poller with no subscriber goes dormant (an idle Complete unprimes it and moves a timestamp checkpoint to that instant; Store.Wake at activation), so neither a resume nor a new subscription launches what changed meanwhile; the first settled tick of an activation pairs what was matched between the save and the subscription landing, then its backfill. A pass ticks pollers concurrently under a per-scan deadline, reports a lease.PassVerdict to the lease's health, and a poller's error is recorded on its subscriptions' last error. A feed entry's version hashes its visible text. Shipped: rss and jira.issue.changed (its first scan bounded to the last day, not_matching refusing an ORDER BY); the example above predates them and is the shape, not a package that loads. How a scan longer than its operation's page bound completes: the next bullet.

  • As built (#3396, the answer's order). spec.TriggerPoll.Order (order:) takes one value, oldest_first (spec.PollOrderOldestFirst); another is refused at load, and so is an opaque cursor without it. Declared on a timestamp cursor, a scan that stops before its last page — the page bound, a later page failing, the scan's deadline — moves the checkpoint to the latest instant it read in full, the one before the last it read (polling.tick.partial, under the bounds tick.instant gives every timestamp checkpoint), reports why it stopped and does not prime, so a first answer longer than the bound primes on the tick whose scan completes. jira.issue.changed declares it, and the shipped-package witness checks a declared answer ascending against the vendor's double. Open: a page bound whose items all share one instant, or more changes within one overlap window than the bound holds, stall an oldest-first checkpoint, and a stopped scan never moves an opaque one.

8. From intake to effect ​

  1. Accepted means durable. After verification and admission (§3) the lane answers a handshake if it is one, applies ignore, extracts the outputs and writes an intake row — the sanitized event, its connection, ingress or poller, trigger id, dedup identity and sequence — then answers ack. A redelivery with the same dedup identity meets the existing row and is answered ack without a second one.
  2. Matching runs after the answer, and its outcome is stored. A worker claims an intake, lists its candidate subscriptions in a stable order (by subscription id), evaluates each one's filters and when, and writes one pair per candidate into a pair store of its own, keyed uniquely on (intake id, subscription id): matched, not matched, or refused with its reason — an expression that exhausted its budget is a refused pair, visible and replayable, never a silent omission. Every writer — the matcher, an activation's catch-up, a backfill — builds a pair through one constructor, intake.PairFor, and the store refuses a pair built any other way: a polled pair carries its item's key, the item at its version within its tenant's connection and trigger (intake.PolledItemKey), the same on every poller of that connection and trigger that accepts the revision. The intake is marked matched only when every candidate has its pair. A fan-out of any width is so many rows, not one growing document.
  3. A pair's launch identity is its submission. A matched pair launches as an idempotent submission keyed by (pair, epoch) — LaunchSpec.SubmissionKey (pkg/runview/submission.go) — and the launch path derives the run id from the key and the tenant, in a namespace no caller-chosen run id may enter. The launch path owes one property in return: submitting a key whose run already exists answers from that run instead of failing or creating another. A cloud run still queued by the launch path's own attempt — no runner claimed it, no resume re-queued it (store.Run.SubmissionAttemptAt) — is completed as a new attempt: re-persisted under compare-and-swap on the version it was judged at, with a queued_at of its own, and published under a message identity of its own. A runner claims a queued run only for a delivery published at or after its queued_at, so a first publication that did land is retired and one attempt is ever executable; the completion supersedes the first attempt's pool lease, as a resume does. A run that was handed on — claimed, parked, re-queued by a resume — is answered as it stands. A run that never left its launch path (LAUNCH_FAILED, terminal by the store's doctrine) has spent its id: the pair's epoch advances, the next attempt submits under the next key, and the failed run stays visible. A pair is launched only once the submission is acknowledged; a run record that exists proves nothing more than a submission to complete. A polled pair is not launched when its subscription already holds a launched pair of the same item key — the revision delivered through another poller, which a subscription moved to another query meets on the poller it joins: the launch refuses it, naming that pair and its run, before any submission (intake.Worker, Store.LaunchedPair), and its replay answers the same. Only a launched pair counts: one the launch refused because its subscription had moved off its poller, a dead one, or one still owed delivered nothing, and the revision launches once through the new poller. Three windows stay open, a duplicate preferred to a loss: a first submission acknowledged but not yet marked launched when the second pair is judged; pairs written before #3396, which carry no item key, so a revision delivered before that deploy can be delivered once more after it; and a pair that expires with its intake, so a poller lagging past the intake retention delivers the revision again.
  4. Transient failures retry; exhausted ones are visible. A pair moves pending → claimed(owner, generation, expiry) → launched | refused | dead, and a failed attempt re-enters pending with backoff (ITERION_CONNECTOR_PAIR_MAX_ATTEMPTS, …_BACKOFF) until its attempts are spent, as trigger.EffectOutbox's MarkRetry already does for board effects; a maintenance hold postpones without spending one. Every write is fenced by the claim's generation, and a write under a lost claim fails rather than landing. A claim past its expiry is claimable again and the reclaim spends an attempt; the work under a claim is bounded to half its lifetime, so a worker that overruns has returned before another can take the row. A pair out of attempts, and an intake whose matching keeps failing, land in the dead-letter view and are replayable from it. A dead pair's replay re-submits its current key — its last attempt may have been handed on, and the launch path then answers with that run; a pair the launch path refused replays under its next key; a pair refused by matching is not replayed into a launch, since no filter ever matched it, and is re-judged by matching instead.
  5. The bus hears it, observationally — readers first. The lane publishes each event with an explicit observational marker, and the evaluator skips marked events whatever their payload. Rollout is reader-first: a release whose evaluators honour the marker ships before any publisher emits an event that carries the marker without a launched run id; until then publishers keep the run id and do not publish filtered or zero-success events.
  6. Modes. direct launches through the shared launch path, with its quota, routing, trust and var layers. board and deliver are refused (§6).
  7. As built (L1d). binding.Matcher judges an intake against its connection's candidates; a connector gone from the catalog, an unloadable package, an undeclared trigger or an undecodable event refuse every candidate's pair, naming why, while an outage is retried. The submitter re-reads the subscription and re-judges it at launch (deleted, disabled, re-bound, re-filtered: refused), computes the vars then, believes a repo_url on the connection's host or one its ingress lists in repo_hosts, and launches under the pair's key with the connector provenance (RunSource.ScheduleID names the subscription, so the run-outcome spine stamps it; pair_id, intake_id). The trigger launcher asks the run service first (AnswerSubmission): a key whose run was handed on is answered without charging the gate again. A concurrency or launch-rate denial postpones the pair by its wait without spending an attempt; a monthly cap or a suspension spends one. A replay of a pair matching refused re-judges it against the subscription as it stands (RejudgePair, #3296). Every replica runs the worker (ITERION_CONNECTOR_WORKER_INTERVAL, the ITERION_CONNECTOR_PAIR_* / _INTAKE_* dials); the local studio keeps a durable intake beside its connections, which only polling and a future local ingress lane will fill. Open: a cloud run still queued is completed as a new attempt (§8.3), and that completion passes the gate again.

9. Expressions: one language, a context per site ​

Every expression is pkg/dsl/expr, under its existing per-expression work budget (ITERION_DSL_EVAL_BUDGET). The candidates a delivery is evaluated against are the tenant's own subscriptions, so a hostile payload controls the input, not the count; an exhausted budget is a per-pair verdict (§8.2). expr.Context gains named callbacks for the namespaces below, and an unknown root is an error at validation time, never the evaluator's implicit input fallback.

SiteNamespacesValidated at
ingress.installation, event, handshake.when/respondpayload, headers (listed)package load
outputs[].from, filters[].from, ignorepayload, headers (listed)package load
poll.paramsquery, cursorpackage load
poll.items, item_id, item_version, cursor.fromresponse, itempackage load
provision.*.params, match, id_fromregistration (url, secret, epoch, marker, scope, remote id), response (match, id_from)package load
subscription when, var_mapevent (outputs, payload, headers)subscription save

ignore, handshake.when and a subscription's when read their value as a condition, as every guard in the language does (expr.Truthy): a set field holds, so payload.event.bot_id drops a bot's own message; nil, false, zero, an empty string, list or map, and the strings "false", "no", "0" do not. Read this way, a loop guard errs toward dropping, the safe side of a loop; an operation's success predicate would err toward reading a failure as success, so it must answer a boolean. An absent path evaluates to nil, and a nil output is absent: the var it maps to is not set, never set to an empty string. Values reach a launch as strings by one conversion — a string as is, a number in canonical decimal, a bool as true/false, a list or map as compact JSON. The preview and the lane call the same evaluator and conversion.

10. The catalog is a read model ​

GET /api/teams/{id}/sources (and /api/v1/sources locally) answers the packages that declare triggers across the tenant's tiers: presentation fields, maturity and tier, push or poll and what polling promises, the grants a source needs, its setup mode and replay protection, the tenant's connections, ingresses and pollers for it, and the subscriptions on each. Beside them it lists the built-in sources — schedule, board, run outcome, emit — as descriptors the studio routes to their existing dialogs. It stores nothing (philosophy §5).

As built (L2, #3272): the cards carry the presentation fields, the
maturity and tier, the delivery mode, the auth schemes, the declared
triggers with their outputs and filters, and the ingress contract
summary; a connection and a subscription count per tenant; the
built-ins route to their dialogs. Setup mode, the grants a source
needs and per-poller rows arrive with the waves that declare them
(L3, L4).

11. The Forgejo lane migrates under one authority at a time ​

The connector-bound Forgejo configs of #2761 are live, and a rolling deploy runs old and new replicas together. Two launchers that each believe they own a delivery would launch twice — the legacy lane keys its idempotency on the delivery record and lets the launch mint its own run id — so the migration never has two authorities:

  • Release A (expand). The decoders accept every new field, and no shipped package uses one: an older replica must never meet a package it cannot decode (pkg/connector/spec/triggers.go decodes strictly). Every replica of A reads, per delivery, an authority field on the legacy config row: unset means the legacy lane, subscriptions means the new one. A reconciler under a lease creates, for each connector-bound config, its ingress and subscription with deterministic ids, disabled. Nothing switches.
  • The switch, once the whole fleet runs A. One compare-and-swap writes authority: subscriptions on the legacy row and enables the migrated subscription. Every replica reads the field per delivery, so exactly one lane owns each delivery at every instant. From then on the subscription is the record an operator edits, disables or deletes; the legacy row keeps only the pointer.
  • Rollback. To A: A reads the field and keeps the new lane. Below A, after the switch: the old code reads the legacy row as it was at the switch and never sees the intake rows, so rolling below A requires draining the intake first. That is an operator procedure the release notes state, and the dead-letter view's undrained count is what the operator checks before it.
  • Release B (contract). The forgejoIssueComment struct and the legacy branch are removed once no row lacks the switch.

Parity is the whole launch, without a Forgejo branch. The witness compares the complete launch request of a migrated delivery with today's — each var with its presence or absence (issue_number and comment_id are set only when non-zero), the operator's var layers and their precedence (applyWebhookVarLayers), the clone target now carried by the repo_url output under its trust rule, the run's trust class, routing, credential pins and launch policies — and the new lane reaches it through the package's declarations alone.

Consequences ​

  • A new source whose wire contract fits the vocabulary costs a package: a connector.yaml, a triggers.yaml, a logo, a sample, and provisioning operations or a setup.md — with a setup-poll.md beside it when its polled triggers need other steps than its webhook ones, which the wizard shows for a polled trigger instead.
  • The connector lane loses its last vendor name, under a single authority throughout its migration.
  • One delivery can serve several bots, each with its own filters, mapping and connection, where a connector webhook launched exactly one.
  • Three closed sets each gain one last member — trigger.SourceConnector, webhooks.ProviderConnector, the invocation kind connector — and Mode gains deliver, refused until #3136.
  • The launch path gains an idempotent submission by caller-chosen key, which any other at-least-once launcher can reuse.
  • New durable state, each with its Mongo twin, its persistent local twin and its memory twin in the change that introduces it: the extended subscription and its tombstones, the ingress with its pinned contract, installation and provisioning state, the intake rows, the pairs, the pollers with their checkpoint, fence and seen set.
  • The studio gains a catalog, a plug wizard, a dead-letter view and a logo component; the local server gains the connection, ingress and source routes.

Alternatives rejected ​

  • An app aggregator at runtime (Composio, Pipedream, Nango). It puts a third party in every event's path and a vendor's catalog in place of the packages' — the opposite of #1072's decisions, which already refused an Activepieces worker and Pipedream at execution time. Declined by the operator on 2026-11-14. Reopens on a named deployment that needs a source no package can describe and accepts the third party.
  • Binding in webhooks.Config.BotRules. A second spine, out of reach of the board and schedule sources, the Automations view and the cloud subscription store.
  • Triggers declared in the .bot text. A connection, a channel and a tenant are a deployment's facts.
  • A brand-icon package in the studio (simple-icons on npm). The logo would belong to the studio, so a team's own package could not bring its own.
  • Matching inside the request. A vendor's acknowledgement deadline does not wait for N subscriptions, and a crash between the answer and the effects would lose what the vendor believes delivered.
  • Two authorities sharing an idempotency key during the migration. The legacy launcher keys idempotency on its delivery record, not on the run, so a shared key would not stop two launches; one authority field read per delivery does.
  • The lease as a fence. pkg/lease elects and expires; it does not order writes. The poller's own generation does.
  • A separate effect field beside Mode. Two fields saying what a match does would disagree, and today's dispatch defaults the unknown to a launch.
  • An aggregate evaluation budget per delivery. The candidate count is the tenant's own; a per-pair verdict keeps every subscription's outcome visible instead of letting an early one starve the rest.
  • A JSONPath library for extraction. A second expression language beside the DSL's.

Not decided here ​

  • The deliver mode's semantics — the standing-bot address, the host door, the queue, the no-live-run policy, the successor when a run's budget is spent: #3135, then #3136.
  • Turning an external event into a board card — its title and body, its identity across updates, grouping, the dispatcher staying the launch authority. Until then board is refused on connector subscriptions.
  • Complete change capture — a vendor's change-history or audit source (Jira's changelog) behind a periodic reconciliation, for a subscription that must see every revision rather than the observed ones.
  • Streaming sources (Slack Socket Mode, a Mattermost websocket): an elected holder of a long-lived connection per tenant. They reopen on a source that offers neither a webhook nor a poll.
  • Slack distributed apps (one app, many workspaces, OAuth installs): #1072's P2 managed OAuth apps. The first wave binds one app to one connection.
  • GraphQL operations in the executor, which Linear's hook provisioning and selectors would need.
  • Distributing packages through the marketplace: #1072 refused marketplace installs in cloud, and that stands.

Witnesses this record owes ​

  • Verification. For each scheme and credential location, with real vendor signature fixtures (Slack, Linear, Forgejo, Jira, Sentry): a wrong secret, a missing or repeated credential field, a timestamp outside the window in seconds and in milliseconds answer 401 and leave the intake store, the monthly counter and the per-webhook bucket unchanged. Skip the verification, and each test fails.
  • Identity and installation. A captured signed request with a changed delivery-id header opens no second intake, nor does a vendor's retry re-signed at a later instant; a Slack delivery signed by the right app for another team_id is refused.
  • The pin. A team override that weakens a baked package's verification is refused until re-bound.
  • The canary. A unique value in the credential field and in an unlisted header reaches no expression, preview, intake row, bus event or run.
  • Isolation. Two connections to one vendor in one tenant, and two overlapping pollers: each delivery reaches only its own subscriptions, once — checked against a real Mongo, its index created and its query plan read.
  • The pair machine. A crash before the launch, after the run is persisted but before it is published, and after publication but before the pair is marked, each end with exactly one published run. A returned launch error retries with backoff and lands in the dead-letter view when its attempts are spent; replay launches it once. Each built in both orders.
  • The answer and the backlog. An accepted delivery is answered with the package's exact ack while matching is pending; over the backlog cap the answer is 503 and nothing is written.
  • Polling. An older generation's checkpoint write and a lower value are refused immediately after a takeover; a crash between intake and checkpoint loses nothing; an incomplete scan advances only a timestamp checkpoint of an answer declared oldest first, to the last instant it read in full, never back nor past its clock, and primes only once a scan completes; equal timestamps across a page boundary are neither skipped nor doubled; a late-visible item older than a subscription's activation still reaches it; an RSS item without guid or link is seen once while it stays in the feed; a private feed URL is refused.
  • Modes. deliver through every From*Invocation builder and the forge dispatch, and board on a connector subscription, answer unsupported and launch nothing. An observational event is never re-evaluated, including by a reader of the previous release.
  • Invocations and restarts. One bot with a Slack and a Jira invocation gets two subscriptions; repeated local restarts keep their ids and honour a tombstone; a restart with an empty manifest scan still drains saved intake.
  • Migration. A migrated Forgejo delivery produces the same complete launch request as today; across the switch on a mixed fleet, one delivery launches one run.
  • The seam. Each first-wave package lands with an empty diff outside connectors/.
  • The logo. An icon.svg carrying <script> and an external href is served without them, with the CSP header.

Adversarial review disposition ​

Each finding was checked against the code before its disposition; the ones with the widest blast radius were reproduced by reading the cited lines.

Round one (codex gpt-6-astra, xhigh — 22 findings) ​

  • Adopted — F1 the pair state machine with a recoverable launch identity · F2 credential and timestamp locations, units and body encoding · F3 the sanitized event and its canary · F4 admission after verification, for every lane (the existing lanes are fixed by #3276) · F5 the pinned contract · F6 the connection on the event and the index · F7 entity versus version · F8 complete scans, overlap and the seen set · F9 accept before checkpoint, a fenced monotonic checkpoint · F10 a beginning per subscription · F11 a migration in stages · F12 parity on the whole launch request · F13 persistent local stores · F14 provisioning on ADR-138's discipline · F15 outbound operations through the resolver under the action grant · F17 the observational marker · F18 Mode as the one discriminator · F19 the declared ack after a durable intake · F21 invocation identity and the connector builder · F22 a context per expression site.
  • Adjusted — F16 the board effect needs an existing card: board is refused on connector subscriptions and materialization is named as undecided · F20 the wizard's routes and the setup matrix are adopted; Linear's setup is manual because the executor speaks no GraphQL yet.

Round two (codex gpt-6-astra, xhigh — 22 findings) ​

  • Adopted — F1, F4 one authority field read per delivery, switched by compare-and-swap once the fleet is homogeneous, with rollback and drain rules (§11) · F2 a pair is launched only once its submission is acknowledged; the launch path completes an existing run id's submission · F3 retries with backoff, attempt limits, a dead-letter view and replay · F5 unsupported kinds and modes refused in every builder and dispatcher · F6 {timestamp} required only for a header timestamp · F7 a poller is a query; intakes match only its subscriptions · F8 eligibility by iterion's intake sequence; durable priming · F9 one ingress per (connection, registration scope) · F10 the authenticated installation · F11 dedup on signed material; vendor delivery ids are metadata · F12 repo_url/repo_ref outputs under a host trust rule · F13 reader-first rollout of the marker · F14 a scalar connector_key index · F15 pagination by the operation's contract; an incomplete scan never advances · F17 feed identity by content digest, retention while the entry is observable · F18 a fence the poller record issues, since pkg/lease has none · F19 list, match and the registration context; zero, one and several matches · F21 a pair store of its own; a backlog cap before the answer · F22 stable ids, tombstones, workers started from durable state.
  • Adjusted — F16 polling promises the revisions it observes, stated per trigger; complete capture is named as undecided rather than promised · F20 the aggregate budget is removed rather than given progress semantics: the candidate count is the tenant's own, and an exhausted per-expression budget is a visible, replayable pair verdict.