fix(base): improve field creation and query guidance - #2114
Conversation
1. Document batch field creation in shortcut help and the delivered Base skill.
2. Choose field types from stored values instead of business-purpose names.
3. Add generic common filter values to the data-query quick guide with contract tests.
说明:
- Combines the accepted fixes for base_table_096, base_table_028, and base_table_087;
MR 1275 contributes round 4 only.
```ai-signature
改动范围: Base field-create 帮助与 Skill 指南、data-query 快速指南,以及对应的 shortcuts/base 契约测试
思考过程: 保留三个实验的最终通用规则,合并 public main 上新增的字段读回提示,并排除没有 benchmark 支撑的 MR 1275 round6
改动原因: 让代理发现批量字段接口、按存储值选择字段类型,并用常见通用形状构造 data-query 过滤条件
Break Change: 否
```
Co-authored-by: BASE Infra Harness <ai@base-infra-harness.noreply.local>
AI-SHA256: a53fdb6b6b82d74e4deff5e6d32591ec897cd2dc6ad662885c961a27e67d4666
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughBaseFieldCreate now supports documenting and validating single or batch field creation, including structured partial-failure responses. Related references and skill rules were updated, while the data-query quick guide and its contract test now focus on common ChangesField creation contract and guidance
Data-query quick guide
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant FieldCreate
participant FieldAPI
CLI->>FieldCreate: Submit field object array
FieldCreate->>FieldAPI: Create fields sequentially
FieldAPI-->>FieldCreate: Success or API error
FieldCreate-->>CLI: Return created, failed, and not-attempted results
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@shortcuts/base/data_query_guide_contract_test.go`:
- Around line 18-31: Expand the assertion list in the contract test around the
guide fixture to cover every newly added filter example: isLess,
isEmpty/isNotEmpty, value as an empty array, type 1, conditions, and the exact
["<status_value>"] shape. Keep the existing substring-based validation and add
one assertion for each required contract fragment so removal of any example
causes the test to fail.
In `@skills/lark-base/references/lark-base-field-create.md`:
- Line 46: Insert one blank line immediately after the arguments table in
lark-base-field-create.md and before the following heading, leaving the table
content unchanged so markdownlint MD058 is resolved.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 4562f56b-1db3-4620-80f7-15c88607d2ce
📒 Files selected for processing (6)
shortcuts/base/base_shortcuts_test.goshortcuts/base/data_query_guide_contract_test.goshortcuts/base/field_create.goskills/lark-base/SKILL.mdskills/lark-base/references/lark-base-data-query-guide.mdskills/lark-base/references/lark-base-field-create.md
1. Assert every common filter fragment introduced by the data-query quick guide. 2. Keep the field-create argument table compliant with markdown table spacing. ```ai-signature 改动范围: data-query 指南契约测试与 field-create Markdown 表格后的空行 思考过程: 逐条核对 CodeRabbit 建议,只补会防止新增指南片段回退的断言和确定性的 MD058 格式问题,不改生产提示语义 改动原因: 关闭 PR 2114 的两条有效自动审查意见并保持变更可回归 Break Change: 否 ``` Co-authored-by: BASE Infra Harness <ai@base-infra-harness.noreply.local> AI-SHA256: 81096f474001f2c9c59af48ee64150f205101710ebcf3b909ab9d300a019f46f
1. Replace the date-and-status scenario template with reusable Condition.value shape rules.
2. Update the contract test to require relative-date guidance and reject evaluation-shaped placehold
ers.
```ai-signature
改动范围: lark-base data-query quick guide 与对应 shortcuts/base 契约测试
思考过程: 保留 select、datetime、empty 的通用 value shape,删除日期字段和状态字段组合模板,避免将 base_table_087 的解题路径固化到公共指南
改动原因: benchmark 显示当前文案能引导目标题,但组合示例与测试过度贴合单题,需要收敛为跨场景可复用的不变量
Break Change: 否
```
Co-authored-by: BASE Infra Harness <ai@base-infra-harness.noreply.local>
AI-SHA256: 7b6916f05dccf6489dce65610fe757f7b346bcd0f8f5500cfbfb1f30c60471f3
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@shortcuts/base/data_query_guide_contract_test.go`:
- Around line 42-51: Update the forbidden-content loop in the contract test to
search normalizedGuide instead of the raw guide, matching the positive checks
and ensuring forbidden phrases split by whitespace or Markdown line breaks are
detected.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 8b8e8e8b-59bc-4c3c-ab2a-58a3fdf140a8
📒 Files selected for processing (2)
shortcuts/base/data_query_guide_contract_test.goskills/lark-base/references/lark-base-data-query-guide.md
🚧 Files skipped from review as they are similar to previous changes (1)
- skills/lark-base/references/lark-base-data-query-guide.md
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@shortcuts/base/field_ops.go`:
- Around line 223-233: Preserve the underlying err when constructing the partial
failure in field_ops.go, passing it as the OutPartialFailure cause while
retaining the existing structured payload. In base_execute_test.go, replace the
display-string-only assertion with checks that errs.ProblemOf metadata includes
category, a non-empty subtype, code, log ID, and the original cause.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 7695c4d8-a2af-4837-a4b3-afe0a71f91e1
📒 Files selected for processing (7)
shortcuts/base/base_execute_test.goshortcuts/base/base_skill_contract_test.goshortcuts/base/data_query_guide_contract_test.goshortcuts/base/field_ops.goskills/lark-base/SKILL.mdskills/lark-base/references/lark-base-field-create.mdskills/lark-base/references/lark-base-field-json.md
🚧 Files skipped from review as they are similar to previous changes (2)
- skills/lark-base/references/lark-base-field-create.md
- skills/lark-base/SKILL.md
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@4d1fb9a0065b8d7c4c95aa2ab4b8c2efe40d85a8🧩 Skill updatenpx skills add huarenmin13/cli#codex/base-field-query-guidance -y -g |
Summary
Improve Base agent guidance for three recurring failure modes without changing API request behavior.
+data-queryfilter values.Changes
+field-create.Test Plan
go test ./shortcuts/base -count=1make unit-testmake buildgo vet ./...go mod tidyleavesgo.modandgo.sumunchangedgolangci-lint run --new-from-rev=upstream/mainreports 0 issuesc88ec548Benchmark result: three normalized runs completed. Case 096 exercised one-call batch creation of 10 fields in 2/3 runs; the third run found the copied target fields already present and skipped the requested new write. Case 087 returned the requested overdue count in 3/3 runs, using direct
+data-queryin 2/3 and a record-list fallback in 1/3. Case 028 did not produce automatic translation in any run: one unsupported type was rejected and two runs created plain-text placeholders. The whole-case grader was 4/9 in each run, with several broadernewly createdexpectations also affected by pre-existing copied state. Case 087 guidance was subsequently reduced to genericCondition.valueshapes inbfbe90db; that follow-up has not yet been benchmarked. This PR remains Draft pending follow-up on the unsupported translation intent and refreshed benchmark evidence.Related Issues
Co-authored-by: BASE Infra Harness ai@base-infra-harness.noreply.local
AI-SHA256: 513b23583ffc1911429df7bc6257eebcc023c8642a33734d3e0df61b326fb36f
Summary by CodeRabbit
--jsonnow accepts either a single JSON object or a non-empty JSON array.Condition.valueshapes and date/empty handling notes.field-create/reference docs (and quick-route entries) to cover multi-field--jsonusage and batch response/failure details.