i2goSignals

goSignals

i2goSignals — Architecture Glossary

This file captures the vocabulary that emerged from the PRD #39 provider-chain collapse. New contributors and AI agents should share these terms when reading or modifying the persistence layer.

Provider chain (post-collapse)

The persistence chain is now flat:

handlers / event router → service (StreamService, EventService, …) → DAO → driver

There is no longer a god-interface (DbProviderInterface) or a god-object (common.BaseProvider) sitting between handlers and services. Each consumer depends on the narrowest seam it actually uses.

Vocabulary

Management-plane vs data-plane auth

Two independent authorization planes:

A management session never grants event delivery; a delivery token never administers the server — with one narrow carve-out: a delivery token may read its own stream’s configuration, which (when it presents the stream’s current server-issued bearer) doubles as self-service credential rotation. See Rotate-on-GET below and docs/security_model.md.

Standards-required public SSF surface

The Internet-reachable endpoints required for SSF interoperability: transmitter discovery and keys, stream configuration/status/verification/subject management, and push, poll, or SSTP event delivery. It excludes operator-only administration, bootstrap, cluster-internal, health, metrics, and Swagger surfaces unless a deployment deliberately publishes them. Avoid the narrower term “event endpoints,” which hides the required stream-control endpoints such as status.

Rotate-on-GET (bearer rotation)

The SSF behavior where a GET of a stream’s configuration returns a freshly-minted delivery bearer. The trigger is proof of possession: rotation fires only when the GET is authenticated by the stream’s current server-issued bearer (the credential about to be replaced). The caller is thereby obligated to persist and switch to the new value.

Any other authorized read of the same configuration — a management session, an admin token, or a valid-but-non-current delivery token — receives a masked bearer value and triggers no rotation. Admins observing config never see (or invalidate) the live credential; the live value is surfaced exactly twice in a credential’s life: the response that created it and the rotation response that retires it.

Rotation applies only to credentials goSignals itself issued (inbound-facing bearers); peer-supplied outbound credentials are never rotated by a local GET.

Rotation preserves the credential’s authorization shape — same scopes, same project — but the replacement is always bound to the stream(s) it serves: a rotated bearer never widens to a wildcard, and a presented bearer whose stream binding does not match the stream being read never rotates anything.

Masked credential

How a credential field reads on any surface other than the response that minted it: the literal sentinel ***, with the field present. The sentinel is deliberately not omission — an absent credential means “none configured”, a *** means “configured, not shown”. Writing *** back through an update means “leave unchanged”, so a read-edit-write round-trip can never clobber a live credential. Masking covers every stored credential — server-issued bearers and peer-supplied ones alike.

Rotation grace

The bounded window after a rotation during which the retired bearer remains valid. It exists for two client-experience reasons: requests already in flight with the old bearer are not failed mid-race, and a caller whose rotation response was lost can retry its GET with the old bearer and receive the same current bearer again (idempotent re-read — no third credential is minted). When the window expires the old bearer is dead cluster-wide. A zero-length grace means immediate revocation. Deliberate trade-off: a stolen old bearer can re-read the live credential until the window closes — inherent to possession-proves-rotation, bounded by the window.

key scope

authSupport.ScopeKey ("key") — a narrow capability between reg and admin. A key-scoped caller may create a new issuer signing key (POST /key/<issuer>) and obtain a reg-only IAT (GET /iat), but is denied key takeover (force=replace/rotate/?rotate → keyScopeOnly guard in api_out_of_band.go) and has no stream/event capability. It seeds the machine tier ladder for unattended bootstrap.

Bootstrap secret

I2SIG_BOOTSTRAP_TOKEN — a shared secret read by authUtil.resolveBootstrapBearer. A presented bearer that constant-time-equals the configured value is synthesized into a key-scope AuthContext before any JWT validation. When the variable is unset, the path is closed and no bootstrap bearer is accepted (fail closed). It is an app-layer authorization mechanism, orthogonal to and coexisting with transport-layer SPIFFE/TLS identity. There is no anonymous /iat endpoint — closing it is the reason the secret exists.

PRM-driven login

The CLI’s login flow is driven by the server’s RFC 9728 Protected Resource Metadata (/.well-known/oauth-protected-resource), which advertises the OAuth authorization_servers and the recommended public client_id (I2SIG_CLI_CLIENT_ID, default gosignals-cli). add server caches the PRM’s authorization_servers; login resolves the issuer from it, discovers the issuer’s OpenID configuration, then runs OAuth authorization-code + PKCE (RFC 7636) via a loopback listener — or RFC 8628 device-code on headless hosts. Sessions are stored per-issuer in credentials.json; see docs/cli_login.md.

Local issuer / Foreign issuer

Two classes of SSF issuer, distinguished by whether the issuer’s root (scheme://host[:port]) equals the server’s own base URL.

The split exists because SSF §7.2.4 binds issuer == fetch-URL == SET iss, and that binding belongs to whoever actually published the SET. See docs/adr/0023-local-issuer-addressing.md.

SSF stream-create acceptance: strict / flexible / goSignals

Three categories of SSF transmitter, from the perspective of a Receiver registering a stream (SSF §8.1.1 / §8.1.1.1):

There is no reliable discovery signal separating strict from flexible (goSignals advertises spec_version: 1_0 exactly as a strict server would). The Receiver therefore declares the posture per-server via an operator flag (add server --strict-ssf, persisted as StrictSsf); the default is flexible. A strict transmitter that rejects an asserted iss/aud is itself the proof of strictness. StrictSsf is carried on both the CLI SsfServer and the shared model.Server, so the server-side TxAlias receiver-create knows the posture of the transmitter it is registering against.

Presence-based acceptance

How goSignals-as-transmitter decides whether to honor iss/aud on an inbound stream-create: if the Receiver supplied them, honor them (cluster-federation / flexible); if absent, auto-generate. No mode flag — the request body picks the path, so one server serves strict external receivers and cluster sisters simultaneously.

Transmitter-assigned iss/aud

What goSignals auto-generates on the §8.1.1.1 path: iss = the server’s advertised issuer (GetDefIssuer(); a per-tenant local issuer once the create endpoint becomes issuer-aware), because §8.1.1.1 requires the Receiver to confirm iss equals the issuer it discovered the Transmitter Configuration from — a per-stream issuer would fail that check. jwks_uri is that issuer’s existing JWKS endpoint (ADR 0023). aud is a freshly-generated, immutable (§8.1.1: “cannot be updated”) per-Receiver identifier in URI form.

Route mode

What a stream does with an event on its way through the router. One value per stream:

A signing transmitter is any transmitter not in Forward mode, whatever its delivery method; a transmitter with no route mode set counts as Publish. An active signing key for its iss and signing_alg must already exist: goSignals never creates a key as a side effect of creating or updating a stream, because doing so would mask a misconfiguration. A key is created deliberately, before the stream that uses it. The check applies to the stream as it would be after a create or an update (any update, not only one that changes iss, signing_alg or route mode), and again when the stream is re-enabled.

Avoid: calling a Forward stream “unsigned” — it may carry a signed SET untouched.

Re-sign (PB) routing and identity rules

How RouteMode and the EventSource selector interact at the matcher (EventService.MatchesStream), which today filters only on (iss, aud, event-type) and must be extended to honor both axes:

SET signing algorithm (signing_alg)

Which JWS algorithm a stream’s SETs are signed with, chosen per stream rather than per server (ADR 0034, RFC 9964). A pinned value — RS256 (RSA-2048), ES256 (ECDSA P-256) or ML-DSA-65 (post-quantum) — signs with the issuer’s newest active key of that type. "" (unset) means any key type: the stream signs with the issuer’s newest active key, and the JWS alg follows that key’s type (spec #114). An issuer that only ever had its legacy RSA key therefore signs exactly as before; one that gains a newer ES256 key moves its unset streams to ES256, while the RSA key stays in the JWKS so SETs signed earlier still verify.

New keys minted without an explicit algorithm take the type I2SIG_KEY_ALG names (default ES256; RS256 and ML-DSA-65 also accepted). The auth-token key is always RSA. Every minting POST /key/{name} response carries a Key-Id header naming the new kid, and a key summary’s keyStates[] report each key’s alg (RS256 for a stored ""), oldest-first.

Each opt-in trades differently, which is why the choice is per stream:

The vocabulary that hangs off it:

Independent of all of the above: CERT_KEY_ALG selects the key algorithm for the internal mTLS certificates cmd/genTlsKeys generates. Different trust root, different blast radius, its own off-by-default switch.

Key rotation / Absolute revoke

How a signing key is retired, as the signing transmitters that use it see it.

A suspend or replace that would leave a signing transmitter with no active key needs the operator’s explicit confirmation; a revoke never does.

A signing key is created only by an operator, one algorithm at a time — never as a side effect of creating or updating a stream. Rotate and replace act on one algorithm and leave the issuer’s keys of other algorithms alone.

Every node stops signing with a suspended, revoked or replaced key, and picks up a rotated one, within a few seconds of the change, whichever node handled it.

The bound is the router’s key cache (internal/eventRouter/signing_key_cache.go): each node’s in-memory signing keys, per issuer and algorithm, which every signing transmitter on the node shares. An entry is re-read from the key store 2 s after it was loaded, once per issuer and algorithm however many streams use it; the node that handles a key change clears the issuer’s entries at once. A re-read that finds no active key drops the entry, so the transmitter follows the missing-key rule; a re-read that fails keeps the current key, so a key store outage does not pause every signing transmitter.

Key validity period (ADR 0042): a signing key may carry NotBefore / NotAfter — its certificate’s dates, or creation plus a lifetime (I2SIG_ISSUER_KEY_LIFETIME, default 180 days). Outside that period the key is expired or not-yet-valid: it stays in the JWKS but never signs, and a stream left without a valid key follows the missing-key rule. A key without a period never expires. Validity is derived on read, never stored as status; a key otherwise leaves service by suspend, revoke or replace.

Stream status: paused / disabled

Pause and disable are defined at the transmitter:

A signing transmitter that has no active signing key takes a key-unavailable pause: it keeps queuing, resumes by itself once the key is active again, and disables if the key is still unavailable after the retry limit. It resumes only its own key-unavailable pause, never an operator’s.

A receiver’s own status reports paused whenever it has stopped polling, for one of two reasons:

A transmitter disable, or an operator disable, stops the receiver until an operator re-enables it.

A receiver’s paused or disabled status is transmitter-caused when the transmitter’s status endpoint reported it, as opposed to an operator setting it. The receiver records which, so an operator can tell the two apart; any operator status change clears it.

A receiver that is only retrying (for example after connection errors) has not paused: its status stays enabled and the reason says why.

Avoid: “paused” for a receiver that is only retrying.

Persistence record

*dbProviders.Persistence — the composition root returned by dbProviders.OpenPersistence(url, dbName). It bundles the per-domain services, the cluster coordinator, and the lifecycle storage seam:

type Persistence struct {
    StreamService *services.StreamService
    KeyService    *services.KeyService
    EventService  *services.EventService
    ClientService *services.ClientService
    ServerService *services.ServerService
    TokenService  *services.TokenService

    Coordinator cluster.ClusterCoordinator
    Storage     storage.Storage
}

Callers should depend on the narrowest field they need (one service, or Coordinator, or Storage) — not pull the whole record around.

ClusterCoordinator

internal/providers/cluster.ClusterCoordinator — the seam that owns distributed-lease and node-registry state. Two implementations:

Storage seam

internal/providers/storage.Storage — the lifecycle surface (Name, Check, Close, ResetDb, SetBaseUrl). Decoupled from data access so health checks and shutdown paths don’t drag the whole god-interface in. One implementation per adapter (MemoryStorage, MongoStorage).

PushDelivery

internal/eventRouter/delivery.PushDelivery — the one-attempt push-side delivery seam consumed by the router’s push loop. One method: Deliver(ctx, PushRequest) PushOutcome “given a stream config, an event record, a signing key, and a kid, sign-or-forward the SET, push it to the receiver, return the goSetPush.Classification + captured peer address + (possibly-rotated) key and kid.”

Two adapters, prior art ClusterCoordinator from PRD #39:

Scope discipline: the seam covers one delivery attempt. Recovery cadence, lease heartbeats, retry policy, backfill, and cluster wake-ups stay in the router — the router consumes the classification and decides what to do next. PollDelivery (the symmetric poll-side seam) is deferred to a follow-up PRD.

DeliveryQueue

The per-stream module the EventRouter owns for one target stream’s in-memory work: the pending JTIs still to deliver, the in-memory poll claims, and the coalesced acknowledgement batch. The acknowledgement batch is one Mongo write — a conditional update of the stream’s deliveries documents from pending to delivered, plus w:1 inserts of the re-signed outbound copies into events. It replaced the old pendingEvents DeleteMany + deliveredEvents InsertOne + retract DeleteMany sequence.

RoutingTable

An immutable snapshot of stream routing — stream id, status, delivery mode, event-type and subject filters — rebuilt whenever a stream is added, removed or changes status, and read without taking the router lock. Lease ownership is deliberately not part of it; that stays in the lease-owner cache (see Ingest read caches).

PeerTransport

The seam for inter-node wake signalling. One method: Wake(ctx, owner node, WakeMessage{StreamID, Mode, Reason, JTIs}). The production adapter is HTTP (HMAC-signed, its own routes, node address looked up in Mongo); the two-node test harness uses an in-process adapter. The JTI list is advisory and capped — the receiving node falls back to reading its pending deliveries from Mongo.

LeaseManager

The node-level module that owns lease acquire / heartbeat / release for every stream on a node. It keeps the lease expiry each heartbeat returns and answers “do I still hold stream X” from local tenure minus a safety margin, so no Mongo read precedes an acknowledgement batch. Fencing tokens remain for operator-visible diagnostics; fence-on-write was rejected (no transactions, and delivery documents carry no owner).

One-trip ingest write

Ingest stores a batch’s event bodies and every matching stream’s pending markers in ONE store call, EventDAO.InsertWithPending (ADR 0043). On MongoDB 8.0+ it is a single ordered multi-namespace client bulkWrite, so ingest pays one majority-acked round trip; below 8.0 it falls back to two sequential writes (bodies, then markers for the accepted bodies only) and logs one WARN at startup. Either way a marker is written only for a SET whose body was stored, so there is no speculative marker to retract.

The router’s ingest path plans first and writes once: planFanoutLocked selects the matching streams (no write), EventService.AddEventsWithPending stores bodies and markers, and commitFanoutLocked meters the accepted SETs as egress and only then wakes the streams. A SET is acked only when its body and its markers are durable (ADR 0038’s contract, retained).

Worth knowing before debugging a delivery oddity: a body-less marker can still exist — data left by an older build’s concurrent ingest — and every delivery leg skips one without acking it. A crash between the fallback path’s two writes leaves the opposite: a stored body with no marker, never acked. And if a body lands but one of its markers fails, the SET is answered 503; the retry resolves as a duplicate, and router.requeueDuplicates repairs it through EventService.RequeueDuplicate / EventDAO.EnsurePending, an idempotent (sid, jti) upsert that queues the SET on each target holding neither a pending nor a delivered record for it, then meters and wakes those targets like an accepted SET (#331). A duplicate with its markers in place changes nothing; a failed repair is answered 503 again. The WAL drain runs the same repair. The only residual is a retry that arrives after retention purged the delivered record, which is re-queued (at-least-once).

The pending-marker and delivered-record collections (pendingEvents / deliveredEvents) were replaced by the single deliveries collection under planning #112 — see below. Legacy documents are migrated once at startup.

deliveries collection

Replaces the pendingEvents and deliveredEvents collections with one document per (sid, jti): {sid, jti, ackJti, state: pending|delivered, createdAt, ackDate, expireAt} — a reference only, never the body. ackJti is the row’s Acknowledgement JTI (see below). Indexes: unique (sid, jti); (sid, ackJti) for the acknowledgement match; (sid, state, jti) for the pending read; TTL on expireAt; jti for the body sweep; and a partial (sid, createdAt) index over state: pending rows only, for the backlog’s oldest enqueue time. state is open to a later claimed value. Because a delivery document is a reference, a body in events is purged only when no delivery document in either state references it. expireAt is written at acknowledgement from the stream’s retention policy (enterprise policy may vary it per stream).

Acknowledgement JTI (AckJti)

The JTI a receiver acknowledges a delivered SET by, stored on the deliveries row as ackJti when the row is written. For a Forward stream it is the inbound JTI; for a re-signing route mode it is the JTI of the re-signed outbound copy. An acknowledgement is matched against ackJti, never re-derived from the stream’s current route mode, so a route-mode change does not orphan rows already written (#363).

Claim

Two related meanings, both owned by the stream’s lease owner:

ServesClaims

RouterDeps.ServesClaims: true when the process serves poll and accepted-SSTP requests and mounts /_cluster/claim (the community server and goSsfServer). A router with it false (business routers) never takes a poll-transmitter or sstp-server lease; it wakes a known owner at ingest and otherwise leaves the rows pending (#365).

Enqueue time / Queue time / Acknowledgement time / Backlog (#352)

The transmitter-side waiting vocabulary, per target stream:

originalJti (field on events)

Set on a re-signed outbound copy stored in events: the copy carries a new jti, and originalJti points at the inbound SET it was derived from. Ingest dedup is on the inbound jti only (amends ADR 0017, follow-up pending). Ordering (ADR 0040) sorts on the original jti.

Ingest read caches

Three separate caches serve the per-event reads on the ingest path, each scoped to its own staleness tolerance rather than sharing one TTL (ADR 0039). Reach for the right one by what it answers, not by name:

EventService.MatchesStream

(*EventService).MatchesStream(stream, event) bool — the SET-to-stream routing predicate. Owns the direction/iss/aud/event-type filter that decides whether a given AgEventRecord should be delivered to a given StreamStateRecord. Pure predicate: touches no DAO state.

Previously a free function eventRouter.StreamEventMatch in the router package. Lifted into EventService so the predicate sits next to the rest of the event-routing surface and can be unit-tested without constructing a router. Same fat-services / thin-DAOs rule that brought the receiver-stream predicate together under StreamService in PRD #39.

Fat services / thin DAOs

The architectural principle: business logic, predicates, caching, and cross-DAO coordination belong in services. DAOs are storage operations only — no predicates, no if-trees, no domain reasoning.

This rule has historical weight. Before PRD #39 the receiver-stream predicate had drifted between adapters (StreamDAOMongo.FindReceiverStreams filtered on route_mode == "import"; StreamDAOMemory.FindReceiverStreams used state.IsReceiver() — different predicates that the memory adapter’s tests covered while the Mongo path silently diverged). Lifting predicates into the service is the structural fix that keeps the two adapters in lockstep.

Fencing token

Monotonically increasing per-resource counter handed back from TryAcquireOrRenewLease. The MemoryCoordinator’s contract guarantees the token never moves backward across the lifetime of a coordinator instance, even after takeover.

Rebindable collection

The atomic-pointer pattern Mongo DAOs use to survive a ResetDb(true) / reconnect without invalidating service references. Each Mongo DAO holds its *mongo.Collection behind an atomic.Pointer[mongo.Collection]. On reconnect the provider calls SetCollection(newCol) on each DAO; in-flight readers see either the old or the new collection, never a partial state. Replaces the pre-PRD #39 swap-on-reconnect path that rebuilt the entire *BaseProvider behind an RWMutex.

Notifying DAO (memory)

Per-DAO decorator wrappers used only by the in-memory adapter. Each wraps an interfaces.X DAO and fires a notify() callback after every successful mutation. Used by MemoryProvider to drive file-backed persistence (MarkDirty → save loop). Mongo carries no decorator and pays no overhead — the memory adapter is the only path that needs after-mutation hooks.

Replaces the WriteHook / SetWriteHook / afterWrite / notifyWrite plumbing previously threaded through ~25 BaseProvider methods.

Subject filtering vocabulary

Terms used by SSF §8.1.3 subject filtering. The implementation guide is docs/subject_processing.md.

Subject

The principal an event is about, identified per RFC9493 Subject Identifiers — the same vocabulary SSF §8.1.3 and SCIM Events (RFC9967) use. Formats: account, email, iss_sub, opaque, phone_number, did, uri, aliases, plus complex subjects (user / group / device / session / tenant / org_unit). A Subject is not necessarily a person — it may be a device, session, or org unit. Avoid: treating “user” or “account” as synonyms for Subject.

Subject matching

The SSF §8.1.3.1 predicate that decides whether two Subjects are “the same” for filtering purposes — distinct from EventService.MatchesStream (which is iss/aud/event-type routing). Rules:

Consequence: a receiver can subscribe broadly (few fields specified) and still receive narrower, more-specific events. Because the two kinds match differently, the subject filter is stored split by kind — simple Subjects hash-indexed on their canonical key (O(1) membership), complex Subjects held in a small field-wise-scanned list. A filter may legitimately reach millions of entries; see docs/adr/0003-split-subject-filter-storage.md.

defaultSubjects

A per-transmitter-stream setting (goSignals extension, not an SSF stream-config field) expressing the default delivery policy a receiver sees — not a guarantee:

It is only a default. Per SSF a transmitter MAY ignore Add/Remove requests and MAY deliver a Subject out-of-band on its own policy (e.g. a user opt-in dialog at the transmitter). So a NONE upstream can still send Subjects goSignals never added, and an ALL upstream may withhold some.

The stream’s subject filter table holds only the non-default set. Changing defaultSubjects on a live stream is a deliberate reset: the filter table is cleared, because old entries carry the opposite meaning under the new baseline.

Provenance-independent downstream filtering

Because upstream delivery is never guaranteed to track what goSignals subscribed for, goSignals must tolerate receiving events for Subjects it never added. The downstream transmitter filter is therefore applied to whatever arrives, judged purely on that downstream stream’s own defaultSubjects + filter table — never on how or why the event arrived. Inbound subscription state and outbound delivery policy are decoupled.

Subject filtering mode

A setting on a goSignals receiver stream giving the operator explicit control over how Add/Remove Subject requests arriving at the fed downstream transmitter streams are handled:

PASSTHRU and HYBRID require (a) the upstream to advertise add_subject_endpoint / remove_subject_endpoint in its SSF discovery metadata, and (b) an unambiguous relay target — see Event source and Subject handler.

Event source

How a transmitter stream selects the events it sends. A new axis, distinct from RouteMode (IM/FW/PB). An unset source resolves to Direct (issue #199), the branch that keeps the historical filter — not to Audience-routed, which drops half of it:

Subject handler

The single receiver stream designated to receive relayed Add/Remove Subject requests for a given issuer. When an Audience-routed transmitter stream’s iss matches exactly one receiver stream, that receiver is the subject handler automatically. When several receiver streams share the issuer (e.g. a cluster of nodes all transmitting to goSignals on common audiences), the ambiguity MUST be resolved at configuration time by designating one explicitly via Explicit (SID) source — otherwise stream configuration is rejected.

Publish-mode iss/aud rewriting is a deferred enhancement and is out of scope; it will later interact with subject filtering because rewriting iss changes the canonical key of iss_sub Subjects.

Add Subject / Remove Subject

Receiver-initiated requests (SSF §8.1.3.2 / §8.1.3.3) telling a transmitter stream whether to deliver events for a given Subject. Add Subject POST returns 200; Remove Subject POST returns 204. Carry stream_id, subject, and (Add only) an optional verified boolean. A transmitter MAY silently ignore them. goSignals stores verified for audit and relays it verbatim upstream, but it does not influence filtering — goSignals is not an identity verifier.

The endpoints are gated by a server-wide I2SIG_SUBJECT_FILTERING setting (DISABLED default / ENABLED). When DISABLED they are omitted from SSF discovery and return 404.

Add/Remove take effect for future events only — they do not replay a Subject’s event history. A receiver that wants history uses the existing ResetDate / ResetJti replay mechanism instead.

goSignals applies the subject filter at delivery time, not at routing time. MatchesStream and HandleEvent are untouched — an event still enters the stream’s pending buffer. The filter is consulted when the buffer is drained:

This is why routing-time filtering was rejected: routing runs on an arbitrary ingest node, so it would force every node to hold every stream’s filter, with no existing channel to keep them consistent. Delivery-time filtering pins the hot path (PUSH) to the single lease owner, which the wake-up scheme already addresses.

Operational events (Operational=true — verify, stream-updated) carry no Subject and always pass the filter, just as they already bypass MatchesStream.

Removal grace period

A configurable interval (SSF §9.3, “Malicious Subject Removal”) during which a Subject whose delivery was just stopped continues to be delivered, so a malicious or coerced receiver cannot instantly blind a downstream by quietly removing a victim Subject.

Example dialogue

Dev: The SCIM demo cluster has several i2scim nodes, each transmitting to goSignals on the same set of audiences. A downstream receiver removes a Subject — where does the Remove go? Domain expert: i2scim doesn’t speak SSF, so there’s no upstream Add/Remove endpoint to relay to. goSignals filters LOCAL. Dev: And if i2scim later supported SSF? Domain expert: The cluster would synchronize Subjects internally, so you’d relay to just one node. You’d pick one cluster stream as the Subject handler via Explicit (SID) source — issuer matching alone is ambiguous across the cluster, so config would reject it otherwise.

What got deleted

Package boundaries

The server handler tree (application.go, routers.go, api_*.go, and their tests) lives in internal/server. The former pkg/goSignals/ package (embedded Swagger UI served at /swagger/, plus codegen scaffolding) was removed in v0.12.0-alpha.21; neither server mounts a Swagger UI any more.

pkg/goSignalsServer (product export) vs pkg/goSsfServer (spec server). goSignals — served by cmd/goSignalsServer over internal/server.SignalsApplication — is the primary product: a strategic gateway that is a superset of SSF (receivers, cross-protocol SET routing, MongoDB-lease clustering, subject filtering, admin CRUD). pkg/goSignalsServer is that product’s pkg-importable export surface for out-of-tree consumers (the enterprise REST-coexistence binary — #215, ADR 0027); today it exports only the admin handler set (NewAdminSurface/AdminRoutes()) with a stub event router — the peer/event plane is served by the binary directly. pkg/goSsfServer is a separate, minimal, SSF-spec-only server for inter-op testing and event generation that deliberately omits the product’s extended functionality (e.g. receivers). Caution: pkg/goSignalsServer’s admin export carries only a stub event router (adminRouterAdapter panics on every event method) — it cannot host an event-plane seam; a live EventRouter exists only on the in-binary gateway and the goSsfServer test server. The Slice-15 metering event-observer (#217) was therefore closed not-planned: its AdminSurfaceConfig.EventObserver rides that stub router and observes nothing. Where the community does meter is the live EventRouter, transport-agnostically: IncrementCounter tags every business SET — push, poll, and SSTP alike, the transport carried only as a tfr label — into the events_in_total / events_out_total Prometheus counters and exposes them at /metrics (internal/server/prometheus.go:363, routers.go:76). Event-throughput metering is therefore a scrape of that existing surface, not a new hook; the one piece it cannot supply is distinct-subject MAS, which is not a counter and needs per-event subject visibility wherever subjects are seen.

Known debt: pkg/goSsfServer/ssf-application.go (a demo receiver) imports internal/server, crossing the pkg/ → internal/ boundary. Reabsorbing pkg/goSsfServer into internal/ (or cmd/goSsfServer/) is deferred — recorded in PRD #50 Out of Scope.

Log-level policy

The four slog levels (DEBUG / INFO / WARN / ERROR) are the same labels that flow through to Loki and any dashboards built on top. Pick the right one so operators can rely on level=ERROR as a real attention signal, not a noise floor:

The discipline is asymmetric. Promoting an item from WARN to ERROR because “it might matter” pollutes the signal that on-call uses to decide whether to wake up. Demoting an existing ERROR to WARN because the condition turned out to be normal-ops is welcome — leave a note at the call site so the next reader knows it was deliberate.

If you find yourself wanting a fifth level (“this is serious but not quite ERROR”), the answer is almost always WARN plus an error= field on the record. Grafana / LogQL can already filter {level="WARN"} | json | error="..." for the subset that matters; a new level cannot.

Token administration vocabulary

Terms for the management-plane view of issued tokens (the tokens collection / TokenRecord). These are about administering IATs and stream tokens, not validating them on the data plane.

The guiding insight: an issued token is a bearer credential that an administrator typically copies and pastes to wherever it will be used. The IP a token was minted from is therefore near-noise; the audit-valuable signal is where it was redeemed/used. So the model tracks redemption, not issuance.

Redemption

The act of using a token, distinct from minting it.

Last-redemption IP

For an IAT: the remote address of the most recent /register call that presented it, with last_redemption_at and a redemption_count. Last-only (not a full trail) — deep per-event forensics live in the SET event journal. redemption_count is also the data primitive a future max-uses / redeem-once policy would consume; a future IAT-IP-mask restriction would consume the redemption IP. Neither policy is built today.

Last-seen IP

For a stream token: the most recent address the peer actually connected from — already tracked per stream as RemoteIP on StreamStateRecord and refreshed as the peer reconnects (no extra write on the hot path). The management-plane token table joins this onto stream-typed tokens. This is the stream-token analogue of an IAT’s Last-redemption IP. Undefined for IATs (they are not bound to a stream).

Event validation vocabulary

Event validation mode

A setting on a goSignals receiver stream controlling whether the semantics of SET event payloads (required claims, subject shape) are checked after the SET itself passes signature/iss/aud verification. Validation is per event URI: an event is recognized when a validator for its URI is registered, unsupported otherwise.

An event is also treated as unsupported when its URI is out-of-contract — matching none of the stream’s negotiated events_delivered patterns. Which event types flow on a stream remains the job of events_requested ∩ events_supported; validation mode governs payload well-formedness, not type selection.

The events_supported half of that intersection is the catalog: the compiled-in SCIM/CAEP/RISC/WISE packs, plus any URIs an operator adds through I2SIG_EVENT_TYPES_EXTRA (ADR 0032). It is a routing gate, not an advertisement — a type outside it negotiates into an empty events_delivered and its SETs are stored but never routed. An extended URI has no built-in validator, so it is unsupported by the definition above: forwarded under every mode but STRICT.

Rejection granularity is the whole SET (worst disposition wins): the router forwards raw signed tokens and never strips a payload, so under STRICT a SET carrying an unrecognized extension payload alongside a valid event is rejected whole.

Event validation wire mapping

Where a rejected SET surfaces on each receive transport. The pkg/goSet* receiver libraries never reject: they compute dispositions and report them (goSetPush.ReceivedSET.Validation, goSetPoll.ParsedPollResponse.Validations). Mode policy and the mapping below live in internal/server — the libraries stay policy-free, and “dispositions reach the server wiring” is structural rather than a review checkpoint.

Both transports report the same error code, invalid_request: RFC8935 §2.4 defines it for a non-conformant event payload and RFC8936 §7.1.2 shares that registry. The description names the offending event URI and, for a malformed payload, the failing claim.

Validator engagement is derived from the stream’s negotiated events_delivered, expanded through ssfModels.MatchDeliveredEvents so exactly one pattern→URI surface exists. NONE builds no validator set at all, so the default posture is the pre-validation receive path rather than “validate and discard the answer”.

Observability is one counter, goSignals_router_event_validation_total, labeled disposition × mode × transport. It is not labeled by stream or event URI, either of which would make the series unbounded. NONE records nothing, because it computes nothing.

SSF stream-management events

The two event types the SSF spec itself defines, both diagnostic / operational rather than business signals: the Verification Event (SSF §8.1.4.1, the receiver-triggered stream liveness check) and the Stream Updated Event (§8.1.5). They are always in-contract and always validated regardless of a stream’s events_delivered list, so a narrowly-scoped STRICT receiver never rejects its own verification handshake. Distinct from the enterprise product’s control-stream events, which are not community vocabulary.

Ping event (ADR 0048, planning#142): A Verification Event, whoever sent it: a keepalive or operator-triggered verify that goSignals transmits, or one it receives from a peer SSF server. It is a diagnostic event, not a data event; it is kept only for short-term diagnosis, unlike data events, which follow their stream’s retention. Avoid: heartbeat, keepalive event (a keepalive is one source of ping events, not the whole set), verify SET

Adding a new persistence method

  1. Add the method to the appropriate DAO interface (internal/dao/interfaces/). DAOs are storage-only.
  2. Implement it in both DAO adapters (internal/dao/memory/ and internal/dao/mongo/). Keep them mechanically equivalent — any business logic that varies between adapters is a service-level concern, not a DAO concern.
  3. Add the corresponding method to the service that owns the business surface (StreamService, EventService, etc.). This is where predicates, caching, and cross-DAO coordination live.
  4. Handlers depend on the service, not on the DAO.

Adding a new persistence adapter (e.g. Postgres)

Implement the three small seams:

Then wire dbProviders.OpenPersistence to dispatch based on URL prefix. The interfaces are free of bson.ObjectID and other Mongo-specific types — string IDs only.


(C)2026 Independent Identity Inc.