Skip to content

perf(metadata-protocol): one form request reads the view list and each type's stored rows once - #38164

Merged
objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/issue-37709-form-reads-once
Nov 28, 2026
Merged

objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/issue-37709-form-reads-once

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Fixes #37709

Clause-②: yes (widening) — ObjectStackProtocolImplementation.readFormRequest
Metadata-protocol: none

维护者速读

  • 用户无感:匿名公开表单页和按名读取表单时,返回的内容与以前完全一样,只是同一次请求里不再把同一批元数据反复读好几遍。
  • 属于"表单独立成为元数据类型"这一系列的收尾,解决上一轮评审留下的"同一请求重复读库"这一条遗留项。
  • 若出错,公开表单可能打不开或判断错一个表单是否公开;改动不碰任何存储数据,可直接撤回。
  • 无。

What changes

The effective form read (ADR-0159 D5) resolves over both types: the generic form list, the projection of the view list, and the cross-type resolution (step 3) over the stored rows of both types. Each of those readings, and each of the five reads an anonymous form door makes, asked the store for the same rows again.

  • packages/metadata-protocol/src/protocol-form-reads.ts. formRequestScope(host): one request's reading, over which each stored row set (per type and package binding) and each flattened list (per request, audience and layer) is read once. readEffectiveFormList reads through it, so the generic form list and step 3 share one reading of the form rows, and the view list and step 3 share one reading of the view rows. readInFormRequest(read) runs read as one request reading (an AsyncLocalStorage store): every protocol list read inside it over the same host shares one scope, and once read settles the scope memoizes nothing, so nothing outlives the request. The stored rows of step 3 stay read whole (a container row's name is not the name its expansion writes); they are read once per request. The readEffectiveFormList docblock now states that.
  • packages/metadata-protocol/src/protocol-meta-list-reads.ts. readFlattenedMetaItems takes an optional stored-row reader (the scope's); getMetaItems and getMetaItemsPerPackage read through the open request reading when there is one; the package-scoped form list face reads its envelope through the same scope.
  • packages/metadata-protocol/src/protocol.ts. The private readFlattenedMetaItems passes the row reader on. New server-only extension readFormRequest(read) (feature-detected by the doors, like getMetaItemsPerPackage and getUnreadableFormBodies): runs read as one request reading.
  • packages/rest/src/form-routes.ts (outside the claim's file surface; the measured producer of the repeated door reads, see Acceptance notes). resolveFormBySlug makes its five reads inside readFormRequest when the protocol serves it, and exactly as before otherwise. Both doors (GET /forms/:slug, POST /forms/:slug/submit) go through it.
  • packages/metadata-protocol/src/protocol-meta-item-reads.ts. Comment only at readEffectiveFormItem: on this tree it calls readEffectiveForms once (not up to three times), and that one call now reads each row set once.

Every answer is unchanged: the same items, in the same order, from the same served-row order. The ADR-0159 D5 cross-type resolution is untouched; names and packageId handling is untouched (names was already pushed into both generic reads, and the reason packageId is not pushed down was already stated in the readEffectiveFormList docblock, both landed in #37422's rework; confirmed on this tree, not redone).

Measured counts (real protocol, real ObjectQL + SQLite store, OS_METADATA_OVERLAY_CACHE_TTL_MS=0, one warm-up request)

"Row-set read" = one readActiveOverlayRows call (one sys_metadata statement under the singular type, plus one under the plural when the singular answers no row).

Request Form shape view list (effective) before → after view row sets before → after form row sets before → after
by-name form read authored form item 1 → 1 2 → 1 2 → 1
by-name form read old-shape formViews entry 1 → 1 1 → 1 1 → 1
form-door GET authored form item 2 → 1 5 → 1 3 → 1
form-door GET old-shape formViews entry 2 → 1 4 → 1 2 → 1

Before = origin/main 93fa911 (with #37422 merged); after = this branch. The by-name read also issues one row read predicated on the name (the generic by-name read's own, readItemActiveRows), before and after. The door reads the form list, the per-package form layer and the per-package view layer once each, before and after. With the row cache on (default 30 s) the repeated reads were cache hits at the SQL level, but each still ran its parse and merge; with it off (or on a cold or invalidated cache) each was a statement.

Tests

  • New packages/rest/src/public-form-reads-once-37709.test.ts (8 cases, both form shapes): the by-name read and the door GET read the view list once and each type's row sets once (exact counts, answers asserted); CONTROL 1, two requests read twice (the scope never spans requests); CONTROL 2, the five door calls outside one reading (a protocol without readFormRequest) read the view list twice and the view rows four times, so the counter sees a repeated read when there is one.
  • packages/rest/src/rest-write-route-hook-refusal-sentence.ledger.test.ts: its catch-all protocol double rejects every method it does not list, and the door now feature-detects readFormRequest, so the double's reads table gains one pass-through entry, as it gained getMetaItemsPerPackage and getUnreadableFormBodies when those door extensions landed. No assertion changed. Every other form-door and D5 test is unchanged and green.
Suites on f97bc7d (merged with origin/main)
  • @objectstack/metadata-protocol vitest run: Test Files 372 passed, 9 skipped (381); Tests 23605 passed, 45 skipped.
  • @objectstack/rest vitest run --project local: Test Files 433 passed (433); Tests 8981 passed, 351 skipped.
  • pnpm --filter @objectstack/metadata-protocol typecheck, pnpm --filter @objectstack/rest typecheck: exit 0.
  • Final head 73983ef changes only protocol.ts text after that run (the readFlattenedMetaItems docblock reflowed and the new method's docblock made one line, so the facade stays at its 11705-line ceiling, check:facade-delegation-only). On it: rebuilt, both typechecks exit 0, and the pin plus 11 form-door files: Test Files 12 passed (12), Tests 898 passed (898).
Ablations on 6178fb1 (scripts/ablation-replace.mjs, each leg built and checked in dist with scripts/ablation-dist-preflight.mjs)
  • A1, the effective form read without its scope (drop host = formRequestScope(host) in readEffectiveFormList): 2 failed / 6 passed (the by-name read of an authored form item, and CONTROL 1).
  • A2, readFormRequest opens no reading (readInFormRequest(read) replaced by calling read directly): 4 failed / 4 passed (the door GET in both shapes, and CONTROL 1 in both).
  • A3, the scope's list reads read their rows outside it (no row reader passed): 6 failed / 2 passed.
  • Restore leg: every marker absent from dist, tree clean against HEAD, pin 8/8 green.
Local gates on 73983ef (the 75 families `dispatch-gates.mjs --commands` derives for this diff)
  • All 75 commands exit 0, each exit captured before any pipe. pnpm check:dual-build-cjs-loads first answered PREREQUISITE NOT MET (exit 3: it reads every package's dist/), and exit 0 when re-run after check:type-check-debt's full build on the same head (126 require entry points across 74 packages load).
  • check:facade-delegation-only held the line: protocol.ts is at its 11705-line ceiling (it went red at 11719 on f97bc7d, fixed in 73983ef).
  • dispatch-gates.mjs --ran: 75 derived, 75 run, 0 NOT-MEASURED, 0 UNRUN.
  • Raw control-byte self-scan of the changed files: no match.

Acceptance notes

  • Landing point outside the claim's file surface: packages/rest/src/form-routes.ts. Measurement shows the door's repeated view-list and row reads come from its five separate protocol calls; no change inside packages/metadata-protocol alone can share a reading across them. A first cut answered the five reads through one new protocol call; it bypassed the doubles four existing door tests install by overriding getMetaItems / getMetaItemsPerPackage / getUnreadableFormBodies on a real protocol, so the door keeps its five calls and runs them inside one request reading instead.
  • Premise check. On 93fa911 readEffectiveFormItem calls readEffectiveForms once (the card's "up to three times" no longer holds); the repeats were inside that one call (the form and view row sets twice each).
  • New seam worth a reviewer's eye: readFormRequest is a new public method on ObjectStackProtocolImplementation (server-only, feature-detected), and metadata-protocol now uses AsyncLocalStorage (node:async_hooks; the package is already node-only).

Verification

First read, by risk:

  1. packages/metadata-protocol/src/protocol-form-reads.ts, formRequestScope and readInFormRequest: a memoized list is one object handed to several callers in the same request (every caller reads it, none writes it), and the live() check that stops memoizing once the request settles.
  2. packages/rest/src/form-routes.ts, resolveFormBySlug: the five reads inside inOneReading, in their old order.
  3. packages/metadata-protocol/src/protocol-meta-list-reads.ts: readRows at the active-row read of readFlattenedMetaItems, and inFormRequestScope in getMetaItems / getMetaItemsPerPackage.

Two-minute check: pnpm --filter @objectstack/metadata-protocol build && pnpm --filter @objectstack/rest exec vitest run src/public-form-reads-once-37709.test.ts prints Tests 8 passed (8).


Generated by Claude Code

…ws once per form request (wip)

Claude-Session: https://claude.ai/code/session_017xRBcSAaBEfQpU2yJexSJ8
Co-authored-by: Claude <noreply@anthropic.com>
… reads, so test doubles of those reads still answer

Claude-Session: https://claude.ai/code/session_017xRBcSAaBEfQpU2yJexSJ8
Co-authored-by: Claude <noreply@anthropic.com>
… doors' request reading

Claude-Session: https://claude.ai/code/session_017xRBcSAaBEfQpU2yJexSJ8
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 2 package(s): @objectstack/metadata-protocol, @objectstack/rest, touching 26 documentable anchor(s).

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

  • content/docs/api/client-sdk.mdx (via getBookTree (sdk, the bare tail of client method meta.getBookTree, bound to GET /api/v1/meta/book/:name/tree), meta.getBookTree (sdk, the route ledger binds it to GET /api/v1/meta/book/:name/tree, selected by route anchor /book/:name/tree))
  • content/docs/concepts/metadata-lifecycle.mdx (via ObjectStackProtocolImplementation (symbol, a top-level class), getMetaItems (symbol, a top-level function))
  • content/docs/deployment/environment-variables.mdx (via getMetaItems (symbol, a top-level function), /app/:appId/bundle (route, bridged from symbol getMetaItems — its route source's handler names it))
  • content/docs/frontend/data-objectstack.mdx (via /app/:appId/bundle (route, bridged from symbol getMetaItems — its route source's handler names it))
  • content/docs/kernel/cluster.mdx (via ObjectStackProtocolImplementation (symbol, a top-level class))
  • content/docs/kernel/services-checklist.mdx (via getMetaItems (symbol, a top-level function))
  • content/docs/ui/apps.mdx (via /book/:name/tree (route, bridged from symbol getMetaItems — its route source's handler names it))
  • content/docs/ui/forms.mdx (via /forms/:slug (route, bridged from symbol getMetaItems — its route source's handler names it))
  • content/docs/ui/public-data-collection.mdx (via /forms/:slug (route, bridged from symbol getMetaItems — its route source's handler names it))
  • content/docs/ui/translations.mdx (via /book/:name/tree (route, bridged from symbol getMetaItems — its route source's handler names it))

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

  • content/docs/releases/v14.mdx (via /book/:name/tree (route, bridged from symbol getMetaItems — its route source's handler names it))
  • content/docs/releases/v16.mdx (via ObjectStackProtocolImplementation (symbol, a top-level class))
  • content/docs/releases/v17/17-0.mdx (via ObjectStackProtocolImplementation (symbol, a top-level class))
  • content/docs/releases/v17/17-5.mdx (via /book/:name/tree (route, bridged from symbol getMetaItems — its route source's handler names it))
  • content/docs/releases/v17/17-6.mdx (via /forms/:slug (route, bridged from symbol getMetaItems — its route source's handler names it))
  • content/docs/releases/v17/17-7.mdx (via /forms/:slug (route, bridged from symbol getMetaItems — its route source's handler names it))
  • content/docs/releases/v18/18-2.mdx (via /forms/:slug (route, bridged from symbol getMetaItems — its route source's handler names it))
  • content/docs/releases/v18/18-3.mdx (via /app/:appId/bundle (route, bridged from symbol getMetaItems — its route source's handler names it))

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
  • 2 name(s) were too generic to anchor anything (single lowercase words)
  • 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 — 26 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 33a0d4fa625cdfb69873a89a1e0f5d9f49fea744 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 33a0d4fa625cdfb69873a89a1e0f5d9f49fea744

⚠️ 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 33a0d4fa625cdfb69873a89a1e0f5d9f49fea744 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…ublished protocol class

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

Contract review

Served-tier: TIER_DEFAULT
Head-sha: c1aaf1cee64e259ab228c6a69d83df4f7d35ddc7
Local-runs: none

Face: the Clause-②: yes (widening) declaration alone (no published schema, no governed path, no narrowing in the diff), reviewed by the lane seat as the declaration face asks.

① Derived judgments

  • Public surface: one new public method, ObjectStackProtocolImplementation.readFormRequest<T>(read: () => Promise<T>): Promise<T>, reachable from @objectstack/metadata-protocol's . entry (src/index.ts:3 exports the class). Right as a widening: additive, optional to call, and the one consumer (packages/rest/src/form-routes.ts) feature-detects it (typeof p.readFormRequest === 'function'), so a protocol without it serves exactly as before.
  • Accept set: unchanged. Every answer of getMetaItems, getMetaItemsPerPackage and getUnreadableFormBodies is the same items in the same order; only the number of underlying reads changes. The 11 existing form-door files (898 cases, asserting answers) are green, and the new pin asserts exact read counts with two CONTROLs.
  • New exports from protocol-form-reads.ts (readInFormRequest, formRequestScope, inFormRequestScope): module-internal, not re-exported from src/index.ts — not published surface.
  • Runtime dependency: node:async_hooks in an already node-only package (check:lean-entry-closure green on this head).

② Semver level

@objectstack/metadata-protocol patch, @objectstack/rest patch, Metadata-protocol: none. Right by AGENTS.md Post-Task Checklist step 3 (the level follows the metadata-protocol kind; none ships patch) and check-changeset-no-major's level axis; Check Changeset success on this head. The Clause-② line is identical in the changeset and the PR body.

③ Boundary flags

  • Dev flag, form-routes.ts outside the claimed surface: the measured producer of the door's repeated reads (five protocol calls); accepted, recorded in the seat's claim amendment 7234355369.
  • Dev flag, one pass-through row in rest-write-route-hook-refusal-sentence.ledger.test.ts's READS table: no assertion changed; accepted.
  • Scope lifetime: the memo is per readInFormRequest call (AsyncLocalStorage), closed in finally; outside a reading it is the one call's own; a continuation after the request reads the store directly. No cross-request cache (that stays meta-overlay-cache.ts). Memo keys carry type, packageId, names, previewDrafts, audience, layer (lists) and type, packageId (rows): no key collapses two different reads.
  • Shared results: the module copies before it writes (projectedServed spreads the item; the other writes are to local arrays; the one sort is on a copy), so a memoized row set or list is not mutated by a later reader in the same request.
  • SQL push-down: no finding — the change removes repeated reads; no id materialisation or in-app join is added.

Implemented-by: claude/issue-37709-form-reads-once
Reviewed-by: session_017xRBcSAaBEfQpU2yJexSJ8

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

L1: ACCEPT · head c1aaf1cee64e259ab228c6a69d83df4f7d35ddc7 · 2026-11-28T05:39Z · card #37709

席位核对

  1. Shape — l1-face.mjs --pr 38164 clean: draft on main, mergeable_state clean, first line Fixes #37709 only, one changeset (@objectstack/metadata-protocol, @objectstack/rest), Clause-②: yes (widening) · Metadata-protocol: none on the body and the changeset. Fixes is right: 7205862309's three acceptance lines (counts measured and recorded, each request reads the view list once and each type's rows once, a count pin with a CONTROL and an ablation) are in the diff and the PR body.
  2. Premise measured — on 93fa9118: a by-name form read read the form rows 2× and view rows 2×; a door GET read the view list 2×, view rows 5×, form rows 3×. After: once each, both shapes. The card's "readEffectiveFormItem calls readEffectiveForms up to three times" was stale (one call; the repeats were inside it) — the dev's correction is accepted. Ablations A1–A3 each turn the pin red (2/4/6 failed), restored clean.
  3. Gates at this head — check-runs: 39 success · 18 expected skip · 0 failed · 0 pending; Lint & Repo Gates and TypeScript Type Check success (the earlier red at 73983efb was the lint workflow's cancel-in-progress cancelling two lanes on the next push, no type error logged). check-governed-merges.mjs --pr 38164: NOT governed (+409/−51).
  4. L2 — the declaration face (Clause-②: yes) owes TIER_DEFAULT; the seat's record 7234800035 on this head is PASS (public method readFormRequest, feature-detected by its one consumer; answers unchanged; scope per request, closed on settle; no shared-result mutation).
  5. Read by the seat — the changeset sentence by sentence: true to the diff ("each call answers what it answers on its own", "nothing is kept past the request", "Every answer is unchanged" — held by the 898 door cases and the pin). The Docs Drift bot's ten listed pages match only by symbol or route name; the change alters no answer, so no page's statement moves — none edited. Accepted deviations: form-routes.ts and one ledger-test pass-through row (claim amendment 7234355369); the pin lives in packages/rest (the real ObjectQL + SQL stack is there).
  6. Out of scope — none reported. Skills-docs: not owed (kind none).

Landing — non-governed, ≤3000 lines, L2 PASS on this head: the seat lands it through the ordinary queue.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

Landing · 2026-11-28T05:40Z · head c1aaf1ce

probe reading
check-governed-merges.mjs --pr 38164 NOT governed · +409/−51 ≤ 3000
landing-k.mjs --pr 38164 K = 8 < 15
L2 on this head PASS · record 7234800035 · TIER_DEFAULT

State: ready for review + auto-merge (L1 ACCEPT 7234807820).

@github-actions

Copy link
Copy Markdown
Contributor

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

队列构建 46113210720 红了。队列跑的是全量套件(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 队列共有 37 个失败构建(不含本次)。

分诊清单:

  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 构建失败 — 先分诊,再决定要不要重排

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

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

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

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

    @objectstack/plugin-approvals:test:  FAIL  src/stranded-request-inspection.test.ts > #37808 — past 500 decided requests, a new strand is still reported > an older strand outside the newest window is r
      ↳ 失败原因: @objectstack/plugin-approvals: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/stranded-request-inspection.test.ts — 24h 窗口内只有本 PR 撞到过,暂不汇总(再有一个不同 PR 撞到就会自动开汇总 issue)。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

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

分诊清单:

  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 构建失败 — 先分诊,再决定要不要重排

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

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

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

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

    @objectstack/plugin-approvals:test:  FAIL  src/stranded-request-inspection.test.ts > #37808 — past 500 decided requests, a new strand is still reported > an older strand outside the newest window is r
      ↳ 失败原因: @objectstack/plugin-approvals: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/stranded-request-inspection.test.ts — 24h 窗口内只有本 PR 撞到过,暂不汇总(再有一个不同 PR 撞到就会自动开汇总 issue)。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

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

分诊清单:

  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 构建失败 — 先分诊,再决定要不要重排

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

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

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

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

    @objectstack/plugin-approvals:test:  FAIL  src/stranded-request-inspection.test.ts > #37808 — past 500 decided requests, a new strand is still reported > an older strand outside the newest window is r
      ↳ 失败原因: @objectstack/plugin-approvals: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/stranded-request-inspection.test.ts — 24h 窗口内只有本 PR 撞到过,暂不汇总(再有一个不同 PR 撞到就会自动开汇总 issue)。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

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

分诊清单:

  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#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

Dequeue (seat asks) · 2026-11-28T07:30Z · head c1aaf1ce · the seat signed in this PR's body trailer.

Signature: Test Core (9/10) · packages/plugins/plugin-approvals/src/stranded-request-inspection.test.ts › "#37808 — past 500 decided requests, a new strand is still reported" · Test timed out in 5000ms. It ejected this PR four times: queue builds 46114725605, 46115033565, 46119645478, and one earlier. No other PR hit it in 24h. The flake exemption's three facts do not all hold: @objectstack/plugin-approvals depends on @objectstack/metadata-protocol, so the failing file's import closure meets this diff. Another re-queue would only burn the queue for the PRs behind it.

Next: the dev's fix round, already ordered, measures the test's wall time on this head against the merge base and reports this PR or not this PR with numbers. The seat re-queues only on that reading.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Relay pr_dequeue · session_017xRBcSAaBEfQpU2yJexSJ8 · request fw-20261128T073042Z-2d408e

Merge-queue dequeue of #38164 — cause seat-asks.

  • Relay read: landing seat repo:objectstack#8 · sunhaolin, signed by repo:objectstack#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8.
  • Seat's reason: Same timeout signature 4x on this PR only (plugin-approvals stranded-request-inspection, Test Core 9/10); plugin-approvals depends on metadata-protocol so the closure meets the diff; fix round measuring before re-queue.

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#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

Re-queue · 2026-11-28T08:42Z · head unchanged. Fix round verdict (os-dev-report on #37709, 07:53Z): not this PR. The plugin-approvals stranded-request-inspection case runs in 1.0 s on this head, the merge base and main (3 runs each, 39/39 green). Call probes count 0 calls of formRequestScope / readFlattenedMetaItems / readActiveOverlayRows in that file; the CONTROL counts 7. Queue build 46121613844 (#38167, without this PR) times out on the same case at 5.8 s. It is a load-sensitive budget on 1200 serial inserts, filed as its own card for its lane.

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

Copy link
Copy Markdown
Contributor

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

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

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

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

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

    @objectstack/plugin-approvals:test:  FAIL  src/stranded-request-inspection.test.ts > #37808 — past 500 decided requests, a new strand is still reported > an older strand outside the newest window is r
      ↳ 失败原因: @objectstack/plugin-approvals: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,按失败测试文件聚合):

历史信号:

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

分诊清单:

  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#8 · sunhaolin · session_017xRBcSAaBEfQpU2yJexSJ8

Re-queue · 2026-11-28T10:29Z · head c1aaf1ce unchanged · second ejection, re-judged by signature before re-queuing.

Landing rule: a known signature whose fix has landed on main since ⇒ re-queue as is. A third ejection on this signature after #38235 would be a new problem and gets diagnosed, not re-queued.

@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 28, 2026
Merged via the queue into main with commit e2a0e90 Nov 28, 2026
58 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-37709-form-reads-once branch November 28, 2026 10:54
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.

Form reads at the form doors: push the name and package predicates down (SQL first) — residual of #37086 review S5

2 participants