Repository navigation
v0.7.0: Application identity gating
For full design rationale, see docs/design/v0.7.0-application-identity.md.
Application identity release. Plugins can declare which host application they target; hosts can declare their own identity to validate plugin claims.
Added
BasePlugin.target_application: str | None = Noneattribute. Plugins declare the host application identifier they target (e.g."bibliogon","adaptivlearner").Nonemeans "not declared."PluginManager(app_id: str | None = None)constructor parameter. Hosts declare their application identifier. When set, plugintarget_applicationdeclarations are validated against this value.FilterReasonextended with"wrong_application". Plugins whosetarget_applicationmismatches the host'sapp_idare filtered with this reason at activation.ErrorPhaseextended with"identity_check". New phase for identity-related diagnostics, sibling toversion_check.- v0.7.0 deprecation warning path: plugins that have not declared
target_applicationproduce aPluginError(phase="identity_check", severity="warning")recorded inDiscoveryResult.errorsand logged vialogger.warning. Plugin still activates. The warning fires regardless of whether the host has adoptedapp_id, to nudge plugin authors during the deprecation cycle. Warning stops in v0.8.0 steady state.
Changed
DiscoveryResult.errorssemantic widening: previously contained onlyseverity="error"entries (every entry implied a filtered plugin). Now also containsseverity="warning"entries from the identity deprecation path (entries do not imply filtering). Consumers iteratingresult.errorswithout filtering on severity should re-check their assumptions: render withseverity == "error"to preserve previous behavior, or render warnings in a separate visual treatment. The type contract (list[PluginError]) is unchanged; only the operational meaning is widened.
Migration notes
-
DiscoveryResult.errorssemantic widening (see Changed). New behavior may surprise consumers iterating the list without severity filtering. Adapt by filtering onseverity == "error"for the previous error-only behavior, or by computing failure counts aslen(states) - len(activated)rather thanlen(errors). -
Plugin authors: declare
target_applicationon yourBasePluginsubclasses with the host application's identifier (e.g.target_application = "bibliogon"). In v0.7.0, plugins withouttarget_applicationemit a deprecation warning but still activate. In v0.8.0, plugins withouttarget_applicationwill be filtered withFilterReason.missing_target_applicationwhen the host has adoptedapp_id. The v0.7.0 deprecation warning text, surfaced both inDiscoveryResult.errors[].user_facing_messageand in thelogger.warninglog line:Plugin 'X' does not declare target_application. Hosts adopting app_id in v0.8.0 or later will filter this plugin. Authors should add target_application to remain compatible with identity-aware hosts.
-
Host application owners: pass
app_idtoPluginManager(app_id="my-app")to enable identity gating. Plugins whosetarget_applicationmatchesapp_idactivate normally; mismatches refuse activation withFilterReason.wrong_application. Withoutapp_id, identity is not validated and behavior is identical to v0.6.x. This mirrors the v0.6.0min_app_version/app_versionpattern explicitly: a plugin's identity claim is enforced only when the host opts in by declaring its own identity. A host can run all of v0.6.x, v0.7.0, and v0.8.0 without ever adoptingapp_id, and continue to load plugins as it always has. Identity protection is available, not mandatory. -
Identifier format: free string, lowercase-kebab-case recommended (e.g.
bibliogon,acme-knowledge-base). Reverse-domain notation and a central registry are deferred as open questions in the design doc.