From d4f2919c2ca1acd0b0277222808229e3998042f3 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 16 Sep 2026 09:41:17 +0000 Subject: [PATCH] docs(kernel): refresh plugin manifest dependency examples and state what the kernel reads The PLUGIN MANIFEST examples on plugin-spec.mdx still pinned `@objectstack/core` at `^2.0.0`; `@objectstack/core`'s current version is 17.4.0 and the npm `package.json` example on the same page was already moved to `^17.0.0`. Move the two manifest `dependencies` sites to `^17.0.0` so both halves of the page agree, and move the pin-vs-caret worked example to an exact `17.4.0` against `^17.0.0`, which keeps that lesson arguing and demonstrating exactly what it argued before. Also record what the kernel actually does with these strings, because the page implied a resolution it does not perform. `manifest.dependencies` has two consumers and both take `Object.keys(...)` only: `resolveArtifactPackageOrder` (packages/core/src/artifact-packages.ts) feeds the ids to `resolvePluginOrder` as `optionalDependencies`, and `resolveWritePackageScope` (packages/metadata-protocol/src/protocol.ts) walks the ids transitively. `SemanticVersionManager` and `DependencyResolver` are exported from `@objectstack/core` but have no call site outside their own unit test, so the range value is never parsed at plugin load. Co-authored-by: Claude Claude-Session: https://claude.ai/code/session_017ef78bLdybu3AffehKkhfk --- content/docs/protocol/kernel/plugin-spec.mdx | 27 +++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/content/docs/protocol/kernel/plugin-spec.mdx b/content/docs/protocol/kernel/plugin-spec.mdx index 011daa47f67..f948028b39a 100644 --- a/content/docs/protocol/kernel/plugin-spec.mdx +++ b/content/docs/protocol/kernel/plugin-spec.mdx @@ -57,7 +57,7 @@ export default definePlugin({ // DEPENDENCIES dependencies: { - '@objectstack/core': '^2.0.0', + '@objectstack/core': '^17.0.0', '@mycompany/base': '1.0.0 - 2.0.0', }, @@ -433,7 +433,7 @@ Plugin **cannot function** without these. ```typescript dependencies: { - '@objectstack/core': '^2.0.0', + '@objectstack/core': '^17.0.0', '@mycompany/base': '1.0.0 - 2.0.0', } ``` @@ -467,6 +467,20 @@ Use for large dependencies (React, Vue) that should be shared across plugins. ### Version Constraints + +**The kernel does not check these range strings at plugin load.** `manifest.dependencies` +has exactly two consumers today and both read `Object.keys(...)` only — the ids, never the +ranges: `resolveArtifactPackageOrder` (`packages/core/src/artifact-packages.ts`) hands the +ids to `resolvePluginOrder` as `optionalDependencies`, so an id naming a sibling package in +the same artifact orders ahead of it and an id naming anything else is skipped; and +`resolveWritePackageScope` (`packages/metadata-protocol/src/protocol.ts`) walks the ids +transitively for the write-scope gate. `SemanticVersionManager` and `DependencyResolver` +below are exported from `@objectstack/core` but have no call site outside their own unit +test. So a range here is a **declaration for the installer and for human readers** — a +stale or malformed one fails nothing at load. The forms below are the ones the parser in +`dependency-resolver.ts` accepts, not a set the kernel enforces on you. + + ObjectStack uses **semantic versioning (semver)**. `SemanticVersionManager.satisfies()` (`packages/core/src/dependency-resolver.ts`) accepts exactly these forms: @@ -935,14 +949,19 @@ declares one (`PluginLifecycleSchema`) but nothing in the kernel calls it. ``` ### 3. Pin Core Dependencies -Use exact version for `@objectstack/core` to avoid surprises: +Use an exact version for `@objectstack/core` rather than a caret range, so moving to a new +release is a deliberate edit and not whatever the installer happens to resolve: ```typescript dependencies: { - '@objectstack/core': '2.0.0', // Not '^2.0.0' + '@objectstack/core': '17.4.0', // Not '^17.0.0' } ``` +Per the *Version Constraints* callout above, the kernel does not check this range at load, +so the advice is for whoever installs the plugin — and it applies with more force to the +same dependency in `package.json`, which npm really does resolve. + ### 4. Validate Configuration Early Parse config with your Zod schema in `init()` — the first phase that runs — so a bad value fails the boot instead of the first request. There is no `onBoot` hook (the name