Skip to content

fix(runtime): an artifact boot names every code plugin of the app that it does not run - #36708

Merged
objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/project-thread-g4g7t8
Nov 23, 2026
Merged

objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/project-thread-g4g7t8

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Warren · project thread

Fixes #36647

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:应用用编译产物上线时,如果它带的代码插件没有跑起来,启动日志会逐个点名这些插件并说清怎么补上;以前一声不吭。
  • 为什么做:BrightRule 评估里知识库、向量检索和条款索引三个插件全部没装上,后面检索为空、钩子找不到服务,没有任何提示,排查很难。
  • 出错会怎样:只多一条警告,不加载、不拒绝、不改变任何插件,启动照常;改动可以直接撤回。
  • 要你做什么:无(走的是已有裁决「产物只带元数据,插件由宿主装配」这条路,没有替你选「把插件塞进产物」)。

What changes

  • packages/runtime/src/artifact-declared-plugins.ts (new): warnUnmountedDeclaredPlugins judges each entry of the app's plugins by name against the kernel's own plugin table and warns once, naming every listed plugin the kernel does not run, with the remedy: boot from objectstack.config.ts, or from a host config that loads the artifact and lists the plugins in its own plugins, 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 (no init) also counts as running under the plugin.app.ID name 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 with securityMetadataRegistrar: 'artifact-door', the existing declaration that its bundle IS the artifact the artifact door reads. Only createStandaloneStack (the door every artifact boot goes through: createDefaultHostConfig for OS_ARTIFACT_URL and for cloud's composed boot, os start on a built app) and the os dev host-config artifact door make it. A config boot (the CLI's new AppPlugin(config) wrap, default registrar) is never judged, because its host materializes the stack's plugins under names a descriptor cannot predict. Read in start(): the kernel refuses use() 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.
  • Changeset: @objectstack/runtime patch.

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:

"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 build fail on a stack with plugins was not done: the same build feeds config boots that do mount them (os start / os dev over 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 real os build (the Compile command in process) of a config listing two live plugin instances, then a real boot of the artifact it wrote through createStandaloneStack (reached through @objectstack/runtime's exports, so dist/).

  • PREMISE: objectstack.json holds both plugins as descriptors with no init;
  • the boot runs neither (kernel.hasPlugin false 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 of createStandaloneStack over an artifact file on disk carrying two plugin descriptors exactly as os build writes them.

  • neither mounted → exactly one warning, { appId, plugins: [vector, indexer] }, both names and the remedy in the line (CONTROL: kernel.hasPlugin is false for both);
  • CONTROL: host mounts one → the warning names only the other;
  • CONTROL: host mounts both → silent;
  • CONTROL: artifact lists no plugins → silent;
  • CONTROL: config door (new AppPlugin(config), default registrar) with an unmounted descriptor → silent;
  • four unit cases of 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/cloud apps/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).
  • Not touched: the build summary's Runtime: N plugins count. 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 under scripts/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).
  • Neighbours: runtime 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-config on every touched source → exit 0; cli test/vitest-tiers-partition.test.ts → 22/22.
  • node scripts/pm/overlap-check.mjs → clean (shares self-hosting.mdx with fix(auth)!: a boot outside development mode retires what the development seed issued #36311 and chore: version packages #35129, both merge cleanly).
  • Derived gate families (node scripts/pm/dispatch-gates.mjs --commands, 100 commands) at 3676b4f987: 97 exit 0; pnpm check:test-source-alias exit 1 (the new cli pin reached two lazy loads inside a clocked window), fixed at a5af61eea5 by two module-top side-effect imports and re-run there: exit 0; pnpm --filter @objectstack/spec run check:skill-examples and pnpm check:dual-build-cjs-loads exit 3, PREREQUISITE NOT MET (they read built output of packages this change does not build): NOT MEASURED locally, CI runs them. CI at 3676b4f987 was red on the same test-source-alias gate only.

Two-minute check

OS_ARTIFACT_URL=file://$PWD/dist/objectstack.json os start on an app whose config lists plugins: [new SomePlugin()]: the boot log carries one [AppPlugin] app '…' lists 1 plugin(s) that are not running on this kernel: '…' line. os start from the same app's config prints no such line.


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01JQwxba17kw1B3myaWtd4wP

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 23, 2026
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/runtime, touching 8 documentable anchor(s).

2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/kernel/cluster.mdx (via getKernel (symbol, a field of interface DeclaredPluginsContext))
  • content/docs/plugins/anatomy.mdx (via getKernel (symbol, a field of interface DeclaredPluginsContext))
What this run could not see
  • 2 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 68 of 251 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 30 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json b617675d2887f7b88e98a397011f70cf2004ae0c → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 9533e58ab197137f82ee5914f404b3f751ba2232 — the merge of head a5af61eea5991520e1f63a560cef781986cea291 into base b617675d2887f7b88e98a397011f70cf2004ae0c, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# 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

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs b617675d2887f7b88e98a397011f70cf2004ae0c → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

维护者速读

用 os build 编译出的应用包,只带应用的元数据和钩子,不带应用自己的代码插件。以前用这个包启动时什么也不说,后面依赖这些插件的功能会莫名失败。现在启动时会警告一次,列出没在运行的插件名,并告诉运维怎么补上。行为本身不变(按之前的裁决 #15219 A 与 ADR-0025)。
要你做的:无。

席位核对 — ACCEPT (L1) · repo:objectstack#1 · head a5af61ee · 2026-11-23T13:51Z

  • Shape: Fixes #36647. packages/runtime/src/artifact-declared-plugins.ts (new) and its test, one call in app-plugin.ts, a cli pin that runs a real os build and boots what it wrote, one row in self-hosting.mdx, a @objectstack/runtime patch changeset. Clause-②: no (no option, export or artifact field added). Metadata-protocol: none. Not governed.
  • Read: only on the artifact door (securityMetadataRegistrar === 'artifact-door', set by createStandaloneStack and the os dev host-config artifact door), AppPlugin.start() warns once, naming each listed plugin the kernel's own plugin table does not hold (by name, or by the plugin.app.<id> alias for a descriptor), with the remedy; fields { appId, plugins }. Judged per name, so a host that mounts some of them hears only about the rest; package-specifier strings and a kernel with no readable table are skipped. The route is the warn-once one the seat accepted as following finding(cli): plugins / devPlugins are package-owned collections, but os serve and os migrate read them off the flattened top level only — and the mechanical fix is wrong #15219 ruling A and ADR-0025 §3.10.
  • Evidence (thread): runtime 9/9 and cli pin 2/2; ablation (door call off) gives runtime 2 red and cli 1 red; neighbouring runtime suites 564 passed; runtime and cli typecheck 0. The Test-source alias red at 3676b4f9 is fixed by two module-top imports.
  • Follow-up: the cloud doc apps/objectos-ee/deploy/artifact-pinned-boot.md says the app's own plugins come from the artifact; a cloud-side doc fix is noted for the cloud lane.
  • Gates: 59 check-runs on a5af61ee: 42 success, 17 skipped, 0 failed. K = 14 behind main (< 15).
  • Landing: ready + auto-merge now. On merge, Artifact boot silently drops an app's code plugins: runtimeModule carries only functions, so plugins: [new XPlugin()] never mounts (and its dependencies are not shipped) #36647 closes and the seat clears its label.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 23, 2026 13:52
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit e343ab7 Nov 23, 2026
60 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-g4g7t8 branch November 23, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants