You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(spec)!: retire the plugin lifecycle-hook family the kernel never implemented (#4212) (#4233)
PluginLifecycleSchema declared onInstall / onEnable / onDisable / onUninstall
/ onUpgrade, each with confident TSDoc. The kernel calls none of them, and
never has. Its plugin contract is init / start / destroy
(packages/core/src/types.ts): use() validates and stores, bootstrap() runs
init then start, shutdown runs destroy in reverse order. There is no install
phase and no first-time-only path. Repo-wide, the schema's only importer was
its own test — and the docs built on it sent authors at a dead seam (#4216
fixed the metadata-type registry's advice; this removes what the advice
pointed at).
Removed, with zero consumers verified across objectstack, objectui and cloud:
- PluginLifecycleSchema + PluginLifecycleHooks, and the five hook members on
PluginSchema (now a plain descriptor object — and, with the function
members gone, JSON-representable: it publishes a kernel/Plugin JSON schema
for the first time).
- UpgradeContextSchema + UpgradeContext, which existed solely to serve
onUpgrade.
- The @objectstack/spec/system ./types module: the ObjectStackPlugin
interface and its PluginContext / PluginLogger / ObjectQLClient / IKernel /
ObjectOSKernel companions — seeded by the aspirational spec in issue #2,
referenced by no file in any repo since.
Route: plain deletion, not retiredKey() tombstones — nothing parses plugin
objects through these schemas (stack.zod carries plugins as
z.array(z.unknown())), so a prescription nobody can receive is noise; the
plugin-runtime.zod.ts precedent. Per that precedent the key-vanish guard's
baseline entries (kernel/UpgradeContext:* in authorable-surface.json) are
dropped deliberately, and kernel/UpgradeContext leaves
json-schema.manifest.json in the same PR. No ADR-0087 conversion: function
members on runtime objects are not authorable stack metadata; there is no
source for os migrate meta to rewrite.
The kernel docs that taught the fiction now teach the real contract:
protocol/kernel/lifecycle.mdx (five-hook example → init/start/destroy class,
plus the app-bundle onEnable distinction), protocol/kernel/index.mdx (the
"kernel calls onInstall/onEnable" claim and a fictional Kernel.installPlugin
API → the real package-install flow), protocol/kernel/plugin-spec.mdx (a
manifest `lifecycle:` file-map ManifestSchema never declared + a six-hook
section with an invented context API → the runtime contract and real
execution order), and AGENTS.md's own plugin example. Each page carries a
callout naming what was fiction, so an author who wrote against the old docs
finds the correction where the fiction was.
Pin tests: PluginSchema declares none of the five names; an authored hook is
stripped by the parse; the retired exports are gone from the module. The
stack-level lint keeps reporting onDisable and friends as undeclared keys, so
authors who still write them hear about it at load.
Claude-Session: https://claude.ai/code/session_01HrRNgrWaRtggzmrHpbomyh
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments