Plugin Data Model
The current schema contains exactly 23 plugin tables. They separate code identity, user authority, device execution, and durable delivery so that changing one concern cannot silently change another.
Catalog and Releases
plugin_package_blob is server-side publication storage. It is not the Runner's channel-scoped runtime cache. An installation pins a release and never changes merely because a newer version appears in the catalog.
Installations and Authority
Device-local Feishu and GitHub credentials must not use plugin_secret. Their plugin_connection.device_id is set, credential_id remains null, and the operational secret stays in the selected Desktop's OS-backed storage.
Permission documents are append-only revisions. A document may cover the entire installation (capability_id is null) or one capability. The policy fields are deliberately closed:
data_reads,device_access, andinbound_events:allowordenylocal_reversible:prompt,allow, ordenyexternal_writes:promptordeny; unconditional allow is not valid
Devices and Runtimes
Enrollment is durable identity; a lease is short-lived liveness. Normal reconnects reuse an enrollment. Revocation advances the generation and fences old connections and requests.
plugin_runtime_instance applies to agent_runtime capabilities. A local_provider such as Feishu or GitHub normally uses a ready connection and the Runner's provider activator without inventing a runtime instance.
Effects and Inbound Delivery
An effect moves through a closed state machine:
Before dispatch, it may also become expired, stale, or cancelled_before_dispatch. failed_before_dispatch is safe to retry; uncertain may have crossed the provider boundary and must be reconciled first.
Relationships
The diagram omits evidence references. Effects and Channel outbox rows also pin permission and connection revisions, release/config/tool digests, and device generation so an approval for one authority cannot execute as another.
Removed Session Tables
Migration 00093_remove_session_plugin_authority.sql removed:
plugin_session_snapshotplugin_session_capabilityagent_plugin_binding- the Session
plugin_snapshot_idcolumn
Current tool visibility resolves from enabled account installations, default connections, and current permissions. Runtime sessions, effects, and Channel dispatches freeze their own direct authority. Do not add compatibility reads or recreate the removed snapshot model.