Reeve Docs

Docs / Reference

Plugins

A plugin is a driver. It owns bidirectional translation between one vendor protocol and Reeve's canonical device vocabulary, and it is the only place vendor vocabulary is allowed to live. No layer above a plugin parses vendor keys or coerces wire values.

Two lanes, two trust levels

A manifest declares one of two loaders. Both produce the same factory contract and share one manifest, permission, consent and install pipeline.

Loader Runtime Boundary Use it for
native A .NET assembly in a collectible assembly load context None — in-process, full trust Arbitrary .NET libraries, native SDKs, raw sockets, in-process speed
wasm A WebAssembly module in an embedded runtime A real capability sandbox Community and less-trusted code

Native plugins run with the full trust of the backend process, so the permission model there is defence in depth. In the WASM lane an ungranted capability is a host import that returns a wire-level denial, with no in-process reflection to escape through.

Nothing sandboxes a native plugin

For native plugins the permission model is consent, least privilege and an audit trail, not containment. A native plugin can reach past its grants by reflection, and bypasses the vended HTTP client entirely by constructing its own client or opening a raw socket.

Install a native plugin only from a publisher you would trust to run any program on the host. Installation is not a security boundary, and the sidecar/companion split is not one either — that split is about hardware coupling and replication. Network-level controls (cluster network policy, an egress firewall) are the only real containment for a native plugin, and they need a network plugin that actually implements network policy.

What a plugin may reference

May reference Must never reference
The plugin abstractions package The application, infrastructure or domain assemblies
The contracts package Another plugin
The plugin-authoring helper package The product source tree (contracts come from the NuGet packages only)
The shared sidecar wire-protocol contracts (client plugins only)
Any other NuGet package

No non-plugin project references a plugin. The authoring helper package is a convenience layer (vendor-to-canonical value maps, unit converters, typed device builders) and never a trust or enforcement boundary — referencing it grants no capability.

Only the assemblies named in backend/src/Reeve.PluginAbstractions/HostSharedAssemblies.txt are shared with a plugin's load context: Reeve.PluginAbstractions, ReeveWorkflow.Abstractions, Reeve.Contracts, Reeve.Adapters.Protocol and Microsoft.Extensions.Logging.Abstractions. Anything else a plugin ships loads isolated in the plugin's own context, and if that type also appears on the shared host facade, the identity split throws a missing-method error the first time the plugin touches it.

A plugin must not reference a newer version of a shared assembly than the host provides. Pre-flight refuses it (preflight_assembly_missing), so a plugin built against a newer SDK package needs a newer host. A manifest's minBackendVersion states the lowest host the plugin accepts, and the host refuses to install or load it on an older one; see version compatibility.

Lifecycle

Each configured instance is a row in the database. Several instances of one plugin type, backed by one artifact, run concurrently.

Phase What the host does What the plugin must do
Create Calls the factory with the instance id, the persisted configuration and the host facade Read configuration defensively; never throw for a missing optional value
Start Calls StartAsync once, with a token that a restart, a stop or the host stopping cancels Open connections, take a connection-ownership lease, start background work, and observe that token
Run Routes commands and health checks Serve; report health honestly
Health Polls for a health report Return healthy, degraded, unhealthy, not-configured or unknown
Stop Calls StopAsync Close connections, cancel work, release leases
Dispose Disposes after stop Release sockets and native handles

After stop and dispose the host removes the instance's unclosed state-feed subscriptions, disposes its tracked MQTT connections and retires its workload ingestion sink. A later start builds fresh resources. A WASM instance returns its module reference when it stops; the runtime frees the module once the calls already in flight return.

A plugin that throws during start is marked faulted and the rest of the application continues. Faulted is set by the host and tells a crash from "not started yet", so a plugin never returns it from a health report. Dispose sockets and native handles in the load context's unloading handler: a static reference blocks unload, and an unload can otherwise orphan a connection.

Native load contexts

A native plugin loads into its own collectible assembly load context. A reload unloads the context explicitly, and a stop releases it so that it unloads once collected. The host logs whether a context unloaded after one, ten and sixty minutes, and reports one that is still alive at an hour as retained. A plugin whose own static field reaches its factory or registration (a singleton Instance, for example) keeps its old context until the process restarts, which costs one context per hot upgrade of such a plugin. See the constraint.

An instance's HTTP routes reach the plugin through a lease the host owns. A stop, a reload or a delete empties the lease, so a request routed to the instance answers 503, or 404 once the instance is deleted.

Instance operations

Start, restart, stop, reload and forget run one at a time per instance, in request order. Different instances run in parallel, so a slow StartAsync delays only the next operation on its own instance.

  • Each lifecycle call is bounded at 30 seconds. StopAsync and the DisposeAsync after it share one 30-second deadline. A call that does not return in time is abandoned: the host cancels its token and does not resume the operation when the call returns late. An overrun start faults the instance with the reason, and an overrun stop ends as FailedToStop. Until the abandoned call has returned, the instance is not started again, an explicit enable, restart or reload is refused as Faulted, and its health reads Faulted.
  • A restart or a stop supersedes pending operations and cancels the token of a start under way. A superseded start never publishes its plugin: if StartAsync returns anyway, the host stops and disposes the plugin and the operation ends Cancelled.
  • A start request joins a pending start or restart that can still start. A reload queues behind pending operations.
  • When the host is stopping, start halves are cancelled and every operation ends Refused(Stopping) except a completed start or stop.
  • An unexpected exception in an operation is logged, marks the instance faulted and ends the operation as Failed.

Operations run outside the request that asked for them. The request's cluster scope, its identity and its logging scopes do not reach StartAsync, so plugin code there sees no caller principal and no personal-access-token scope. A request can answer 200 for a stop or reload before another replica has applied what the operation wrote.

How an operation ended decides what the caller sees:

Ending Owner, throwing variant Owner, result variant Joiner
Superseded, caller's token live Returns Cancelled Cancelled
Host stopping, caller's token live Returns Refused(Stopping) Refused(Stopping)
Caller's own token fired before the end Throws OperationCanceledException (a stop and a forget return) Cancelled Cancelled
Token already cancelled at the request Throws (a stop and a forget return); nothing is scheduled Cancelled as the owner
Start or restart Failed with an exception Throws it Failed Throws it (throwing) or Failed (result)
Joined operation abandoned, or ended before its start half none none Cancelled

A joiner that cancels ends only its own wait. An owner that cancels after a joiner arrived abandons the start for the joiner too, and the instance stays down until the next recovery sweep or start request.

Instances and grants converge through generations

An operator's write reaches every replica as a generation of two aggregates, plugin_instance and plugin_grant. A request that creates, enables, disables or edits an instance, or changes its permissions, writes and returns. It does not start, restart or reload anything itself. The generation that carries the write converges the instance on every replica alike, the writer included. Installing a plugin type is the exception: it pulls and loads inline, because no generation carries the files.

  • The response does not wait for the replica to apply its own generation. The Plugins page refetches its instance list every couple of seconds while an instance is enabled but neither running nor failed, for about 30 seconds.
  • Enabling an instance that is already enabled still produces a generation, so a replica whose copy was stopped starts it again without waiting for the recovery sweep. A replica whose copy runs leaves it alone.
  • Every start asks the adapter for a snapshot, because frames that reach an instance while it is stopped are dropped. The request is best-effort, and only the replica that holds the adapter's socket sends the close.
  • A start registers its instance only if the row and the type's grant are still what the start read. Otherwise the start is cancelled without a retry, and the newer generation starts, restarts or forgets the instance against its own rows. A running instance whose configuration revision is behind its row, or whose grant disagrees with the current one, is reported as not running and receives no dispatch until the replica has reloaded it.
  • Work that fails or is refused is retried at doubling intervals from Plugins:TypeCatchUpRetryDelay up to Plugins:TypeCatchUpRetryMaxDelay, until a pass finds everything agreeing or a newer generation supersedes it. The recovery sweep (Plugins:InstanceSweepInterval, 60 seconds by default) starts enabled instances that are not running, such as one whose restart failed after it stopped the copy.

The host facade

The root facade exposes only baseline members plus the granted permission set, the granted device types, and a TryGet<T>() lookup. Every gated capability is a sub-interface fetched from a bag and simply absent when its code is not granted. A plugin checks for a capability and degrades; it never catches an exception to discover a denial.

The root facade surfaces no service provider, no scope factory, no raw data-protection provider and no raw HTTP client factory. Each would give a plugin an ungated path or a way in by reflection.

Baseline capabilities need no declaration and are each instance-bound:

Baseline capability Binding
Logger Instance-scoped
Audit sink Records each action as plugin/<typeId>/<action>, cut to 100 characters, with the plugin type, instance and the action as given in its metadata; drops a plugin-supplied actor id
Own-device event sink A plugin always reads, reports and controls the devices it owns, regardless of any device-type grant
In-memory cache A private instance, never the host singleton
Issue registry Surfaces repairable problems to the operator
Data protector Pre-derived under a purpose the plugin cannot rebase
Replica id
Connection-ownership lease Needs no grant, so every plugin can avoid connecting from every replica

The services a plugin sees are scoped to it:

  • The distributed cache is a per-instance view with the key prefix plugin:{instanceId}:. Every entry expires within 30 days, and an entry without a TTL gets 30 days. Deleting an instance deletes its keys with a bounded scan of up to 100 000 keys; the rest expire. cache_get_delete is at-most-once: a call the guest abandons at its deadline can still delete the value, so a guest that must not lose a value reads it with cache_get and removes it afterwards.
  • A plugin type id longer than 93 characters has no settings namespace. The settings facade refuses every read and write for it.
  • The audit sink drops any actor the plugin sets and records every action as plugin/<typeId>/<action>, so a plugin cannot forge a first-party audit entry.
  • A WASM instance's audit-write, issue-raise and issue-clear are limited to 60 calls a minute each and log to 600 lines a minute. A call past the limit is dropped with one warning per minute. An instance raises at most 64 distinct issue codes.
  • The plugin diagnostics payload redacts sensitive config fields for every caller, and replaces string values that look like internal URLs. Plugin-contributed diagnostics run under a timeout and a 1 MB cap and return an error envelope when they exceed either.
  • The seeded instance of the platform-owned system plugin is hidden from listings and answers 404 from every instance endpoint.

Permissions

A manifest declares permission codes (each optionally required), deviceTypes and hosts. The operator grants a subset. Enforcement reads granted only, and the factory re-clamps granted to the intersection with requested at build time, so a stale or tampered grant wires nothing extra.

  • Codes match case-sensitively against a closed list. An unknown code fails the manifest parse, and a code from the human role namespace is unknown here.
  • A grant is keyed on (repository, plugin type), not on the instance. Consent is captured once per type at first setup; a second instance must not re-ask and must not clobber the grant. An in-place update reuses the existing instance row and preserves its enabled state.
  • If the host cannot resolve a plugin's grant at start or when it arms a WASM trigger, the plugin runs with an empty grant, so every permission check refuses. The next grant generation resolves the grant and reloads or re-arms the plugin; a config or repair flow resolves it again on its next attempt.
  • A grant change never applies mid-call. Once it commits, the plugin_grant generation carries it to every replica. Each replica reloads the instances it runs, re-arms its WASM triggers and rebuilds its plugin alert subscribers. An unchanged grant reloads nothing. Until a replica has reloaded, a running instance whose facade disagrees with the grant is not dispatched to. A subscriber rebuild loses the state the subscriber holds in fields, as a reload does.
  • An existing installation does not gain a newly-requested permission on upgrade. The new code path stays denied until the operator re-grants, so a missing capability must degrade to an actionable unhealthy state rather than throw.
  • A hosts entry config:{key}:{mode} is a config host token: granted per type like any host, resolved per running instance against that instance's config field {key} (config host tokens).
  • An MQTT plugin requests mqtt.outbound and connects to the broker the owner types, admitted through a config: token.
  • Empty hosts means deny-all outbound HTTP over the vended client. Empty deviceTypes means all device types.

Outbound HTTP

The egress guard covers only the vended HTTP facade. A raw socket or a self-constructed client is ungated no matter what the manifest declares — device I/O over a raw socket needs no permission, and the host allowlist governs HTTP alone.

Every resolved address is checked at connect, for the vended HTTP client and for mqtt.outbound broker connections; raw sockets are not covered. A granted host may resolve to a private LAN address (RFC 1918, fc00::/7) with no opt-in, and the Reeve host's own pod, node and in-cluster Service addresses are LAN addresses. Loopback, link-local, carrier-grade NAT, multicast and the unspecified addresses are always refused; the operator's host lists do not open them, only an exact IpAddress entry of the operator allowlist does. With Plugins:Egress:LanOnlyThroughOwnerAddresses on, a LAN address is reached only through a grant of "*", an address the owner typed, a host on the operator's private-host list or a listed address (network egress). The operator allowlist is the enabled database rows, editable at runtime with no restart, or the Managed:Egress section when the deployment declares it; every block is written to a blocked-egress log the operator can read.

Each serving replica builds the allowlist snapshot from the applied egress generation and installs it when that generation's deferred work runs, which lags the acknowledgement by the deferred scheduling. Until the first install the provider answers config-only rules, which hold a subset of the allowed hosts, so a call in that boot window can be refused and never wrongly allowed. A later failed build is retried by the applier and does not replace the installed snapshot.

The operator's Host and PrivateHost entries never widen a plugin's grant: a plugin reaches only the hosts its grant admits, and a new source is a manifest host and a new grant, not a row in the operator allowlist.

Every call through the vended client is summarised into the plugin call log: method, host, path, status, duration. Bodies, headers and the query are never captured, and neither is the path's text, which may hold a credential: the log and the trace span's url.full carry the route template the plugin set for the request, or a per-process keyed fingerprint of the path. A denial lands on the egress dashboard, attributed to the plugin type and instance, and raises an egress.denied alert for that instance, host and port that the instance's next allowed call to them clears. It raises no plugin issue.

Every WASM module the host loads runs under the same limits, whether it is loaded to read its describe at install or boot, to run a workflow block, or for a plugin instance or trigger: its memory cannot grow past 512 pages (32 MiB), and a call that runs longer than 30 seconds is stopped as soon as guest code runs again. Each host function the guest calls runs under a deadline of its own, the same 30 seconds, and ends early when the guest's call is cancelled (an instance stopping, an event outstaying its timeout); a host function that does not finish in time fails with a host_error, so a call blocked in one is bounded too. Such a host_error says the outcome is unknown: the host work was abandoned, not undone, and may still have taken effect. An http_fetch timeoutMs above that deadline is lowered to it, and a fetch without one gets it. A guest denied the memory it asked for, or whose call is stopped, fails that call as the plugin's. A describe that fails this way refuses the module (describe_failed), and a block that fails this way fails its node.

A WASM plugin's http_fetch hands the guest at most 4 MiB of response body. A larger body — declared or streamed — reaches the guest as a host_error naming the limit, and a fetch that outstays the guest's timeoutMs fails with a host_error saying so. A HEAD request and a 204/304 carry no body, so their status and headers reach the guest as they are, whatever Content-Length they declare. A host import whose reply does not fit in the guest's memory, or that returns after its call was cancelled, fails that call with a short host_error or with no reply, instead of stopping the host.

A WASM export call whose caller cancels it ends as a cancellation, not as the plugin's failure. A start cancelled that way leaves the instance stopped, with no new fault in its health; an instance that was already faulted keeps the fault it had. A call that outlasts the module's own time limit, or the event pump's per-event limit, still fails as the plugin's.

Replacing or uninstalling a WASM plugin releases the module it replaces once the calls running on it return. A workflow block resolved before an update runs on whatever version is live when it executes, and retries once if the module it picked was retired in between; if the new version no longer exports that block, the guest's own error is the outcome. After an uninstall a stale block fails, since no module is left to run it. The runtime caches one compiled module per installed WASM block plugin (reeve_wasm_cached_modules); the other kinds load a module per instance and keep none cached.

Config host tokens

A manifest hosts entry config:{key}:{mode} means "the host the owner typed into the config field named {key}". The grant holds the token per plugin type, like any other host, and each running instance resolves it against its own config, so two instances of one type reach only their own addresses. The author's side is in the authoring guide.

The config: prefix and the mode are lowercase. {key} is one or more ASCII letters, digits, _, - or .. Any other entry that starts with config:, in any case, is refused as invalid_manifest. "*" may not be mixed with a token.

Mode Accepted value Allowed
url an absolute URL with a host: http://192.0.2.20:8899/onvif, mqtts://broker.local, rtsp://[fd00::20]:554/ that host, on the port the URL names; without one, the scheme's default (http and ws 80, https and wss 443, mqtt 1883, mqtts 8883). Any other scheme needs an explicit port
host a host name or IP literal with an optional port: camera.local, 192.0.2.20:8899, fd00::20, [fd00::20]:8080 that host; with a port only that port, otherwise any port

The value is trimmed, and only the host and port of a URL are kept. A host name is lowercased and converted to ASCII. An IPv4 address is accepted only as four decimal numbers from 0 to 255 without leading zeros, an IPv6 address is kept in canonical form, and an IPv4-mapped one counts as the IPv4 address it carries. Refused values are a URL without a host, a URL of an unlisted scheme without a port, a port outside 1 to 65535, a wildcard, an IPv6 zone index, any other spelling of an IPv4 address (127.1, 0x7f.1, 3221226004) and, in host mode, a scheme, path or @.

Install check. The field must be exactly one field of type Text or Password in the plugin's instance config schema (a native factory's ConfigurationSchema, or the schema a WASM module describes). A field that appears only in a config-flow step does not count. Two tokens that differ only in case, or that read one field in both modes, are refused. The install loads the staged artifact to check this and refuses a token that names no declared field, more than one field or a field of another type as invalid_manifest. reeve-plugindev pack runs the same check before a release is published (CLI reference).

Resolution. When an instance starts, each token the type's grant holds is resolved against that instance's stored config, with a Password field decrypted and a secret reference resolved. The resolved hosts join the instance's fixed hosts. A token the grant does not hold resolves to nothing, and an empty field adds no host. A secret reference is checked only at start, so rotating the secret takes effect at the instance's next start.

A stored value that does not parse starts the instance without that host and raises the repair issue config_host_invalid (a Warning plugin.issue alert naming the fields by label). The next start with every such field valid or empty clears it. Saving an instance's config restarts it, and the restart resolves the new values. Editing the field is not a grant change and asks for no consent. GET /api/plugins/instances/{id} returns the resolved hosts as configHosts. A field holding a secret reference is not listed.

Validation on save. Every owner write of instance config refuses a value that does not parse in its token's mode with plugin_config_field_invalid and the field in invalidFields (HTTP 400). This covers creating or editing an instance through the API, the end of a config or options flow, and an install or update that carries config. A masked secret that is not being changed (***) and a secret reference are not checked on save.

Where tokens apply. The resolved hosts feed the HTTP allowlist of the instance's vended client, which re-checks every redirect hop, and the mqtt.outbound broker check of that instance. Workflow blocks, alert subscribers, config flows, repair flows and WASM trigger proxies run without instance config, so a token grants them no host. A resolved host passes the same connect-time address rule as any granted host (network egress): loopback, link-local, cloud metadata, carrier-grade NAT, multicast and unspecified addresses are refused whatever the owner typed, and RFC 1918 and unique-local addresses are open. With Plugins:Egress:LanOnlyThroughOwnerAddresses on, the owner-typed hosts of a token still reach the LAN.

Only the owner sets the value. A plugin cannot steer its own allowlist. The settings facade refuses an instance-config write that would change a field one of the plugin's tokens reads (PluginPermissionDeniedException, code settings.config-host-field). A config or options flow's result counts for such a field only if the owner typed the value into a Text field, or a Password field without a plugin-supplied default, of a form step with the same name. A Select answer, a masked prefill, a client-value answer or an answer in a differently named field does not count. A flow that returns another value creates or updates nothing, ends with an error that names the field, and audits plugin.configflow.refused with reason unconfirmed-host-fields (or invalid-config-fields for a value that does not parse). The host never fills a Required field's default into such a field.

Updates. An auto-update candidate that requests a host its installed release did not request, such as a token replacing "*" or another field or mode, is held as hosts_changed until the owner approves it. Approving adds only the new hosts to the grant. A plugin that finds its targets itself, such as a Matter controller, keeps "*".

The raw value is never logged, audited or put into a repair issue, because a URL can carry credentials.

Sidecars

A plugin that needs code outside the backend process declares a deployment section: a closed, versioned schema of managed workloads, each pinning an exact image digest for that plugin version. A tag-only reference requires an explicit operator opt-in.

Installing or updating the plugin deploys or updates its sidecar as one unit; nothing about the plugin needs to be known by the deployment chart or by the operator. The plugin requests workloads.deploy to declare workloads and workloads.command to command its own sidecars, and that facade binds to the calling instance, so a plugin can never command another plugin's workload.

See sidecar workloads and the session plane.

Calls between plugins

A plugin invokes another by plugin type id with a string payload and gets a string back. The host neither defines nor inspects the payload. The producer opts in by exporting a handler; the consumer needs the plugins.invoke grant. There is no target allowlist and no extra permission code.

Serialization and meaning are a contract between the two plugins. Calling a type with no running peer-callable instance is a distinct error from an empty reply; calling a type with several running instances without naming one is another. Call depth is capped so a cycle terminates. Peer invoke resolves through the replica-local plugin map, so it does not cross replicas. While the replica is fenced, an empty peer list or a not-available error means "not now", not "no such peer": the peer keeps running and answers again after readmission, so the plugin re-queries or retries. A WASM guest sees it as not_supported with code peer_unavailable, which is the same mapping a missing peer gets, so a guest must not treat that code as permanent.

Where such a contract is a category rather than one pair's private arrangement, its wire shape ships in Reeve.PluginAbstractions so the two sides cannot drift and neither has to copy the other's file. CameraEventSourceContract is the first: how a plugin that detects motion, objects, sounds or speech reports them to the plugin that owns the camera device, which republishes them as its own. The host still neither defines nor inspects the payload — the type is there for the plugins, not for it, and the version field in the frame, not the package version, is what a receiver refuses on.

Multiple replicas

Every in-process plugin loads on every replica.

Plugin instance health

Two answers travel on every /api/plugins/instances response, for two kinds of caller:

Field Means Read by
healthStatus, healthMessage, healthReplicaId The fleet's verdict, the same from every replica at the same moment. healthReplicaId names the replica whose own plugin report decided it, null when a workload or the session did. SPA plugin card (chip, tooltip, message); System status Plugins box (the same view, server side); System status Devices box (its session-lost fact)
replicaHealthStatus, replicaHealthMessage (with replicaId) The serving replica's own live GetHealth report, to confirm an action taken on that replica. SPA reload modal (success, failure); SPA starting poll (with the fleet verdict: either Unknown keeps it polling)

The mobile app reads neither. The fleet verdict is composed from shared inputs only, so two replicas compute it from the same rows:

  1. The plugin's own report, from the published sections. Each replica publishes the GetHealth report of every instance it runs, has faulted or holds for a secret in its reeve status section (PluginHealth, messages cut to 300 characters). The getters are read on the status tick under one 2 s deadline; one that misses it reports Degraded ("did not answer") for itself and is not asked again until it returns, so a hung plugin never silences the section. A hung getter is logged once per hang, and the host refuses a Cluster:StatusReportInterval under 3 s, which that deadline would not fit. In a cluster the view reads these sections only, this replica's own included, never its live getter. A Faulted report from any replica wins (a load failure is that replica's fact); otherwise the report of the replica holding the instance's adapter session; with no owner, the worst (Unhealthy, Degraded, NotConfigured, Healthy, then Unknown), a tie going to the lowest replica id. No report at all reads Unknown. A host with Coordination:Clustered unset reads its own live report (an instance it does not run is no report), and so does a clustered one whose roster read fails.
  2. Workload state, folded across the instance's workloads, which leaves a suspended workload out: Failed makes it Unhealthy with the redeploy route in the message; Degraded, VersionSkew and Unknown Degraded; PendingConfiguration and AdoptionPending NotConfigured; every workload suspended Degraded. Deploying and Switching add their name to the message only.
  3. The adapter session: a session the installed manifest owes and that reads absent makes it Unhealthy and marks it session-lost, unless a session workload is deploying, switching, waiting for its parameters or adoption, suspended or terminating, or no replica reports the instance at all within two minutes of its last change (a plugin start and a status interval). A plugin's own Unknown explains nothing. An unreadable session adds nothing.

The status is the worst of the three, and the message puts the host's reasons before the plugin's own text (… Plugin: <report>). A disabled instance reads Unknown, "The instance is disabled.", on every replica. RequiresRestart, HostUpgradeReason, ArtifactRejectedReason, WaitingForSecret and ReplicaId stay per replica. One request reads the workload rows once for all instances and the session presence in one batch.

Status Means
Healthy The picked report is Healthy, no workload needs attention, and the owed session is connected.
Degraded The picked report is Degraded, or a workload is Degraded, VersionSkew or Unknown, or every workload is suspended.
NotConfigured The picked report says so, or a workload waits for its parameters or its adoption.
Unhealthy A workload is Failed, or the owed adapter session is not connected on any replica: its devices cannot be reached.
Faulted A replica could not load or start the plugin.
Unknown No replica reports the instance running yet (with an owed session absent, for two minutes at most), or it is disabled.

The System status Plugins box needs attention for every enabled instance at NotConfigured or worse. During a rolling upgrade a replica on another build answers with its own report, and a section without PluginHealth is no report from that replica.

Cross-replica convergence

Installed plugin types converge through a third generation type, plugin_type. After a generation that changes a type's entry, each replica pulls the artifact for every installed type it does not hold at the recorded version and registers it, unless a newer generation has replaced the entry meanwhile. A walk that leaves an entry unfinished for a reason that can pass (a pull cut off by Plugins:TypeCatchUpTimeout, a replica not ready, a busy lock, a type held by an open update) waits Plugins:TypeCatchUpRetryDelay and walks again, doubling the wait up to Plugins:TypeCatchUpRetryMaxDelay. An artifact the install judged invalid is not retried. A replica in safe mode applies nothing, and a replica still booting waits for its boot first.

Two versions of one type never prepare at once, and an uninstall waits for an activation in flight. An update reloads one replica at a time. After an uninstall, every replica deletes its copy of the artifact and evicts the registration; a reinstall that lands meanwhile wins.

The plugin instance response includes replicaId, identifying the replica that supplied its in-memory assembly hashes, restart flags and other local plugin state. Diagnostics also names the serving replica. These values can differ between requests routed to different replicas.

A plugin update uses Workloads:PluginRoll:FleetSize from the current leader's configuration; replicas that may lead should use the same value because the target is not stored in the roll row. An unclustered host uses one; a clustered host without the setting refuses to start an update (fleet_size_unset). Below the target, it waits for enough live members; a member stops counting when its cluster lease runs out, but there is no overall wait timeout. It processes every member in the current census. See running multiple replicas.

  • Never keep device state in plugin memory. Replicas are stateless and horizontally scaled; an in-process cache goes stale and produces wrong behaviour.
  • Take a lease from the connection-ownership facade before opening a long-lived connection, observe its Lost token (or poll IsStillOwnedAsync), and self-fence when it is lost. Lost is final. It fires at a fence, at a drain start and at disposal. At a drain the lease stays held until the plugin disposes it, so close the connection first. A probe failure counts as lease loss. A follower is healthy with a follower annotation, not degraded.
  • A null lease from TryAcquireAsync means "not now", never "never": a peer owns the resource, or this replica is not serving (starting, fenced or draining). That holds at every replica count. An exception from TryAcquireAsync is transient as well. A plugin retries on a bounded interval, and again after Lost fires or its connection is evicted, or it never connects. Instances start only after the replica first serves; a fence later on still refuses leases.
  • Do not build a leader election on the broker or on the distributed cache. The cache does offer set-if-absent (TrySetAsync, one atomic round trip), but winning it is not a lease: it has no fencing and no renewal, and the winner may already be gone. Use it for a value that must be the same on every replica — a credential the plugin mints once and hands to its workload, say — and take the connection-ownership lease for anything that must be done by one replica.
  • Never mint a per-replica secret for something a single peer verifies. A readonly field initialised from a random generator is a different value in every replica's plugin object, so whichever replica configured the peer last is the only one that can then talk to it; every other replica is refused, deterministically and for as long as the process lives.
  • Plugin object storage is shared across replicas but last-write-wins, with no version precondition. Pair it with a fixed-resource lease when mutual exclusion matters. Switching its backend to the filesystem makes it silently per-replica.
  • An operator's edit restarts your instance on every replica. The PUT advances a revision on the instance row, and each replica rebuilds a copy still on an older one — so configuration read at start is applied when the plugin_instance generation reaches the replica, once the write is acknowledged. A newer edit supersedes a start still under way: the host cancels the token it gave StartAsync and discards the instance if it returns anyway. Writes your plugin makes to its own settings stay state: they advance nothing and restart nothing.
  • A device command runs on the replica that received it: the plugin instance is resolved from a replica-local map. A plugin whose connection lives on another replica passes the command on with IPluginConnectionOwnership.SendDeviceCommandToHolderAsync, and a resync with TriggerResyncOnHolderAsync; the host carries the call to the replica that holds the lease on that resource and runs the same instance's own IInputPlugin method there. A forwarded call is refused if it reaches the facility again on the same async flow; the call fails fast when there is no holder, and says whether it never ran, may have run, or got a failure from the holder. See connection ownership.

Which entry file loads

A release's reeve-plugin.json names its entry; the host never globs a filename for an installed type. One resolver reads the manifest for every kind: a native manifest yields the entry assembly under the version directory, a WebAssembly manifest yields only the release facts (hash, signature, floor) and is left to the WebAssembly lane.

A release with several builds is selected at load time, every time. A flat manifest has one build, in the version directory itself. A builds list has one build per target framework, in <version>/<framework>/, and the host chooses among them on every boot, hot registration, reload and start, so a host whose runtime or version changes picks again without a re-pull. The choice is one pure function of the declared builds, the running runtime's major, the host version and the compatibility switch; nothing names a runtime major:

  1. Candidates are the builds whose framework major is at most the runtime's. None: target_framework_unsupported, naming the lowest framework the release offers. The compatibility warn switch does not reach this refusal.
  2. Of those, the builds whose minBackendVersion is at most the host version. None: incompatible_host_version, naming the lowest floor among the candidates; under warn the highest candidate loads and the load is audited as plugin.compatibility.warned. A build that meets its floor is preferred whenever one exists.
  3. The highest framework wins; frameworks compare as numbers (net100.0 ranks above net99.0).

A flat manifest passes step 1 (its framework is read from the DLL) and its floor and ceiling stay with the compatibility gates at install and start. For the selected entry the resolver also reads the assembly's target framework without loading it and refuses one newer than the running runtime. Boot, hot registration, reload and instance start apply any refusal before anything is loaded: boot skips the type, records a plugin.load.rejected audit and an occurrence, hot registration declines, a start marks the instance faulted and a reload fails while the running copy keeps running, and a framework or floor refusal offers the host upgrade as the remedy. A manifest the resolver cannot take an entry from is refused as invalid_manifest, without the upgrade remedy. Registration inspection at install runs on the same selected build.

Signing information is per installation and per framework. The boot and hot-registration check takes the hash and signature of the selected build, keyed by that entry's full path (<version>/<framework>/<dll>), so a dual-build plugin keeps its recorded verdict across boots and a change to the build that was not selected is not judged. Under Plugins:RequireSignature a DLL the resolver selected for a type that has an installation record, and for which no signing information could be found, is refused (plugin.signature.rejected, signing_info_missing) and never allowed. A type with no installation record (a hand-placed development drop, with or without a manifest) still loads, and without RequireSignature a missing entry loads as unsigned. The signature and the signing keys come from the installation record itself: the manifest it stored at install (the release row only for a record that has none) and its repository's keys, so a removed repository does not unload what it installed; with the repository gone the key that verified the install is the candidate, unless it has since been revoked. A hot registration that cannot read the installation record declines with signing_info_unavailable.

The install gate and the auto-update pre-check run the same selection on a builds list, before any download, so the refusal and the floor it names are the selected ones. A targetFramework is netN.0 with N below 1000.

Only an unowned DLL is found by naming convention. A Reeve.Plugins.*.dll that no manifest owns is found by the convention, as one function serves the boot glob and the reload fallback: it skips everything in or below a directory that holds a manifest (a build's own subdirectory is never a second plugin) and the .staging area. When Plugins:CustomPluginsDirectory separates the install root from the image directory, the install root holds installs only and is not walked for convention DLLs; a development drop belongs in the image directory, which is walked. A DLL in the install root with no manifest beside it is not loaded: no install writes one, and the host logs an error naming the file at boot.

Reload

The assembly watcher checks each loaded artifact on disk on a configurable interval and flags a change; it re-hashes a file only when its length or timestamp moved, plus a full re-hash hourly for an in-place replacement that kept both. It never auto-reloads. Auto-reload is unsafe mid-copy of a multi-file update and surprising, so reload is always operator-approved.

Pre-flight validation runs first and inspects metadata only — it never executes code from the candidate artifact. For an assembly the host shares with plugins (the list the plugin load context shares) it checks the host's copy, as the runtime binds it, and refuses a plugin that references a higher version than the host has. Other references resolve against the plugin's folder, then the host's own assemblies, so a plugin need not bundle the shared ones. It also compares the factory's PluginTypeId with the manifest's pluginTypeId (case-insensitively) when the getter is a plain string literal, and refuses a mismatch with preflight_type_mismatch; any other form is logged as not compared and left to the start-time check. On failure the running instance keeps running and the request returns a structured refusal. The hash is tracked per assembly path, not per instance, and is never persisted: one artifact backs many instances. Every device owned by the reloading instance is offline from stop until restart; the confirmation lists those devices and requires an explicit acknowledgement.

A reload is an operation on the instance's lane. It queues behind the pending operations, so it runs against whatever those left. It ends Gone when the instance is not running, and Cancelled when a restart or a stop took the running copy first. Pre-flight runs before the copy leaves the running map; a refused pre-flight leaves it running. The reload takes the copy out of the map only when it is about to stop it, and from then on a restart or a stop cancels the new copy's start. A reload for a grant change compares the running grant with the current one when it runs, and ends NotApplicable when they agree.

Plugins with the system flag

Only a first-party, always-present service sets the system-plugin flag. Such a plugin is auto-created, auto-enabled and auto-consented once by a leader-only idempotent hook, stays visible and disable-able, and is never re-enabled against an explicit operator disable. A marketplace-installed plugin that sets the flag makes the boot hook create a conflicting bundled grant alongside the operator's install grant.

Frontend

A plugin contributes zero code to the frontend. It ships a configuration schema plus server-driven views the frontend fetches as a component kind and a payload and renders generically. Core handlers key on capability or kind, never on plugin identity, and author-supplied text is rendered quarantined and attributed to the plugin author, never as product copy.

Secret references

The Secrets → Secret providers tab can request a cluster refresh with secrets.bind; it confirms when the request is accepted.

After start-up, each replica checks stored plugin configuration references, workload password references and configured secret _REF settings once. Unresolved occurrences are logged with provider and path plus owner metadata, without logging secret values. Startup continues if a reference cannot resolve. /health/details reports that replica's last successful unresolved count and scan time, or a null count if the scan failed, to a home.manage caller only. Periodic and requested refresh passes read plugin and workload references only. The page reports refresh acceptance or an HTTP error.

Plugin configuration keeps provider references in the stored field as ref:<provider-id>:<path>#<key>[@<version>]. The host resolves references for secret-bearing fields before it creates a plugin instance. A failed resolution puts that instance in a waiting state, and the recovery sweep retries with backoff. Management responses show the reference, while config-flow answers remain redacted. Binding and unbinding require secrets.bind and are audited. Workload deploy resolution, the start-up scan and refresh provider calls write secrets.resolve_failed with the reference and failure kind, never the resolved value, once per reference and replica until a provider call succeeds. Management updates retain the stored value when the submitted field is ***.

The default refresh interval is 15 minutes and is set with SecretReferences:RefreshIntervalSeconds. POST /api/secrets/references/refresh requests a pass by the owner of the secret-reference-refresh kind. A call that lands on the owner waits for the pass and answers 503 if the kind is lost first. On any other replica it answers 202 once the request is published. Changed-reference candidates go to peers, which refresh their own caches and restart their local instances without changing the shared config revision.

Secret references in plugin configuration

A plugin configuration value may be stored as a ref: reference only for a Password or otherwise sensitive field, after the caller has secrets.bind and the provider path passes its configured prefix policy. Plugins receive the resolved literal through instance configuration reads; submitted references remain stored as references. The plugin facade does not allow a plugin to write the instance's raw settings row. Nor does it let a plugin change a field one of its config: host tokens reads; such a write is refused whole with code settings.config-host-field (config host tokens). Configuration flows redact a referenced sensitive field as set, and preserve the reference when an unchanged mask is submitted. A masked or unchanged value retains its stored raw form byte-for-byte, including unreadable ciphertext; only a genuinely new literal is encrypted on write.

Management updates read the stored value, decide the binding, merge masks, validate, save and advance the revision under one lock, so permission checks use the value current at the write. A field the loaded schema marks as ordinary refuses a reference. Instance create, update and repository update encrypt Password and sensitive fields at rest. An OAuth2 step may carry a reference as its client secret only when it equals the answer to a secret-bearing flow field and the submitter holds secrets.bind.

Authenticated operators can read the deployment-wide requireReferences setting at GET /api/secrets/policy. Operators with secrets.bind can list provider capabilities at GET /api/secrets/providers, browse allowed paths at GET /api/secrets/providers/{id}/browse, list pinned versions at GET /api/secrets/providers/{id}/versions, and test a reference with POST /api/secrets/providers/{id}/test. Test responses and audit records contain only resolution status, character length, and an error kind; they never contain the resolved value or provider error body. The provider list also returns the deployment-wide requireReferences policy with the provider collection.

The host caches successfully resolved values. Normal reads use that cache; a lease leader refreshes the database-referenced set and sends candidate references to peers, which refresh only references already cached locally. A changed local value restarts local instances without changing the stored config revision. A rotation whose restart did not complete is restarted by the next pass; two passes running at once on one replica restart a rotation once. Peers drop cached references no instance uses. Failed refreshes retain the last good value for running instances. A fresh process with no cached value waits for the reference and retries with backoff rather than starting with an empty setting.