Skip to content

feat(objectql): refuse a nested-relation condition and a lookup dimension up front on a driver without the readableIdsLeaf capability - #34565

Merged
os-zhuang merged 20 commits into
mainfrom
claude/project-thread-imw0tl
Nov 17, 2026
Merged

os-zhuang merged 20 commits into
mainfrom
claude/project-thread-imw0tl

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Fixes #33876

Clause-②: yes (narrowing) — narrowed: on a driver that does not declare DriverCapabilities.readableIdsLeaf (MongoDB, OData, a third-party driver), a nested-relation condition beneath a single-valued relation on find, findOne, count or aggregate is refused INVALID_FILTER / 400 before anything is read, where it read the related ids first and answered up to 1,000 related matches (past 1,000 it was already refused INVALID_FILTER / 400, never truncated); an analytics dimension through a lookup on such a driver is refused INVALID_QUERY / 400 before anything is read, where it was served by reading the related records for the grouped ids. Widened: a driver that declares the bit is served by the planned semi-join whatever its name.
Metadata-protocol: added
Skills-docs: follow-up #33875 — skills/objectstack-query/SKILL.md (its nested-relation row still promises the capped id read on every driver; MongoDB and OData now refuse it)

维护者速读

  • 改了什么:spec 新增驱动能力位 DriverCapabilities.readableIdsLeaf(SQL 各方言、Turso、内存驱动声明,MongoDB/OData 不声明)。引擎在单值关系的嵌套条件(读操作)上看这个位:没有它就在规划/读取任何关联数据之前直接拒收 INVALID_FILTER/400,点名驱动并给出两步写法;分析里「经查找字段分组的维度」用同一个位,没有它就 INVALID_QUERY/400。引擎的 where 判定(judgeFilter)按驱动声明的能力位给出与执行相同的拒收,先问判定的调用方(分析的读范围合并)拿到同一结论。ADR-0139 D3 在本 PR 内修订。
  • 为什么改:执行你在 analytics: on SQL drivers compile a cross-object where into an in-database semi-join (no 1000-id cap), each hop read-scoped; non-SQL drivers refuse #33626 Q2 选的 A(评论 6889543194):不会跑跨对象 where 的驱动在引擎里提前给稳定 400。维度那半边按 objectql: refuse a cross-object where up front with INVALID_FILTER / 400 on a driver that compiles no semi-join (MongoDB, OData) — ADR-0139 capability-bit amendment #33876 上 6917475155 的范围说明和首要原则第 5 条(做不到的稳定码拒收),用同一个能力位一次判定。
  • 风险与回滚:只影响 MongoDB、OData 和不声明该位的第三方驱动上的部署(收窄,BREAKING)。where 过去先读关联 id:命中不超过 1000 条照常返回,超过 1000 条早已 400 拒收(从不截断);现在一律在读之前 400。维度过去靠逐 id 展开照常返回,现在 400。多值关系和 update/delete 的 where 不变。回滚=回退本 PR。
  • 先看:packages/objectql/src/relation-filter-lowering.ts#relationReadDriverRefusal(执行与判定共用的 where 拒收)、packages/objectql/src/relation-group-join.ts(维度拒收与新的 refused 结果)、packages/spec/src/data/driver.zod.ts(新能力位)。
  • 两分钟验证:pnpm --filter @objectstack/objectql exec vitest run src/engine-nested-relation-lowering.test.ts,预期 32/32 绿,其中「a driver without the readableIdsLeaf bit … is refused up front」一条覆盖 Mongo/OData/未声明驱动在四个读操作上都是 400 且一次读取都没有;「the filter judge answers the same up-front refusal as execution」一条覆盖判定与执行同一结论。
  • 需要你做的:本 PR 带 ADR-0139 D3 修订(docs/adr/,受治理面),请审这段修订:D3「不再回来任何能力位」对 readableIdsLeaf 及引擎自己的两个读者解除,六个消费方的 500 拒收不变。已合含 fix(spec, objectql, driver-sql): a predicate delete with a cascade locks the rows it walks #34517、feat(objectql,driver-sql): PostgreSQL buckets a non-UTC reference timezone in the database (ADR-0053 D2 as amended) #34530 的 main,能力位钉子为 8(lockRows、zonedDateBucketing、readableIdsLeaf 三位并存),driver*.mdx 已重生成。

What changes

  • @objectstack/spec: DriverCapabilities.readableIdsLeaf (optional boolean, absence = false): the driver's filter compiler compiles (or, in process, evaluates) a composed ReadableIds leaf. TSDoc and the live-bit list in the schema header say who reads it. The driver reference pages are regenerated.
  • Drivers: driver-sql declares it on every dialect (SqliteWasmDriver and TursoDriver inherit it; Turso's remote transport compiles the leaf with its own compiler). driver-memory declares it (it evaluates the leaf in process, ruling Q1, comment 6889549817). driver-mongodb and driver-odata are unchanged and do not declare it.
  • @objectstack/objectql, the where half (engine-query-lowering.ts#lowerRelationConditions): on find / findOne / count / aggregate, every relation site is judged before any related read is planned or run. If any single-valued site exists and the read's driver lacks the bit, the read is refused INVALID_FILTER / 400 (relation-filter-lowering.ts#relationReadDriverRefusal, which builds relationSemiJoinDriverRefusal), naming the driver and the two-step route. relation-semi-join.ts drops the hard-coded SEMI_JOIN_COMPILING_DRIVERS name set; relationSemiJoinServes and the refusal both read the bit through driverCompilesReadableIdsLeaf. A multi-valued relation and the where of update / delete keep the capped id read on every driver.
  • @objectstack/objectql, the filter judge (engine-top-level.ts#judgeWhereAdmission, IObjectQLEngine.judgeFilter): the judge answers that same refusal, through the same relationReadDriverRefusal, from the object's driver's DECLARED capabilities. It still calls no driver. An engine that routes the object to no driver (the authoring-time judge) does not judge it. The contract docblock in packages/spec/src/contracts/objectql-engine.ts says so. A caller that asks the judge before composing a filter (the analytics read-scope merge) therefore refuses what execution would refuse, in its own envelope.
  • @objectstack/objectql, the dimension half (relation-group-join.ts#relationGroupDriverRefusal, called first in engine-delete-and-aggregate.ts#aggregate): a relation group request on a driver without the bit gets a new outcome { kind: 'refused', error } (INVALID_QUERY / 400) and nothing is read. A driver with the bit that compiles no join (memory, Turso) is declined as before.
  • @objectstack/service-analytics: the plugin's engine bridge returns the engine's refusal as refusal on a joined: false answer, and ObjectQLStrategy#executeCrossObjectJoined throws it instead of falling back to the FK-expand. A host that wires no executeRelationGroupAggregate keeps the FK-expand (it never asks the engine).
  • ADR-0139 (docs/adr/0139-engine-internal-semi-join-leaf-readable-parent-ids.md, added to the declared file surface by the seat): a status-line amendment, an amendment note under D3 and a Consequences sentence. D3's "⛔ No DriverCapabilities bit returns" is lifted for readableIdsLeaf and the engine's own two readers (the nested-relation condition, and the analytics dimension through a lookup), each refusing with a 400 before any read; the six consumers' INTERNAL_ERROR / 500 refusal stands.
  • Comments (packages/cli/src/utils/authoring-filter-judge.ts, packages/lint/src/validate-rls-predicate-enforceability.ts): both said the judge stops before any driver is resolved. They now say it calls no driver and that an engine with no driver routed (the authoring-time judge) leaves its one driver-dependent verdict unjudged. No code changes there.
  • Docs (in the declared file surface): content/docs/kernel/contracts/data-engine.mdx and content/docs/protocol/objectql/query-syntax.mdx listed "a driver that compiles no subquery (MongoDB, OData)" as an id-read fallback case. This change makes that false, so both pages now say the condition is refused there.

BREAKING

For a deployment whose data lives on MongoDB, OData or a third-party driver that does not declare readableIdsLeaf. Measured on main: such a driver got a capped id read, served up to 1,000 related matches and refused INVALID_FILTER / 400 past them (never truncated; relationFilterCapError, pinned by engine-nested-relation-lowering.test.ts "the cap"); a dimension through a lookup was served by the FK-expand. The fix:

  • FROM find('opportunity', { where: { account: { region: 'NA' } } }) TO two reads: find('account', { where: { region: 'NA' }, fields: ['id'] }), then find('opportunity', { where: { account: { $in: ids } } }). The same for findOne, count and aggregate.
  • FROM an analytics dimension opportunity.stage on a line cube TO a dimension on the lookup field itself (opportunity), then a read of opportunity for stage by those ids.
  • FROM an analytics where naming a field through a lookup (opportunity.stage), or a dataset whose own filter does, TO a filter on the lookup field itself (opportunity $in the ids read from opportunity with that condition): the analytics service hands such a leaf to the engine as the same nested-relation condition, so on these drivers it is refused INVALID_FILTER / 400 the same way.
  • FROM a row-level read scope that holds such a condition (a field through a single-valued relation) TO one on the relation field itself (account $in the ids it may read): on these drivers an analytics query under the former is refused before anything is read with the withheld READ_SCOPE_COMPILE_FAILED / 500, the answer a read scope the engine cannot run already gets.
  • A third-party driver whose filter compiler composes the leaf declares supports.readableIdsLeaf: true and keeps serving both.

ADR-0087 disposition (changeset marker): not-required (no-migration-prescription): no metadata key, value or type is removed or re-shaped; the moved answer is a runtime refusal.

Tests

  • packages/objectql/src/engine-nested-relation-lowering.test.ts: the recording driver now declares supports (default: the bit). The old pin "a driver that compiles no subquery (MongoDB, OData, any unnamed driver) keeps the capped id read" is replaced by the refusal pin: MongoDB, OData, an undeclared name and a SQL name each with {}, { readableIdsLeaf: false } and { readableIdsLeaf: 'true' } give INVALID_FILTER / 400 on all four read verbs and under $or / $not. The message names the driver, the driver sees no read, and a multi-valued relation and an update where keep the id read. A control: a driver named MongoDB that declares the bit plans the semi-join (the bit decides, not the name).
  • packages/objectql/src/engine-nested-relation-lowering.test.ts, "the filter judge answers the same up-front refusal as execution": on MongoDB and OData without the bit, judgeFilter answers { ok: false, INVALID_FILTER, 400 } with execution's own message on all four read verbs and under $or / $not, and reads nothing; a multi-valued relation and an update where are admitted; controls: a driver with the bit, and an engine with no driver, admit it.
  • packages/services/service-analytics/src/__tests__/objectql-read-scope-engine-admission.test.ts, "a nested-relation condition on a driver that does not declare it can run one": a real engine over SqliteWasmDriver re-declared without the bit; a read scope with a single-valued nested-relation condition is refused READ_SCOPE_COMPILE_FAILED / 500 with no read, on the direct and the cross-object path; controls: the same scope on the driver with the bit is served with exactly its rows, a scope without such a condition is served, and the caller's own where with that condition keeps INVALID_FILTER / 400.
  • packages/objectql/src/relation-group-join.test.ts: memory and Turso (bit, no join) stay declined. MongoDB, OData and a SQL name without the bit are refused, INVALID_QUERY / 400 on the outcome, and the driver is never called.
  • packages/services/service-analytics/src/__tests__/cross-object-relation-group-join.test.ts: on a real SqliteWasmDriver re-declared as MongoDB without the bit, a stage dimension query answers INVALID_QUERY / 400 naming the driver, outcome refused, and zero driver reads (no FK-expand). A control re-declared as Turso with the bit is declined and served by the FK-expand, with the same rows as the reference.
  • packages/spec/src/data/driver.test.ts: the live-bit roster is eight (with lockRows from fix(spec, objectql, driver-sql): a predicate delete with a cascade locks the rows it walks #34517 and zonedDateBucketing from feat(objectql,driver-sql): PostgreSQL buckets a non-UTC reference timezone in the database (ADR-0053 D2 as amended) #34530); absence parses to no key; a non-boolean is refused.
  • packages/drivers/driver-memory/src/memory-driver.test.ts: supports is { readableIdsLeaf: true }. packages/drivers/driver-mongodb/src/mongodb-readable-ids-conformance.test.ts: MongoDB does not declare the bit.

Tests changed because the behaviour changed (each named): in credential-evaluation-guard.test.ts, query-expression-conformance.test.ts and engine-readable-ids-nested-composition.test.ts the test drivers stand for drivers that run the nested condition, so each now declares the bit. Their assertions are unchanged.

Acceptance notes

  • Premise re-measured on origin/main e8cba8f: the card body says MongoDB/OData reach the driver and answer INTERNAL_ERROR / 500. PR feat(objectql): a nested-relation condition on a read verb is one read-scoped in-database subquery per relationship, up to three, where it is provably the same read as the id read #33652 as merged (9a7f8c1) keeps the capped id read for a driver outside the name set instead (up to 1,000 related matches served, past that INVALID_FILTER / 400). So this change is a narrowing, declared Clause-②: yes (narrowing) by the seat's ruling; ruling A (6889543194) chose the shape, the engine refusing up front, not a premise of a 500.
  • The dimension refusal uses INVALID_QUERY / 400 and the where refusal INVALID_FILTER / 400, the same envelope shape (seat ruling): a dimension is not a filter, and INVALID_QUERY is the code the engine already uses for a group-key refusal.
  • The where refusal sits ahead of the related object's own doors on those drivers. A caller with no read access to the related object now gets the 400, not a 403, on MongoDB/OData.
  • The claim reads Metadata-protocol: none. The changeset gate refuses none here because the authorable-surface shard packages/spec/authorable-surface/data.json gains data/DriverCapabilities:readableIdsLeaf, so this PR declares added (spec minor) and carries the Skills-docs: line.
  • ADR-0139 D3 says "No DriverCapabilities bit returns". This PR adds one with its readers in the same change, as the ruling orders, and amends D3 in the same PR (the seat's ruling, which added docs/adr/** to the declared file surface). docs/adr/ is a governed surface, so this PR waits for a governed approver before it leaves draft.
  • The dimension refusal follows the scope note on objectql: refuse a cross-object where up front with INVALID_FILTER / 400 on a driver that compiles no semi-join (MongoDB, OData) — ADR-0139 capability-bit amendment #33876 (6917475155) under Prime Directive 5; ruling A (6889543194) is the where half's.

Verification

Readings are in the os-dev-report on #33876.


Generated by Claude Code

…ithout the readableIdsLeaf capability

Claude-Session: https://claude.ai/code/session_01ADHkmQh7Hd2qHJy17QJq6n
Co-authored-by: Claude <noreply@anthropic.com>
…IdsLeaf; doubles declare the bit

Claude-Session: https://claude.ai/code/session_01ADHkmQh7Hd2qHJy17QJq6n
Co-authored-by: Claude <noreply@anthropic.com>
…regenerate the driver reference pages

Claude-Session: https://claude.ai/code/session_01ADHkmQh7Hd2qHJy17QJq6n
Co-authored-by: Claude <noreply@anthropic.com>
…bleIdsLeaf is refused up front, no FK-expand

Claude-Session: https://claude.ai/code/session_01ADHkmQh7Hd2qHJy17QJq6n
Co-authored-by: Claude <noreply@anthropic.com>
…ition up front, no longer a fallback case

Claude-Session: https://claude.ai/code/session_01ADHkmQh7Hd2qHJy17QJq6n
Co-authored-by: Claude <noreply@anthropic.com>
…set declares the added key

Claude-Session: https://claude.ai/code/session_01ADHkmQh7Hd2qHJy17QJq6n
Co-authored-by: Claude <noreply@anthropic.com>
…citly

The readonly relations array narrowed to any[] under Array.isArray, so the
attribute callbacks were implicitly any and objectql's typecheck failed.

Claude-Session: https://claude.ai/code/session_01ADHkmQh7Hd2qHJy17QJq6n
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation protocol:data tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 7 package(s): @objectstack/cli, @objectstack/driver-memory, @objectstack/driver-sql, @objectstack/lint, @objectstack/objectql, @objectstack/service-analytics, @objectstack/spec, touching 34 documentable anchor(s). ⚠️ 4 changed file(s) yielded no anchor (packages/cli/src/utils/authoring-filter-judge.ts, packages/lint/src/validate-rls-predicate-enforceability.ts, packages/services/service-analytics/src/read-scope-sql.ts, …), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

37 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json a34eb0716a8e9838ea286677f305e71df74c62f6.

⛔ 9 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 4 changed file(s) yielded no anchor (packages/cli/src/utils/authoring-filter-judge.ts, packages/lint/src/validate-rls-predicate-enforceability.ts, packages/services/service-analytics/src/read-scope-sql.ts, …) — pages documenting those are invisible to this run
  • 1 anchor(s) matched too much of the corpus to be a work list: ObjectQL (symbol, 81 pages)
  • 2 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 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; 123 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 — 183 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 a34eb0716a8e9838ea286677f305e71df74c62f6 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json a34eb0716a8e9838ea286677f305e71df74c62f6

⚠️ 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 a34eb0716a8e9838ea286677f305e71df74c62f6 → 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-steve · session_01ADHkmSLi1reMd27fT62jJ3

CI note · PR #34565 · 2026-11-17T01:47Z

Test UI (2/16) on head 4c649ca failed in AppContent.objectScope-12811.test.tsx, a console timing test; the Test UI aggregate went red on it. This PR touches no ui/** file, and the developer reports 3 of 3 local passes of that file. The area re-runs the failed jobs of run 43993532891 once through the relay. No code change. If it fails again on the same test, the area files a finding for the flake rather than re-running again.

…-imw0tl

# Conflicts:
#	packages/drivers/driver-sql/src/sql-driver.ts
#	packages/spec/src/data/driver.test.ts
#	packages/spec/src/data/driver.zod.ts
…s merge and declare the narrowing

Regenerates the authorable surface and driver reference pages from the merged
tree. The DriverCapabilities TSDoc now states what a driver without the bit got
before (a capped id read: up to 1,000 related matches served, refused past
them) and the live-bit list names the analytics dimension reader. The changeset
declares the narrowing arm, with the BREAKING migration and its ADR-0087
disposition.

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmSLi1reMd27fT62jJ3

Final head · PR #34565 · 2026-11-17T03:49Z

Final head for L1 and L2: cc31d3f7b6c50ed7c720d61bbea6f9f5c9840b29 (rework round 1 on the seat's ruling, main merged with #34517 in it). Check-runs on this head: 72, of which 60 success and 12 skipped, none pending, none red (the PR-body guards and Check Changeset re-ran green after the area patched the body to the developer's revision).

  • Declarations: Clause-②: yes (narrowing), Metadata-protocol: added; the body's ## BREAKING section carries FROM → TO. Measured on main: past 1,000 related matches the capped id read was already refused INVALID_FILTER / 400, never truncated.
  • Dogfood battery on this head (under os-verify-lock.sh): Test Files 478 passed | 3 skipped (481), Tests 4054 passed | 68 skipped (4122), VERDICT command-exit 0.
  • Gates: 125 commands derived on this head, all exit 0, 0 NOT MEASURED / 0 UNRUN.
  • Landing: this PR changes packages/spec/src, so it does not self-land; after L1 and L2 it goes to the seat for the Tier H steps, and stays a draft. Order: after feat(objectql,driver-sql): PostgreSQL buckets a non-UTC reference timezone in the database (ADR-0053 D2 as amended) #34530, which edits the same DriverCapabilitiesSchema block; this PR then merges main, moves its pin to the live count and regenerates driver*.mdx.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq

Contract-review-claim: session_01ADHkmP44onN8RMzsPMqjRq · head cc31d3f · 2026-11-17T03:50Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmPZf3MhxKeGaxV4P3W

席位核对

L1 first review · ACCEPT · head cc31d3f7b6c50ed7c720d61bbea6f9f5c9840b29 · card #33876 · read 2026-11-17T03:52Z

Checklist (read on GitHub at this head, not from the report)

  • Shape: draft, base main, attribution lines first, then Fixes #33876. Closing-keyword scan of the whole body: one hit, #33876; #33626, #33652, #33875 carry no keyword. Fixes is right: the card's where half and the dimension half named by scope note 6917475155 are both in the diff.
  • Declarations: Clause-②: yes (narrowing) names what narrows (single-valued nested relation on the four read verbs, and the lookup dimension, on a driver without the bit) and what widens (any driver that declares it). Metadata-protocol: added: the shard authorable-surface/data.json gains data/DriverCapabilities:readableIdsLeaf; spec minor. Check Changeset and Spec property liveness are success. The changeset carries the same three lines, a **BREAKING** FROM → TO and an ADR-0087 not-required (no-migration-prescription) marker; no package goes major.
  • The narrowing premise: the body measured main (e8cba8f): a driver outside the old name set got the capped id read, served up to 1,000 related matches and refused INVALID_FILTER / 400 past them, and the dimension was served by the FK-expand. So the narrowing arm is right, and the card's "500" premise is corrected in the body.
  • File surface: 28 files from get_files. Inside claim 6931038718 plus scope note 6917475155 except, as the report says, the two docs pages (kernel/contracts/data-engine.mdx, protocol/objectql/query-syntax.mdx, which named MongoDB/OData as id-read fallback cases), the MongoDB conformance pin, and the generated driver*.mdx. The claim's packages/plugins/driver-* means packages/drivers/driver-*. Each is the card's own consequence; see "Before landing" for the card note.
  • Mechanism, read in the source:
    • lowerRelationConditions: on find / findOne / count / aggregate, when any site is single-valued and driverCompilesReadableIdsLeaf(this.relationReadDriver(object)) is false, it throws relationSemiJoinDriverRefusal (INVALID_FILTER) before the replacement loop, so no related read is planned or run. Multi-valued sites and update / delete reach the old capped id read unchanged.
    • driverCompilesReadableIdsLeaf is supports.readableIdsLeaf === true exactly; the SEMI_JOIN_COMPILING_DRIVERS name set is gone (not re-exported by any package index on main), and relationSemiJoinServes reads the bit. The engine binds relationReadDriver to its own getDriver.
    • aggregate asks relationGroupDriverRefusal before the registry decline; on refusal it writes { kind: 'refused', error } (INVALID_QUERY, status and httpStatus 400, param: 'groupBy') and returns no rows. The analytics bridge passes refusal through, and executeCrossObjectJoined throws it before the joined: false → FK-expand fallback.
    • driver-sql declares readableIdsLeaf: true beside aggregationFilter and lockRows (SqliteWasm and Turso inherit); driver-memory's supports becomes { readableIdsLeaf: true }; MongoDB and OData declare nothing.
  • Rejection assertions: the where pin asserts the {code, status} envelope (INVALID_FILTER / 400) for MongoDB, OData, an undeclared name and a SQL name, each with {}, false and the string 'true', on all four verbs and under $or / $not, with no driver read. The dimension pins assert { code: 'INVALID_QUERY', status: 400 } on the outcome (engine) and on the thrown error (service, real SqliteWasmDriver re-declared without the bit, zero driver reads, no FK-expand).
  • Controls and ablations: a driver named MongoDB that declares the bit plans the semi-join (the bit, not the name); Turso / memory shape with the bit is declined and served by the FK-expand with the reference rows. Ablations in os-dev-report 6935291273: A (where throw removed) → 1 red, B (aggregate refusal disabled) → 3 + 1 red, C (throw answer.refusal removed) → 1 red, each restored to the HEAD blob.
  • Forced test changes: credential-evaluation-guard, query-expression-conformance and engine-readable-ids-nested-composition doubles now declare the bit; their assertions are unchanged (the body names each).
  • Consumer layer: a grep of content/, skills/, packages/**/src and the ADRs at this head for "compiles no subquery" / "keeps the id read" finds no sentence left that sends MongoDB/OData to the id read on a read verb. Two skill files still teach the capped id read on every driver: skills/objectstack-query/SKILL.md:373 and rules/filters.md:96. That is what Skills-docs: follow-up #33875 points at; see "Before landing".
  • Dogfood battery (narrowing): on this head under the verify lock, 478 files passed / 3 skipped, 4054 tests passed / 68 skipped, VERDICT command-exit 0 (final-head comment 6937664173, objectstack-seat2/33876-dogfood-reading.txt). Derived gates 125/125.
  • Gates at this head: check-runs on cc31d3f7…: 72 runs, 60 success, 12 skipped, 0 failed; Lint & Repo Gates, TypeScript Type Check, Dogfood Regression Gate, Check Changeset, Spec property liveness, Build Docs and Test UI success.
  • Deviation, accepted as reported: on MongoDB/OData the up-front 400 precedes the related object's own doors, so a caller with no read access to the related object gets the 400, not a 403.

Before landing

  1. Serial with feat(objectql,driver-sql): PostgreSQL buckets a non-UTC reference timezone in the database (ADR-0053 D2 as amended) #34530 (o2-F), which adds zonedDateBucketing. git merge-tree --write-tree of this head against feat(objectql,driver-sql): PostgreSQL buckets a non-UTC reference timezone in the database (ADR-0053 D2 as amended) #34530's head f9fa9729 exits 1: conflicts in driver.zod.ts, driver.test.ts, sql-driver.ts and the generated driver*.mdx. This PR lands second (the area's order): merge main, keep all three live bits, move the pin to 8 live bits, regenerate, re-run CI. That head needs an L1 delta read and the L2 record to name it, and the battery reading pins this head only.
  2. Ride that head move: relation-group-join.ts:70 leaves the old heading ## Declined, never half-served empty above the new ## Refused … section; the declined paragraph now sits under the refused heading.
  3. Card, no head move: a File surface amended comment on objectql: refuse a cross-object where up front with INVALID_FILTER / 400 on a driver that compiles no semi-join (MongoDB, OData) — ADR-0139 capability-bit amendment #33876 for the two docs pages, the MongoDB conformance pin and the generated driver*.mdx.
  4. skills(objectstack-query): the nested-relation condition is one subquery per relationship on a read verb, up to three relationships — retire the "up to 1000 related ids" / one-level text #33875, no head move: its body describes feat(objectql): a nested-relation condition on a read verb is one read-scoped in-database subquery per relationship, up to three, where it is provably the same read as the id read #33652's change only. Add a comment there naming this PR's refusal on MongoDB/OData (and the filters.md paragraph) so the skills card writes it; otherwise the Skills-docs: line points at a card that will not carry it.
  5. ADR-0139 D3 ("No DriverCapabilities bit returns") is contradicted by the new bit. Its amendment card is the seat's to file; the body says "after this PR merges". Record the card number on the PR when filed.
  6. Title, optional: the PR is a declared narrowing with a BREAKING section; a ! (feat(objectql)!:) would mark it in the squash commit, as fix(objectql)!: a write refused after its before* hook wrote through ctx.api rolls that hook's write back #34503 does.

Owed after this

…f its declined heading

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

Copy link
Copy Markdown
Contributor Author

l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: cc31d3f7b6c50ed7c720d61bbea6f9f5c9840b29
Local-runs: none
Scope: packages/spec/src/data/driver.zod.ts + packages/objectql/src/engine-query-lowering.ts, packages/objectql/src/relation-filter-lowering.ts, packages/objectql/src/relation-semi-join.ts, packages/objectql/src/relation-group-join.ts, packages/objectql/src/engine-delete-and-aggregate.ts, packages/objectql/src/engine.ts, packages/drivers/driver-sql/src/sql-driver.ts, packages/drivers/driver-memory/src/memory-driver.ts, packages/services/service-analytics/src/plugin.ts, packages/services/service-analytics/src/strategies/objectql-strategy.ts, packages/services/service-analytics/src/strategies/types.ts; narrowing floor: every other non-prose path of the diff (packages/spec/src/data/driver.test.ts, packages/spec/authorable-surface/data.json, the eight test files under packages/objectql, packages/drivers and packages/services/service-analytics); read to judge, not reviewed: packages/drivers/driver-turso/src/turso-driver.ts, packages/drivers/driver-mongodb/src/mongodb-driver.ts, packages/drivers/driver-odata/src/odata-driver.ts, packages/objectql/src/engine-find.ts, packages/objectql/src/engine-top-level.ts, packages/spec/src/contracts/objectql-engine.ts, packages/spec/src/api/errors.zod.ts, packages/services/service-analytics/src/read-scope-sql.ts, docs/adr/0139-engine-internal-semi-join-leaf-readable-parent-ids.md, AGENTS.md

① Derived judgments

  • Inputs read: card objectql: refuse a cross-object where up front with INVALID_FILTER / 400 on a driver that compiles no semi-join (MongoDB, OData) — ADR-0139 capability-bit amendment #33876 body and its three comments; PR feat(objectql): refuse a nested-relation condition and a lookup dimension up front on a driver without the readableIdsLeaf capability #34565 body, file list (28 files) and net diff against its merge base with main; the 72 check-runs on this head (60 success, 12 skipped, none red, none pending); the cited rulings 6889543194 and 6889549817 on analytics: on SQL drivers compile a cross-object where into an in-database semi-join (no 1000-id cap), each hop read-scoped; non-SQL drivers refuse #33626 and the seat route on analytics: a dimension through a lookup answers 500 DATABASE_ERROR past the dialect bind limit (FK-expand id list) — compile it to a JOIN … GROUP BY on SQL drivers #33664.
  • DriverCapabilitiesSchema gains readableIdsLeaf: z.boolean().optional(). Accept set widened by one optional key; a non-boolean is refused; absence parses to no key. Right. The DriverCapabilities type gains one optional member; every in-repo supports literal still type-checks (TypeScript Type Check green).
  • Live-bit count: 7 at this head (queryDateGranularity, autonumber, batchSchemaSync, transactionsUnsupported, aggregationFilter, lockRows, readableIdsLeaf) plus 31 tombstones. Right for main as it stands: main carries 6 (with lockRows), and zonedDateBucketing (feat(objectql,driver-sql): PostgreSQL buckets a non-UTC reference timezone in the database (ADR-0053 D2 as amended) #34530) is not on it.
  • Who declares the bit, read on every driver's supports: SqlDriver (getter, every dialect), SqliteWasmDriver (inherits, no override), TursoDriver (spreads super.supports; its remote path resolves the leaf through remoteReadableIdsSemiJoin), InMemoryDriver (evaluates the leaf in process, ruling 6889549817). MongoDBDriver (batchSchemaSync, queryDateGranularity) and ODataDriver (transactionsUnsupported) do not, and both refuse the leaf in their own filter path. The declaring set equals the removed SEMI_JOIN_COMPILING_DRIVERS name set member for member, so no in-repo driver changes side. Right.
  • SEMI_JOIN_COMPILING_DRIVERS is removed. It was an export const of a module the package index does not re-export (index.ts exports only RELATION_FILTER_ID_CAP from this family), and nothing outside packages/objectql/src named it. No public removal. Right.
  • The narrowing, where half. Accepted before, refused now, on a driver whose supports.readableIdsLeaf is not exactly true (MongoDB, OData, any third-party driver that does not declare it): a where holding a condition beneath a single-valued relation field ({ account: { region: 'NA' } }, at any depth of $and / $or / $not) on find, findOne, count and aggregate. Before: the related ids were read as the caller and the read was served up to 1,000 related matches (past 1,000 it was already INVALID_FILTER / 400). Now: INVALID_FILTER / 400 before any read, on every such query. Stated by the body and the changeset. Right as a statement.
  • The same narrowing reaches two analytics shapes the body does not name: an analytics where leaf through a lookup, and a dataset's own filter through a lookup, both of which ObjectQLStrategy hands the engine as that nested-relation condition (servedWhere, servedScope). On those drivers they are refused by the same engine door. See N4.
  • The narrowing, dimension half. Accepted before, refused now, on the same drivers: an analytics query with a dimension through a lookup (opportunity.stage on a line cube) when the host bridges the engine (executeRelationGroupAggregate wired, the plugin's default). Before: declined by the engine and served by the FK-expand. Now: INVALID_QUERY / 400, nothing read. A host that wires its own executeAggregate never asks the engine and keeps the FK-expand. Stated by the body. Right as a statement.
  • Unchanged, checked in the code: a multi-valued relation condition and the where of update / delete keep the capped id read on every driver; the fallbacks relationSemiJoinServes names (a hook or object middleware on the related object, another datasource, a federated related object, a tenancy-class mismatch under a walled posture) keep the id read on a declaring driver.
  • The widening: the leaf is planned for any driver that declares the bit, whatever its name. A third-party driver that declares it takes on ADR-0139 D3's compile obligation, tenant wall included. Right, and the TSDoc says who should not declare it.
  • RelationGroupOutcome gains { kind: 'refused', error } and RelationGroupAggregateAnswer gains an optional refusal on its joined: false arm. Both additive; a host-supplied hook that never sets refusal behaves as before. Right.
  • Error codes: INVALID_FILTER and INVALID_QUERY are both members of the standard catalog (StandardErrorCode, packages/spec/src/api/errors.zod.ts) and both appear on the ledger page. Neither is a new code, so no ledger row is owed, and the lint and repo-gate check-runs, which carry the error-code gates, are green on this head. The dimension refusal stamps StandardErrorCode.enum.INVALID_QUERY, status and httpStatus 400, param: 'groupBy'. Right.

② Semver level

Clause-②: yes (narrowing) on the PR body and on the changeset, the same line in both. Right: the diff widens (a new optional spec key; the leaf by bit, not by name) and narrows (the two refusals above).

Metadata-protocol: added with @objectstack/spec at minor; objectql, driver-sql, driver-memory and service-analytics at patch. This matches AGENTS.md: the kind added takes at least minor on the package that gains the key, and a non-protocol breaking change ships patch with its BREAKING banner. The changeset carries the banner, the FROM and TO mapping, both declaration lines and one ADR-0087 marker (not-required (no-migration-prescription)), which is the right disposition: nothing stored is rewritten. driver-mongodb gains a test only and publishes nothing new. Check Changeset is green on this head.

③ Boundary flags

  • open_questions 1 (route to contract review): answered by this record.
  • open_questions 2 (Clause-② arm): yes (narrowing) is right. The premise re-measurement is correct against main: a driver outside the name set got the capped id read, not a 500.
  • open_questions 3 (dimension code): INVALID_QUERY is right. It is the standard code the aggregate door already uses for a group-key refusal, a dimension is not a filter, and the scope note asks for the same stable 400, which it is.
  • open_questions 4 (the bit's name): readableIdsLeaf names the leaf ADR-0139 defines and is acceptable. It is a published key, so the Tier H approver confirms the name when landing.
  • open_questions 5 (landing order against ADR-0139): escalated to the Tier H approver. Ruling 6889543194 says the PR carries an ADR-0139 amendment, and the card lists the amendment as item 1 of what lands. This head carries none, and ADR-0139 D3 on main still reads that no DriverCapabilities bit returns. The amendment is a governed surface outside this card's file surface, so it is not a finding on this diff, but the approver should land this PR with the amendment card filed and linked, not after an open-ended gap.
  • Authority for the dimension half: ruling A (6889543194) names a cross-object where only. The dimension refusal rests on scope note 6917475155, the epic rule quoted on analytics: a dimension through a lookup answers 500 DATABASE_ERROR past the dialect bind limit (FK-expand id list) — compile it to a JOIN … GROUP BY on SQL drivers #33664 (MongoDB and OData refuse with a stable 400) and Prime Directive 5 (ruling record 6888468549). The seat route on analytics: a dimension through a lookup answers 500 DATABASE_ERROR past the dialect bind limit (FK-expand id list) — compile it to a JOIN … GROUP BY on SQL drivers #33664 says in its own words that it is not a maintainer ruling. Sufficient to judge the design; the approver should know which authority it lands on.
  • Deviations: Metadata-protocol: added in place of the claim's none is forced by the authorable-surface shard and is right. The two docs pages and the regenerated driver pages are prose and generated output, not reviewed. The MongoDB pin is a sound guard against the bit being declared while the filter translation refuses the leaf.
  • SQL push-down: no new id materialisation and no new in-app join. The change removes an id-read path on drivers without the bit and replaces it with a refusal, which is what Prime Directive 5 asks for. On a declaring SQL driver the single-valued read-verb condition stays one nested subquery. The id reads that remain (multi-valued relation, write verbs, the named fallbacks) and the FK-expand on driver-memory and Turso all predate this PR and are unchanged by it.
  • Refusal order: the where refusal runs at where admission, before the middleware chain and before the related object's own doors; the dimension refusal runs before the aggregate doors. No scope, tenant-wall or permission filter is dropped or reordered on a served path: the refused paths serve nothing, and the served paths are the code main runs. A caller with no access to the related object reads a 400 in place of a 403; the message names only what the caller wrote, plus the driver name the ruling asks for.
  • Cross-repo note: a driver outside this repository that builds its own supports literal instead of spreading SqlDriver's loses the nested-relation condition until it declares the bit. The changeset says so for third-party drivers.
  • Landing note (collision with feat(objectql,driver-sql): PostgreSQL buckets a non-UTC reference timezone in the database (ADR-0053 D2 as amended) #34530): this head is right for main today. feat(objectql,driver-sql): PostgreSQL buckets a non-UTC reference timezone in the database (ADR-0053 D2 as amended) #34530 also adds a live bit and moves the same pin and the generated driver pages to seven. Whichever lands second merges main, moves the pin in packages/spec/src/data/driver.test.ts to eight (both the roster and the two count strings), and regenerates the driver reference pages. The PR body already plans to land second.

④ Design judgment

packages/spec/src/data/driver.zod.ts, against rulings 6889543194 and 6889549817 and its first consumer. The bit holds. Method presence cannot carry the signal (every driver has find()), which is the file's own rule for a live bit. The reader lands in the same change (driverCompilesReadableIdsLeaf, three call sites, === true exactly, so a truthy string does not pass). The .describe() text and the header roster agree with the code. I tried to break it through an inheriting driver that cannot honour the bit (Turso remote: it compiles the leaf with its own transport), through a wrapper driver with its own supports (none in the tree), through a read verb that skips the door (find, findOne, count and aggregate are the only four operations that reach it, all pinned), and through a mixed where (the first single-valued site refuses the whole read before any id read, pinned under $or and $not). None broke.

The narrowing, read against the published contract on main. It makes a ruled refusal real; it does not take a capability away at the consumer on the consumer's own word. ADR-0139 D3 already says MongoDB and OData refuse the leaf, Prime Directive 5 says a driver that cannot run the SQL shape refuses with a stable code and keeps no slower parity path, and the maintainer chose the engine-side INVALID_FILTER / 400 for exactly these drivers. The capped id read on those drivers was the parity path. The refusal is decided once, in the engine, from a declaration the driver owns, and a driver that can run the leaf restores the capability by declaring it. The dimension half follows the same rule from the same bit, which is coherent: the joined dimension is built from the same composed leaf.

Implementing files, sentence by sentence. engine-query-lowering.ts: the door judges every site before any related read, as its docblock says. relation-semi-join.ts: relationSemiJoinServes now reads the bit; its header no longer lists the driver as a fallback, which matches the code. engine-delete-and-aggregate.ts and relation-group-join.ts: the refusal precedes the registry decline and reads nothing. plugin.ts, objectql-strategy.ts, types.ts: the refusal travels as refusal and is thrown after the catch that turns a 4xx into the FK-expand, so it cannot be swallowed into the fallback. The driver declarations agree with the drivers' own compile paths.

S1 (should-fix) — a possible access finding was reported to the seat privately.

Nits, none affecting correctness:

  • N1: the docblock of relationGroupDriverRefusal and the test comment beside it attribute the dimension refusal to the maintainer's ruling A on analytics: on SQL drivers compile a cross-object where into an in-database semi-join (no 1000-id cap), each hop read-scoped; non-SQL drivers refuse #33626. That ruling names the where; the dimension rests on scope note 6917475155 and Prime Directive 5. Follow-up, with any later edit of that file.
  • N2: the where refusal message says a declaring driver runs the condition as one statement. driver-memory evaluates it in process, and the named fallbacks keep the id read. Follow-up.
  • N3: the TSDoc of the bit says the condition is planned as the leaf when the bit is true and that the dimension is refused without it. The first omits the fallbacks relation-semi-join.ts names; the second holds only where the host bridges the engine. Follow-up with the ADR-0139 amendment.
  • N4: the changeset's BREAKING section names the engine where and the dimension, and not the analytics where leaf and dataset filter through a lookup that the same door now refuses on those drivers. The changeset is prose; one added line there closes it.

Implemented-by: claude/project-thread-imw0tl
Reviewed-by: session_01ADHkmP44onN8RMzsPMqjRq

VERDICT: PASS

…tics where leaf in BREAKING

The dimension refusal follows the scope note on #33876 under Prime
Directive 5, not ruling A. The changeset's BREAKING section now also names
an analytics where leaf through a lookup, and a dataset's own filter, which
reach the same nested-relation gate on these drivers.

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

Copy link
Copy Markdown
Contributor Author

l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: e7323bc858842852bc307a78eb2c24f2b54eb502
Local-runs: none
Scope: packages/spec/src/contracts/objectql-engine.ts, packages/spec/src/data/driver.zod.ts, docs/adr/0139-engine-internal-semi-join-leaf-readable-parent-ids.md + packages/objectql/src/engine-query-lowering.ts, packages/objectql/src/relation-filter-lowering.ts, packages/objectql/src/relation-semi-join.ts, packages/objectql/src/relation-group-join.ts, packages/objectql/src/engine-delete-and-aggregate.ts, packages/objectql/src/engine-top-level.ts, packages/objectql/src/engine-secrets-and-routing.ts, packages/objectql/src/engine.ts, packages/drivers/driver-sql/src/sql-driver.ts, packages/drivers/driver-memory/src/memory-driver.ts, packages/services/service-analytics/src/plugin.ts, packages/services/service-analytics/src/read-scope-sql.ts, packages/services/service-analytics/src/strategies/objectql-strategy.ts, packages/services/service-analytics/src/strategies/types.ts; narrowing floor: every other non-prose path of the diff (packages/spec/src/data/driver.test.ts, packages/spec/authorable-surface/data.json, the nine test files under packages/objectql, packages/drivers and packages/services/service-analytics); read to judge, not reviewed: packages/objectql/src/engine-datasource-routing.ts, packages/lint/src/validate-rls-predicate-enforceability.ts, packages/lint/src/authoring-rules.ts, packages/metadata-protocol/src/protocol-authoring-gate.ts, packages/cli/src/utils/authoring-filter-judge.ts
Security-touching: yes

Delta review. The record this one follows is comment 6937856418 (PASS on head cc31d3f7b6c50ed7c720d61bbea6f9f5c9840b29). What it judged and did not move stands as written there; this record judges the change between the two heads on the PR's own 34 files. The main merges are not reviewed.

① Derived judgments

  • Inputs read: record 6937856418 in full; the lane's final-head account 6941127319; card objectql: refuse a cross-object where up front with INVALID_FILTER / 400 on a driver that compiles no semi-join (MongoDB, OData) — ADR-0139 capability-bit amendment #33876 body and its five comments, with the file-surface amendment 6937929777; rulings 6889543194 and 6889549817 on analytics: on SQL drivers compile a cross-object where into an in-database semi-join (no 1000-id cap), each hop read-scoped; non-SQL drivers refuse #33626; the PR body at this head; the five commits the lane added between the heads and the conflict hunks of the two main merges; whole files at this head through git objects; the check-runs on this head.
  • Check-runs on this head: 72 runs, 60 success, 12 skipped, none failed, none pending. The lane's account counts 68 (58 and 10); the difference is the four runs of the later body-patch pass (two success, two skipped). Check Changeset, Spec property liveness, Governed Surface Queue Guard, Lint & Repo Gates, TypeScript Type Check, Test Core, Build Docs and Dogfood Regression Gate are success.
  • The filter judge, as changed. relationReadDriverRefusal (relation-filter-lowering.ts) is now the one function that decides the up-front refusal. Execution calls it in lowerRelationConditions before any related read; the judge (judgeWhereAdmission, the body of IObjectQLEngine.judgeFilter) calls it at the same point, after the two admission stages and before it descends into the related conditions. Both compute the sites with the same relationSitesOf call on the same resolved where, both name the driver through the engine's own getDriver(object), which takes the object name only and no caller context, and both build the message from the same operation and object. So for one filter on one object the code, status and message are the same by construction. Right.
  • Shapes checked against execution, in the code: a single-valued site at the top level, under $and, $or and $not (one site list, walk order, first single-valued site refused in both); a multi-valued site whose related condition holds a single-valued site (execution refuses inside the related find; the judge recurses as a find on the related object with that object's driver); a related object routed to another datasource (the judge asks driverOf per object, as execution's related read does); a write verb's where (not refused at the top in either, and the related id read is judged as a find in both); a multi-valued site alone (admitted in both). None diverges.
  • The read-scope merge. assertReadScopeAdmittedByEngine asks the judge about the scope alone, under aggregate, at each engine-bound merge of ObjectQLStrategy (withReadScope, relatedReadScope), and the plugin wires that judge to the same engine its aggregate bridge executes on. On the direct path and on both cross-object paths the merge runs before the engine call, and its refusal is the withheld READ_SCOPE_COMPILE_FAILED / 500; on the joined path it is a 5xx, so the catch that turns a 4xx into the FK-expand does not swallow it. The object-form doors judge a node without its siblings, so the scope alone is refused exactly when the composed filter would be. The PR's test pins this on a real engine over a driver re-declared without the bit: withheld 500, no read, on the direct and the cross-object path, with three controls (the declaring driver serves the same scope, a scope without such a condition is served, the caller's own where keeps INVALID_FILTER / 400). Right.
  • A host that resolves no driver. The facet hands the judge getDriver wrapped so that a throw answers null, and the judge skips this one verdict when the answer is null or no driverOf is given. getDriver throws for an engine with no driver registered, which is the authoring-time judge (stackFilterJudge builds a driverless ObjectQL); the PR pins that control. Its verdicts are the ones it gave before. Right.
  • Who else asks a live engine's judge: the runtime publish gate hands it to the RLS predicate rule. That rule judges lowered CEL predicates, and its own header lists a cross-object path as outside the pushdown subset, so no nested-relation site reaches the judge from it. No further narrowing found there.
  • Live bits at this head: eight keys in DriverCapabilitiesSchema (queryDateGranularity, autonumber, batchSchemaSync, transactionsUnsupported, aggregationFilter, lockRows, zonedDateBucketing, readableIdsLeaf) and 31 tombstones. driver.test.ts lists the same eight in LIVE_BITS, its count strings read 8 in both places, and the roster comment calls readableIdsLeaf the eighth. SqlDriver.supports carries lockRows, zonedDateBucketing and readableIdsLeaf together. Right.
  • Generated artifacts on the tree: packages/spec/authorable-surface/data.json holds lockRows, readableIdsLeaf and zonedDateBucketing under data/DriverCapabilities (its only difference from main in that block is the readableIdsLeaf row); driver.mdx (both tables), driver-sql.mdx and driver-nosql.mdx each carry the three rows. The regeneration commit restored the zonedDateBucketing rows the merge had dropped. Right, and Spec property liveness is green on this head.
  • The pre-existing cap path: relationFilterCapError and the id read that raises it are byte-identical to main in the net diff. Untouched.

② Semver level

Unchanged and still right. Clause-②: yes (narrowing) is the same line on the PR body and the changeset. Metadata-protocol: added, @objectstack/spec at minor, the four other packages at patch with the BREAKING banner, one ADR-0087 marker. The delta adds no package and no protocol key: the spec change between the heads is the contract docblock of judgeFilter and the merge of the third bit from main. The judge's new verdict ships in @objectstack/objectql under the same banner, and the changeset now states it. Check Changeset is green on this head.

③ Boundary flags

  • The escalated ADR-0139 amendment (open_questions 5 of the dev report): answered. The amendment is in this PR, as ruling 6889543194 asks, and the card's file surface was amended for it (6937929777). docs/adr/** makes the PR governed; it stays a draft for the Tier H approver.
  • The live-bit collision with feat(objectql,driver-sql): PostgreSQL buckets a non-UTC reference timezone in the database (ADR-0053 D2 as amended) #34530: resolved on this head as the prior record asked (pin at eight, artifacts regenerated).
  • Authority for the dimension half: unchanged, and the amendment says so in its own words (the scope note 6917475155 under Prime Directive 5, not ruling A). The approver who lands the amendment lands that basis with it.
  • The bit's name stays the Tier H approver's to confirm.
  • File surface: the delta touches engine-top-level.ts, engine-secrets-and-routing.ts, read-scope-sql.ts (a docblock) and the analytics admission test, which the amended claim does not list. They are the fix the prior record asked for. A card note is the lane's to add; no finding.
  • SQL push-down: no new id materialisation and no new in-app join. The judge reads a declared bit and calls nothing.
  • The cap refusal on the id-read path is execution's alone, as on main. This diff does not touch it, and it remains with the owner seat.
  • A possible access finding was reported to the seat privately. It concerns code this diff does not touch and is not graded here.

④ Design judgment

packages/spec/src/contracts/objectql-engine.ts, against its first consumer. The sentence that the judge stops before any driver is resolved is gone. The contract now says the judge calls no driver, names the one verdict taken from the driver's declared capabilities, and says an engine that routes the object to no driver does not judge it. "No driver call" and "a driver's own refusals" are the right words for what the code does. The docblock of judgeWhereAdmission gains the matching paragraph, its "what it reads" list now names the declared capabilities, and its list of what is execution's alone (the ids, the cap, the caller's permissions on the related object) is still true. ObjectQL#judgeFilter and the read-scope-sql.ts header say the same. The contract holds against the code.

Design. Reading a declaration is not calling a driver, the member stays synchronous, and one function serves both callers, so the two cannot drift. The judge refuses at the point execution refuses. This is the better of the two fixes: it keeps the engine the single judge, where a catch in the analytics service would have been a second reading of the same rule.

docs/adr/0139-engine-internal-semi-join-leaf-readable-parent-ids.md, against the ruling, the card and the code. The amendment has the record's own form: a dated paragraph in the status block, an amendment note under the D3 bullet it lifts, and a sentence in Consequences. It is true to the code: who declares the bit, the two refusals and their codes, the judge answering the same refusal, the three cited symbols (all present at this head), and the unchanged INTERNAL_ERROR / 500 for a leaf a consumer composes. It is complete against the card's item 1 and against the ruling. It cites its authority for each half separately. Holds.

packages/spec/src/data/driver.zod.ts: the merge places zonedDateBucketing and readableIdsLeaf side by side in the header roster and in the schema; neither text was altered.

S1: closed
N1: closed
N4: closed

Carried, none affecting correctness:

  • N2: unchanged. The where refusal message says a declaring driver runs the condition as one statement; driver-memory evaluates it in process and the named fallbacks keep the id read. Follow-up.
  • N3: unchanged, and the amendment shares it. The TSDoc of the bit and the amendment both say the dimension is refused without the bit; that holds only where the host bridges the engine. Follow-up.

New nits, none affecting correctness:

  • N5: the amendment says "the six consumers". The same record, as amended earlier, names a seventh (controlled_by_parent), whose leaf meets the same envelope. "Every consumer" would be exact.
  • N6: two files outside this diff still describe the judge as stopping before any driver is resolved (packages/cli/src/utils/authoring-filter-judge.ts, packages/lint/src/validate-rls-predicate-enforceability.ts). True in effect for the driverless engine, no longer true of the function. Follow-up.
  • N7: the changeset's BREAKING list has no line for a read scope that holds such a condition. On these drivers every analytics query on that object now answers the withheld 500 until the policy is rewritten; the changeset says so only in its paragraph on the judge. One added line closes it.

No must-fix, no should-fix.

Implemented-by: claude/project-thread-imw0tl
Reviewed-by: session_01ADHkmP44onN8RMzsPMqjRq

VERDICT: PASS

… in cli and lint, list the read scope in BREAKING

ADR-0139's amendment keeps the 500 envelope for a leaf any consumer
composes. The authoring filter judge's two comments now say the engine's
judge calls no driver and leaves its one driver-dependent verdict unjudged
when no driver is routed. The changeset's BREAKING list names a row-level
read scope holding such a condition: on these drivers an analytics query
under it answers the withheld 500.

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmSLi1reMd27fT62jJ3

Final head · PR #34565 · 2026-11-17T07:52Z

Final head for the prose deltas: 779d1aa3303cc1b0a70179d5aada3b860641ac01, one commit over e7323bc8 (L1 6941171913, L2 6941313688). It changes prose and comments only, 4 files, +14 / −6: the ADR-0139 amendment wording (N5), two comments in packages/cli and packages/lint (N6), one line in the changeset's BREAKING list (N7). No code moved and main was not merged, so the dogfood battery reading on e7323bc8 (478 files passed, 3 skipped; 4055 tests passed; exit 0) carries. Check-runs on this head: 72, of which 60 success and 12 skipped, none red. Gates on this head: 131 derived, all exit 0, 0 NOT MEASURED. The body was patched to the developer's revision (N7 line, the comment note).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq

Contract-review-claim: session_01ADHkmP44onN8RMzsPMqjRq · head 779d1aa · 2026-11-17T07:53Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmTHGRTjPqZAcBuo9WH

席位核对

L1 delta (prose only) · ACCEPT · head 779d1aa3303cc1b0a70179d5aada3b860641ac01 (final head 6942114459) · card #33876 · over my ACCEPT 6941171913 at e7323bc8 · read 2026-11-17T07:53Z

Delta read (one commit, 779d1aa3, 4 files, +14 / −6, no main merge)

  • ADR-0139 (N5): "for a leaf one of the six consumers composes" → "for a leaf any consumer composes", in the status amendment and in the D3 amendment note ("For every consumer this bullet stands as written"). That matches the code: the up-front 400 is only for the two author-written conditions (relationReadDriverRefusal, relationGroupDriverRefusal), and a consumer-composed leaf still reaches the driver.
  • Comments (N6): packages/cli/src/utils/authoring-filter-judge.ts and packages/lint/src/validate-rls-predicate-enforceability.ts now say the judge calls no driver, that its one driver-dependent verdict comes from declared capabilities, and that an engine with no driver leaves it unjudged. I checked that last claim. judgeFilter's driverOf turns a getDriver throw into null. getDriver (engine-datasource-routing.ts) ends in throw new Error('[ObjectQL] No driver available for object …') when nothing routes, so the driverless authoring engine skips the verdict and does not refuse every nested-relation condition.
  • Changeset (N7): the new BREAKING line says a row-level read scope with a field through a single-valued relation is refused on these drivers with the withheld READ_SCOPE_COMPILE_FAILED / 500, before anything is read. That matches the [#33876] describe in service-analytics/src/__tests__/objectql-read-scope-engine-admission.test.ts: base scope and cross-object path, READ_SCOPE_COMPILE_FAILED, 500, prose withheld, nothing read.
  • No code moved, so the battery reading on e7323bc8 carries. Check-runs on 779d1aa3…: 72, 60 success, 12 skipped, 0 failed. Derived gates 131, all exit 0 (6942114459).

The verdicts 6937717736 and 6941171913 stand for everything outside this delta.

Owed after this

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 779d1aa3303cc1b0a70179d5aada3b860641ac01
Local-runs: none
Scope: packages/spec/src/contracts/objectql-engine.ts, packages/spec/src/data/driver.zod.ts, docs/adr/0139-engine-internal-semi-join-leaf-readable-parent-ids.md + packages/objectql/src/engine-query-lowering.ts, packages/objectql/src/relation-filter-lowering.ts, packages/objectql/src/relation-semi-join.ts, packages/objectql/src/relation-group-join.ts, packages/objectql/src/engine-delete-and-aggregate.ts, packages/objectql/src/engine-top-level.ts, packages/objectql/src/engine-secrets-and-routing.ts, packages/objectql/src/engine.ts, packages/drivers/driver-sql/src/sql-driver.ts, packages/drivers/driver-memory/src/memory-driver.ts, packages/services/service-analytics/src/plugin.ts, packages/services/service-analytics/src/read-scope-sql.ts, packages/services/service-analytics/src/strategies/objectql-strategy.ts, packages/services/service-analytics/src/strategies/types.ts; narrowing floor: every other non-prose path of the diff (packages/spec/src/data/driver.test.ts, packages/spec/authorable-surface/data.json, the nine test files under packages/objectql, packages/drivers and packages/services/service-analytics); read to judge, not reviewed: packages/objectql/src/engine-datasource-routing.ts, packages/lint/src/validate-rls-predicate-enforceability.ts, packages/lint/src/authoring-rules.ts, packages/metadata-protocol/src/protocol-authoring-gate.ts, packages/cli/src/utils/authoring-filter-judge.ts
Security-touching: yes

Delta review. The record this one follows is comment 6941313688 (PASS on head e7323bc858842852bc307a78eb2c24f2b54eb502). What it judged and did not move stands as written there; this record judges the one commit between the two heads. Its Scope is kept unchanged: the two comment files this commit edits (packages/cli/src/utils/authoring-filter-judge.ts, packages/lint/src/validate-rls-predicate-enforceability.ts) are now in the diff, with comment lines only.

① Derived judgments

  • Inputs read: record 6941313688 in full; the lane's final-head account 6942114459; the PR body at this head; the diff between the two heads and the four files whole at this head, through git objects; the judge and its refusal function at this head; the check-runs on this head.
  • The change between the heads: one commit (779d1aa3), whose single parent is the prior head. No merge of main. Four files, 14 lines added and 6 removed: the changeset (one line added), the ADR (two lines reworded), the cli file (inside its header block comment) and the lint file (inside the docblock of engineRefusal). Every changed line in the two TypeScript files sits inside a block comment. No executable line moves, so the prior record's readings of the code carry to this head.
  • Check-runs on this head: 72 runs, 60 success, 12 skipped, none failed, none pending. The lane's account gives the same counts. Check Changeset, Spec property liveness, Governed Surface Queue Guard, Lint & Repo Gates, TypeScript Type Check, Test Core, Build Docs, Check Documentation Links and Dogfood Regression Gate are success. The 12 skipped are the opt-in and queue jobs (among them Queue verdict, Temporal Conformance, Dogfood Verify CLI), as on the prior head.
  • The ADR wording, against the record's own consumer list. The record names six consumers in D4 and a seventh, controlled_by_parent, in its earlier amendment. The amendment note under D3 now reads "For every consumer this bullet stands as written: its leaf still reaches a refusing driver and is refused there in this envelope", and the status paragraph reads "for a leaf any consumer composes". Both are true of all seven: this PR lifts D3 only for the two author-written conditions the engine judges itself, and no consumer's leaf takes that route. The singular "its leaf" agrees with the new subject.
  • The two comments, against the function at this head. judgeWhereAdmission takes an optional driverOf, reads the object's driver only when the filter holds a relation site, and passes it to relationReadDriverRefusal, which reads the declared readableIdsLeaf and calls nothing on the driver. With driverOf absent or answering null the verdict is skipped. stackFilterJudge builds an ObjectQL with no driver, so the cli comment's "as this one does" is true. The cli comment says the judge "calls no driver" and that the one driver-dependent verdict "is taken from that driver's declared capabilities"; the lint comment says the admission runs "before any driver call" and that the verdict "is left unjudged by an engine with no driver, as at authoring time". Each is true of the code.
  • The changeset line, against the code and the PR's test. A read scope holding a nested-relation condition beneath a single-valued relation is refused by the analytics read-scope merge, which asks the engine's judge before any engine call, with READ_SCOPE_COMPILE_FAILED / 500 and the message withheld. That is the same answer the merge already gives a read scope the engine does not admit. The prior record read this in read-scope-sql.ts and in the pinning test (withheld 500, no read, on the direct and the cross-object path); none of that code moved. The line says what is refused (an analytics query under such a read scope), where (drivers that do not declare the bit), with what answer, and until what (the scope is rewritten onto the relation field). True at rule level.
  • The changed text states rules and outcomes only. Nothing in the four files says more than the rule.

② Semver level

Unchanged and still right. The delta adds no package, no bump and no protocol key. The changeset frontmatter, the Clause-②: yes (narrowing) line, Metadata-protocol: added and the ADR-0087 marker are byte-identical to the prior head; the one added line is a fourth FROM/TO entry under the existing BREAKING banner, describing a narrowing the prior head already shipped and the changeset's paragraph on the judge already stated. The same line is on the PR body. Check Changeset is green on this head.

③ Boundary flags

  • Nothing new is flagged by the lane for this commit, and no open question is added. The flags the prior record answered stand as answered there: the ADR-0139 amendment is in this PR and makes it governed (it stays a draft for the Tier H approver), the bit's name is that approver's to confirm, and the authority for the dimension half is cited separately.
  • File surface: the cli and lint files are comment-only edits the seat asked for; the PR body names them under Comments and says no code changes there, which the diff confirms.
  • SQL push-down: no executable line moves, so no new id materialisation and no new in-app join.
  • The privately reported access item is not changed by this commit and is not graded here. No text in this commit describes it.

④ Design judgment

docs/adr/0139-engine-internal-semi-join-leaf-readable-parent-ids.md, against its consumers. The rewording is confined to the two sentences this PR's own amendment added: the dated paragraph in the status block and the amendment note under the D3 bullet. No decided text of the record is touched, the note keeps its heading and its place under the bullet it lifts, and the Consequences sentence is unchanged. It is still in the record's amendment form, and it is now exact for the seventh consumer. Holds.

packages/spec/src/data/driver.zod.ts and packages/spec/src/contracts/objectql-engine.ts: not changed between the heads. The judgment of 6941313688 stands.

The two comments now agree with the contract docblock of judgeFilter ("calls no driver", one verdict from declared capabilities, an engine with no driver does not judge it). The three places say the same thing about one function.

The changeset line follows the three entries above it in form (FROM, TO, then the answer and its code) and gives a policy author the thing to change. It names the existing withheld envelope and does not invent a second one.

N5: closed
N6: closed
N7: closed

Carried, none affecting correctness:

  • N2: unchanged. Follow-up.
  • N3: unchanged. Follow-up.

New nits, none affecting correctness:

  • N8: both new comments name the condition more widely than the function refuses it. The refusal is for a condition beneath a single-valued relation on a read verb; the cli comment leaves out "single-valued" and the lint comment leaves out both that and the read verb. The changeset and the contract docblock carry the exact form. Follow-up.
  • N9: the changeset line's route for a read scope, "account $in the ids it may read", does not say where a policy gets those ids. A read scope cannot run the two-step read the entries above describe, so the author must hold the ids in the scope itself or key the scope on a field of the object. One clause would say so. Follow-up.

No must-fix, no should-fix.

Implemented-by: claude/project-thread-imw0tl
Reviewed-by: session_01ADHkmP44onN8RMzsPMqjRq

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmQ2SN4K183oqAvUajA

Seat record · 2026-11-17T07:57Z · Head-sha: 779d1aa

维护者速读

  • 改了什么:spec 新增驱动能力位 DriverCapabilities.readableIdsLeaf(SQL 各方言、Turso、内存驱动声明,MongoDB/OData 不声明)。引擎在单值关系的嵌套条件(读操作)上看这个位,没有它就在读任何关联数据之前直接拒收 INVALID_FILTER/400,点名驱动并给出两步写法;分析里经查找字段分组的维度用同一个位,没有它就拒收 INVALID_QUERY/400。引擎的 where 判定(judgeFilter)与执行给出同一拒收。ADR-0139 D3 在本 PR 内修订。
  • 为什么改:兑现你在 analytics: on SQL drivers compile a cross-object where into an in-database semi-join (no 1000-id cap), each hop read-scoped; non-SQL drivers refuse #33626 Q2 选的 A(评论 6889543194):不会跑跨对象 where 的驱动,在引擎里提前给稳定的 400。维度那半边按 objectql: refuse a cross-object where up front with INVALID_FILTER / 400 on a driver that compiles no semi-join (MongoDB, OData) — ADR-0139 capability-bit amendment #33876 上 6917475155 的范围说明,用同一个能力位一次判定。
  • 风险与回滚:收窄,BREAKING,只影响 MongoDB、OData 和不声明该位的第三方驱动上的部署。今天这类 where 会先读关联 id:命中不超过 1000 条照常返回,超过 1000 条早已 400(从不截断);修后一律在读之前 400。维度今天靠逐 id 展开照常返回,修后 400。多值关系和 update/delete 的 where 不变。回滚即撤回本 PR。
  • 先看:packages/objectql/src/relation-filter-lowering.ts(relationReadDriverRefusal,执行与判定共用的拒收)、packages/objectql/src/relation-group-join.ts(维度拒收)、packages/spec/src/data/driver.zod.ts(新能力位)、docs/adr/0139-engine-internal-semi-join-leaf-readable-parent-ids.md(D3 修订)。
  • 两分钟验证:pnpm --filter @objectstack/objectql exec vitest run src/engine-nested-relation-lowering.test.ts,预期 32/32 全绿;「a driver without the readableIdsLeaf bit … is refused up front」一条覆盖 Mongo/OData/未声明驱动在四个读操作上都是 400 且一次读取都没有。
  • 需要你做的:用 os-zhuang 审读并批准这个收窄和 ADR-0139 D3 修订(D3「不再回来任何能力位」对 readableIdsLeaf 及引擎自己的两个读者解除,六个消费方的 500 拒收不变)。请确认:今天 MongoDB/OData 上 1000 条以内的这类查询能答,修后改为 400。契约复审 PASS 6942192439,钉在 Head-sha 779d1aa3303cc1b0a70179d5aada3b860641ac01。批准在案后由席位翻 ready,经合并队列落地。

席位意见:同意合并。这是兑现你在 #33626 Q2 的裁决 A;能力位名、两个错误码都有先例可循,席位已照准。收窄的方向是把「做得到一部分、超过 1000 条才报错」的不稳定行为,换成一开始就稳定拒收,AI 写元数据时更难写出只在小数据上能跑的查询。

席位核对

  1. 形态:36 个文件,+726/−100,Fixes #33876;Clause-②: yes (narrowing),Metadata-protocol: added,Skills-docs: follow-up #33875(skills/objectstack-query/SKILL.md 的嵌套关系行仍承诺在所有驱动上读封顶 id)。碰 docs/adr/** 与 packages/spec/src,且是收窄 ⇒ Tier H。
  2. 前提实测:卡线程实测今天的路径是封顶 1000 的 id 读,已写进 FROM→TO 行(席位 01:58Z 要求);钉子覆盖四个读操作 × 三类驱动的提前拒收,以及判定与执行同一结论。
  3. 门禁 check-runs:head 779d1aa3 上 72 条,60 绿、12 跳、0 红;mergeable clean。全电池在 e7323bc8 跑过:478 过/3 跳,exit 0;本 head 相对它只改散文与注释,电池读数沿用。已合含 fix(spec, objectql, driver-sql): a predicate delete with a cascade locks the rows it walks #34517、feat(objectql,driver-sql): PostgreSQL buckets a non-UTC reference timezone in the database (ADR-0053 D2 as amended) #34530 的 main,能力位钉子计数为 8。
  4. 接受的偏差:L1-b2 delta ACCEPT 6942141849(前一份 6941171913 于 e7323bc8);契约复审 PASS 6942192439(前一份 PASS 6941313688 的 N5/N6/N7 已在本 head 修,BREAKING 说明写全),无 must-fix/should-fix。文件面已在卡上补登 cli 与 lint 两个注释文件(6942153708)。
  5. 范围外去向:技能文本 → skills(objectstack-query): the nested-relation condition is one subquery per relationship on a read verb, up to three relationships — retire the "up to 1000 related ids" / one-level text #33875。复审散文 nit N2、N3、N8(cli/lint 注释写的条件比实际宽,漏了单值关系与读操作)、N9(changeset 没说可读 ids 从哪来)合为一张跟进卡,合并后由席位立卡交分诊。ADR-0139 的其余修订按席位 01:58Z 裁定,在本 PR 合并后另立卡。
  6. 落地条款:os-zhuang 授权批准在案后,席位翻 ready,经合并队列落地;Fixes #33876 合并即关卡。

@github-actions

Copy link
Copy Markdown
Contributor

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

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

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

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

  • Test UI (6/16) — 失败步骤: Run the ui tests (shard 6/16)

    × a failed submit that jumps to an off-screen tab scrolls it into view, error dot and all 51ms
    FAIL   dom  packages/components/src/renderers/form/__tests__/form-field-tabs.test.tsx > form renderer — fieldTabs strip at phone width (objectstack#34615) > a failed submit that jumps to an off-screen
      ↳ 失败原因: AssertionError: expected [] to deeply equal [ 261 ]
    

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

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

历史信号:

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

分诊清单:

  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-steve · session_01ADHkmQ2SN4K183oqAvUajA

Queue note · 2026-11-17T10:19Z

The merge-group build for this PR (run https://github.com/objectstack-ai/objectstack/actions/runs/44058185304) failed only in Test UI (6/16): ui/packages/components/src/renderers/form/__tests__/form-field-tabs.test.tsx, a case that landed on main today with #34695. This PR changes only docs/adr/**, so the failure is not caused by this diff; it is filed as #34782.

@os-zhuang: there is no approving review on record, so the seat does not re-queue it. If it has left the queue, please put it back. The head (779d1aa3) is unchanged and the seat record above still pins it.

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 protocol:data size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

3 participants