Skip to content

Data collection

Partial

Collection is how a value on a device becomes a sample in Omniglass. Four pieces carry it:

  • an endpoint, one API a component exposes, spoken over one transport;
  • a driver, the declarative spec that says what to read from that API and how to set things on it;
  • the tasks an outpost runs, derived from the driver attached to the endpoint;
  • the outpost, which runs those tasks near the device, parses each answer on the spot and ships typed samples to the server (outposts).

This page is the model: endpoints, drivers, sessions, the gate that guards every connection, and the account every endpoint gives of its own collection. Each transport’s wire behavior is on transports, the field-by-field spec on the driver spec, and the operator’s view on the collection guide.

Endpoints: the device’s APIs, declared once

Section titled “Endpoints: the device’s APIs, declared once”

An endpoint is an API we intend to call on a component, not a network address: a host or a port is an input it consumes, not its identity (ADR-0039). It is typed by its transport (ssh, https, snmp), and its name is derived from that transport, so a component holds at most one endpoint per transport and a second is a 409. What an endpoint is for goes in its optional label (“Control processor”), settable at create; an endpoint with no label reads its derived name verbatim (ADR-0119).

An endpoint is made one of two ways:

  • bare: a transport and its params, which gives a reachability probe and nothing more;
  • attached: a driver reference and its inputs, which derives the transport, the params and every collection task from the driver’s spec (below).

Placement is not declared on the endpoint: it names the outpost that runs it, and an outpost purge cascades its endpoints and their tasks. A component that still owns endpoints cannot be deleted; the refusal (409) names how many, rather than stranding them (ADR-0528). An endpoint marked out_of_band (a BMC, a management port) answers through a reboot of its own device, so a reboot command leaves its gate open (the hold set).

Reachability is the bottom of a ladder every endpoint climbs: reached, responsive, authenticated, then collecting. Only the first rungs need the transport alone; the ladder and the gate that guards it are below.

A task is an outpost’s unit of collection work: a poll it runs or a listener it holds on one endpoint. It is read-only plumbing (GET /tasks and GET /tasks/{id} only), its id a content hash of its endpoint, mode and spec, and it carries no outpost column: placement projects from its endpoint (ADR-0040). Both endpoints and tasks carry the two authorization layers, with scope cascading through the owning component (out of scope is a non-disclosing 404).

A task has two independent axes:

  • its mode: poll (we ask) or listen (we wait), said from our side on purpose, since “pull” and “push” invert with the frame;
  • its endpoint’s transport: stateless (a connection per exchange) or held (one connection kept open across ticks, a session).

All four cells are real:

poll (we ask)listen (we wait)
statelessan snmp get, an http request, a udp requesta webhook post, a udp push to the endpoint’s own socket
helda line ask over tcp, tls, telnet or ssh; a request frame over a websocketa line push, a server-sent events stream, a websocket subscription

A driver turns a class of device API into a menu of signals and actions. Its body is the spec: a declarative document stored as jsonb on the driver row and interpreted by one generic engine (ADR-0135). The spec is validated against the catalogs on every write (create, update and the boot seed), so a spec that cannot be interpreted is refused when it is authored, never when it runs. A driver row with no spec is a stub and cannot be attached. A spec declares:

  • one transport it rides, from the transport registry;
  • inputs an attachment supplies: typed string, number or secret, required or defaulted. A secret input is a reference to a secret row of the declared shape, never a value;
  • poll functions: a schedule, a transport-shaped request, and emits, each read with one extraction selector for the answer’s format (oid, regex, jsonpath, xpath, key) and an optional declared transform (an enum map, then scale, then cast);
  • listeners: an arm conversation sent on every connection, a match that claims an unsolicited message, and the same emit shape. A listener rides a held session, a udp socket or a webhook; on any other transport it is refused at write (#1115);
  • command bindings: how a command_type actuates over this protocol (commands);
  • optionally a session block (a login, a credential scheme, the replies that are terminal) and a ladder (which rung each layer runs), both defaulted from the transport.
NameVersionRidesMenu
snmp-generic 1.0.0 snmp 1 poll
lyra-arc-snmp 1.0.0 snmp 2 polls
lyra-hx-snmp 1.0.0 snmp 2 polls
meridian-mx-snmp 1.0.0 snmp 2 polls
meridian-xl-snmp 1.0.0 snmp 2 polls
boreal-beam-snmp 1.0.0 snmp 2 polls
boreal-edge-snmp 1.0.0 snmp 2 polls
polaris-amp-snmp 1.0.0 snmp 2 polls
polaris-dsp-snmp 1.0.0 snmp 2 polls
ferrite-pdu-snmp 1.0.0 snmp 2 polls
ferrite-pdu-api 1.0.0 http 1 poll, 2 commands
kestrel-api 1.0.0 https 4 polls, 10 listeners, 3 commands
kestrel-relay-api 1.0.0 https 4 polls
kestrel-gaze-api 1.0.0 https 2 polls
kestrel-ws 1.0.0 wss 3 polls, 5 listeners, 2 commands
newtron-panel-nvp 1.0.0 tcp 2 polls, 2 listeners, 1 command
newtron-core-nvp 1.0.0 tcp 4 polls, 3 listeners, 1 command
newtron-slate-nvp 1.0.0 tcp 1 poll, 1 listener
newtron-nvp-telnet 1.0.0 telnet 1 poll, 1 listener, 1 command
newtron-nvp-ssh 1.0.0 ssh 1 poll, 1 listener, 1 command
newtron-nvp-tls 1.0.0 tls 1 poll, 1 listener, 1 command
newtron-nvp-udp 1.0.0 udp 1 poll, 1 listener, 1 command
tessellate-census-http 1.0.0 http 2 polls
tessellate-census-feed 1.0.0 tcp 1 poll, 1 listener
boreal-cast-api 1.0.0 http 2 polls
recording-service-api 1.0.0 https 3 polls, 1 listener
newtron-panel-web 1.0.0 https 1 poll
boreal-edge-web 1.0.0 http 1 poll, 2 commands
ucc-webhook 1.0.0 webhook 8 listeners
scheduling-service-api 1.0.0 https 1 poll
ucc-rooms 1.0.0 https 2 polls

Attach is the authoring move. Creating an endpoint with a driver instead of a transport derives everything from the spec in one transaction: the transport, the params (the host and port inputs join into the probed target), the baked defaults, and the tasks, one poll task per poll function and one standing listen task per listener. Each task carries its function whole, with every emit’s lane resolved at attach, so the outpost never looks up a catalog at runtime. A refusal is a 422 naming the fault: a missing required input, an undeclared one, an ambiguous secret name.

A secret input is resolved under the caller’s own secret read scope and admin tier, so an attach can bind only a credential its author could read; an out-of-scope secret refuses exactly as an absent one does. A driver-attached endpoint’s address and credential edit in place through its inputs (PATCH /endpoints/{endpoint} with inputs), re-resolved under the editor’s scope, audited, and the tasks re-derived in the same transaction; a raw params.target, or a transport the driver does not speak, refuses.

The tasks re-derive when the spec changes (#823). A driver update, or the boot seed upserting an official spec, rewrites every attached endpoint’s tasks in the same transaction, writing the ones the spec now derives and retiring the rest. Task ids are content hashes, so an unchanged function keeps its row and a re-seed that changes nothing writes nothing. The outposts concerned are nudged to pull at once (the change nudge), including for a change to the session block or ladder, which no task id hashes (#1997). Until an outpost pulls (under a second, or one tick if the nudge is lost), samples it publishes under a retired task id are dropped at ingest as orphans, warned and counted like any other.

A poll runs on its own schedule.every interval from the outpost’s dispatcher, a new task at once and each later run on a stable phase of its interval; a due whose last run is still in flight is skipped, and a failed fetch retries on a backoff from one second, capped at the interval (ADR-1634; the dispatcher is on outposts). Reachability probes run on the outpost’s probe interval (--probe-every, default 30s, ADR-1273).

The outpost fetches over the transport, then interprets the answer against the baked function: locate each emit, apply its transform, type it by its baked lane. A metric value that is not numeric is a fault, never a sample on the wrong lane; a missing emit faults by name while the rest still land; a failed fetch lands nothing. Every fault lands a collection-failed event naming the task, never a silent drop.

Secrets at the edge. The worklist delivers a task’s secret inputs unsealed on the outpost’s own subject: the server resolves each reference once per pull, and a reference that no longer resolves is delivered as absence, which the outpost reports as the missing credential. The worklist also names each task’s mask, the values of the secret-marked fields (a password, a community, never a username). Before a group of samples is queued, the outpost masks those values, and the forms an http credential takes on the wire, out of every string it carries on every lane, so a device that echoes its credential never puts it on the stream or in storage.

A poll’s or a listener’s emit maps what it reads onto any of the four collected lanes (ADR-1145):

  • a metric or a property names its key and locates its value with one extract;
  • an event names its event type and carries a message and attributes, each a constant or an extract, rendered into its payload and held to the type’s payload_schema. It lands as a caught event (events);
  • a log line names no key: it declares log with a severity, facility and source, beside a message and attributes.

The emit’s name resolves against the metric, property and event catalogs as one namespace, and a reserved key or event type (collection-failed, command-issued) is refused at the spec’s write.

listeners:
- name: events
arm: ["SUBSCRIBE INPUT"]
match: { prefix: "EVT INPUT " }
emits:
- { name: video-input, extract: { regex: "^EVT INPUT (\\S+)$" } } # a property
- name: input-changed # an event
message: { value: "Video input changed" }
attributes:
input: { extract: { regex: "^EVT INPUT (\\S+)$" } }
- name: logs
arm: ["SUBSCRIBE LOG"]
match: { prefix: "LOG " }
emits:
- log: # a log line
severity: { extract: { regex: "^LOG (\\S+)" } }
facility: { value: panel }
message: { extract: { regex: "^LOG (?:\\S+\\s+)?(.+)$" } }
ts: { extract: { regex: "at (\\S+)$" }, layout: rfc3339 }

One held feed can carry every lane. The Kestrel bar’s server-sent events stream (kestrel-api) is claimed by event name: a change event lands the call’s state and participant count as samples, call-started, participant-joined and their siblings land as caught events naming the call, and an event: log line lands as a log line, its severity, facility and text read off its JSON (#2754).

The two non-sample lanes differ on a miss. A log line is raw arrival (ADR-0066), so it always lands: a message that misses falls back to the whole text, and a severity or attribute that misses is left out, each miss a collection-failed. An event is an assertion, so an attribute that misses lands nothing. On a plain poll an event or a log line lands only when its content changes from what that task last landed, so a status page’s last error lands once per change.

Time. Any emit may read its time from the payload (ts, with a layout: rfc3339, rfc3164, unix, unix-ms, or a Go reference layout). Without one, it is the time the outpost received it. A time more than five minutes ahead of arrival lands at arrival instead, and a time that does not parse lands at arrival and faults.

A task’s log lines are its component’s. The outpost carries them apart from its own self-logs, and ingest writes them to log_line on the task’s component, the endpoint as the instance, owner-bound from the task as every sample is. The Storage Gateway holds every log line to RFC 5424’s eight severities through one alias table (warn reads warning), keeps a word outside it as the severity_raw attribute, and bounds the message and attributes at 16 KiB each.

A function reads records and names each one’s identity

Section titled “A function reads records and names each one’s identity”

A service that speaks for many owners answers about all of them at once: one request listing every room, one post naming two. A poll or a listener may declare two fields for it (ADR-1282):

  • records: a dotted path to an array in a JSON body. Each element is read as its own payload, and the function’s emits and identity read once per record, at most 2048 per payload. Records ride a JSON body only, and a function reading records that emits any sample must declare an identity.
  • identity: a match key (a registered property type such as ucc-room-id) and the extract that reads its value off each record. The value is trimmed and bounded (non-empty, at most 256 bytes, no control character), or it is a fault.
polls:
- name: rooms
schedule: { every: 30s }
request: { path: /rooms } # {"rooms":[{"id":"r1","state":"in-call"}, ...]}
records: rooms
identity: { key: ucc-room-id, extract: { jsonpath: id } }
emits:
- { name: call-state, extract: { jsonpath: state } } # one per room, each naming its room

Every sample a record yields carries its identity on the wire. A record whose identity misses lands nothing, and record faults collapse to one per kind per run, so a renamed id field is one fault rather than thousands. A log line never carries an identity: it stays on the conduit’s component. The identity is a claim, never an owner: only the conduit’s bindings turn it into one (below).

A held transport keeps one connection per endpoint across ticks. The outpost holds a session for an endpoint whose worklist carries a standing listen task, any poll over a transport that is always held (tls, telnet, ssh, websocket, wss), or a poll whose driver declares a login. The session is keyed by the endpoint’s id and runs on its own:

  • establish: the first dial; it reads establishing until it connects.
  • authenticate: the driver’s or the transport’s auth step, on every connection, before anything else rides it (below).
  • arm: each listener’s arm conversation, sent in order (listeners).
  • operate: it reads up. Polls and commands borrow the held connection instead of dialing; one reader goroutine owns it. The connection’s first ask waits out a connect quiet window (session.connect_quiet, default 250ms) so a slow banner is never taken as the first answer.
  • recover: a drop (the peer closed, a read failed, the keepalive gave up, an unshaped answer timed out) reads recovering at once and redials with a jittered exponential backoff, 250ms doubling to 30s with 20% jitter. Five consecutive failed attempts read down, where an attempt also fails if its connection drops unanswered within 10s, so a device that accepts and then says nothing never reads up. An answered exchange forgives the failures before it.
  • teardown: a listen task leaving the worklist, a change to what the connection depends on, or outpost shutdown. Teardown publishes no state, since the outpost stopped wanting the session, which says nothing about the device.

There is no session table. Each transition lands as the session-state property on the endpoint’s component (the endpoint’s name as instance) and as an outpost self-log carrying the reason (ADR-0150). A poll that finds its session recovering, down or rejected fails at once with a collection-failed naming the state, so a down device never stalls the outpost’s tick, and it never dials a connection of its own. A session’s first connection is not a failure: a poll that arrives while the session is still establishing waits for the first dial up to its timeout, and if the session is still not up the poll is held, as a gate holds one (counted in poll-held-count, no collection-failed, no backoff), and runs the moment the session is up, released by the same sweep that releases a refused poll once its session is up again. A run now in that window answers that the session is still making its first connection.

A listener derives a standing listen task, and every listen task on an endpoint runs over that endpoint’s one session (ADR-0151):

  • arm is the subscribe conversation, sent on establish and on every recover. It is plumbing, not a command row: each is an outpost self-log with the device’s reply.
  • match claims an inbound message: a line on a line session, an event on a server-sent events stream, a text frame on a websocket. It matches by prefix, regex, a stream’s event name, or a JSON field. Listeners are offered a message in name order and the first that matches claims it.
  • extraction reads the claimed message through the same emit shape a poll’s answer does, and lands it at once under the listen task, with no poll involved.

Every inbound message on a held session is routed by one precedence:

  1. A message a listener claims is the listener’s. It is never an exchange’s answer, unless the exchange declared a reply shape the message also matches.
  2. An exchange in flight (a poll or a command) takes the first message its declared reply shape (request.reply: a prefix, a regex, a JSON field, or a websocket’s correlated id) matches, or, declaring none, the first message no listener claims. A declared error shape answers it as a refusal carrying the device’s text.
  3. Anything left is unclaimed: counted and logged once per housekeeping pass, and, by the spec’s unmatched policy, discarded (the default), landed as a collection-failed, or landed as a raw log line on the component.

A shaped request that gets no answer in time fails only itself and keeps the connection; an unshaped one recycles it, since its late reply would answer the next ask. A driver whose protocol mixes pushes with answers declares its reply shapes. Commands ride the held session too, falling back to a throwaway connection only when none is held.

Auth is a layer that gates the session (ADR-0155). Each attempt runs dial, then the auth step, then the arm, then up. The auth step is the driver’s login dialog or the transport’s own handshake, and its result lands as endpoint-authenticated.

  • One login dialog. A driver declares the prompts to wait for, what to send at each (a secret input’s field, ${secret.<input>.<field>}), and the match that means ready. The same primitive answers a raw tcp password prompt, a telnet login and ssh keyboard-interactive. A credential is only ever written to the wire: any text the component sends back is scrubbed of it before it reaches an error or a reason.
  • Terminal or retryable. A refusal retrying cannot fix is terminal: the driver declares which replies are (session.terminal, each with a class: auth, host-key, certificate, protocol), and a transport classifies its own (ADR-0156). Anything unclassified is retryable and follows the backoff.
  • The login budget. A component that hangs up after the final secret with no refusal text cannot be told from a dropped connection once; three such logins in a row are an auth refusal.
  • Rejected. A terminal refusal moves the session straight to rejected: it closes and dials no more. Polls and commands fail fast with the reason and never fall back to a throwaway connection, which would retry the bad credential.

A rejected session leaves rejected only when its connection fingerprint moves: something it connects with changes (a rotated secret, an edited input, the transport, the driver’s login, a pin), an operator retries it (POST /endpoints/{endpoint}:retry, gated by endpoint:retry and audited), or the driver declares a slow re-probe (session.reprobe, at least five minutes). An unrelated edit, such as a label, moves nothing. Each transition also lands session-reason, so an event rule can alarm on it.

In the console, the component’s reachability read carries each endpoint’s latest session-state and reason, aged by the endpoint’s last_seen, and a rejected endpoint offers Retry. A refused changed key names both the pinned and the offered key and offers Trust this key, a :retry the server refuses (409) unless the refusal on record still names that key (ADR-0159). An endpoint holding no session shows the same notice from its gate’s reason (ADR-1110). An endpoint with no reachability yet says why in a derived pending field: no-outpost (nothing will probe it until one is assigned) or awaiting-probe. The collection guide teaches all of it.

The connection fingerprint and the layered gate

Section titled “The connection fingerprint and the layered gate”

Every connection to an endpoint, held or stateless (the probe, a throwaway poll, the session), is verified bottom up on one ladder (ADR-0158):

  • reachable: a ping, informational only. A device that blocks ping never reads down for it, and a cloud API is never pinged.
  • responsive: the transport rung and the gate. A TCP connect, the protocol’s handshake (ssh, tls), or, where no open port can be detected (udp, snmp), the driver’s named request answered. A wrong host or port fails here, retryably, and never reads as auth.
  • authenticated: the session rung, attempted only when the transport rung passes.

The ladder is declared in the spec (ladder.ping, ladder.transport, ladder.session), defaulted from the transport, so most drivers declare nothing.

The fingerprint is a digest the server computes over every input a connection is made with: the transport, the params, the driver’s inputs, a digest of each attached secret’s sealed envelope (never its plaintext), the session block, the ladder, any declared pins, and the :retry counter. A terminal refusal gates its rung and every rung above it for as long as the fingerprint is unchanged. The rungs below keep running, so reachability stays observed while auth is rejected, except where the transport rung itself carries the credential (an snmp get carries the community).

The gate is a set of reasons (ADR-1650), each with its own release rule:

ReasonAdded whenReleased when
refuseda terminal refusal, on its rungthe fingerprint moves
unreachablethe reachability probe reads down twice runningits next up reading (implicit reachability)
upstreaman endpoint of a path upstream holds a closed gatethe upstream opens and the dependent’s own probe reads up
disrupteda disruptive command (a reboot) is in flightthe device comes back, or the type’s hold_seconds backstop

upstream names the root of the closure, so a chain A to B to C reads upstream A all the way down, and it ranks first, so a dependent is named for the gateway that caused it. The gate is published as endpoint-rejection beside endpoint-rejection-reason (the class and the component’s own scrubbed text) and carried back on the worklist, so a restarted outpost makes no attempt against an unchanged fingerprint. It re-adopts refused and re-derives upstream, but never unreachable, which the probe must earn again.

Every key a probe writes (the reachability and its rungs, probe timings, a session’s state and reason, the trusted host key or certificate, the gate) and the collection-failed a task lands is the outpost’s own observation. POST /telemetry:push refuses each by name, on every lane, under any instance or casing. The set is one declaration, internal/collection/probekeys, which the probes emit from; a key declared there without a ruling fails its test.

The refusal is not the push lane’s alone: every key has one writer class, and the Storage Gateway holds every write to it (ADR-0161, the writer class). The probe keys are the outpost-probe class, so a declared value, a command, a calc rule or an event rule is refused on them too. On the outpost’s own lane a probe key lands only under the endpoint whose task the outpost ran, and a driver spec may emit only a collected key, so a driver cannot speak for the outpost either.

Collection telemetry: every endpoint’s account of itself

Section titled “Collection telemetry: every endpoint’s account of itself”

What an endpoint reports comes in two tiers. Collected data is what its driver reads from the device. Built-in data is what Omniglass knows about the endpoint itself, whatever its driver: the probe samples (transports), a session’s state, the gate, the pins, and the endpoint’s collection telemetry, its account of its own collection (ADR-1369). A driver never emits a built-in key. So even a device that reports nothing of its own has telemetry:

KeyWritten byWhat it counts, per report windowLands
poll-durationthe outpostthe mean time of the endpoint’s poll runs, answered or failed, in mswhen a poll ran
poll-cpu-timethe outpostthe mean CPU time charged to each of those runs on its own thread, in ms: a floor on a poll’s costwhen a poll ran, where the platform has a thread clock
poll-due-countthe outpostthe polls that fell duewhen nonzero
poll-failure-countthe outpostpolls that faulted and landed nothing, or were stopped by a refusal on the gatewhen nonzero
poll-held-countthe outpostdue polls held, not sent, while the gate held unreachable or disrupted, or while the held session was still making its first connection: never a failurewhen nonzero
poll-skipped-countthe outpostdue polls skipped because the last run was still in flight: skipped over due is the schedule’s losswhen nonzero
hold-expiry-countthe outpostdisruptions the backstop ended: a device that did not come back in timewhen nonzero
push-message-countthe outpostmessages its session or udp socket delivered that a listener claimedevery window while held
push-unclaimed-countthe outpostmessages no listener claimedwhen nonzero
webhook-post-countthe serverwebhook posts it accepted for the endpointwhen nonzero, then one zero
webhook-refusal-countthe serverposts it refusedwhen nonzero

Each is counted where it happens and reported once a report window (collection.report_seconds, 60 by default, 10 to 3600), so it costs a few rows per endpoint per window however fast a driver polls. An outpost’s windows close on a grid offset by its name, so a fleet’s outposts land theirs spread across the window (#1779). A rate is read from the counts, never stored. The outpost’s keys are outpost-probe and the webhook keys platform, so neither an outpost nor a push may write the other’s.

The lab exercises every collection method on both tiers: each seeded driver and each transport runs on a dev-fleet component and counts only when both its built-in and its collected data land (simulation). The platform’s account of itself, the outposts’ and the server’s own figures, is on self-monitoring.

The outpost parses, extracts and types every value before it leaves the site, and publishes typed samples on per-lane arrays (metrics, properties, events, logs) of a protobuf batch over JetStream (ADR-0037, ADR-0079). The server never re-parses, and no raw payload is stored: a failed parse lands a collection-failed event instead. The ingest consumer lands each batch once, in one transaction under its receipt (ADR-0311; messaging).

The owner is bound on the server. The outpost stamps no component identity: ingest binds each sample to the component of its task’s endpoint, confines an outpost to its own tasks (another outpost’s task id is an orphan, dropped), and rejects a sample name its lane’s catalog does not hold. An orphan drop is never silent and never a flood: the first in a minute is logged naming the outpost, the task and the samples, the rest counted onto the outpost’s orphaned_batches (#1200). A property series is transition-only, guarded at the outpost and at ingest, so a steady fleet writes each state once (ADR-1592).

On demand: validate, preview, and run a poll now

Section titled “On demand: validate, preview, and run a poll now”

Three routes let an author, human or agent, build a driver against the real device without waiting on a schedule (ADR-1163):

  • Validate (POST /drivers:validate, driver:read) checks a spec by the rules a save applies, names every fault it can on the function it is in, and writes nothing.
  • Preview (POST /drivers:preview, driver:preview) runs a stored or unsaved spec’s polls once through a named outpost and answers with each sample (and its identity), each emit that did not locate, and a masked excerpt of the raw answer. Nothing is stored. A secret input must be one the caller may bind (secret:bind), and each secret used is audited. A poll that rides a held session or a udp socket needs an endpoint, so it is attached and run now instead.
  • Run now (POST /endpoints/{endpoint}/polls/{poll}:run, endpoint:run) runs one of an attached endpoint’s polls outside its schedule and lands what it reads. A gated endpoint refuses with the gate’s reason, and nothing is sent.

Preview and run now share one primitive, the on-demand outpost run (outposts). A poll’s request may be a POST or any line, so a preview reaches the device as a command does. Both hold a request open while an outpost works, so they are bounded more tightly than the API: a few runs in flight per server, fewer per caller, and a run past either is refused (429) before anything is asked. On the outpost they are operator work on the endpoint lane, ahead of scheduled polls.

Shared-API collection: one component, many owners

Section titled “Shared-API collection: one component, many owners”

Some sources describe many entities at once: a SaaS or UCC platform, a controller fronting many devices, an amplifier feeding many loudspeakers. The API is one component (one endpoint, one credential) whose data fans out to the entities it describes (ADR-1282):

  • The conduit is the component whose endpoint reports the value: the path, not the owner. Its driver names each record’s identity.
  • One fan-out step. Ingest resolves every identified sample in a batch against the conduit’s identity bindings in one read, inside the batch’s one transaction. On the outpost lane the conduit is the component confinement already holds the outpost to; on the webhook lane it is the component the token’s endpoint names. Both arrivals land the same rows.
  • A paged list is one collection. A conduit’s list API pages, so its poll declares how (ADR-2789): the engine walks every page in one poll, gathers the records, then identifies and fans out once. A failed page or a reached bound faults the poll and lands nothing.
  • Nothing in a payload names an owner. A payload names an identity, and only the bindings of the conduit the batch is confined to turn it into an owner, so a compromised outpost or a leaked webhook token reaches only the owners bound to its own conduit.
  • A fanned sample is admitted only for a collected key, lands once on its owner (never also on the conduit) at the empty instance, and names its observer in source as <conduit>/<endpoint>. A sample with no identity lands on the conduit as before.
  • The owner can be a system. SaaS state that is telemetry of a room maps to system-owned samples; a virtual component is for a genuine member. Member to component, telemetry to system (ADR-0422).
  • Unmatched identities are kept, never dropped or misfiled on the conduit, in the conduit’s unbound inbox (GET /components/{name}/unbound-identities, component:read): one row per key and value with a count and when it was first and last heard, at most 1024 rows per conduit, aged out after seven days. Binding a row makes the next value naming it land on its owner, with no restart.

Treat a vendor’s own status as an input to a system’s health, not the health: corroborate a reported “offline” before downing the room (health). An event rule over a fanned key on a system owner waits on event rules judging system samples (#1002).

Identity binding: a conduit’s identity tied to its owner

Section titled “Identity binding: a conduit’s identity tied to its owner”

An identity binding ties one value a conduit reports under a match key to exactly one owner, a system or a component. The match key is a registered property type (ucc-room-id), so every driver reporting that kind of identity shares one name; the value is what the conduit reports (R-415A). The same value on another conduit is another binding. The conduit is never its own identity’s owner (422), and a location or an outpost is no owner.

A binding has two ends, so it costs a write on both (ADR-0510): component:update on the conduit and the owner’s update (component:update, or system:update). One end alone would let a user scoped to a system pull a conduit it cannot read onto its system, or a user scoped to the conduit write onto systems it cannot update. Consent is given at write: a binding outlives its author losing scope, and deleting either end deletes it. The routes are GET /components/{name}/identity-bindings and PUT or DELETE on /components/{name}/identity-bindings/{key}/{value}, the value one percent-encoded path segment; every change is audited naming both ends.

identity_binding (collection): generated from the migrated schema by make gen
Column Type Constraints Notes
id uuid PK, default uuidv7()
conduit_id uuid FK → component.id, not null The conduit component: the path the value arrived on, not its owner
property_type_id uuid FK → property_type.id, not null The match key, a registered property type naming what kind of identity the value is
value text not null The identity the conduit reports, 1 to 256 characters; unique per conduit and key
owner_kind text not null component or system: the arc arm that is set
component_id uuid FK → component.id The owning component, when owner_kind is component
system_id uuid FK → system.id The owning system, when owner_kind is system
created_at timestamp with time zone not null, default now()
CHECK constraints and unique indexes on identity_binding
  • identity_binding_owner_arc: CHECK ((((owner_kind = 'component'::text) AND (component_id IS NOT NULL) AND (system_id IS NULL)) OR ((owner_kind = 'system'::text) AND (system_id IS NOT NULL) AND (component_id IS NULL))))
  • identity_binding_owner_kind_check: CHECK ((owner_kind = ANY (ARRAY['component'::text, 'system'::text])))
  • identity_binding_value_check: CHECK (((char_length(value) >= 1) AND (char_length(value) <= 256)))
  • identity_binding_identity_key: CREATE UNIQUE INDEX identity_binding_identity_key ON public.identity_binding USING btree (conduit_id, property_type_id, value)
unbound_identity (collection): generated from the migrated schema by make gen
Column Type Constraints Notes
conduit_id uuid PK, FK → component.id The conduit component that reported the identity
property_type_id uuid PK, FK → property_type.id The match key the identity was reported under
value text PK The identity as the conduit reported it
heard_count bigint not null How many samples named it while it was unbound
first_heard_at timestamp with time zone not null When the conduit first reported it
last_heard_at timestamp with time zone not null When the conduit last reported it; the inbox evicts the least recently heard past 1024 rows and lets go of a row unheard for seven days
carried_type_ids ARRAY not null, default '{}'::uuid[] The metric, property and event types its samples carried, by id; the inbox read names them

A binding declared once at a location or a system, binding every member below it, is not built on purpose: it would widen who can place a value on an owner without the conduit end’s consent (ADR-1282, point 8).

Discovery: unbound identities become candidates

Section titled “Discovery: unbound identities become candidates”

The transports are a code registry the binary ships (internal/transport), not a table (ADR-0073); the list is on transports. The physical layout of every table is on storage.

endpoint is the authored connection:

endpoint (fleet): generated from the migrated schema by make gen
Column Type Constraints Notes
id uuid PK, default uuidv7()
name text not null
params jsonb not null, default '{}'::jsonb The transport parameters, validated against the transport; derived from the inputs on an attached endpoint
created_at timestamp with time zone not null, default now()
updated_at timestamp with time zone not null, default now()
component uuid FK → component.id The component whose API this is
outpost_id uuid FK → outpost.user_id Placement: the outpost that runs it; ON DELETE CASCADE so a purged outpost takes its endpoints
label text The friendly string an operator reads, and the only identity string they type here since the name is derived; NULL falls back to that name, verbatim
transport text not null The transport it speaks, from the transport registry; its name is derived from it
driver_id uuid FK → driver.id Set when a driver attach authored this endpoint; NULL for a bare probe endpoint
inputs jsonb not null, default '{}'::jsonb The effective inputs supplied at attach, defaults baked; secret inputs are reference names, never values
session_retry bigint not null, default 0 The operator retry counter, moved by :retry and hashed into the connection fingerprint
out_of_band boolean not null, default false True for an endpoint that answers through a reboot of its own device
CHECK constraints and unique indexes on endpoint
  • endpoint_component_name_key: CREATE UNIQUE INDEX endpoint_component_name_key ON public.endpoint USING btree (component, name)

task is the derived unit of work:

task (collection): generated from the migrated schema by make gen
Column Type Constraints Notes
id text PK The content hash of (endpoint, mode, spec); same inputs, same task
label text
mode text not null poll or listen
endpoint_id uuid FK → endpoint.id, not null
spec jsonb not null, default '{}'::jsonb The driver function, whole, its emit lanes resolved at attach
enabled boolean not null, default true
created_at timestamp with time zone not null, default now()
updated_at timestamp with time zone not null, default now()
CHECK constraints and unique indexes on task
  • task_mode_check: CHECK ((mode = ANY (ARRAY['poll'::text, 'listen'::text])))