Repository navigation
fix(runtime): an artifact boot names every code plugin of the app that it does not run - #36708
Conversation
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxba17kw1B3myaWtd4wP
…t it does not run Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxba17kw1B3myaWtd4wP
… declaration, no new option Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxba17kw1B3myaWtd4wP
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxba17kw1B3myaWtd4wP
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxba17kw1B3myaWtd4wP
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxba17kw1B3myaWtd4wP
📓 Docs Drift CheckThis PR changes 1 package(s): 2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 30 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 9533e58ab197137f82ee5914f404b3f751ba2232 && git checkout 9533e58ab197137f82ee5914f404b3f751ba2232
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin b617675d2887f7b88e98a397011f70cf2004ae0c a5af61eea5991520e1f63a560cef781986cea291 && git checkout -B drift-repro b617675d2887f7b88e98a397011f70cf2004ae0c && git merge --no-ff a5af61eea5991520e1f63a560cef781986cea291
node scripts/docs-audit/affected-docs.mjs --json b617675d2887f7b88e98a397011f70cf2004ae0c
|
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxba17kw1B3myaWtd4wP
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj 维护者速读用 席位核对 — ACCEPT (L1) · repo:objectstack#1 · head
|
Requested by Warren · project thread
Fixes #36647
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
packages/runtime/src/artifact-declared-plugins.ts(new):warnUnmountedDeclaredPluginsjudges each entry of the app'spluginsby name against the kernel's own plugin table and warns once, naming every listed plugin the kernel does not run, with the remedy: boot fromobjectstack.config.ts, or from a host config that loads the artifact and lists the plugins in its ownplugins, or package them (os plugin build→os plugin install). Structured fields{ appId, plugins }. A host that assembles the app's plugins itself hears nothing about the ones it runs. A bundle entry (noinit) also counts as running under theplugin.app.IDname a host wraps it into. A package-specifier string is never judged: the name its plugin registers under is not in the specifier, so nothing is said that the table could contradict.AppPlugin.start(): makes that call when the plugin was composed withsecurityMetadataRegistrar: 'artifact-door', the existing declaration that its bundle IS the artifact the artifact door reads. OnlycreateStandaloneStack(the door every artifact boot goes through:createDefaultHostConfigforOS_ARTIFACT_URLand for cloud's composed boot,os starton a built app) and theos devhost-config artifact door make it. A config boot (the CLI'snew AppPlugin(config)wrap, default registrar) is never judged, because its host materializes the stack'spluginsunder names a descriptor cannot predict. Read instart(): the kernel refusesuse()once bootstrap has begun, so the table is final. No option, export or artifact field is added.content/docs/deployment/self-hosting.mdx: one row in the artifact-pinned boot table saying an artifact boot runs without the app's code plugins, that the boot names them, and what to do.@objectstack/runtimepatch.Level is
warn: a capability is absent and its next caller finds out, which AGENTS.md "Degradation log levels" grades functional, not durability.Why: the route, and why it is not a fork
The card offers "carry them" or "refuse them, loudly" and leaves the pick to the maintainer. Two existing rulings already make it:
plugins/devPluginsare package-owned collections, butos serveandos migrateread them off the flattened top level only — and the mechanical fix is wrong #15219, maintainer ruling A (2026-09-04, 「同意」):plugins/devPluginsare artifact envelope keys, "runtime ASSEMBLY instructions, not metadata … An artifact carries metadata; a host assembles plugins" (packages/spec/src/stack.zod.ts, the envelope-key docblock)..ospluginwith permission consent; the environment artifact is the L0/L1 declarative channel.cwdConfigJoinsBoot(packages/cli/src/utils/artifact-precedence.ts) already says it: a host config's "own compiled output cannot carry that code"."Carry them" would put app code and its dependencies into the environment artifact, against both. So this PR takes the other half of the card's own Expected: the drop stays, the silence goes. Making
os buildfail on a stack withpluginswas not done: the same build feeds config boots that do mount them (os start/os devover the config's own output), so a refusal there would break working apps; that would be a narrowing and is not this card's call.Tests
packages/cli/test/build-artifact-code-plugins-boot.test.ts(new, 2 tests): a realos build(theCompilecommand in process) of a config listing two live plugin instances, then a real boot of the artifact it wrote throughcreateStandaloneStack(reached through@objectstack/runtime'sexports, sodist/).objectstack.jsonholds both plugins as descriptors with noinit;kernel.hasPluginfalse for both) and warns exactly once with{ appId, plugins: [vector, indexer] }.packages/runtime/src/artifact-declared-plugins.test.ts(new, 9 tests): real kernel boots ofcreateStandaloneStackover an artifact file on disk carrying two plugin descriptors exactly asos buildwrites them.{ appId, plugins: [vector, indexer] }, both names and the remedy in the line (CONTROL:kernel.hasPluginis false for both);new AppPlugin(config), default registrar) with an unmounted descriptor → silent;findUnmountedDeclaredPlugins(order and dedupe, wrapped bundle alias, live instance, strings / unnamed / non-array never named).Ablation: with the door's call switched off (the pre-fix behaviour), the runtime file goes red (2 failed | 7 passed) and, with the runtime rebuilt, the cli pin goes red on the boot test (1 failed | 1 passed, the premise test stays green). Restored and rebuilt: 9/9 and 2/2.
Acceptance notes
objectstack-ai/cloudapps/objectos-ee/deploy/artifact-pinned-boot.md, "What this mode does and does not mount", says "The app's own plugins, flows and triggers come from the artifact". For plugins that has not been true on this tree; the doc fix is the cloud repo's (carrier: cloud).Runtime: N pluginscount. It counts what the stack lists, which is true; a build-time note that the artifact does not carry them would print on every build of every app with plugins, including the ones served from their config. Left as a possible follow-up for the maintainer.Verification
At head
a5af61eea5(heavy runs underscripts/pm/os-verify-lock.sh):pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/artifact-declared-plugins.test.ts→ 9/9 passed.pnpm --filter @objectstack/cli exec vitest run --maxWorkers=2 test/build-artifact-code-plugins-boot.test.ts→ 2/2 passed (runtime rebuilt first).src/app-plugin*.test.ts src/standalone-stack*.test.ts src/default-host*.test.ts→ 41 files, 564 tests passed.pnpm --filter @objectstack/runtime typecheck,pnpm --filter @objectstack/cli typecheck→ exit 0; eslint--no-inline-configon every touched source → exit 0; clitest/vitest-tiers-partition.test.ts→ 22/22.node scripts/pm/overlap-check.mjs→ clean (sharesself-hosting.mdxwith fix(auth)!: a boot outside development mode retires what the development seed issued #36311 and chore: version packages #35129, both merge cleanly).node scripts/pm/dispatch-gates.mjs --commands, 100 commands) at3676b4f987: 97 exit 0;pnpm check:test-source-aliasexit 1 (the new cli pin reached two lazy loads inside a clocked window), fixed ata5af61eea5by two module-top side-effect imports and re-run there: exit 0;pnpm --filter @objectstack/spec run check:skill-examplesandpnpm check:dual-build-cjs-loadsexit 3, PREREQUISITE NOT MET (they read built output of packages this change does not build): NOT MEASURED locally, CI runs them. CI at3676b4f987was red on the same test-source-alias gate only.Two-minute check
OS_ARTIFACT_URL=file://$PWD/dist/objectstack.json os starton an app whose config listsplugins: [new SomePlugin()]: the boot log carries one[AppPlugin] app '…' lists 1 plugin(s) that are not running on this kernel: '…'line.os startfrom the same app's config prints no such line.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01JQwxba17kw1B3myaWtd4wP