Feat/add aitable datasource tools - #1069
Conversation
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
开源 DWS Codex 自动 CR:不通过,CI 未通过Feat/add aitable datasource tools
变更总结本次变更新增 7 个 AI 表格数据源原始命令及对应 Shortcut,并补充 Schema 身份、安全元数据、语义目录和使用文档;命令到 MCP 参数的主要映射保持一致,未发现阻塞合并的安全或数据损失问题。静态审查发现两处文档与实际 CLI/契约不一致,会导致用户照文档操作失败,建议修正;受安全限制未执行测试或构建。 CI 单测结果
结论说明自动 CR 不通过,原因如下:
代码问题
|
Head branch was pushed to by a user without write access
wxianfeng
left a comment
There was a problem hiding this comment.
开源 DWS Codex 自动 CR:不通过,需修复
Feat/add aitable datasource tools
- 评审 SHA:
d24f4be447de0ae4876fd5345ca83c68c68b5a0c - CI 状态:未通过(29 通过,4 跳过,2 未通过)
- 冲突状态:无冲突
- Agent 测试报告:不通过,缺少“Agent 测试报告”截图(aitable)
- 指令 CI 集成测试:不通过,缺少“指令 CI 集成测试”截图(aitable)
- 自动 CR 结论:不通过,需修复
- 代码评审结论:不通过,需修复
变更总结
本次变更新增了 7 个 AITable 数据源直连命令和对应 Shortcut,并补充 Schema、语义目录及使用文档。命令注册和基本参数映射整体一致,但批量上限未在运行时落实,且 Reference 中存在互相冲突的枚举值和未实现的参数,会让 Agent 生成无效调用;建议修复后再合并。受审查约束未执行测试或构建。
CI 单测结果
- ✅ AI Behavior — 通过
- ✅ CLI Smoke — 通过
- ❌ Coverage — 失败
- ✅ Coverage (baseline) — 通过
- ✅ Coverage (current) — 跳过
- ✅ Coverage (current: app) — 通过
- ✅ Coverage (current: cli) — 通过
- ✅ Coverage (current: generators) — 通过
- ✅ Coverage (current: helpers) — 通过
- ✅ Coverage (current: remaining) — 通过
- ✅ Coverage (macOS) — 跳过
- ✅ Coverage (supporting) — 通过
- ✅ Coverage (Windows) — 跳过
- ✅ Edition — 通过
- ✅ Interface Integrity — 通过
- ✅ Lint — 通过
- ✅ Mock MCP — 通过
- ❌ Policy — 失败
- ✅ route — 通过
- ✅ Test — 通过
- ✅ Test (cross-platform compile) — 通过
- ✅ Test (focused: ${{ matrix.shard }}) — 跳过
- ✅ Test (macOS auth/keychain) — 通过
- ✅ Test (race: app-a-b) — 通过
- ✅ Test (race: app-c) — 通过
- ✅ Test (race: app-d-r) — 通过
- ✅ Test (race: app-s-z-example-fuzz) — 通过
- ✅ Test (race: app-schema) — 通过
- ✅ Test (race: cli) — 通过
- ✅ Test (race: generators) — 通过
- ✅ Test (race: helpers) — 通过
- ✅ Test (race: remaining) — 通过
- ✅ Test (race: smoke) — 通过
- ✅ Test (Windows) — 通过
- ✅ Test (workflow and release contracts) — 通过
结论说明
Codex 静态审查发现 P0/P1 阻断问题,需要修复后提交新 commit 重新 CR。
代码问题
-
[P1 | 必须修改] 批量同步未落实声明的 1–5 个数量限制 —
internal/shortcut/aitable/datasource.go:281- 说明:契约、帮助和 Reference 都声明
table-ids单次只能传 1–5 个,但这里直接将任意长度的切片发送给run_datasource_sync。+datasource-sync因而会接受 6 个以上 ID;新增的非 Shortcutaitable datasource sync也只检查非空而没有检查上限。这样 Agent 按契约验证后仍可能发出服务端必然拒绝的写请求,而且没有执行文档要求的拆批。请在两个入口调用 MCP 前统一校验 1–5 个,并为边界值和超限拒绝补测试;task-ids的最多 5 个限制也应同样落实。
- 说明:契约、帮助和 Reference 都声明
-
[P2 | 建议修改] 自动同步配置文档发布了两套互斥枚举 —
skills/multi/dingtalk-aitable/references/aitable/aitable-datasource.md:98- 说明:该 Reference 将
syncType/scheduleType写成schedule与day|week|month,并给出可复制示例;同一 PR 的 Shortcut 参数契约却声明scheduled与daily|weekly|monthly。由于实现只校验 JSON 形状并原样透传,至少其中一套会导致创建或更新失败。请以真实接口契约为准统一 Reference、Flag 描述和示例,并考虑在 CLI 侧校验这些枚举。
- 说明:该 Reference 将
-
[P2 | 建议修改] Reference 声明了命令并不接受的 conflict-strategy 参数 —
skills/multi/dingtalk-aitable/references/aitable/aitable-datasource.md:177- 说明:创建命令的参数表公开了
--conflict-strategy,但DatasourceCreate.Flags和新增的aitable datasource create都没有注册或转发这个参数。Agent 按 Reference 使用时会在 Cobra 参数解析阶段直接失败。请删除该说明,或在两个公开入口及其 Contract/MCP 映射中完整实现该参数。
- 说明:创建命令的参数表公开了
此结论已作为 GitHub CHANGES_REQUESTED 提交;不会自动合并。
开源 DWS Codex 自动 CR:不通过,需修复Feat/add aitable datasource tools
变更总结本次变更新增了 7 个 AITable 数据源直连命令和对应 Shortcut,并补充 Schema、语义目录及使用文档。命令注册和基本参数映射整体一致,但批量上限未在运行时落实,且 Reference 中存在互相冲突的枚举值和未实现的参数,会让 Agent 生成无效调用;建议修复后再合并。受审查约束未执行测试或构建。 CI 单测结果
结论说明Codex 静态审查发现 P0/P1 阻断问题,需要修复后提交新 commit 重新 CR。 代码问题
|
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
wxianfeng
left a comment
There was a problem hiding this comment.
开源 DWS Codex 自动 CR:不通过,需修复
Feat/add aitable datasource tools
- 评审 SHA:
af5419dbc2b2a6a75e01384c9a6b300dca7350af - CI 状态:未通过(29 通过,4 跳过,2 未通过)
- 冲突状态:无冲突
- Agent 测试报告:不通过,缺少“Agent 测试报告”截图(aitable)
- 指令 CI 集成测试:不通过,缺少“指令 CI 集成测试”截图(aitable)
- 自动 CR 结论:不通过,需修复
- 代码评审结论:不通过,需修复
变更总结
本次变更新增 7 个 AI 表格数据源快捷命令及对应的底层 CLI 入口、Schema 声明、测试和使用文档。命令到 MCP 参数的基本映射及 1–5 个 ID 的边界检查总体一致,但创建命令发布的可复制示例缺少其自身契约标明的必填字段,会让标准接入流程直接失败;此外两份文档对数据源返回结构和自动同步枚举存在互相冲突的说明。未执行测试或仓库代码,结论仅来自静态检查。
CI 单测结果
- ✅ AI Behavior — 通过
- ✅ CLI Smoke — 通过
- ❌ Coverage — 失败
- ✅ Coverage (baseline) — 通过
- ✅ Coverage (current) — 跳过
- ✅ Coverage (current: app) — 通过
- ✅ Coverage (current: cli) — 通过
- ✅ Coverage (current: generators) — 通过
- ✅ Coverage (current: helpers) — 通过
- ✅ Coverage (current: remaining) — 通过
- ✅ Coverage (macOS) — 跳过
- ✅ Coverage (supporting) — 通过
- ✅ Coverage (Windows) — 跳过
- ✅ Edition — 通过
- ✅ Interface Integrity — 通过
- ✅ Lint — 通过
- ✅ Mock MCP — 通过
- ❌ Policy — 失败
- ✅ route — 通过
- ✅ Test — 通过
- ✅ Test (cross-platform compile) — 通过
- ✅ Test (focused: ${{ matrix.shard }}) — 跳过
- ✅ Test (macOS auth/keychain) — 通过
- ✅ Test (race: app-a-b) — 通过
- ✅ Test (race: app-c) — 通过
- ✅ Test (race: app-d-r) — 通过
- ✅ Test (race: app-s-z-example-fuzz) — 通过
- ✅ Test (race: app-schema) — 通过
- ✅ Test (race: cli) — 通过
- ✅ Test (race: generators) — 通过
- ✅ Test (race: helpers) — 通过
- ✅ Test (race: remaining) — 通过
- ✅ Test (race: smoke) — 通过
- ✅ Test (Windows) — 通过
- ✅ Test (workflow and release contracts) — 通过
结论说明
Codex 静态审查发现 P0/P1 阻断问题,需要修复后提交新 commit 重新 CR。
代码问题
-
[P1 | 必须修改] 创建数据源的公开示例遗漏必填的
name字段 —internal/shortcut/aitable/datasource.go:69- 说明:该命令对
source-config的参数契约明确说明processCode、name、iconUrl、url都必须从list-sources原样透传,但这里发布到 Schema 的两个可复制示例均没有name;新使用指南中的主要创建示例也同样遗漏,并把name标成可选。按照本 PR 自己的错误排查说明,缺少这些字段会导致创建失败,因此 Agent 或用户照标准示例执行完整接入流程时无法成功。请在所有 create/get-fields/update 示例中加入选定来源的name,并把指南中的必填性改为与命令契约一致;最好增加覆盖最终发布示例所含 sourceConfig 必填成员的契约测试。
- 说明:该命令对
-
[P2 | 建议修改] 两份数据源指南对返回结构和调度枚举给出了不兼容协议 —
docs/datasource-usage-guide.md:54- 说明:通用指南把
list-sources的result直接描述为processCode,而新增 Skill reference 及命令契约说明它是需要再次解析、内含approvals数组的 JSON 字符串;同一 reference 又把自动同步写成syncType=schedule、scheduleType=day/week/month,但快捷命令参数契约声明的是scheduled和daily/weekly/monthly。Agent 按不同入口加载文档会构造完全不同的 sourceConfig 或 autoSyncSetting,其中至少一套会被下游拒绝。请以实际 MCP 协议为准统一两份文档、Flag 描述和示例,并用参数映射测试固定这些枚举及嵌套解析约定。
- 说明:通用指南把
此结论已作为 GitHub CHANGES_REQUESTED 提交;不会自动合并。
开源 DWS Codex 自动 CR:不通过,需修复Feat/add aitable datasource tools
变更总结本次变更新增 7 个 AI 表格数据源快捷命令及对应的底层 CLI 入口、Schema 声明、测试和使用文档。命令到 MCP 参数的基本映射及 1–5 个 ID 的边界检查总体一致,但创建命令发布的可复制示例缺少其自身契约标明的必填字段,会让标准接入流程直接失败;此外两份文档对数据源返回结构和自动同步枚举存在互相冲突的说明。未执行测试或仓库代码,结论仅来自静态检查。 CI 单测结果
结论说明Codex 静态审查发现 P0/P1 阻断问题,需要修复后提交新 commit 重新 CR。 代码问题
|
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
开源 DWS Codex 自动 CR:不通过,CI 未通过Feat/add aitable datasource tools
变更总结本次变更新增了两套 AI 表格数据源命令入口及相应契约、测试和使用文档。快捷命令的参数转发、JSON 对象校验和批量上限处理基本一致;但新增长命令的能力声明与实际参数面不一致,且文档对自动同步频率支持存在自相矛盾,建议合入前修正。未执行测试或构建,仅完成静态审查。 CI 单测结果
结论说明自动 CR 不通过,原因如下:
代码问题
|
- Golden Route: add datasource entry (list-sources → create flow) - 常用 leaf 直达: add datasource-* commands - 当前最短路径: add list-sources-first rule - 安全边界: add sync write warning - 错误最短路径: add errorCode=4014 and sync=false handling - 按需加载: add datasource reference trigger - New reference: aitable-datasource.md with full workflow, sourceConfig protocol, autoSyncSetting config, command details, error codes
- Fix autoSyncSetting enum: scheduled/daily/weekly/monthly; mark selectedMonthDays/selectedWeekdays as required for monthly/weekly - Remove splitParentTableField from --source-config user-settable fields; add note that splitParentTableField/enableDataSyncOaDetailList are internal downstream fields not to be passed - Prepend sync-is-fire-and-forget notice to DatasourceSync descriptions - Remove --conflict-strategy flag (syncConflictStrategy not in MCP schema)
…ist-sources rows in SKILL.md
…ortcut_sections.py
- Add 7 datasource leaf commands to internal/helpers/aitable.go so coverage test can find tool name literals (fixes TestAllShortcutsAssemble) - Add 7 entries to semantic_catalog_aitable.json and update catalog count from 93 to 100 (fixes TestCrossPlatformCoverageAITableSemanticCatalog) - Update publicShortcutCount/schemaPublishedShortcutCount/publiclyDelivered from 422/447/422 to 429/454/429 (fixes TestDeliverySchemaCoversOrExactly) - Fix Contract.Selection.AgentSummary and UseWhen[0] in datasource.go to match Description and Intent exactly as required by schema contract test
ValidateRequiredFlags calls GetString which returns empty for StringSlice flags, causing the examples test to report --table-ids as missing. Switch to String + parseCSVValues to match the codebase convention used by record-ids and other comma-separated flags.
Both the shortcut (+datasource-sync, +datasource-sync-status) and helper (datasource sync, datasource sync-status) layers now validate that table-ids contains 1-5 IDs and task-ids contains at most 5 IDs before calling MCP, matching the declared contract.
…rage 21 tests covering all 7 datasource leaf commands' error paths (missing required flags, count validation) and happy paths (source-config as raw string, --auto flag, boundary cases for table-ids/task-ids).
The OA approval source-config contract requires processCode, name, iconUrl, and url to be passed through unchanged from +datasource-list-sources. Published examples for +datasource-create, +datasource-update, and +datasource-get-fields were missing `name`, and the usage guide marked it as optional. Fix all examples in the shortcut layer, helper layer, and docs; update flag descriptions to mention name; and add a contract test that validates every delivered example's source-config JSON contains the required members.
- docs/datasource-usage-guide.md: clarify that list-sources result is a JSON string containing approvals[]; add missing --auto-sync-setting parameter table rows and a dedicated autoSyncSetting format section using the correct scheduled/daily/weekly/monthly enums. - skills/references/aitable/aitable-datasource.md: fix autoSyncSetting enums (schedule/day/week/month -> scheduled/daily/weekly/monthly) and update the create example accordingly.
MCP requires the auto field in create_datasource / update_datasource_config requests. Previously CLI only sent it when --auto was explicitly changed, causing failures when users omitted the flag. Now both shortcut and helper layers always include auto=false by default. Also update flag descriptions and docs to clarify that the field is always sent downstream, and add test assertions for the default-false behavior.
Omitting --auto on +datasource-update previously sent auto=false to MCP, silently disabling auto-sync for existing datasources. Now auto is only included in tool args when the flag is explicitly provided, so --auto=true and --auto=false work while omission preserves the existing setting. Updated flag descriptions and added tests.
+datasource-update now requires at least one mutable option (--source-config, --auto, --field-ids, or --auto-sync-setting) before calling update_datasource_config, preventing accidental sync triggers. The native datasource update command enforces the same guard for its supported flags. Also adds the required name field to the +datasource-get-fields doc example.
…eate/update Native datasource create/update now expose --field-ids and --auto-sync-setting, matching the shortcut-layer capabilities: - flags registered on both commands - Contract Parameters updated - values mapped to MCP tool args - JSON validation for --auto-sync-setting - no-change update guard now counts the new flags Also fixes the missing required name in the usage-guide update example.
Make +datasource-sync-status consistent across shortcut and native commands: --task-ids is now required, descriptions focus on querying by taskId, and optional/IDLE semantics are removed. Update tests, usage guide, reference doc, and SKILL description accordingly.
…00% changed-code coverage
…tcut layer Align shortcut layer validation with helper layer to prevent empty slices from being sent to MCP, which could clear sync field selection due to datasource update's overwrite semantics. - Add empty string checks for --field-ids in both create and update shortcuts - Add empty string checks for --auto-sync-setting in both create and update shortcuts - Add regression tests verifying MCP is not called when empty values are rejected - Both public entry points now have consistent validation behavior Fixes P1 auto-CR issue for empty flag bypass vulnerability.
…ge gate - Update --field-ids description in create/update shortcuts and the helper-layer datasource update to clarify that omitting the flag keeps existing config (create defaults to all fields), matching the actual update overwrite semantics. - Rename datasource shortcut coverage tests to the TestCrossPlatformCoverage* prefix so they are picked up by the macOS platform coverage gate.
--field-ids is declared as FlagStringSlice, but DatasourceCreate and DatasourceUpdate previously called rt.Str to check whether the flag was empty. RuntimeContext.Str delegates to cobra's GetString, which returns an empty string on slice-typed flags, so the empty-value guard rejected every explicit --field-ids input and the downstream MCP tool never received fieldIds. Switch to rt.StrSlice, sanitize through a new trimNonEmpty helper (drop whitespace-only / empty entries) and pass the cleaned slice to MCP. Add success-passthrough tests for both create and update, plus a whitespace-only rejection case, and enhance the mock caller to record MCP arguments so fieldIds can be asserted.
…sCode docs - Add trimNonEmpty for --table-ids in +datasource-sync and --task-ids in +datasource-sync-status, matching the existing field-ids pattern - Add 4 test cases: whitespace-only rejection and trim-through for both - Fix usage guide: typical workflow and notes no longer equate result with processCode; correctly describe result as JSON to parse for approvals[].processCode/name/iconUrl/url
Head branch was pushed to by a user without write access
9f631f4 to
c7510cd
Compare
wxianfeng
left a comment
There was a problem hiding this comment.
开源 DWS Codex 自动 CR:通过
Feat/add aitable datasource tools
- 评审 SHA:
c7510cd1a10fd213a16f77211ccdec8c32dbb96c - CI 状态:通过(34 通过,4 跳过)
- 冲突状态:无冲突
- Agent 测试报告:已通过(aitable,来源:PR 评论)
- 指令 CI 集成测试:已通过(aitable,来源:PR 描述)
- 自动 CR 结论:通过
- 代码评审结论:通过
变更总结
本次变更新增了 7 个 AI 表格数据源原生命令及对应快捷命令,并补充 Schema 契约、语义目录、测试和使用文档。整体路由、参数映射和读写风险声明保持一致,未发现阻塞合并的安全问题;但原生命令对空字段列表的校验弱于快捷命令,且更新命令文档对省略字段列表的语义描述错误,建议修复后交付。受审查边界限制,未执行测试或构建。
CI 单测结果
- ✅ AI Behavior — 通过
- ✅ CLI Smoke — 通过
- ✅ Coverage — 通过
- ✅ Coverage (baseline) — 通过
- ✅ Coverage (current) — 跳过
- ✅ Coverage (current: app) — 通过
- ✅ Coverage (current: cli) — 通过
- ✅ Coverage (current: generators) — 通过
- ✅ Coverage (current: helpers) — 通过
- ✅ Coverage (current: remaining) — 通过
- ✅ Coverage (macOS) — 跳过
- ✅ Coverage (supporting) — 通过
- ✅ Coverage (Windows) — 跳过
- ✅ Edition — 通过
- ✅ Interface Integrity — 通过
- ✅ Lint — 通过
- ✅ Mock MCP — 通过
- ✅ Policy — 通过
- ✅ route — 通过
- ✅ Test — 通过
- ✅ Test (cross-platform compile) — 通过
- ✅ Test (focused: ${{ matrix.shard }}) — 跳过
- ✅ Test (macOS auth/keychain) — 通过
- ✅ Test (race: app-a-b) — 通过
- ✅ Test (race: app-c-a-l) — 通过
- ✅ Test (race: app-c-m-r) — 通过
- ✅ Test (race: app-c-other) — 通过
- ✅ Test (race: app-c-s-z) — 通过
- ✅ Test (race: app-d-r) — 通过
- ✅ Test (race: app-s-z-example-fuzz) — 通过
- ✅ Test (race: app-schema) — 通过
- ✅ Test (race: cli) — 通过
- ✅ Test (race: generators) — 通过
- ✅ Test (race: helpers) — 通过
- ✅ Test (race: remaining) — 通过
- ✅ Test (race: smoke) — 通过
- ✅ Test (Windows) — 通过
- ✅ Test (workflow and release contracts) — 通过
结论说明
Codex 静态审查未发现 P0/P1 阻断问题;CI 单测已全部结束且通过,冲突和所需测试截图门禁均已满足。
代码问题
-
[P2 | 建议修改] 原生命令会把仅含空白的字段列表作为空数组发送 —
internal/helpers/aitable.go:8585- 说明:
datasource create仅用原始字符串是否为空判断--field-ids,datasource update也只拒绝字面空串;因此--field-ids ' , '经parseCSVValues后仍可能以空数组调用 MCP。对应快捷命令已使用trimNonEmpty并在清理后为空时拒绝,两个公开入口行为不一致,而且空数组可能被下游解释为清空同步字段。请在原生命令中解析后验证列表非空,并补充与快捷命令相同的空白输入测试。
- 说明:
-
[P2 | 建议修改] 更新命令文档错误声称省略 field-ids 会同步全部字段 —
docs/datasource-usage-guide.md:236- 说明:这里把
+datasource-update --field-ids的省略语义写成“不传时同步全部字段”,但实现仅在该 flag 被显式提供时发送fieldIds,省略时会保留现有配置;新增 reference 文档也重复了同一说法。调用者可能因此误以为省略参数能够恢复全字段同步。请统一改为“不传时保持现有配置”,并说明若产品支持恢复全部字段应使用何种显式输入。
- 说明:这里把
此结论已作为 GitHub Approval 提交;不会自动合并。
开源 DWS Codex 自动 CR:通过Feat/add aitable datasource tools
变更总结本次变更新增了 7 个 AI 表格数据源原生命令及对应快捷命令,并补充 Schema 契约、语义目录、测试和使用文档。整体路由、参数映射和读写风险声明保持一致,未发现阻塞合并的安全问题;但原生命令对空字段列表的校验弱于快捷命令,且更新命令文档对省略字段列表的语义描述错误,建议修复后交付。受审查边界限制,未执行测试或构建。 CI 单测结果
结论说明Codex 静态审查未发现 P0/P1 阻断问题;CI 单测已全部结束且通过,冲突和所需测试截图门禁均已满足。 代码问题
|

Summary
Risk tier
Verification
Notes
Agent 测试报告截图(aitable)
开始执行AI表格数据源指令
指令 CI 集成测试(aitable)