Skip to content

fix(objectql): arm the late-manifest metadata bridge on project kernels too#3436

Merged
os-zhuang merged 1 commit into
mainfrom
claude/manifest-bridge-envlocal
Jul 24, 2026
Merged

fix(objectql): arm the late-manifest metadata bridge on project kernels too#3436
os-zhuang merged 1 commit into
mainfrom
claude/manifest-bridge-envlocal

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

问题(#3428 的 dogfood 后续)

浏览器 dogfood #3428 的安装链路时发现:os dev 以项目级 kernel 启动(environmentId: 'env_local'),而 per-manifest bridge 的旗标 arming 沿用了一次性 bridge 的 environmentId === undefined 门控——于是修复在 marketplace install-local 的最主流宿主(os dev)下完全不生效:一次性 bridge 不跑、旗标永不翻、装包对象照旧进不了 metadata 服务。#3428 的集成测试全部用裸 kernel(无 environmentId),没暴露这一点。

修复

翻旗标移出 environmentId === undefined 块,改为 start() 末尾无条件执行(packages/objectql/src/plugin.ts):

  • 该门控对一次性 bridge 是对的:它拷贝整个进程级 SchemaRegistry,多环境服务器上会把兄弟项目对象漏进本 kernel 的 metadata 服务;
  • 对 per-manifest bridge 不适用:它只拷贝本 kernel 刚注册的那一个包的对象——无可泄漏;
  • 各 kernel 形态的启动期行为不变(旗标仍在启动路径完成后才翻),一次性 bridge 保留原门控。

测试

新增回归测试:environmentId: 'env_local'(精确复刻 os dev 形态)的 kernel,bootstrap 后经 manifest 服务装包 → metadata.getObject('crm_contact') 有定义。已证红(修正前该测试失败:getObject undefined)。

  • @objectstack/objectql 72 文件 / 1041 测试全绿。
  • Dogfood 过程另核实:进程加载的确是 workspace dist(ps + require.resolve),排除全局 CLI/陈旧 dist;os dev 默认日志级 warn 会吞 bridge 的 info 行,勿以日志静默判 bridge 失效。

🤖 Generated with Claude Code

…ls too

The per-manifest bridge added for marketplace installs (#3428) armed
itself inside the same `environmentId === undefined` gate as the one-shot
startup bridge - but `os dev` boots the kernel project-scoped
(environmentId 'env_local'), which is marketplace install-local's primary
home, so the fix was inert exactly where it matters. Caught by
browser-dogfooding the install flow: the install succeeded, yet the
process never logged a bridge pass and the flag could never arm.

The gate is correct for the one-shot bridge (it copies the ENTIRE
process-wide SchemaRegistry, which would leak sibling-project objects on
multi-environment servers) but does not apply to the per-manifest bridge:
it only copies the objects of the one package this kernel just
registered - nothing to leak. Arming now happens unconditionally at the
end of start(); boot-time behavior on every kernel shape is unchanged
(the flag still flips only after the startup path has run) and the
one-shot bridge keeps its gate.

Regression test: a project-scoped kernel (environmentId 'env_local' -
the exact `os dev` shape) now asserts a post-bootstrap manifest.register
lands its objects in the metadata service; red before this change.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jul 24, 2026 1:24pm

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling labels Jul 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/objectql.

13 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/concepts/metadata-lifecycle.mdx (via @objectstack/objectql)
  • content/docs/data-modeling/formulas.mdx (via packages/objectql)
  • content/docs/deployment/migration-from-objectql.mdx (via @objectstack/objectql)
  • content/docs/deployment/vercel.mdx (via @objectstack/objectql)
  • content/docs/kernel/services-checklist.mdx (via @objectstack/objectql)
  • content/docs/kernel/services.mdx (via @objectstack/objectql)
  • content/docs/permissions/authentication.mdx (via @objectstack/objectql)
  • content/docs/plugins/index.mdx (via @objectstack/objectql)
  • content/docs/plugins/packages.mdx (via @objectstack/objectql)
  • content/docs/protocol/kernel/index.mdx (via @objectstack/objectql)
  • content/docs/protocol/objectql/state-machine.mdx (via @objectstack/objectql)
  • content/docs/releases/implementation-status.mdx (via @objectstack/objectql)
  • content/docs/releases/v9.mdx (via @objectstack/objectql)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@os-zhuang
os-zhuang merged commit e1fa8d5 into main Jul 24, 2026
16 checks passed
@os-zhuang
os-zhuang deleted the claude/manifest-bridge-envlocal branch July 24, 2026 13:25
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/s tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant