Skip to content

docs(base): disambiguate filter DSL & value shape to cut Base retry loops#1879

Draft
Neseria wants to merge 2 commits into
larksuite:mainfrom
Neseria:worktree-lark-base-filter-guidance
Draft

docs(base): disambiguate filter DSL & value shape to cut Base retry loops#1879
Neseria wants to merge 2 commits into
larksuite:mainfrom
Neseria:worktree-lark-base-filter-guidance

Conversation

@Neseria

@Neseria Neseria commented Jul 14, 2026

Copy link
Copy Markdown

背景

竞品评测(lark-cli vs DWS)中,Base 业务域「筛选/视图」链路耗时约为 DWS 的 2 倍,主因是可避免的 报错 → 查文档/‑‑help → 重试 循环(真实 Trace 复现):

  • +record-list --filter-json 的 tuple 形状 [[f,op,v]]+data-query 的对象型 filters {field_name,operator,value} 混淆 → 800010701 Request validation failed
  • text/number 等标量字段的筛选值被包成数组 → 800010507 Only string values
  • 按字段名把 状态/优先级 猜成 select,或用中文枚举值()而真实值是英文(High)→ 0 命中后重试

改动

  • lark-base-view-set-filter.md:新增顶部「## 0 选对筛选 DSL 与 value 形状」——标量/数组按字段真实 type 选择、先查字段类型、与 +data-query 区分、用真实存储值;强化「易错点」。
  • lark-base-data-query.md坑点 增加与 record/view 筛选形状互斥的反向提示。
  • SKILL.md常见恢复 增加 800010701 / 800010507 两条恢复项;skill 版本 1.2.2 → 1.2.3

Flag 级细节(如 --limit vs --page-size)按 skill 既定设计交由命令 --help 承接,未写入 skill。

验证

  • 在真实 API 上复现三类报错,并确认修正写法(tuple + 标量 + ==)成功。
  • 以修复后 skill 让一个 agent 重跑「创建筛选视图 / 条件查询+批量更新 / 字段增删改」用例,未再触发 800010701/800010507 循环。
  • go test ./internal/qualitygate/skillscan/... 通过。

Eval traces show the Base filter/view chain loses time to avoidable
error->lookup->retry loops:
- record/view --filter-json (tuple [[f,op,v]]) gets confused with
  +data-query's object filters ({field_name,operator,value}) -> 800010701
- scalar fields (text/number) get array-wrapped values -> 800010507
- agents guess a field is select from its name, or guess enum values in
  Chinese when stored values are English -> 0 hits then retry

Add a top-of-doc section to the tuple-DSL SSOT (value shape by field type,
check field type first, don't confuse with data-query, use real stored
values), a reciprocal warning in data-query, and two recovery rows in
SKILL.md. Flag-level details (--limit vs --page-size) are left to command
--help per the skill's stated design.
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2d5f4fa3-bed4-4242-b43e-b84afe4b5a51

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added domain/base PR touches the base domain size/M Single-domain feat or fix with limited business impact labels Jul 14, 2026
…rfit examples

Address review feedback on the first pass:
- remove the added top-level '## 0 …先读' section — it duplicated §3 (per-type
  value rules) and §7 (易错点), and its examples (状态=="Open", 工时>=3.5)
  overfit the eval case and even clashed with §3's own 状态-as-select example.
- instead sharpen what already exists: §7 names the shared commands and the
  data-query object shape to avoid; §6 gets one process rule (confirm field
  type / real values first); all example-free and principle-based.
- revert the data-query.md note (wrong direction; the confusion is fixed at
  the record/view tuple-DSL SSOT).
- slim the SKILL.md recovery rows to terse, message-keyed, reference-pointing
  entries matching the table's style.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Labels

domain/base PR touches the base domain size/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants