Skip to content

objectql: a registration-time declaration so the engine can tell which read middleware may narrow rows after the driver call #34155

Closed as not planned

Description

@objectstack-fleet

domain:server#5 · zhuangjianguo · session_01QsR2jUg7BKfRBcTPyMxbLh

Filing gate: seat ruling on PR #33652, contract finding S1, option B filed as its own card (the seat took option C in that PR). ⛔ Not a claim. Needs a maintainer ruling before anyone claims it.

维护者速读

关系半连接(#33652)与 ADR-0139 的 ReadableIds 叶子一样,只把「为该对象注册」的读规则(对象级中间件、afterFind 钩子)视为在驱动调用之后收窄行的规则。本卡提议在注册时增加一个声明,让引擎知道哪些读中间件可能在驱动调用之后收窄行,从而不再依赖注册方式本身。这是 spec contracts 面的扩展,需要维护者裁决后才能认领。

What exists

  • packages/objectql/src/relation-semi-join.ts plans a single-valued relation condition on a read verb as one subquery where it is provably the same read as the id read, and keeps the id read for a related object that an object-keyed middleware or an afterFind hook shapes.
  • ADR-0139 D5.2 bounds a ReadableIds parent the same way: a read middleware is known by the object it is registered for.
  • The docs pages (content/docs/protocol/objectql/query-syntax.mdx, content/docs/kernel/contracts/data-engine.mdx) state the author-facing rule: a read rule that narrows a related object's rows after its driver call bounds a relation condition only when it is registered for that object.

What this card asks

A registration-time declaration (an option of registerMiddleware, IObjectQLEngine in packages/spec/src/contracts/objectql-engine.ts) by which a read middleware states whether it may narrow rows after the driver call, so the engine, the relation semi-join and the ADR-0139 composition can read it as a registry fact. This widens the spec contracts surface and implies auditing every in-repo registration.

Decision needed

Whether to add the declaration, its spelling and default, and whether ADR-0139 D5.2 is amended with it.

Dedupe words: registerMiddleware declaration, read middleware after driver call, relation semi-join, ADR-0139 D5.2

Activity

  1. added
    needs-user-decision
    domain:server
    on Nov 15, 2026
  2. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmQ2SN4K183oqAvUajA

    2026-11-17T08:37Z Ruled. Steve chose an option on this project's decision card for #34155 at 2026-11-17T08:26:56Z. Option text verbatim: 「两张停放,#34155 关闭」 — 「#33878 和 #33877 写明重启条件后停放,等第一个真实查询撞上再做;#34155 不加声明,关卡。」. It answers this card's open question (the card carried no seat recommendation). Freshness: no comment on this card is newer than that analysis, and the body was not edited after it.

    Ruled: no registration-time declaration; closed not_planned.

    • No host needs it, it would add a contract surface, and it would need an audit of every registration in the repository. Reopening is free if a real host needs it.
  3. removed
    needs-user-decision
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:server

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions