Skip to content

fix(cli): os migrate plan / apply compose the knowledge service an artifact-only stack's shipped source mounts, as os serve does - #38175

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/area-o1C-38062
Nov 28, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/area-o1C-38062

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #38062

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:只用构建产物、没有配置文件的应用,如果自带知识源,运行迁移预览和迁移时会像正式启动一样挂上知识服务,不再提示知识源无人服务。
  • 为什么做:属于知识库检索专题,替用构建产物部署的团队解决迁移命令与正式启动拼出的平台不一致的问题。
  • 出错会怎样:最坏是这类应用的迁移预览多列出知识服务的表;不带知识源的应用不受影响,改动可直接撤回。
  • 要你做什么:无。

What changes

On an artifact-only stack (dist/objectstack.json, no objectstack.config.ts), os serve builds its config as the standalone stack's result laid over the empty authored config (mergeBootConfig), then reads the tokens the stack's items mount off that config (stackItemCapabilities). Since the standalone result started carrying knowledgeSources, a shipped knowledge_source mounts KnowledgeServicePlugin there.

os migrate plan / apply handed the served-platform composition only stack.requires, and composeServedPlatform read item tokens off the loaded config, which is empty on that stack. Now:

  • packages/cli/src/utils/schema-migrate.ts: servedPlatform also carries artifactStack: stack, the standalone result.
  • packages/cli/src/utils/schema-migration-plugins.ts: composeServedPlatform reads stackItemCapabilities off mergeBootConfig(config, artifactStack) whenever the config is not a host config. That is serve's own merge, gated by the same rule requires already follows a few lines above. A host config, or a call with no artifactStack (os migrate security-catalog-overlays), reads the config as before.

The auth gate's authGatedSecurity hand-off is unchanged. The only item token is knowledge, and it maps to no tier (CAPABILITY_TO_TIER), so the tier reading is the same with or without it.

Tests

  • New packages/cli/src/commands/migrate/plan.artifact-item-capabilities.test.ts (unit tier) runs os migrate plan --json on an artifact-only project:
    • one knowledgeSources entry and no requires: exit 0, composition.hostConfig is null (precondition), the "Composed what os serve mounts" note names KnowledgeServicePlugin, and no output channel carries the unserved-knowledge_source warning;
    • control, the same artifact with no source: the note is present and does not name KnowledgeServicePlugin.

Acceptance notes

  • Ablation (both source files restored to the base 0e361201b2, test unchanged): the main case goes red on the note assertion (the note lists the REST API plugin through PackageServicePlugin, with no KnowledgeServicePlugin), and the control stays green. A second ablation moved the warning assertion first. It went red with the ObjectQLPlugin unserved line in captured output, which shows the "no warning" assertion can fail. The tree was restored and git status read clean after each run.

Verification

Read first: composeServedPlatform's servedConfig line in schema-migration-plugins.ts (the gate on isHostConfig), then the servedPlatform hand-off in schema-migrate.ts.

Two-minute check: pnpm --filter @objectstack/cli exec vitest run --project unit src/commands/migrate/plan.artifact-item-capabilities.test.ts should give 2 passed.

Local readings
  • Closure build pnpm turbo run build --filter='@objectstack/cli^...': 69/69 tasks, lock VERDICT command-exit 0.
  • New pin: Test Files 1 passed, Tests 2 passed.
  • @objectstack/cli unit tier: 445 files passed. The 2 published-subpath-* pins failed on a missing packages/cli/dist prerequisite, not on this change. After pnpm --filter @objectstack/cli build they read Test Files 2 passed, Tests 29 passed.
  • pnpm --filter @objectstack/cli typecheck: exit 0.
  • src/utils/schema-migration-plugins.test.ts (integration tier, the touched module): Tests 54 passed.
  • overlap-check --pr=38056,38060,38013,37982,38038: VERDICT clean, exit 0.
  • Derived gate families (dispatch-gates --commands, 70 commands, --ran 70/70 accounted): 68 exit 0. Two read NOT MEASURED: check:dual-build-cjs-loads (PREREQUISITE NOT MET, needs a whole-tree build) and check:i18n-coverage (exit 3, a partial round with unbuilt configs); CI runs both.
  • After the last commit (21be65c, which drops one test-file import), these were rerun on that head, all exit 0: test-source-alias, cross-package-test-inputs, issue-citations, nul-bytes, undeclared-dep-imports, doc-authoring, type-check-debt, type-check-coverage, refd-timer-probe, empty-changeset, changeset-no-major, adr-0087-registration. The new pin and boot-preparation-parity also passed again: Test Files 2 passed, Tests 41 passed.

Generated by Claude Code

@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 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

3 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run.

What this run could not see
  • the SDK route bridge reached 69 of 252 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 — 40 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 9dca1097bd8f843c630cd491d2c8af20e1c678cb → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 7715eaa785f829d4e2b9d51ecdb9127b8d4c73b5 — the merge of head 21be65c7a7eba65f23afbd8fdbb85466139802ab into base 9dca1097bd8f843c630cd491d2c8af20e1c678cb, 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 7715eaa785f829d4e2b9d51ecdb9127b8d4c73b5 && git checkout 7715eaa785f829d4e2b9d51ecdb9127b8d4c73b5
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 9dca1097bd8f843c630cd491d2c8af20e1c678cb 21be65c7a7eba65f23afbd8fdbb85466139802ab && git checkout -B drift-repro 9dca1097bd8f843c630cd491d2c8af20e1c678cb && git merge --no-ff 21be65c7a7eba65f23afbd8fdbb85466139802ab

node scripts/docs-audit/affected-docs.mjs --json 9dca1097bd8f843c630cd491d2c8af20e1c678cb

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3

L1 verdict (L1-a): ACCEPT at head 21be65c7a7eba65f23afbd8fdbb85466139802ab (Fixes #38062). Full read.

Review summary

Shape.

  • 4 files, +210/-5, NOT governed.
  • Clause-②: no and Metadata-protocol: none, so no contract review is owed.
  • An @objectstack/cli patch is the right level: servedPlatform.artifactStack is an internal option between two cli modules, not a published surface.

Code read against the claim.

  • os migrate plan and apply hand the standalone stack's result through as servedPlatform.artifactStack.
  • composeServedPlatform lays it over the config with mergeBootConfig(config, artifactStack) before it reads stackItemCapabilities. This is the same helper and the same argument order serve uses when it lays the boot result over the original config.
  • The merge is gated on a non-host config, as the requires rule above it is. A host config, and a call with no artifactStack, read the config exactly as before.
  • No tier or auth gate reads the new value.
  • The new pin runs the real os migrate plan --json on an artifact-only stack that has a knowledgeSources entry and no requires. It asserts three things: KnowledgeServicePlugin is composed, no unserved warning appears on any channel, and a control artifact composes none. The two ablations go red, one of them proving the no-warning check can fail.
  • The changeset is true of the diff, sentence by sentence.

Gates.

  • The dev's report marks two derived families NOT MEASURED: dual-build-cjs-loads (a prerequisite) and i18n-coverage. CI covers both.
  • CI at 05:24Z: 11 success, 0 failed, 13 pending. This ACCEPT is on the code; the landing waits on every check at this head concluding green, which the area reads before it lands.

Next: the area lands it once every check at this head is green.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP

Landing · area o1-C · head 21be65c7a7 · 2026-11-28T05:51Z · ACCEPT → PR #38175 comment 7234647546 (L1-a)

Probe Reading
check-runs at 21be65c7a7 37 success · 16 expected skip · 0 failed · 0 pending · mergeable_state clean
check-governed-merges.mjs --pr 38175 NOT governed (0 of 4 paths) · +210 / −5
landing-k.mjs --pr 38175 K = 6 < 15

State: ready + auto-merge; #38062 closes on merge via Fixes. Clause-②: no; no contract review owed per L1. The dev's local derived gates were rerun on this head (exit 0, per the PR body), and CI's green check-runs agree.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 28, 2026 05:52
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 46114097353 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Dogfood Regression Gate (2/3) — 失败步骤: Boot example apps and exercise real user flows

    @objectstack/dogfood:test:  FAIL   isolated  test/approval-decide-over-mcp.dogfood.test.ts > an approver's agent decides a pending approval request over MCP (#32442) > ⭐ a member on no slate is refuse
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: {
    @objectstack/dogfood:test:  FAIL   isolated  test/approval-decide-over-mcp.dogfood.test.ts > an approver's agent decides a pending approval request over MCP (#32442) > ⭐ [#33690] the approver's call d
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: {
    @objectstack/dogfood:test:  FAIL   isolated  test/approval-decide-over-mcp.dogfood.test.ts > an approver's agent decides a pending approval request over MCP (#32442) > ⭐ [#33690] the submitter's recal
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: {
    @objectstack/dogfood:test:  FAIL   isolated  test/mcp-system-object-action-exposure.dogfood.test.ts > [#27681, #27900] sys_user identity actions over MCP: what each bucket's declaration lets an agent 
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: {
    @objectstack/dogfood:test:  FAIL   isolated  test/mcp-system-object-action-exposure.dogfood.test.ts > [#27681, #27900] sys_user identity actions over MCP: what each bucket's declaration lets an agent 
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: {
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 40 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

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

Development

Successfully merging this pull request may close these issues.

cli: os migrate plan / apply on an artifact-only stack does not compose the knowledge service that os serve mounts from a shipped knowledge source

2 participants