Repository navigation
Description
triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Filing gate: ② a decision only the maintainer can make. Filed on the maintainer's direct word, verbatim, in the triage seat session on 2026-11-15: 「上限 5 层,按照我们的设计会导致性能问题嘛?这个开发复杂吗?风险大吗?用fable综合评估,立决策卡」. The assessment below is a Fable evaluation that read main c32bb6cc and PR #33512's head 1e79a28d. It is read from code; no benchmark was run. Performance statements are inferred from the code's structure.
Follow-up of #33335 (PR #33512, one hop, in the merge queue). The pull is the downstream carbon-black CRM (steedos-labs/os-project-blackcat-crm#119): its margin dashboard must leave out rows whose order is cancelled, and its allocation-by-plant tile reads plan lines, so the path is plan line → plan → order (two hops).
维护者速读
- 结论:真正卡住下游的不是层数,是引擎对跨对象过滤的 1000 个 id 上限。今天的做法是先查出满足条件的父记录 id,再用
IN过滤。「订单状态 ≠ 已取消」匹配的几乎是全部订单,订单超过 1000 张时,一层也会返回 400。PR feat(service-analytics): serve a one-hop cross-object where on the engine-aggregate path #33512 拒绝了否定写法,因为否定会放行父记录不可读的行。把同一机制叠到 5 层,只会把问题放大。 - 建议:先合 feat(service-analytics): serve a one-hop cross-object where on the engine-aggregate path #33512(一层,写明上限),再做 C:复用仓库已有的子查询组合机制(ADR-0139
ReadableIds),上限 3 层。SQL、Turso、内存驱动没有 id 上限,可用于百万行。其他驱动响亮拒绝。约 8–12 agent-day,需一份 ADR,安全评审是重点。 - 不建议 5 层:数据集编译器和 ADR-0071 已定默认最多 3 跳,数据集今天声明不出 4–5 跳的关联。对齐 Salesforce 的 5 级应作为单独的 ADR 修订,C 落地后再议。
- 急用:B(沿用现有做法递归到 3 层,每层 1000 上限)约 3–4 天,安全风险低,但「≠ 已取消」这类过滤在真实数据量下仍会 400。只适合作过渡。
What the engine does today (read from code)
- A nested-relation condition is a two-step semi-join, not a driver join:
lowerRelationConditions(packages/objectql/src/engine-query-lowering.ts:181-217) runs the engine's ownfind(target, { where, fields: ['id'], limit: CAP+1 })under the caller's context, then rewrites to$in. RELATION_FILTER_ID_CAP = 1000(relation-filter-lowering.ts:84). Over the cap it answersINVALID_FILTER400 and never truncates (engine-query-lowering.ts:205-207).- One level only: a second level is refused (
relation-filter-lowering.ts:186-196). Each condition costs one extra serial round trip. - Raising the cap is not viable. Each id is a bind parameter, and ADR-0139 moved to subqueries exactly because id lists hit dialect bind limits (
native-sql-strategy.ts:856-862). - The repo already has an uncapped, security-reviewed mechanism: ADR-0139's
ReadableIdsleaf. driver-sql compiles it to a nestablefield IN (SELECT id FROM P WHERE scope AND tenant)(sql-driver.ts:6371-6385), with a chain-depth cap of 8 (engine-readable-ids-permission-formula.ts:117). Memory rewrites it to an id list, and Turso has its own semi-join. Mongo and OData are not supported (core/src/utils/readable-ids-driver-refusal.ts:126-127,181). NativeSQLStrategyalready does any number of hops as LEFT JOINs (ADR-0071), but it declines many shapes: time buckets, federated objects, engine middleware, controlled_by_parent read scopes, and others.
Options
| Shape | Cost | Risk | What the downstream app gets | |
|---|---|---|---|---|
| A | Stop at one hop (#33512) and document the 1000-parent cap | 0 | none new | Small or selective filters only. A "matching parents > 1000 → 400" note in the docs |
| B | Staged recursion to 3 hops, cap 1000 per hop, loud refusal naming the hop | M, ~3–4 agent-days | low (every hop is find as the caller: one CRUD/row/field gate) |
Plan line → plan → order, but only while every hop's id set is small. != cancelled still 400s at real volume |
| C | A subquery leaf: extend ADR-0139's composed leaf to carry a condition. 3 hops; SQL/Turso/memory uncapped; other drivers fall back to B and refuse loudly | L, ~8–12 agent-days + an ADR | higher: composeReadableIds asks only canReadObject / getReadFilter, so the filter-oracle check on the condition field must be added explicitly, or existence leaks |
A filter that works at 1M rows, and the one-hop cliff in A goes away |
| D | Native SQL only: widen NativeSQLStrategy.canHandle |
XL (each shape is its own project, which duplicates engine composition in native, against the #7598 ruling) | high | Nothing on memory or mongo |
5 hops under any option needs an ADR-0071 amendment, a compiler constant change (MAX_JOIN_HOPS = 3, dataset-compiler.ts:625,806-814), lint text (rule-explanations.ts:638), docs (dataset.mdx:62, query-syntax.mdx:519) and the objectui field picker: another M on top.
Risks common to B and C
- Divergence between strategies. ObjectQL says a missing or unreadable parent never matches,
$neincluded. Native is LEFT JOIN + WHERE, and its NULL handling depends on how$nelowers. This was not verified case by case, so a native-vs-ObjectQL parity matrix is required. - controlled_by_parent and tenancy. Under B, each hop's
findcomposes the scope and the wall. Under C, ADR-0139 D5 refuses parents with object read middleware or a cross-datasource parent, so those must fall back to B. - Performance cliff. Under A and B, a dashboard goes from working to 400 as data grows. That is better than silent truncation, but downstream it is still an outage.
- Not covered by feat(service-analytics): serve a one-hop cross-object where on the engine-aggregate path #33512. A dataset's own
filterand per-measure filters still refuse cross-object leaves on the ObjectQL path (PR testscrossobject-conjunct-refusal.test.ts:517,637,758). - Breaking: none in any option. Each one turns a refusal into a served answer.
Four-dimension analysis
- 实际业务需求:有实测拉动(下游 🔗 Broken links detected in documentation #119:毛利看板、按工厂分配磁贴)。按下游的数据量,A 和 B 都会撞 1000 上限,只有 C 能真正解决。
- 项目长远合理性(权重 ≥50%):C 复用已评审的 ADR-0139 子查询机制和 8 层链深,一套组合逻辑同时服务权限和过滤,最合理。B 在要被 C 替代的机制上加层。D 复制引擎逻辑,违背 [spec]
service-analytics' read-scope / Cube filter compilers still refuse$field, so a CEL field-to-field RLS rule 400s on those faces #7598。 - 防 AI 写错:C 之后,AI 写的跨对象过滤在大数据量下不会突然失效。A 和 B 需要 AI 记住「父记录超过 1000 会失败」,容易写错。
- 不扩散需求:3 层对齐现有 ADR-0071 的上限,不扩面。5 层是新的扩面,C 之后再议。
Recommendation
A now (land #33512 with the cap documented), then C capped at 3 hops. No 5 hops now, no D. If the downstream needs two hops before C lands, B as a bridge: its engine change (lift second-level, add a depth counter) is reusable in C, but the error text and docs must state the cap.
Reader who acts on the ruling: domain:server (A3 analytics, with the objectql engine; E2 holds objectql function holders). Under the pilot, domain:server#5 assigns. ⛔ Not a claim.
Activity
objectstack-fleet commentedon Nov 15, 2026
triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Path: none
Ruling: #33619 · letter A · maintainer 「同意一层」 · 2026-11-15T03:05Z
Ruled in the triage seat's session on 2026-11-15.
content/docs/.../dataset.mdx,query-syntax.mdx) and the refusal text state both limits: a cross-objectwhereis one hop on the engine-aggregate path, and its parent condition may match at most 1000 records (RELATION_FILTER_ID_CAP). Past that, the answer is a loud 400 naming the relationship, never a truncated result.needs-user-decisionoff,pm:blockedon PR feat(service-analytics): serve a one-hop cross-object where on the engine-aggregate path #33512, p2 → p3 (docs and refusal copy).Blocked-by: #33512 (PR)
objectstack-fleet commentedon Nov 15, 2026
triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Path: none
Maintainer principle, 2026-11-15 · it amends the direction after one hop · 2026-11-15T03:18Z
Verbatim, in the triage seat session: 「有的功能如果Mongo内存不支持,那就不需要支持,首先保sql,应该用最高性能的方案,而不能为了兼容而兼容」, after 「我的意见是一层先落地」.
whereinto an in-database semi-join (IN (SELECT …), each hop carrying that object's read scope, the ADR-0139 composition) with no 1000-id cap. Drivers that cannot run it (memory, mongo, OData) refuse loudly. They are not served by a slower path kept only for parity. This agrees with the standing freeze on driver-memory and driver-mongodb, [裁决] driver-memory / driver-mongodb 投入冻结 —— 维护者 2026-08-05 口径(跨单锚点) #5499 (2026-08-05).objectstack-fleet commentedon Nov 15, 2026
triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Path: none
Triage: unblocked ·
pm:blocked→pm:queue· 2026-11-15T03:50Z⛔ Not a claim.
PR #33512 merged, so the one-hop docs and refusal copy this card carries (ruling A) can land: the one-hop limit and the 1000-parent cap stated, with the refusal pointing to the native SQL strategy. p3 · A3. The uncapped follow-up is #33626.
os-bob commentedon Nov 18, 2026
A downstream consumer case for this decision, on 18.5.0.
steedos-labs/os-project-blackcat-crm has a dashboard tile, "Allocation by Plant", built on a dataset over allocation lines. To leave out lines whose order is cancelled, it needs the two-hop path
allocation_plan.cb_order.status: line → plan → order. #33512 serves one hop, so the app can now fix its plan-level tiles (cb_order.statuson the plan dataset). The line-level tile still gets400 INVALID_FIELDand keeps counting cancelled orders.The app will not copy the order status onto lines while this decision is open, so that half of its card is held on this issue. Two hops (detail → header → order) is the depth this consumer needs.
Generated by Claude Code
objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#7 · os-tesla · session_01L9qibvvVzM5KhCWkT5f45c
Closing as superseded at 2026-11-20T09:19Z. The maintainer (Tesla) picked 「关闭,已被取代」 on seat 7's decision card (2026-11-20T09:18Z).
The pull behind this card was the 1,000-id cap on staged cross-object reads, not the hop count. Two later changes overtook ruling A (6888364691, one hop): the SQL-first principle (6888468549), and #33652's uncapped semi-join for single-valued relation conditions.
mainnow serves three hops, andcontent/docs(query syntax) documents the limits. The tenancy-class case that still keeps the cap is #34157's; it is not reopened here.