docs(base): clarify unsupported capability boundaries - #2133
Conversation
Consolidate the retained Base guidance into generic capability rules. Document unsupported view appearance settings, the current single-table copy contract, and unsupported field handling without carrying over same-name rename behavior or evaluation-specific command traces.
📝 WalkthroughWalkthroughThe Base skill documentation now defines unsupported view settings and field types, plus the table-copy workflow. A contract test loads the documentation and verifies these capability boundaries. ChangesBase capability guidance
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
Avoid an incomplete closed list of supported view properties and scope table-copy guidance to the user's requested resources. Replace evaluation-trace blacklists with three focused capability contract checks.
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/base_capability_contract_test.go`:
- Around line 26-34: Extend the contract assertions in the test around the
existing view-appearance, single-table-copy, and unsupported-field-type checks
to require the mandated stop/refusal behaviors: “说明能力边界并停止”, “说明当前 CLI 不支持并停止”,
and the raw-API prohibition. Keep the existing trigger and guidance assertions,
and fail with targeted messages when any required action is missing.
🪄 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: f70c5174-581c-426a-a059-bfe949fe5fff
📒 Files selected for processing (3)
shortcuts/base/base_capability_contract_test.goskills/lark-base/SKILL.mdskills/lark-base/references/lark-base-field-json.md
| if !strings.Contains(skill, "当前不支持视图行高、冻结列、列宽等 UI-only 外观设置") { | ||
| t.Fatal("lark-base skill missing the unsupported view appearance boundary") | ||
| } | ||
| if !strings.Contains(skill, "当前没有 `+table-copy`;按用户要求的复制范围(schema、records、views)组合现有命令,验证遵循统一的“写入返回优先”规则") { | ||
| t.Fatal("lark-base skill missing the single-table copy boundary") | ||
| } | ||
| if !strings.Contains(skill, "请求字段类型不在 reference 已支持类型目录中时") || | ||
| !strings.Contains(fieldJSON, "不要猜测未注册的字段 JSON、service 或 schema,也不要用其他字段类型冒充目标能力") { | ||
| t.Fatal("lark-base guidance missing the unsupported field type boundary") |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Assert the stop and refusal behavior.
The test checks the view-setting names and the field-type trigger, but it does not check the required actions. A future edit can remove 说明能力边界并停止, 说明当前 CLI 不支持并停止, or the raw-API prohibition while this test still passes. Add assertions for these phrases.
As per coding guidelines, contract tests must assert the changed behavior directly.
Proposed assertions
- if !strings.Contains(skill, "当前不支持视图行高、冻结列、列宽等 UI-only 外观设置") {
+ if !strings.Contains(skill, "当前不支持视图行高、冻结列、列宽等 UI-only 外观设置") ||
+ !strings.Contains(skill, "遇到这类需求,说明能力边界并停止") ||
+ !strings.Contains(skill, "不要猜测未文档化参数或改走 raw API") {
t.Fatal("lark-base skill missing the unsupported view appearance boundary")
}
- if !strings.Contains(skill, "请求字段类型不在 reference 已支持类型目录中时") ||
+ if !strings.Contains(skill, "请求字段类型不在 reference 已支持类型目录中时") ||
+ !strings.Contains(skill, "说明当前 CLI 不支持并停止") ||
+ !strings.Contains(fieldJSON, "直接说明 Base CLI 当前不支持并停止") ||
!strings.Contains(fieldJSON, "不要猜测未注册的字段 JSON、service 或 schema,也不要用其他字段类型冒充目标能力") {
t.Fatal("lark-base guidance missing the unsupported field type boundary")
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if !strings.Contains(skill, "当前不支持视图行高、冻结列、列宽等 UI-only 外观设置") { | |
| t.Fatal("lark-base skill missing the unsupported view appearance boundary") | |
| } | |
| if !strings.Contains(skill, "当前没有 `+table-copy`;按用户要求的复制范围(schema、records、views)组合现有命令,验证遵循统一的“写入返回优先”规则") { | |
| t.Fatal("lark-base skill missing the single-table copy boundary") | |
| } | |
| if !strings.Contains(skill, "请求字段类型不在 reference 已支持类型目录中时") || | |
| !strings.Contains(fieldJSON, "不要猜测未注册的字段 JSON、service 或 schema,也不要用其他字段类型冒充目标能力") { | |
| t.Fatal("lark-base guidance missing the unsupported field type boundary") | |
| if !strings.Contains(skill, "当前不支持视图行高、冻结列、列宽等 UI-only 外观设置") || | |
| !strings.Contains(skill, "遇到这类需求,说明能力边界并停止") || | |
| !strings.Contains(skill, "不要猜测未文档化参数或改走 raw API") { | |
| t.Fatal("lark-base skill missing the unsupported view appearance boundary") | |
| } | |
| if !strings.Contains(skill, "当前没有 `+table-copy`;按用户要求的复制范围(schema、records、views)组合现有命令,验证遵循统一的“写入返回优先”规则") { | |
| t.Fatal("lark-base skill missing the single-table copy boundary") | |
| } | |
| if !strings.Contains(skill, "请求字段类型不在 reference 已支持类型目录中时") || | |
| !strings.Contains(skill, "说明当前 CLI 不支持并停止") || | |
| !strings.Contains(fieldJSON, "直接说明 Base CLI 当前不支持并停止") || | |
| !strings.Contains(fieldJSON, "不要猜测未注册的字段 JSON、service 或 schema,也不要用其他字段类型冒充目标能力") { | |
| t.Fatal("lark-base guidance missing the unsupported field type boundary") |
🤖 Prompt for 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.
In `@shortcuts/base/base_capability_contract_test.go` around lines 26 - 34, Extend
the contract assertions in the test around the existing view-appearance,
single-table-copy, and unsupported-field-type checks to require the mandated
stop/refusal behaviors: “说明能力边界并停止”, “说明当前 CLI 不支持并停止”, and the raw-API
prohibition. Keep the existing trigger and guidance assertions, and fail with
targeted messages when any required action is missing.
Source: Coding guidelines
| - `base-block` 只负责资源目录管理,包括创建资源、移动到 folder、重命名和删除;具体资源内容仍走 table/dashboard/workflow 命令。 | ||
| - 新建 Base 时,强烈推荐一次性执行 `lark-cli base +base-create --name "<base>" --table-name "<table>" --fields '<field-json-array>'`,同时配置新 Base 里唯一一个初始数据表的 name 和 schema;使用 `--fields` 前先读 [lark-base-field-json.md](references/lark-base-field-json.md) 或复用 `+field-create` 的字段 JSON 形状,不要猜字段属性。 | ||
| - `+base-create` 不传 `--table-name` 和 `--fields` 时,会创建一个默认 schema 的初始数据表。 | ||
| - 当前没有 `+table-copy`;按用户要求的复制范围(schema、records、views)组合现有命令,验证遵循统一的“写入返回优先”规则。 |
There was a problem hiding this comment.
[P1] 复制视图前需要重映射字段引用
这里把没有 +table-copy 时的方案描述为组合现有命令复制 schema、records 和 views,但缺少关键的字段引用重映射步骤。现有 view getter 返回的 visible_fields、group、sort、timebar、card 等配置可能携带源表的 field ID;目标表创建字段后会得到新的 ID。如果按照当前“先 get,再按返回结构更新”的指引直接写入目标视图,配置会继续引用源表字段,导致写入失败或复制结果不正确。
建议补充明确的 table-copy SOP:创建目标字段后,根据返回结果建立 source field ID/name → target field ID 映射,再重写各项视图配置后写入;同时说明 link、自关联、附件、计算字段、部分失败状态及最终读回验证的处理策略。
There was a problem hiding this comment.
table-copy正在开发,快上线了。不加的话影响大吗,加的话得跟那边说,等他上线的时候记得去掉这个描述
| } | ||
| if !strings.Contains(skill, "请求字段类型不在 reference 已支持类型目录中时") || | ||
| !strings.Contains(fieldJSON, "不要猜测未注册的字段 JSON、service 或 schema,也不要用其他字段类型冒充目标能力") { | ||
| t.Fatal("lark-base guidance missing the unsupported field type boundary") |
There was a problem hiding this comment.
[P2] 契约测试没有固定新增的停止和 raw API 禁用语义
当前断言只检查“不支持视图外观设置”的触发语句,以及不支持字段类型的条件和“不要猜测”语句。即使后续从文档中删除“说明能力边界并停止”“不要改走 raw API”或“说明当前 CLI 不支持并停止”,测试仍然会通过,因此无法防止本 PR 新增的关键拒绝行为发生回退。
建议分别断言上述停止/拒绝语义,并为每项缺失行为提供有针对性的失败信息。
| fieldJSON := read("../../skills/lark-base/references/lark-base-field-json.md") | ||
|
|
||
| if !strings.Contains(skill, "当前不支持视图行高、冻结列、列宽等 UI-only 外观设置") { | ||
| t.Fatal("lark-base skill missing the unsupported view appearance boundary") |
There was a problem hiding this comment.
markdown文件也要单测了?
Summary
Clarify Base agent behavior when a requested operation is outside the current CLI/OpenAPI capability surface. This consolidates two evaluated guidance changes into one minimal patch, while avoiding the general create-semantics guidance already covered by #2114.
The root failure mode was repeated exploration of unsupported view properties or field types, plus ambiguity around the scope and verification of single-table copies. This change turns those cases into explicit, reusable boundaries without changing API request behavior.
Changes
+table-copyshortcut: compose existing commands according to the user-requestedschema,records, andviewsscope, and use the existing write-response-first verification rule.Scope intentionally excludes the same-name view auto-rename implementation and does not repeat #2114 generic create-evidence rule.
Test Plan
go test -count=1 ./shortcuts/basemake unit-testgo vet ./...gofmt -l .produces no outputgo mod tidyleavesgo.modandgo.sumunchangedgo run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6 run --new-from-rev=upstream/mainreports 0 issuesmake buildand current-branch embedded Skill read expose all three boundariesRelated Issues
Summary by CodeRabbit
Documentation
Tests