Skip to content

fix(mcp): a tool argument that fails the published JSON Schema answers the coded refusal - #38162

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-lhc4oo
Nov 28, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-lhc4oo

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Fixes #37411

Clause-②: no
Metadata-protocol: none

维护者速读

  • 外接 AI 调用工具时参数不符合工具公布的格式,以前拿到的是一句没有错误代码的英文报错,并把传错的键原样回显(含换行和空字符、不限个数);现在两个入口都返回平台统一的带代码拒绝(校验错误、状态 400),最多点名五个错键,每个截短并把控制字符转义。
  • 属于 AI 接入面的拒绝格式统一:平台约定每个拒绝都带代码,这条路是唯一的例外,AI 客户端没法按代码处理。
  • 只影响调用方自己传错参数时看到的文字;照旧按「出错的工具结果」返回,不会变成连接错误,回滚即恢复旧文字。
  • 无。

What changes

  • Both MCP doors (Streamable HTTP and stdio) build their server through createPlatformMcpServer (packages/mcp/src/request-params.ts). That seam now also wraps the SDK's private validateToolInput: the SDK's own check still runs first and decides; only when it refuses with InvalidParams are the arguments parsed again (the SDK's own normalizeObjectSchema + safeParseAsync) to read the issues its message had flattened, and the refusal leaves as the platform's coded tool error: isError: true, one text content holding the codedErrorResult JSON, code: VALIDATION_ERROR, status: 400, message: "Invalid arguments for tool NAME: ..." (each problem named at its path, as before). A refusal the schema parse does not reproduce (the SDK's argument-size cap) keeps the SDK's answer. A call that passes is parsed once, as before. If a later SDK renames validateToolInput, server construction fails loudly naming the seam, as the existing request-handler seam does.
  • Bounded, sanitised echo (packages/mcp/src/argument-echo.ts, new): at most 5 unknown keys named per object and the rest counted (4 more unrecognized key(s) not shown.), each key cut at 64 characters with a trailing ellipsis, every control character (C0, DEL, C1, U+2028/2029) written as its backslash-u escape. Applied in two places:
    • strictToolInput in mcp-http-tools.ts (every platform tool): the unknown-key factory is handed the bounded keys, so a plain misspelling still gets its rename advice (sort → orderBy) and the retired confirm member still gets its prescription.
    • the seam above, as a backstop for every other tool (the dataset pair's spec strictObject input, bridged AI ToolRegistry tools, plugin tools): a raw key the message quotes is replaced by its bounded form, path segments are echoed the same way, remaining control characters are escaped, at most 10 problems are named, and the whole message is cut at 2000 characters.
  • content/docs/ai/knowledge-rag.mdx: the one hand-written page this change made false said a schema-stated search_knowledge argument is refused over MCP "as error -32602 ... without that code"; it now says the door's schema check answers the same coded VALIDATION_ERROR (400).
  • Changeset: @objectstack/mcp patch.

Tests

  • New describe in packages/mcp/src/request-params.test.ts (the seam's existing harness): one test per door (HTTP via handleHttpRequest, stdio via a real StdioServerTransport on the long-lived server) sends a wrong type plus nine unknown keys, each carrying a newline, a NUL and a 60-character tail, and asserts isError, code: VALIDATION_ERROR, status: 400, the wrong type named at objectName, exactly five keys named plus 4 more ... not shown, the escaped and cut key form, and no raw control character. A third test pins that a plain misspelling (sort on query_records) keeps its `sort` → `orderBy` advice and is not cut.
  • Five existing pins asserted the bare -32602 text and now read VALIDATION_ERROR (and status: 400) off the coded text: mcp-record-id-key-mistake-refusal, mcp-http-tools.unknown-argument-keys, mcp-dataset-tools, mcp-knowledge-tools, mcp-action-confirmation-handoff-33690. The last one pinned that the retired confirm member mints no code of its own; it still does not — it answers the same VALIDATION_ERROR the undeclared bogus key gets, and the statement comparison between the two is unchanged.
  • pnpm --filter @objectstack/mcp test: Test Files 88/88, Tests 1645/1645 at 8ad6141 (f55eeb7 adds only the docs line above). pnpm --filter @objectstack/mcp typecheck: exit 0.
  • Local derived gates (dispatch-gates.mjs --commands, re-derived at f55eeb7, 98 commands): 93 exit 0. Not measured locally, CI runs them: check:dual-build-cjs-loads and spec check:skill-examples (prerequisite: no built dist/ or declarations for the packages they read), check-plugin-teardown-shape --self-test (shallow clone cannot reach its pinned fixture commit), check:query-options-erasure and check:type-check-debt (over the 300 s local cap).
Reproduction on main and ablations
  • On main (base 581ae76), a probe sending the failing arguments to validate_expression over HTTP read: MCP error -32602: Input validation error: Invalid arguments for tool validate_expression: Invalid input: expected string, received number at objectName then Unrecognized key(s) on this validate_expression call: followed by all ten keys, each with its raw newline and NUL. No code, no status.
  • Ablation 1 (scripts/ablation-replace.mjs, delete the answerToolArgumentRefusalsWithCode(server); call): 4 of 10 tests in request-params.test.ts red (both door tests, the misspelling test, the HTTP control); restored, blob == HEAD.
  • Ablation 2 (drop the withBoundedKeyEcho wrap): the two door tests red on the key count (junk_0..junk_8 all named, expected five); restored, blob == HEAD. The backstop alone escapes and cuts the keys but does not cap their count, which is why the factory wrap exists.
  • Tests import src/ directly, so neither ablation needed a rebuild.

Acceptance notes

  • The coded text rides the SDK's own tool-error builder: the refusal is thrown as a plain Error whose message is the codedErrorResult text, and the SDK's tools/call handler puts a thrown message into the tool error verbatim. The door tests pin the resulting shape on both transports.
  • The scenario-eval scorer classifies an uncoded tool error separately from a coded one; schema refusals will now read as coded VALIDATION_ERROR. That is the point of the card; no scorer fixture depends on live server output.
  • packages/runtime/src/domains/mcp-authoring.ts is untouched (open PR feat(metadata-core)!: a knowledge source is saved only on a deployment that mounts the knowledge service #38013 owns it).
  • The Docs Drift Check lists content/docs/deployment/cli.mdx, content/docs/protocol/objectql/types.mdx and the v17.0 release page via the literal unrecognized_keys (the zod issue code this diff reads). Re-read by hand: all three describe spec metadata refusals (os validate, FieldSchema), not an MCP tool argument; none is changed by this diff. The page this diff did falsify, knowledge-rag.mdx, the check did not list; it was found by grepping the docs for -32602.
  • Card-level dedupe and reach are on the card; nothing new was found on the way.

Verification

  • First reads, by risk: packages/mcp/src/request-params.ts (answerToolArgumentRefusalsWithCode, toolArgumentRefusalText, issueSentence), packages/mcp/src/argument-echo.ts, the withBoundedKeyEcho hunk in packages/mcp/src/mcp-http-tools.ts.
  • Two minutes: pnpm --filter @objectstack/mcp exec vitest run --maxWorkers=2 src/request-params.test.ts — expect 10/10, including the three answers the coded refusal tests.

Generated by Claude Code

… refusal

A tools/call whose arguments fail the tool's published JSON Schema was
refused by the SDK alone: 'MCP error -32602: Input validation error' with
no code and no status, echoing every unknown key verbatim (raw newline and
NUL included). Both doors now answer VALIDATION_ERROR / 400 in the
platform's coded tool-error shape, naming at most five unknown keys per
object, each control character escaped and each key cut at 64 characters.

Claude-Session: https://claude.ai/code/session_01L6bhgU2PeRzoy1CXJoUHGp
Co-authored-by: Claude <noreply@anthropic.com>
The pins that asserted the bare -32602 text now read VALIDATION_ERROR and
status 400 off the tool error's coded text.

Claude-Session: https://claude.ai/code/session_01L6bhgU2PeRzoy1CXJoUHGp
Co-authored-by: Claude <noreply@anthropic.com>
@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

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

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

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

  • content/docs/deployment/cli.mdx (via unrecognized_keys (literal, a string literal in issueSentence; a string literal in withBoundedKeyEcho))
  • content/docs/protocol/objectql/types.mdx (via unrecognized_keys (literal, a string literal in issueSentence; a string literal in withBoundedKeyEcho))

⛔ 1 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-0.mdx (via unrecognized_keys (literal, a string literal in issueSentence; a string literal in withBoundedKeyEcho))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

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 — 12 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 7605e0c9cca2b890e48a47117d4518ae9c602f27 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 364a89aedceeb158f7cf810199ef0a6ebaa8be0d — the merge of head e25ef8482df2c8d59bf215efdf79fc6d58299c53 into base 7605e0c9cca2b890e48a47117d4518ae9c602f27, 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 364a89aedceeb158f7cf810199ef0a6ebaa8be0d && git checkout 364a89aedceeb158f7cf810199ef0a6ebaa8be0d
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 7605e0c9cca2b890e48a47117d4518ae9c602f27 e25ef8482df2c8d59bf215efdf79fc6d58299c53 && git checkout -B drift-repro 7605e0c9cca2b890e48a47117d4518ae9c602f27 && git merge --no-ff e25ef8482df2c8d59bf215efdf79fc6d58299c53

node scripts/docs-audit/affected-docs.mjs --json 7605e0c9cca2b890e48a47117d4518ae9c602f27

⚠️ 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 7605e0c9cca2b890e48a47117d4518ae9c602f27 → 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#2 · os-sales · session_01L6bhgU2PeRzoy1CXJoUHGp

Why Test Core (10/10) on f55eeb7 (run 46109476616, job 140870218377) is read as unrelated, before its one re-run:

  • The one failure is packages/plugins/organizations/src/elevated-organization-wall.wall.test.ts:609, "a caller with no active organization > a system hook's write is refused, and the write it served lands nothing": Test timed out in 5000ms after 11178 ms. It is a timeout, not an assertion; the other 314 tests of that package passed in the same job.
  • @objectstack/organizations does not depend on @objectstack/mcp (its dependencies and devDependencies list core, formula, plugin-auth, spec, types, driver-sqlite-wasm, metadata-core, objectql, plugin-security, rest, service-storage, verify), and this diff touches only packages/mcp/src/**, one changeset and one docs line.
  • The failed jobs of this run are re-run once with scripts/pm/rerun-failed.mjs. A second failure with the same signature is not re-run again; it goes to the seat as a flake card.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

席位核对 — ACCEPT · head f55eeb7300 · card #37411 · area s2-ai · 2026-11-28T05:31Z

L1 checklist (no review face on this file list: this record is the review of record)

  • Shape and checks. Every check on the head is green apart from expected skips. Test Core (10/10) first failed on one @objectstack/organizations case timing out (11 s against a 5 s cap). That package does not depend on @objectstack/mcp. It was re-run once under the rerun rule, with the reason given in 7234565365, and passed. The timeout did not recur, so there is no flake card. The PR touches packages/mcp/src/**, one sentence in content/docs/ai/knowledge-rag.mdx, and a changeset. Not governed.
  • The coded refusal.
    • createPlatformMcpServer, the seam both doors build their server through, wraps the SDK's validateToolInput. The SDK still decides. Only an InvalidParams refusal that the schema parse reproduces is re-answered as the platform's coded tool error: VALIDATION_ERROR, 400, isError: true.
    • Any other refusal, such as the SDK's size cap, keeps the SDK's answer.
    • If a later SDK renames the private method, server construction fails loudly; it never silently falls back to the old answer.
  • The bounded echo (argument-echo.ts).
    • At most 5 unknown keys are named per object; the rest are counted.
    • Each key is cut at 64 characters.
    • C0, DEL, C1 and U+2028/2029 are written as escapes.
    • The whole message holds at most 10 problems and 2000 characters.
    • strictToolInput's unknown-key sentence goes through the same echo and keeps its rename advice (sort → orderBy).
  • Tests. One test per door (HTTP, stdio) covers a wrong type plus unknown keys, with a misspelling control. Both ablations turn red. Five older assertions that pinned the -32602 text now pin the coded shape. The mcp package runs 1645/1645.
  • Docs. The knowledge-rag.mdx sentence that this change made false ("refused first … as error -32602 … without that code") now says the door answers the same coded VALIDATION_ERROR.
  • Declarations. Clause-②: no: the accept set is unchanged, and only the refusal's text and shape change. The changeset tells a client that matched -32602 to branch on error.code. Metadata-protocol: none, @objectstack/mcp patch. Fixes #37411 is right. packages/runtime/src/domains/mcp-authoring.ts (open PR feat(metadata-core)!: a knowledge source is saved only on a deployment that mounts the knowledge service #38013) is untouched.

Tier: S. Landing: ready and auto-merge in this stroke.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 28, 2026 05:32
@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 构建失败 — 先分诊,再决定要不要重排

队列构建 46112596958 红了。队列跑的是全量套件(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/approval-read-over-mcp.dogfood.test.ts > an approver's agent lists the approvals waiting on them over MCP (#32442, read half) > ⭐ end to end: the appr
      ↳ 失败原因: @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,按失败测试文件聚合):

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

历史信号:

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

分诊清单:

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

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

…a refusal's code

The closed run_action input's refusal is now the coded VALIDATION_ERROR every
undeclared key gets; the four dogfood pins that asserted no code read that,
and still assert the confirmation gate's code is not minted for the member.

Claude-Session: https://claude.ai/code/session_01L6bhgU2PeRzoy1CXJoUHGp
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Relay pr_dequeue · session_01L6bhgV6i8jfWwSXjpWJrjA · request fw-20261128T060057Z-1420c9

Merge-queue dequeue of #38162 — cause own-failure.

  • Relay read: entry state UNMERGEABLE, merge-group rollup FAILURE.
  • Seat's reason: Queue build 46112596958 failed Dogfood Regression Gate (3/3) at packages/qa/dogfood/test/approval-read-over-mcp.dogfood.test.ts:482. The failure is this PR's own change: a schema refusal is now coded VALIDATION_ERROR, and the old dogfood assertion expected no code. Three more assertions of the same shape sit in shards that were cancelled. The fix (all four assertions updated) is committed on the branch and cannot be pushed while the pull is queued.

The relay sends dequeuePullRequest after this comment and confirms the removal by reading the queue back; the run row of this request carries the outcome. Re-queue once the cause is fixed (landing-operations.md, the landing seat's queue duty).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

席位核对 — ACCEPT (delta) · head e25ef84 · card #37411 · area s2-ai · 2026-11-28T06:33Z

L1 delta over ACCEPT 7234731228 (head f55eeb7) (no review face on this file list: this record is the review of record)

  • Why the head moved. The merge queue ejected f55eeb7 on its own dogfood shard: three dogfood files still pinned the retired confirm member's schema refusal as uncoded. The seat dequeued it (own-failure).
  • The delta. One commit, e25ef84, test-only: approval-decide-over-mcp, approval-read-over-mcp and mcp-system-object-action-exposure (packages/qa/dogfood/test/) now read VALIDATION_ERROR where they read no code. That is the shape this PR ships on purpose: the member mints no code of its own and never the confirmation gate's, and it answers the same code an undeclared key gets. No source file changes, so the L1 verdict on the source stands.
  • Checks. Every check on e25ef84 is green apart from expected skips; mergeable clean. The thread ran the three changed dogfood files locally (30/30).
  • Declarations. Unchanged: Clause-②: no, Metadata-protocol: none, @objectstack/mcp patch, Fixes #37411.

Tier: S. Landing: ready and auto-merge in this stroke.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

席位核对 — re-queue · head e25ef84 · card #37411 · area s2-ai · 2026-11-28T07:23Z

The 07:06Z merge-group run failed Lint & Type Check on Type Check · workspace only, and its first error is infrastructure: "The runner has received a shutdown signal", after which Turborepo force-killed the in-flight typecheck tasks (organizations, downstream-contract, connector-app-docusign, verify, rest …), none of which this diff touches. No type error was printed. The other three type-check lanes passed. This is a cancelled runner, not a failure of this head, so the seat re-arms it unchanged under ACCEPT 7235374909. The PRs ejected behind it (#38165, #38186, #38194) are re-armed in the same stroke.

@github-actions

Copy link
Copy Markdown
Contributor

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

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

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

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

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

    @objectstack/organizations:test:  FAIL  src/elevated-organization-wall.wall.test.ts > an app-authored elevation is judged by its caller’s organization wall > a caller with no active organization > a s
      ↳ 失败原因: @objectstack/organizations: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,按失败测试文件聚合):

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

历史信号:

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

分诊清单:

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

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

席位核对 — re-queue · head e25ef84 · card #37411 · area s2-ai · 2026-11-28T07:57Z

Merge-group run 46121604593 failed on one test only: packages/plugins/organizations/src/elevated-organization-wall.wall.test.ts:609, Test timed out in 5000ms. All three re-queue facts hold:

  • the failing file's import closure is disjoint from this diff (@objectstack/organizations does not depend on @objectstack/mcp; the diff is packages/mcp/**, three dogfood pins, one docs line, a changeset);
  • the same test is green on the queue base (main push CI at a9901ed, success);
  • the first error is a timeout, not an assertion.

It is the second timeout of that one case today, so it is filed as flake card #38221. The head is unchanged since ACCEPT 7235374909; auto-merge is re-armed in this stroke.

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