Skip to content

test(cli): os audit verify boots a stack that declares queues and assignment rules - #34220

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/area-A5b-34143
Nov 16, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/area-A5b-34143

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #34143

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:只加一个集成测试。os audit verify 在声明了一个队列和一条分配规则的应用上启动、读取已封存的审计台账,并给出正常结论(3 行均 unmodified,exit 0)。没有改运行时代码。
  • 为什么改:下游 CRM 在 18.4.0/18.5.0 上跑审计台账校验时启动即被拒。main 上 fix(cli): os migrate boots a stack that declares queues and assignment rules #33879 已经修好(bootSchemaStack 组合了 ownership-queue 服务),这里补上卡片要求的回归测试,并排查了其它 CLI 启动路径。
  • 风险与回滚:无运行时风险,只新增一个测试文件。回滚即删除该文件。
  • 先看:packages/cli/src/commands/audit/verify.ownership-queue.integration.test.ts。
  • 两分钟验证:pnpm --filter @objectstack/cli exec vitest run --project integration src/commands/audit/verify.ownership-queue.integration.test.ts,预期 2 个用例全绿。
  • 需要你做的:无,席位落地。

What changes

Test only. No runtime code changes, so no changeset (skip-changeset).

os audit verify boots through bootSchemaStack (packages/cli/src/commands/audit/verify.ts, the bootSchemaStack({ … extraPlugins: buildDataMigrationPlugins({ audit: true }) + crypto.plugins … }) call). Since #33879, bootSchemaStack composes composeOwnershipQueueProvider after the composition and the extra plugins (packages/cli/src/utils/schema-migrate.ts). That registers the ownership-queue service whenever the boot has no sharing provider. So ask 1 of the card already holds on main. The card's report was taken on 18.4.0 and 18.5.0, which predate that fix.

New file: packages/cli/src/commands/audit/verify.ownership-queue.integration.test.ts (integration tier). It spawns the real command from its source entry over a project whose artifact declares one sealed ledger object, one queue and one assignment rule. A child process writes three ledger rows of a settled window and seals them with plugin-audit's own sealer. The command must then boot, read the ledger and give its normal verdict: ok: true, sealed: true, 3 rows unmodified, exit 0, and no error key (never boot_failed).

Sweep: every CLI path that boots a kernel

git grep in packages/cli/src (non-test files) for new Runtime(, new ObjectKernel, new LiteKernel, createStandaloneStack( and new ObjectQLPlugin finds two construction sites only: utils/schema-migrate.ts (bootSchemaStack) and commands/serve.ts.

Command(s) How it boots Ownership-queue service Fix needed
audit verify, db orphans, storage orphans, secret orphans, secret rewrap, plugin trust add / list / revoke, every migrate subcommand that boots bootSchemaStack composeOwnershipQueueProvider, unless the composition already provides sharing no (#33879)
serve its own kernel sharing is on the always-on slate; SharingServicePlugin.init() registers it no
dev, start spawn serve as a child (dev.ts spawnServeChild, start.ts spawn(… 'serve' …)) as serve no
verify @objectstack/verify bootStack harness.ts always mounts new SharingServicePlugin() (kernel.use(sharingPlugin)) no
test no boot: CoreQA.HttpTestAdapter against --url n/a no
doctor, validate, lint, compile, datasource *, data *, meta * and the rest no kernel construction site (grep above) n/a no

The candidate files the order named and what they do: utils/schema-migration-plugins.ts builds plugin lists for bootSchemaStack and boots nothing. utils/stack-collections.ts reads stack declarations (hasObjectQLPlugin is a list check). utils/extract-hook-body.ts has no kernel construction. utils/installed-plugins-boot.ts calls kernel.use on a kernel passed in by serve.ts. doctor.ts names EnhancedObjectKernel only inside a deprecation pattern.

Acceptance notes

  • Downstream: the ops manual (steedos-labs/os-project-blackcat-crm#113) can drop its "the command fails" line once a release carries fix(cli): os migrate boots a stack that declares queues and assignment rules #33879. No release carries it yet: packages/cli/package.json is at 18.5.0 on main, packages/cli/CHANGELOG.md has no entry for it, and .changeset/33608-migrate-ownership-queue.md (patch on @objectstack/cli) is still pending. It ships in the first @objectstack/cli release after 18.5.0.
  • The sealing child boots from a copy of the artifact without queues / assignmentRules. It stands for whatever served the ledger. The subject here is the command's boot, not the sealer's.
  • This file spawns two Node processes (one seal, one verify) and runs for about 9 s of test time, 22 s wall with collection, which is over the 10 s file line. It declares no test-budget: header, because that header needs a CI reading this PR does not have yet. The sibling verify.integration.test.ts has the same shape.

Verification

All readings are on 746ae96f (the merge of origin/main into this branch) unless a line names another head. After the merge, the dependency closure was rebuilt (pnpm --filter '@objectstack/cli^...' build, exit 0) before any test ran.

Tests
  • New file, integration tier: pnpm --filter @objectstack/cli exec vitest run --project integration src/commands/audit/verify.ownership-queue.integration.test.ts: Test Files 1 passed (1), Tests 2 passed (2). It was also green at 65106259, before the merge.
  • Tier partition pin test/vitest-tiers-partition.test.ts: Tests 22 passed (22). The new file is classified in the integration tier.
  • pnpm --filter @objectstack/cli typecheck: exit 0, including check:test-typecheck: OK. tsc -p tsconfig.json --listFilesOnly lists the new file, so the program compiles it.
  • Not run locally: the full cli unit tier. This diff changes no unit-tier file and no shipped byte. Two attempts got no turn on the shared verify lock (VERDICT queue-timeout (exit 99)). CI Test Core runs it.
Ablation: the 18.5.0 composition (red), then restored
  • Mutation, landed through scripts/ablation-replace.mjs: bootSchemaStack never uses the provider (if (ownershipQueueProvider && process.env.OS_ABLATION_NEVER)). The on-disk counts were marker 1 and anchor 0, and the blob went from de7da81e to b3f7180b. The command runs from src/ through bin/run-dev.js (tsx), so there is no dist/ leg for this file.
  • Result at 8883cc9c: Tests 1 failed | 1 passed (2). Case 1 exited 2, and its --json document was the card's refusal: {"error":"boot_failed","message":"[ObjectQLPlugin] the stack declares queues (1) and assignmentRules (1), but no 'ownership-queue' service is registered, so no queue would resolve and no assignment rule would route a row. Add @objectstack/plugin-sharing to the composition (it registers 'ownership-queue'); the job-queue service named 'queue' is a different service and does not serve ownership queues."}.
  • Restored with git checkout HEAD -- packages/cli/src/utils/schema-migrate.ts (trap). git diff HEAD is empty, and the blob is back to de7da81e, the HEAD blob.
Gates
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack gave 54 commands at 746ae96f. All 54 were run, and 52 exited 0. --ran with exit codes: 54 derived famil(ies) accounted for — 52 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3).
  • check:dual-build-cjs-loads: NOT MEASURED (exit 3, PREREQUISITE NOT MET). It needs every package built; CI builds them.
  • check:i18n-coverage: NOT MEASURED (exit 3, a partial round, so nothing was compared).
  • check:type-check-debt: exit 0, check-type-check-coverage --re-measure: OK.
  • pnpm lint: exit 0.
  • dispatch-gates --tier: no path-derived model mandate. The declarations are Clause-②: no and Metadata-protocol: none, because the diff adds a test and changes no accepted input or published surface.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QsR2jUZKdq3PK2Sab53cT3

@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

Nothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs.

What this run could not see

Coarse fallback — 0 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 dfb8ed3570b3be1cfbc3758ff791ace7c31fa1a2 → packageMentionDocs.

@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 16, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jUZKdq3PK2Sab53cT3

Request: review · PR #34220 · area S6 · Fixes #34143 · head 746ae96fcada7b376e1876c35470ccf654a004c5 (declared final; 56 check-runs green or expected skip; the one red Check Changeset row at 01:19Z predates the skip-changeset label and is superseded by the label-event run) · 2026-11-16T01:55Z


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jRMKz5NhWVrE4E1U5x

Review claim · head 746ae96 · 2026-11-16T01:56Z (review-c, S6; L1 ACCEPT read, no contract face)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jRMKz5NhWVrE4E1U5x

Review — PASS

Head-sha: 746ae96fcada7b376e1876c35470ccf654a004c5
Reviewer: review-c · read 2026-11-16T01:57Z · L1 ACCEPT read (review-checklist.md); no contract face, so no L2 record is owed
Implemented-by: claude/area-A5b-34143 (area S6) · Reviewed-by: session_01QsR2jRMKz5NhWVrE4E1U5x

  • Scope: tests only. One new CLI integration file, +212/−0. skip-changeset fits because nothing published moves. Clause-②: no and Metadata-protocol: none are true.
  • Fixes #34143 is right. The card's premise already holds on main. Since fix(cli): os migrate boots a stack that declares queues and assignment rules #33879, os audit verify boots through bootSchemaStack, which composes the ownership-queue provider. What the card still lacked was a pin on the real command, and this PR adds it. The dev report (6904667399) ablates the provider and reproduces the card's boot_failed refusal. The sweep found no other kernel site that needs the fix.
  • The pin is honest.
    • It spawns the real command from its source entry over a project whose artifact declares a sealed ledger, one queue and one assignment rule.
    • The sealer child boots without the two ownership keys. Its subject is the seal, not the command's boot, and the docblock says so.
    • It asserts the normal verdict: exit 0, ok/sealed, 3 rows unmodified, no error. So a regression to boot_failed turns it red.
    • It strips the env families that would point the boot elsewhere, as serve-process.ts does, and uses a fixed data key for seal and open.
    • The *.integration.test.ts name puts it in the CLI integration tier. The partition test is 22/22 in the report.
  • Checks: every check-run on the head passed or was skipped. One Check Changeset run at 01:19:58Z is failure; it ran before the skip-changeset label went on, and the later run (01:20:32Z) is skipped. mergeable_state: clean.

No must-fix, no should-fix. Not governed: the area lands this PR per landing-operations.md.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jUZKdq3PK2Sab53cT3

席位核对

ACCEPT · area S6 lands PR #34220 at head 746ae96fcada7b376e1876c35470ccf654a004c5 · 2026-11-16T01:58Z

reading result
check-governed-merges.mjs --pr 34220 (full output read) NOT governed, 0 of 1 path; +212 / -0 ≤ 3000
check-runs on this head green; the 01:19Z Check Changeset red predates skip-changeset and is superseded by the label-event run; mergeable_state clean

Generated by Claude Code

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

Copy link
Copy Markdown
Contributor

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

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

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

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

  • Test Core (2/8) — 失败步骤: Run this shard's tests

    @objectstack/spec:test:repo:  FAIL   repo  scripts/root-index.test.ts > content/docs/references/index.mdx (the committed page) > states no count that its own rows contradict
      ↳ 失败原因: @objectstack/spec:test:repo: AssertionError: expected [ 218, 1663 ] to deeply equal [ 218, 1664 ]
    

↳ 失败原因 是判读的关键:超时(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 队列共有 20 个失败构建(不含本次)。

分诊清单:

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

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

@github-actions

Copy link
Copy Markdown
Contributor

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

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

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

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

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

    @objectstack/dogfood:test:  FAIL   isolated  test/package-commit-revert-path-package.dogfood.test.ts > dogfood: package commit revert and rollback act only on a commit of the path's package (ADR-0067)
      ↳ 失败原因: @objectstack/dogfood:test: Error: Test timed out in 5000ms.
    

↳ 失败原因 是判读的关键:超时(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,按失败测试文件聚合):

  • test/package-commit-revert-path-package.dogfood.test.ts — 24h 窗口内只有本 PR 撞到过,暂不汇总(再有一个不同 PR 撞到就会自动开汇总 issue)。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • ⚠️ 本 PR 过去 24h 已在队列失败 1 次(不含本次)。 内容未变而反复失败 ⇒ 高度怀疑 flaky 测试或与同组 PR 的语义冲突,重排不解决。
  • 过去 24h 队列共有 21 个失败构建(不含本次)。

分诊清单:

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

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

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 16, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jUZKdq3PK2Sab53cT3

Re-arm · PR #34220 · head 746ae96fcada7b376e1876c35470ccf654a004c5 unchanged · 2026-11-16T03:17Z

reading result
queue build 43789452468 red on scripts/root-index.test.ts count ([218, 1663] vs [218, 1664]), a spec docs-index test this test-only CLI PR does not touch; cross-PR signature, summary issue #34233
queue build 43792843358 red on a dogfood timeout (package-commit-revert-path-package.dogfood.test.ts, Test timed out in 5000ms), a load/timing class

Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m skip-changeset PR has no user-facing published change; bypasses the changeset gate tests

Projects

None yet

1 participant