Plugin host
A plugin is a driver: it owns the translation between one vendor protocol and Reeve's canonical device vocabulary. This page describes the host that loads, grants, distributes and runs plugins, and the rules that hold that host together across replicas. Plugins are built and released in their own repositories against the published SDK packages. The cross-cutting plugin rules live in constraints and are linked here, not repeated.
- What an operator is trusting when they install one: plugin trust.
- Endpoints, manifest fields, refusal codes and settings: plugin reference and plugin distribution.
- Writing one: plugin authoring.
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.
| Lane | Runtime | Boundary | For |
|---|---|---|---|
native |
A .NET assembly in a collectible assembly load context in the backend process | None: in-process, full trust | Arbitrary .NET libraries, native SDKs, raw sockets, in-process speed |
wasm |
A WebAssembly module in an embedded runtime (Extism over Wasmtime) | A capability sandbox | Community and less-trusted code |
The load context of a native plugin keeps plugin and host from coupling by accident and lets a plugin unload; it is not a security boundary, and the grant facades only prevent accidents (constraints). Network-level controls are the only real containment for a native plugin. The WASM lane caps memory and wall-clock time, links every host import always and gates each one on the grant, gives the guest no access to sensitive configuration, and runs SSRF guarding on every fetch regardless of grant. An ungranted capability there is a host import that returns a wire-level denial.
A WASM module with another ABI major version is skipped, not loaded
A WASM manifest declares its ABI version, and the host loads only modules with its own ABI major version (1). A module with any other major version is skipped cleanly at install and at boot with a message naming the version, instead of failing later on a missing or reshaped import.
Type, installation and instance
A plugin type is three things that can disagree:
- Registered: loaded in this replica's plugin registry. Per replica.
- Installed: the installation record in PostgreSQL, cluster-wide and durable. It survives having zero instances.
- Instances: the configured instance rows, zero or more per type, each running on every replica.
Installing a type creates no instance. The install adds the artifact, the installation record and the permission grant; instances are added afterwards, and the install dialogs create the first one as a second call, so the two steps can fail independently.
Configuration defaults and the grant's lifetime belong to the installed type
A create fills a required configuration field the request leaves out with the default the loaded factory declares, because only the server loads the factory and a manifest may declare no schema. A value sent blank is still refused, and an update is never filled, because it replaces a configuration the client already holds. The server fills the default because every client would otherwise need the same fix. Deleting the last instance of an installed type keeps its grant and recorded consent; the type's uninstall removes them. A bundled type, which has no installation record and is never uninstalled, loses its grant with its last instance.
Deployment parameters are the caller's alone: an instance added without parameters resolves the author's defaults. The install's parameters are not copied onto the grant, because every writer of the consent and the rows would have to keep such a copy current.
Auto-update and permissions are addressed by the type, and one type has one subscription
Auto-update subscriptions and permission grants describe the artifact, not a configured instance, so both are addressed by plugin type and are reachable while a type has no instance. A subscription is unique on the plugin type case-blind, with the repository it follows as an ordinary column: two instances of one type cannot run different versions, so one type cannot follow two sources. Only an uninstall retires a subscription. A re-subscribe re-points a surviving subscription at the repository the installation record names and leaves the version baseline alone.
Approving a parked, deployment-bearing update for a type with no instance demands workloads.approve: the
escalation diff is addressed by instance and an approve records the consented profile, so a diff that cannot
be computed fails closed rather than passing as an all-clear.
Grants
A manifest declares permission codes, a device-type scope and an outbound host allowlist; the operator grants a subset. Enforcement reads granted only, re-clamped to requested at build time, and every gated capability is a sub-interface that is simply absent when its code is not granted (clamping, present or absent). A plugin always reaches its own devices. Reaching another plugin's devices needs both a permission and a device-type scope, where an absent or empty scope means all types and an operator narrowing a requested set down to nothing means deny. The vended HTTP client is the only gated network path (constraints).
Grants are keyed on the plugin type, and a required permission blocks the install
A grant row is keyed by repository and plugin type and shared by every instance of the type, so consent is captured once per type and a second instance neither re-asks nor clobbers it. An in-place update reuses the existing instance row and keeps its enabled state. A code the manifest flags as required must be present when a grant is first created, or the create is refused; a plugin that cannot work without a capability never reaches a half-installed state that reports unhealthy forever. Editing a grant applies a transition rule: removing a currently granted required code is refused, while a save that leaves an already-missing one missing is allowed, so grants that predate a requirement stay editable. Mark a code required only when the plugin cannot start without it.
A provisional grant fails closed
When the repository identity of a grant cannot be resolved while arming a WASM trigger or starting a running
instance, the component receives an empty grant until resolution succeeds; falling back to the manifest's set
during an outage could exceed a narrowed or revoked grant. The plugin_grant convergence retries provisional
triggers and instances and re-arms or reloads them on the resolved grant. A configuration or repair flow that
cannot resolve its grant also runs on an empty grant; it has no running snapshot to retry, so its next attempt
resolves afresh. A start that ran provisionally after the last grant generation's walk ended is corrected only
by a later grant generation: that case needs a database fault between two reads and fails closed.
A permission change reloads the plugin's instances on every replica
A facade links its capabilities once, at instance start, so a grant change is applied by reloading what it
would have changed. The serving replica writes the row; the plugin_grant generation reaches every replica,
and each reloads its own instances of that type whose facade holds a grant that no longer resolves to the
row. The comparison (resolve the row again, compare with what the facade holds) is the whole mechanism and is
the same on the writer and on a peer, so a no-op change reloads nothing. An armed WASM trigger and a plugin
alert subscriber carry the grant their facade was built from and are compared the same way: the trigger's
re-arm is asked of the leader lane that holds the arm, the subscriber is rebuilt by the pass itself. The
convergence passes again at doubling intervals until one finds every facade, trigger and subscriber agreeing,
so a refused or failed reload is issued again; while the grant row cannot be read, no pass reloads anything.
The change is in effect on a serving replica once the write is acknowledged, because a facade that disagrees with the pinned grant row is not dispatched to (constraints). A removed code reloads every instance of the type cluster-wide, so a plugin that keeps in-memory work across a grant change loses it, as at any reload. The grant is not checked on every capability call: that would put a database round trip on the plugin call path and still could not recall a capability already handed out through an open handle.
During a setup wizard the facade is built from the requested set
A setup wizard runs before any instance row exists, so the host builds its facade from the requested permission set, which lets a connection test use capabilities the operator is about to grant. The issue registry is inert in that facade, because there is no instance to attach an issue to.
Artifact identity, signing and anomalies
What the operator is deciding at each of these steps is on the plugin trust page. The install order (hash, then signature, then anomaly acknowledgement) is fixed (constraints).
Artifact identity is verified by content, not by name
The loader resolves an installed plugin's entry assembly from the manifest persisted into the install directory, never from a filename pattern, so authors keep their own artifact names. The artifact must be a genuine managed assembly, the fetched bytes must match the declared hash, and after load the discovered factory's type id must equal the manifest's or the instance start is refused and audited. An assembly that declares factories but no registration is refused at install instead of installing and contributing nothing. Artifacts are streamed, hashed and extracted under path-containment and size caps. Every entry path, hash, signature and floor is read through one resolver (constraints).
Signing is opt-in over the artifact hash, and the trusted key list is global
A manifest may carry an Ed25519 signature over the artifact's hash. Verification always runs and its outcome (verified, unsigned or failed) is always recorded on the instance; the enforcement setting decides only whether a non-verified install is refused. Operators trust publisher keys in one global list, and an active key there verifies releases in any repository, including ones added later. A per-repository pin is exclusive: while it is set, the global list is not consulted for that repository. A key an index advertises lands in separate proposed columns and verifies nothing until an operator compares the fingerprint and accepts it. Revocation is soft, so who admitted a key stays answerable.
An anomalous update stops and asks; a routine one does not
Before any bytes are written, the candidate is compared with the installed version for a signing-key change, a dropped signature, a changed signer, a changed entry assembly, a changed plugin type id, broadened capabilities, or a first install with no verified signature. Any of these makes the install return a conflict listing them; the operator re-calls with acknowledgements bound to that exact release, and the server re-verifies from scratch. The invariant compared is the signer's identity, never the signature bytes, which differ in every version. A routine update costs no extra step, or the mechanism would be ignored. An auto-update subscription that resolves an anomalous candidate parks awaiting approval and installs nothing; an unnoticed park freezes the plugin at its old version.
Distribution
A plugin ships as an OCI artifact or as a release asset; OCI is the primary channel. The pull verifies the fetched blob against the digest declared in the manifest, and that digest is the integrity anchor: an OCI plugin is never refused on signature grounds, but its signature is still verified and recorded, because signature status describes the artifact and not the transport.
A publisher index is its own entity listing, per entry, the resource type, source, latest version, digest and an optional yanked flag. One credential attaches to the index and is inherited by its children; a priority field decides between indexes. An index carries metadata only, so it can be public while artifacts stay private, and a public index listing private resources reveals that they exist. A compromised index can point at a bad artifact; the defence is transport security plus digest verification.
An index entry outranks a standalone repository of the same resource
When an index lists a source an operator already added as a standalone repository, the index adopts that repository row instead of creating a duplicate, and releases it back to standalone if the index is deleted. A duplicate row would list the resource twice; deleting the standalone row would let an index deletion silently remove an operator's own repository.
Marketplace search matches prefixes
Marketplace search builds an AND-joined prefix full-text query (term:*), because the box searches as the
operator types and a whole-lexeme query never matches a partial word. Operator characters typed by the user
are neutralised, and an empty query matches nothing.
Version compatibility
A manifest's host range is enforced, and its floor is derived from the SDK
A manifest declares a minimum and maximum host version, checked at install, at reload and at cold start. An out-of-range plugin is not loaded and the refusal is audited, naming the range. A plugin's release pipeline stamps the minimum from the resolved plugin-abstractions package version, so the floor follows the SDK the plugin was built against instead of a number someone remembers to bump. Bumping the SDK package raises a plugin's floor without failing anything at build or publish: the plugin simply refuses older hosts, so every SDK bump is coordinated with a host release.
The host version is a capability floor
<Version> in backend/Directory.Build.props is the single source of the host version, and the compatibility
gate compares it with each manifest's minimum. It stays at or above the highest minimum of any shipped plugin
and at or above the newest published SDK package version; a host reporting less refuses every plugin rebuilt
against that SDK, and without an explicit value MSBuild reports 1.0.0 and blocks every plugin that declares a
floor. The host version, the shipped-component floor and the chart's application version move together
(constraints). The gate parses SemVer
build metadata away, but a prerelease label sorts below the bound and breaks it. The release version is the tag without its v, so a
-rc.N tag builds a host with a prerelease version, which sorts below the floor of every plugin built against the
same X.Y.Z. The parser refuses a fourth dotted part.
One artefact carries one build per target framework, and the host picks at load
An OCI manifest lists its builds in builds, one per target framework, each with its own entry hash,
signature and minimum backend version; a build's files are the <tfm>/ directory of the layer. What belongs
to the plugin (identity, entry DLL name, signer, permissions) stays top-level. At every load the host picks
the highest framework not above its own runtime major whose floor it meets, and refuses the plugin, at install
and at every load, when no build fits; a manifest without builds is read as a list of one. Every build is
signed separately by the same key. A DLL inside a version directory is admitted only through the manifest that
owns it, so an install is verified in a staging directory outside the loader roots and a refusal never leaves
files a glob could load.
pack holds a build to the versions its framework provides
reeve-plugindev pack refuses a build that references a host-shared framework assembly at a higher version
than that framework's targeting pack supplies, and names the package that pulled it in; a host provides a
framework assembly at its framework's version, so such a build would fail at load. Reeve's own host-shared
assemblies, such as ReeveWorkflow.Abstractions, version on their own cadence, are governed by
minBackendVersion and are not checked. Comparing every host-shared assembly's major with the framework major
would refuse every build for the older framework as soon as the first Reeve assembly reached a new major, so it is not done.
Install convergence across replicas
Each replica owns its install root (constraints),
and the cluster shares the installation records in PostgreSQL and one copy of each artifact in object
storage. A type's registry writes happen inside the plugin_type generation's swap
(constraints).
The artifact is stored in the cluster before the installation is recorded
An install puts the verified artifact into cluster object storage, keyed by its content hash, before it commits the installation record, so a record always names an artifact some replica can obtain. The reverse order would produce records nothing can repair, while an object nothing names is reclaimable. Orphan objects are therefore possible, and they are deleted only by digests known to be finished, never by sweeping the namespace. A failed put is a retryable refusal, and an artifact larger than the active storage backend's per-object cap is refused before download.
Installs reach peers through the installation record, and the deferred work retries itself
The installation record, not a bus message, carries an install to every replica. The plugin_type
generation's deferred work retries what it could not finish (a pull cut off by a slow node, a transient fault,
a busy lock) after a growing wait, until it succeeds or a newer generation replaces it; generations come only
from writes, so without its own retry one fault would last until an unrelated write or a restart. A record
written after a failed reload on the origin still reaches the peers, so a native version whose reload failed
there is reloaded on every peer at once; a plugin without workloads has no staged rollout.
Uninstall convergence requires a tombstone
A replica deletes and evicts a loaded install-root type only when the type's normalized id has a durable
uninstall tombstone and no installation record. The tombstone is written in the same save that deletes the
installation rows and cleared by the next write of an installation record. An absent row alone is not
evidence: it is the state of a development drop and of plugins a workload plane uses that the type sweep does
not inspect, and acting on it would delete a live plugin. The plugin_type generation hands each tombstoned
type to every replica's sweep, which protects in-flight installs and re-reads the tombstone under the locks
before it deletes; a replica that missed the uninstall converges at its next generation and by its own
retries. Artifact and manifest timestamps are compared with the tombstone time, so copied files that kept
older timestamps can be removed, and a filesystem clock ahead of PostgreSQL can preserve an artifact for
operator review. Two observations of an absent row would not be enough either, because the second can
still delete a live artifact whose record never existed.
An uninstall retires a native plugin's blocks once no live run uses them
Each replica retires an uninstalled native type's workflow blocks when it evicts the type: the serving replica
inside the request, a peer in its uninstall sweep. From that moment the replica's start admission refuses a
Manual or Trigger start whose version, or a workflow it calls, holds one of the blocks (code
plugin-uninstalled, the message naming the plugin; 403 on the library's execute endpoint, 409 on a debug-session
start); a sub-workflow start is admitted, because its root run
was admitted earlier. The replica then waits up to 30 s, or Cluster:ActionTimeBudget when that is shorter (the
request is a writing handler), for the live runs that use the blocks: state rows in any status that is not terminal
(Pending, Running, Sleeping, Waiting, Suspended) whose own version, or any version their pins name, holds a
block id; a run whose pins cannot be read counts as using them (ILiveRunsUsingBlocks). A parked run is among them:
the workflow library begins a state row for every run when a state store is configured, as Reeve's is, and parks it
Suspended, so parked suspensions are not counted on their own. The count is read from the database, so every
replica judges the same runs. At zero it removes the plugin's block ids, owner-checked and under
the type's activation gate, and the ledger stops counting the blocks against the restart verdict. Otherwise the
blocks stay until the restart, the refusal stays with them, and the runs still going are reported. The wait runs
outside the sweep's locks and the type's gate, which it takes only for the removal, so a peer's sweep does not hold
them for the wait. A second uninstall of the type during the wait joins it and gets the same outcome. A native
reinstall ends the retirement and its refusal when its native registration starts, and forgets the uninstall's
outcome; that activation then decides about the blocks as any update does. A WASM install of the same type id does
not, so the refusal stays until the restart. Each replica keeps its outcome in its runtime records
(blocks retiring, blocks removed, blocks kept until restart) and publishes it in its state report, which a
type with a block outcome gets even without instances or after its uninstall; the report carries the result, the
count of runs still going and the reason, not the runs. The serving replica answers the uninstall with its own outcome
to a caller that asks for it (Prefer: return=representation, allowed by the CORS policy): none when the type had
no native blocks (a WASM type included), removed, kept with each run's id, workflow and status (and a reason when
the runs could not be counted), or ended with its reason when a reinstall or the replica's stop ended the wait first;
any other caller gets 204, the plain acknowledgement. The web dialog stays open on
the answer: a success note for none and removed, a warning for kept that lists the runs with links, says new
starts are refused until the restart and links to every live run of the plugin, and a note with the reason for
ended. The audit row plugin.type.uninstalled commits in the uninstall's own save, so a caller that goes away
during the wait loses only the answer; the retirement goes on without the request. A WASM type's blocks
are still unregistered at once by its eviction. A start admitted on a peer that has not begun retiring yet is
counted by the others' wait; one that slips past a replica's zero reading fails at the block or is abandoned on
resume, as such a run is after a restart.
Versions are pruned after an update, and a type without an installation record is not loaded
An update, once it has taken effect, keeps its target, the version it replaced and the highest version below the replaced one, on the volume and in the object store, and deletes the rest: three versions leave a rollback and a roll back from it. Each replica prunes only its own install root at the end of its own turn, waiting for the in-process install gate within a budget and taking no cluster lock. The shared object store is pruned once, when the roll reports every live replica at the target (an in-place install prunes after its record commits), under the cluster install lock and the update-start lock in the order an install takes them. A digest that any record, kept version or other release names is never deleted, because a replica that restarts downloads the version its record names. A pass still blocked when its budget ends logs a warning and deletes nothing.
At boot, a type whose directories sit in a separate install root with no installation record is not loaded and its files are removed, so a half-finished or hand-copied drop never runs; an unreadable record table fails the boot. Directories already on disk are not swept at boot, because a boot cannot tell a replaced version from an old one.
Installed artifacts missing from the artifact store are stored by a leader-owned pass
An installation record whose digest names an object no backend holds is repaired by one leader-owned pass that runs when its unit is assigned and every six hours. It obtains the artifact (from this replica's disk where the artifact is the entry asset, from the repository otherwise) and stores it; it is leader-owned because it downloads. The pass never rewrites a record: a record is never re-pointed, even where its release row names other bytes, because the record is the only witness of what was installed. A version move the orchestrator commits against a release row without a valid digest is refused, so a record never loses its snapshot at runtime. For an OCI plugin whose repository has been deleted no copy is possible, because the artifact is the layer blob and cannot be rebuilt from its extracted directory.
An install reports one blocked outcome, and Requires restart only when a restart could help
An install that leaves the committed version inactive on the serving replica reports exactly one of: Requires restart when the version is not active there and a restart could change that, Backend too old when the version declares a host floor this backend is below, or Rejected when the replica refused the artifact's registration for a reason the next boot would repeat. One classifier reads the activation both lanes build, so a WASM start that fails in a host step and a native version whose boot-only parts load only at the next boot both read Requires restart. A WASM start that fails in the version's own code reads no outcome: it stays the instance's health, which the recovery sweep retries. A WASM call its caller cancels is a cancellation, decided from the call's token, because the runtime reports a cancel with the text its own timeout uses. The remedy is classified from the call results, not from the activation verdict: once the replica is stopping the verdict turns every non-ok result into an interruption, so a floor or a repeating refusal would read as a restart that could help.
At most one of RequiresRestart, HostUpgradeReason and ArtifactRejectedReason is set, on the install
response and on the instance badge, so no surface reconciles a restart promise with a deterministic refusal.
The markers live in memory on the replica that served the install, and a successful start of the instance
clears them; a peer applying the install writes none, because a surface reads the serving replica's markers
and a peer's would flap. Rolling the deployment converges them.
Discovery matchers are not boot-only: the write that registers a native factory also replaces its matchers in the index. Neither are HTTP routes: they belong to the instance and are replaced on each of its starts (see An instance serves its own routes under its prefix).
Workflow blocks are swapped live on each replica when their shapes are unchanged. The hot
registration keeps the block factories it reads, and the replica compares them with the blocks it has registered
for the plugin: every registered id must be exported again with an equal shape, and new ids are allowed. When that
holds, the activation's calls answered at the target and no host failure cut it short, one registry write after them
replaces the plugin's block set, the ledger records the blocks at the new version, and Requires restart names
only the kinds still behind, so a plugin whose only boot-only kind is blocks reads none. Otherwise the blocks stay
until the next boot (blocks after restart: block `x` changed shape), or, when a call did not succeed or the
host failed, until an activation of the version that succeeds or the next boot (blocks not swapped: <reason>). The
restart reason on the instance badge names a changed or dropped block; a failed call or host failure fails the
activation, so the badge names that failure and blocks not swapped is only in the replica's log. A swap that the
registry refused some new ids for names them (blocks swapped live, except …, which another owner holds). A plugin
that exports only blocks counts as registered at the new version once they are swapped, and a first install's blocks
register at once, since nothing is registered to compare with. Each replica logs its own outcome and keeps the last
one in its runtime records and in the state report it publishes, on every door, an uninstall clearing it. A type is
reported while it has instances or a block outcome (the last update's or the uninstall's), and once more when its last
outcome is cleared, so a plugin without instances is reported too; The plugin's admin page reads the serving replica's records and the peers' last reports for
every counted member (GET api/plugins/types/{id}/replica-outcomes); a replica that does not serve the route answers 404, and the page
says the outcomes are not available there. The page reads them again every two seconds while a retirement waits for
live runs, and for up to a minute from each new disagreement among the reporting replicas (one recorded the uninstall
and another has not yet, or their last updates name different versions), since a peer's outcome arrives with its next
report. A retirement outcome carries the block ids the replica retired, so the executions list's plugin filter finds
the runs a peer's kept blocks serve after this replica removed or never loaded its own. A roll turn's reason carries the outcome only
when the turn's activation succeeded. A plugin without instances has no badge.
Alert subscribers are swapped in place after the same instance calls The hot registration keeps the
subscriber types of the new version's context; when the calls answered at the target and no host failure cut the
activation short, the alert bus builds a subscriber for each type on the plugin's current grant and, after the
activation's registry commit, swaps each of the plugin's slots in place under its lock, adds a slot for a new type
and withdraws the slot of a dropped one, so an alert reaches the old or the new subscriber and never neither. The
ledger then records the kind at the new version, and a plugin with blocks and a subscriber that both swap needs no
restart. A subscriber that cannot be built or activated leaves all the plugin's slots as they were
(alert subscribers after restart: <reason>), a failed call or host failure leaves them too
(alert subscribers not swapped: <reason>), and the outcome is recorded and reported like the block outcome. A
replaced or withdrawn subscriber's facade is disposed once the deliveries in progress on its slot end, waited for at
most 30 seconds. An uninstall withdraws the plugin's slots on every replica that removes the type.
A changed artifact on disk is flagged, never reloaded by itself
The assembly watcher notices when a loaded artifact changes on disk and flags a pending change; it never reloads. An automatic reload is unsafe in the middle of copying a multi-file update, so a reload is always an operator's action, preceded by a metadata-only pre-flight that leaves the running instance in place when it refuses.
Instances at runtime
A running plugin is dispatched to only if the committed row admits it
Instance and grant rows reach every replica as the plugin_instance and plugin_grant generations; the
cluster bus carries no enable, configuration or grant message. A component (an instance start or reload, a
WASM trigger arm, an alert-subscriber build) takes its row and the grant state of its type from the generation
it began against, never from the table, and the replica that writes a change does not start, restart, reload
or re-arm inline in the request (constraints).
A start registers only inside an activation of plugin_instance and is refused when the instance's current
state is no longer the object the build read, or the type's grant state is no longer the one the generation
held. Every accessor that hands a running plugin to a request or to background work pins the current
generation and answers "not running" when the row is absent, disabled, or on a newer revision than the
running copy (constraints).
An acknowledged disable, edit or grant change therefore holds on every replica before that replica has converged, at the cost of one pinned read. A request that reaches an instance the row no longer admits is answered as though the instance were not running, and the caller does not wait. A refused start is cancelled, not retried: the newer generation's convergence or the 60-second recovery sweep starts it. Each deferred walk covers every key of its type, because a newer generation cancels the running walk whichever key it changed. A plugin type install keeps its inline pull and hot-load, because no generation carries files. The visible cost: an instance can read "not running" between the response and the writer applying its own generation. The request does not wait for the instance's lane, which would hold it for as long as a stop or start takes, and no enable, configuration or grant bus hints run beside the generations, which would give two paths to one state.
An operator's configuration edit is a revision the convergence compares
An instance row carries ConfigRevision, advanced only by an operator's configuration edit, in the same commit
as the configuration and by an atomic increment, so two concurrent edits are two revisions. A replica's
plugin_instance convergence compares each running copy with the row it read itself: a disabled or absent row
stops the copy, and a row on a newer revision rebuilds it. A start that reads a disabled or absent row under
its own gate starts nothing, so every running copy comes from a read that said enabled. A plugin's own writes
to its configuration advance nothing and restart nothing. An edit that changes nothing still costs one
restart per replica, because the row does not remember what it held; an unchanged row never costs one.
The convergence does not hash the configuration or compare UpdatedAtUtc, because a plugin's own write moves both.
Instance lifecycle runs on a per-instance lane, and requests supersede
Each instance has a lane, a background task that runs its start, restart, stop, reload, grant reload and
forget one at a time, in request order; different instances run in parallel. A restart or stop takes the
running entry out of the map when it is requested, marks pending operations superseded and cancels the token
of a start under way, and a superseded start never publishes. The instance gate is a short lock never held
across an await, a plugin call or a database read, and a caller that needs the outcome waits on the
operation's completion with its own token
(constraints). The row pass, the
grant pass and the recovery sweep request their operations under the pass lock, release it, and observe the
completions afterwards, so a pass reports what it requested and a slow StartAsync stalls neither the next pass
nor another instance. A plugin's StartAsync must observe its token, or it delays the next restart of its
instance. A restart refused in this replica's own plugin-roll turn leaves the instance stopped until the
recovery sweep or the next generation. Starts are never awaited under the instance gate or the pass locks: a
slow start would stall every later edit of the instance and every pass, and a newer edit could not cancel it. Boot waits a bounded time for each start
(constraints).
Instance health is the fleet's verdict
An instance's healthStatus and healthMessage are composed by one host reader from shared state only, so
every replica reports the same verdict at the same moment. It folds three inputs and takes the worst:
- The plugin's own reports, as the replicas published them in their status sections (this replica's included): a Faulted report from any replica wins, then the report of the adapter session's owner, then, with no owner, the worst.
- Its workload rows, folded by the workloads library's aggregation:
Failedis Unhealthy with the redeploy route;Degraded,VersionSkew,Unknownor every workload suspended is Degraded;PendingConfigurationandAdoptionPendingare NotConfigured. - Its adapter session: a session the manifest owes that is absent, and is not explained by a workload coming up or paused, is Unhealthy.
healthReplicaId names the replica whose report decided it. The serving replica's own live report travels
separately in replicaHealthStatus and replicaHealthMessage, for a caller confirming an action it took on
that replica (the reload dialog, the starting poll), which a fleet verdict held down by a workload or a
reconnecting session would never satisfy. A plugin cannot see its own workload or other replicas, so its own
report alone would read Healthy while its workload is gone. The verdict lags a plugin's own change by up to
one status-report interval, and a just-enabled instance reads Unknown until its first report. During the
180-second session outage grace a session plugin's devices stay Online and their freshness label reads
stale; automations, failover and commands do not read the label. The owner, not the worst report across replicas, breaks ties, because a non-owner reconnecting on every rolling restart
would otherwise turn the fleet Degraded.
Plugins keep no device state and lease before connecting
Every in-process plugin loads on every replica, so a plugin holds no device state in memory and takes the connection-ownership lease before opening a long-lived connection (constraints). What the host keeps from a plugin's load context, and how plugin-derived state names its plugin, are constrained by load-context lifetime and plugin-derived state. The replica-level rules behind all of this are on the cluster page.
What a plugin contributes, and how plugins talk
A plugin contributes no frontend code
A plugin ships a configuration schema plus server-driven views, fetched as a component kind with a payload and rendered generically, optionally behind a multi-step setup wizard. 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 (constraints). A new capability hangs off the live plugin instance, not a new factory member.
An instance serves its own routes under its prefix
A native plugin instance that implements IPluginRoutes describes its HTTP routes on a host builder: a pattern
relative to api/plugin/{instanceId} (the instance id in the "D" GUID format), its methods, a RequestDelegate and
its access rules. The host builds every endpoint itself, with its own methods, authorization (an access token, a
permission's host policy, or anonymous), API-description exclusion and write acknowledgement, so no plugin metadata
reaches the shared matcher and no handler signature reaches minimal-API binding. A plugin handler gets an
HttpContext of its own over the request's features, whose request services resolve no host service, only a logger
factory that logs nothing, which the result helpers need, and never change. An endpoint
reaches its handler through a host-owned lease that a stop, a reload or a delete empties, so an endpoint a framework
cache keeps afterwards holds nothing of the plugin and answers 503, or 404 once the instance is deleted. After the
instance starts, the host captures the routes and publishes them in the lock that publishes the instance, so the
routes always run the code of the instance that is reachable. A set with a route the host will not build (rooted or
dot-segment pattern, unknown constraint, invalid method, unknown permission) is refused whole, and the instance keeps
running without routes. Every start replaces the set. While the instance runs, a path or method under its prefix that
the set does not map answers 404. A stopped or reloading instance answers 503 on every path under its prefix if it has
published on this replica since the host started, and 404 otherwise; a deleted one answers 404. The route source is
per replica and holds nothing durable.
Peer calls between plugins are opaque strings
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, and the consumer needs the invoke grant, with no target allowlist. Each instance runs in its own collectible load context, and a live typed handle would need host-curated shared assemblies for type identity, would let the consumer reflect into the producer's facade and use its grants, and would pin the producer's context so it never unloads. Serialisation and meaning are a contract between the two plugins. Call depth is capped so a cycle terminates, and resolution is replica-local, so a peer call does not cross replicas.
Plugins report operator-actionable problems through an issue registry
A plugin raises an issue with a stable code and a severity, optionally with a fix hint and a guided repair
action, and clears it when the condition resolves. Raising is idempotent per instance and code, and clearing a
code that does not exist is a no-op, so a plugin never checks first. Dismissal is per row, so the next raise
opens a new one: fix the condition or expect it back. Health checks answer "is it up" and audit answers "who
did what"; neither is where an operator looks for "this bridge needs re-authorising". Issue metadata is
visible to any administrator, so it never carries a secret. Issues surface as plugin.issue alerts
(alerts); open issue rows are never copied into the alert store, because a
row for a plugin that no longer raises it would stay open with nothing to clear it.
A plugin call's path is redacted by default
The host records every call through the vended HTTP client without any text from its path: in the log line and
in the trace span's url.full the path becomes a per-process keyed fingerprint, unless the request names a
path template (PluginHttpRequestOptions.PathTemplate), which is recorded instead, reduced to path characters
and without its query. Credentials travel in paths (webhook tokens, bot tokens, bridge application keys), so no
rule about which segments to keep is safe, and an opt-in "sensitive" marker would leave every plugin already
published leaking until rebuilt. The fingerprint key is random per process, because an unkeyed hash of a short
secret can be reversed by enumeration, so fingerprints correlate only within one process. A template that
repeats a long segment of the real path is taken for a mistaken interpolation and replaced by the fingerprint;
a short secret put in a template still leaks. WASM plugins cannot name a template, as their fetch call has no
field for one. Workflow HTTP blocks and scripts keep their paths in the run log but not on the span, and the
HTTP client factory's own request logging still writes workflow URLs to the backend log at Information.
Flows
Configuration, options, action and repair flows are multi-step interactions between an operator, the host and a plugin. Their answers live in Redis, and a plugin may keep a flow's work in memory.
A flow runs on the process that started it
Every flow records the process that started it: replica id plus an id drawn at process start. A submit that reaches another replica is forwarded to that process over the cluster library's member ask, run there, and its HTTP answer returned unchanged. When the owner no longer runs, the replica that receives the submit adopts the flow by a check-and-set against the stored flow, so there is one adopter per former owner. A step write, and the end a step's outcome causes, succeed only while the writing process is the stored owner, checked in the same transaction, so an owner whose flow was adopted carries out nothing of its result. Liveness is the owner's member row in PostgreSQL, not Redis.
A plugin may hold per-flow state in memory, and treats a submit for a flow it holds nothing for as a fresh
start. An owner that is stopping, fenced or not yet serving, and a roster that cannot be read within 2 seconds,
answer 503 FLOW_OWNER_BUSY, which the web application retries; an owner that took the submit and did not
answer in time answers 504, which nothing retries, because the step may still complete. A stopping replica
starts no new submit and finishes the ones it has taken for a quarter of the shutdown timeout before its
services stop. A cancelled submit keeps its flow. Without this rule, under round-robin balancing, a polling
step landing on another replica would start the same work twice.
A flow's end is claimed once in Redis when it is decided
Every end of a flow, the plugin's own Finish and Error included, first writes the flow's end claim with
set-if-absent at the moment it is decided and before any other host work; the end that wrote it is the flow's
end, and one that loses does nothing. A winning end that is not the plugin's own is delivered to the plugin
after the request answers, by a host-lifetime runner that asks the flow's owner process through the replica
request relay and calls the plugin locally on any answer but "done". A second set-if-absent key, the call
claim, keeps a fallback from repeating a call the owner started; each call is bounded by
ConfigFlow:EndHookTimeoutMs. Expiry is recorded, not observed: every write of a flow's state also writes its
deadline into a Redis sorted set (configflow:deadlines), and the reconciliation leader sweeps the due entries
in bounded batches, taking the end claim as Expired. State is deleted only after a claim. Native commands
order the ends, with no server-side script (constraints).
The end hook is best-effort and at most once: a notice not yet delivered when the host stops, a sweeper down for longer than the state's backstop TTL, or a flushed Redis tells the plugin nothing, so a plugin keeps its own deadline. The hook may run on a replica that holds none of the flow's in-memory work, so a plugin stops that work through something shared. How a plugin implements the hook is in the flow end hook.
A client-supplied secret is a generic ClientValue step
A flow asks a capable client for a secret with a ClientValue step and gates itself with
RequiredClientCapability. The answer is the single field value; the host encrypts it at rest, decrypts it
only for the plugin's submit and never logs it. The host knows no kind and no capability, and it refuses a
submit that is not exactly one non-empty value before calling the plugin. A kind is a string the plugin and
the client agree on, declared in no SDK, and a client lists a flow only when it supports its capability; the
web client supports none. Repair flows keep their answers in plain text, so they refuse the step. A plugin that
uses the step declares the host version that introduced it as its floor. The plugin SDK has no protocol-specific interface, because it
would put one protocol with one implementer into the SDK and open a second route for secret input. Authoring
detail: client value flows.
A flow slot is the flow's id in a set, not a counter
A user's config-flow budget is a sorted set at configflow:user:{userId}:slots whose members are flow ids and
whose scores are reservation times. Taking a slot is one MULTI/EXEC that adds the flow's id with ZADD NX,
counts the members with ZCARD and sets the key's TTL; a count over the cap removes the id again and refuses the
start. Releasing is ZREM of that id. A repeated reserve or release is therefore harmless, and nothing is compared
before the write, so no WATCH is needed. Reconciliation adds a slot for an active flow that holds none and drops a
slot whose flow key is gone; it is safe to run twice. A release that faults costs the slot for a grace of
max(2 minutes, 2 × the reconcile interval) plus one interval.
Repair flows reuse the flow step contract with their own store
A repair flow is started from an issue, not from an instance, and creates no plugin instance at its finish, so it reuses the configuration-flow step contract but keeps its own session store. Sessions are shared across replicas with a 15-minute sliding TTL, and writes and removal are atomic against the recorded owner. Answers round-trip through Redis as JSON elements. User-facing behaviour: repairs.
The plugin authoring tool
reeve-plugindev (tools/Reeve.PluginDev) is the author's command line: watch, test, validate,
deploy, pack and observe. Its usage is in the plugin dev CLI; its
architecture rests on three rules.
- It runs the host's own code, never a fork.
deployvalidates and renders a manifest's deployment section offline with the parser and renderer registry the backend wires, against the published deployment schema embedded in the tool; the schema cannot express uniqueness, cross-field or path-policy rules, so the parser is the authority for those.validateruns the host's pre-flight over manifest and DLL through a metadata-only load context, so no plugin code executes and nothing uploads, and it grades the floor of the selected build.packwrites the per-framework layout above, strips what is reachable only through host-shared assemblies, and verifies the IL closure. - It mints nothing real. A deployment rendered at authoring time carries a documented placeholder token, and specs hold secret references, never raw tokens.
observeproves replication, not just execution. It replays frames through an owner and a follower copy of the plugin in one process, each with its own load context, instance and facade, sharing nothing but the Redis stream. The follower's facade refuses and records every effect-causing call, so an observer that swallows the refusal is still caught, and a run that replicated and observed nothing is not a pass. Replay flushes Redis, so it refuses a Redis it is not free to write into. The verb has three documented exit codes and no other, because authors gate releases on them.
Argument parsing is hand-rolled rather than built on a command-line framework, because every dotnet tool run
would pay that framework's startup cost.