Skip to content

docs(base): clarify unsupported capability boundaries - #2133

Open
huarenmin13 wants to merge 3 commits into
larksuite:mainfrom
huarenmin13:agent/base-capability-boundaries
Open

docs(base): clarify unsupported capability boundaries#2133
huarenmin13 wants to merge 3 commits into
larksuite:mainfrom
huarenmin13:agent/base-capability-boundaries

Conversation

@huarenmin13

@huarenmin13 huarenmin13 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

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

  • Document that view row height, frozen columns, column width, and similar UI-only appearance settings are unsupported, without defining an incomplete closed list of supported view properties.
  • Clarify that there is no atomic +table-copy shortcut: compose existing commands according to the user-requested schema, records, and views scope, and use the existing write-response-first verification rule.
  • Treat field types absent from the field JSON reference as unsupported instead of guessing unregistered JSON, service, or schema shapes or substituting another field type.
  • Keep focused contract coverage for the three capability facts without embedding evaluation identifiers or historical command traces.

Scope intentionally excludes the same-name view auto-rename implementation and does not repeat #2114 generic create-evidence rule.

Test Plan

  • Focused Base capability contract test
  • go test -count=1 ./shortcuts/base
  • make unit-test
  • go vet ./...
  • gofmt -l . produces no output
  • go mod tidy leaves go.mod and go.sum unchanged
  • go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6 run --new-from-rev=upstream/main reports 0 issues
  • Skill format check
  • make build and current-branch embedded Skill read expose all three boundaries

Related Issues

Summary by CodeRabbit

  • Documentation

    • Clarified that unsupported view appearance settings should be declined rather than approximated.
    • Added guidance for copying single tables using available commands.
    • Documented that unsupported field types should be rejected without guessing schemas, APIs, or substitutes.
  • Tests

    • Added coverage to verify that required capability guidance remains present.

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.
@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 31, 2026
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The 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.

Changes

Base capability guidance

Layer / File(s) Summary
Document unsupported Base capabilities
skills/lark-base/SKILL.md, skills/lark-base/references/lark-base-field-json.md
The documentation stops unsupported view settings and field types. It directs table duplication to use existing commands.
Validate capability guidance
shortcuts/base/base_capability_contract_test.go
The test loads the documentation through the virtual filesystem and checks for the required guidance.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • larksuite/cli#2114: Updates related Lark Base field-type guidance and contract documentation.

Suggested reviewers: liangshuo-1

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the documented clarification of unsupported Base capabilities.
Description check ✅ Passed The description covers the required summary, changes, test plan, and related issue sections with specific verification details.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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.

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.
@huarenmin13
huarenmin13 marked this pull request as ready for review July 31, 2026 09:26

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5cf09ec and c04b491.

📒 Files selected for processing (3)
  • shortcuts/base/base_capability_contract_test.go
  • skills/lark-base/SKILL.md
  • skills/lark-base/references/lark-base-field-json.md

Comment on lines +26 to +34
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")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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.

Suggested change
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

Comment thread skills/lark-base/SKILL.md
- `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)组合现有命令,验证遵循统一的“写入返回优先”规则。

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] 复制视图前需要重映射字段引用

这里把没有 +table-copy 时的方案描述为组合现有命令复制 schema、records 和 views,但缺少关键的字段引用重映射步骤。现有 view getter 返回的 visible_fieldsgroupsorttimebarcard 等配置可能携带源表的 field ID;目标表创建字段后会得到新的 ID。如果按照当前“先 get,再按返回结构更新”的指引直接写入目标视图,配置会继续引用源表字段,导致写入失败或复制结果不正确。

建议补充明确的 table-copy SOP:创建目标字段后,根据返回结果建立 source field ID/name → target field ID 映射,再重写各项视图配置后写入;同时说明 link、自关联、附件、计算字段、部分失败状态及最终读回验证的处理策略。

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

table-copy正在开发,快上线了。不加的话影响大吗,加的话得跟那边说,等他上线的时候记得去掉这个描述

}
if !strings.Contains(skill, "请求字段类型不在 reference 已支持类型目录中时") ||
!strings.Contains(fieldJSON, "不要猜测未注册的字段 JSON、service 或 schema,也不要用其他字段类型冒充目标能力") {
t.Fatal("lark-base guidance missing the unsupported field type boundary")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

markdown文件也要单测了?

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