Skip to content

[docs] services.data 页的 Parameters 只列 legacy 查询词汇(top/skip/filter),而签名接受的 QueryOptionsV2 才是 SDK 自称推荐的那套 #6002

Closed

Description

@hotlong

事实(对 origin/main 核实,628b028)

content/docs/kernel/runtime-services/data-service.mdx 的 Methods 一节写明 find 接受两种 options:

services.data.find( object: string, options?: QueryOptions | QueryOptionsV2 )

但 Parameters 一节只列了其中 legacy 的那套:

- `options` (`find`): filters, sorting, pagination (`top`, `skip`, `filter`, `sort`, `select`)

而 canonical source(packages/client/src/index.ts)对这两个接口的自述正好相反:

  • QueryOptions(148 行起)的 JSDoc:"This interface uses legacy parameter names (filter/sort/top/skip) that require translation to QueryAST. Prefer QueryAST fields directly: filter → where, select → fields, sort → orderBy, skip → offset, top → limit"
  • QueryOptionsV2(174 行起)的 JSDoc:"Canonical query options using Spec protocol field names. This is the recommended interface for data.find() queries."

即:本页把签名里那个被 SDK 自己称作 recommended / canonical 的词汇表整个略过,只教被称作 legacy、需要翻译的那套。

为什么算缺陷(以及为什么归到 observation 类)

content/docs/ 是 AI 照抄的语料,这页又是 services.data 的唯一参考页 —— 照抄的人拿到的是需要运行时翻译的旧词汇,而 where / fields / orderBy / limit / offset 与 QueryAST、与协议层是同名的,长期看是少一层心智映射的那套。

但今天没有用户会撞坏:两套 options 在 find 里都真的被 normalize(packages/client/src/index.ts 的 find 显式嗅探 where/fields/orderBy/offset 再翻译),legacy 词汇不是幻觉也没被弃用移除。所以这是教得不全,不是教错 —— 与 #5944 修掉的「教了运行时不交付的形状」不同族,故按 observation 类记录,打 finding、不入 pm:queue。

建议修法

Parameters 一节把两套都列出来并点明推荐关系(canonical where / fields / orderBy / limit / offset,legacy filter / select / sort / top / skip 仍受支持),Example 是否跟着换成 canonical 词汇一并决定。

关联

未认领,交 PM 分诊定级。

Activity

  1. claude commented on Aug 6, 2026

    @claude
    Contributor

    发现分诊:晋级 —— 摘 finding,改 pm:queue + domain:devx

    判级 — 晋级入队。立单人按「今天没人撞坏」自评为观察类,分诊不采纳这一档:判级发生在发现分诊轮而不是立单时(SKILL:立单的 dev 只有局部视野)。理由是这一页是 services.data 的唯一参考页,而 content/docs/ 是人与 AI 照抄的语料 —— 它把签名里被 SDK 自己标注为 recommended / canonical 的那套词汇整个略过,只教被标注为 legacy、需要翻译 的那套。代价不是「有人会撞坏」,是每个照抄者都多背一层心智映射,且照抄结果会持续增殖。修法是一节 Parameters 的补写,范围清楚、无需拍板(canonical 与 legacy 的推荐关系由 packages/client/src/index.ts 的 JSDoc 自己写死,不是 PM 或 dev 的取舍)。

    域 — 落点 content/docs/kernel/runtime-services/data-service.mdx ⇒ domain:devx(域表:content/docs/**)。

    过时前提检查(origin/main 44106d9;正文引用的是 628b028,已前移故重核):

    给派发方的一条范围提示 — 正文把「Example 是否跟着换成 canonical 词汇」列为一并决定项。建议换,并与 Parameters 一节同批:PR #5995 刚把该页 Example 从 hook 语境混搭里摘干净,此时改词汇是同一处的最后一道,拆两次会让同一段落连续动两轮。

    本评论来自分诊座位 Routine(#5474 试点),不构成认领。


    Generated by Claude Code

  2. self-assigned this
    on Aug 7, 2026
  3. hotlong commented on Aug 7, 2026

    @hotlong
    ContributorAuthor

    认领(pm-dispatch devx 座位) — 本单进入派发。


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions