Skip to content

Add Aitbale Ability#377

Closed
wqyenjoy wants to merge 0 commit into
DingTalk-Real-AI:test/pre-mcp-discoveryfrom
wqyenjoy:test/pre-mcp-discovery
Closed

Add Aitbale Ability#377
wqyenjoy wants to merge 0 commit into
DingTalk-Real-AI:test/pre-mcp-discoveryfrom
wqyenjoy:test/pre-mcp-discovery

Conversation

@wqyenjoy
Copy link
Copy Markdown

Summary

  • What changed?

    • Aligned open-source DWS CLI helper coverage for the Yuyuan scoped products: aitable, doc, drive, wiki, aiapp, and devdoc.
    • Added/adjusted AI 表格 helper support, including form-related commands, record batch-update, and compatible command/flag routing.
    • Fixed doc export behavior to match expected CLI contracts: required --output, progress/job output to stdout, directory output auto filename handling, and invalid job-id validation.
    • Synced mono/multi skill docs for the scoped business domains.
    • Removed unsupported command references and best-practice references from the scoped skill docs.
  • Why is this change needed?

    • This aligns the open-source CLI command surface and skill guidance with the Yuyuan evaluation baseline.
    • It reduces failures caused by missing helper commands, incompatible flags, and unsupported command references in skill docs.
    • It keeps mono and multi skill packaging consistent for the scoped product set.

Verification

  • make build
  • make lint
  • make test
  • make policy
  • ./scripts/policy/check-generated-drift.sh
  • ./scripts/policy/check-command-surface.sh --strict (if command surface changed)

Additional verification:

  • go test ./internal/helpers
  • go test ./internal/cli ./internal/app -run 'Aitable|Doc|Export|Supplement'
  • Scoped Wukong evaluation passed for the updated command areas.
  • Business-domain skill command scan:
    • checked aitable/doc/drive/wiki/aiapp/devdoc
    • 44 skill files, 134 dws ... command references
    • 0 unsupported command references found

@wqyenjoy wqyenjoy changed the title Test/pre mcp discovery Add Aitbale Ability May 31, 2026
Copy link
Copy Markdown
Collaborator

@PeterGuy326 PeterGuy326 left a comment

Choose a reason for hiding this comment

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

Review

跑了 go build ./...(过)、go test ./internal/helpers ./internal/cli ./internal/app(全过),并逐文件读了 diff。代码本身质量不错,但有一处必须确认的删除,外加几个建议改的点。

🔴 必须先确认:删了整个 best_practices 目录,但引用还在

本 PR 把 skills/mono/references/best_practices/ 整个删了——15 个文件(messaging / task / meeting / document / reporting / minutes×3 / directory / mail / _common/ / lite-recipes.md),外加 products/aitable/aitable-best-practices.md。其中 messaging/task/meeting/mail/minutes 跟 aitable 无关,超出了 PR 描述的 aitable/doc/drive/wiki/aiapp/devdoc 范围。

问题是引用没跟着删:

  • skills/mono/SKILL.md 第 168–182 行,15 条链接全部指向已删除文件
  • products/contact.md(3 处)、products/aisearch.md(1 处)、products/minutes.md(1 处)仍链向 08-directory.md / 10-minutes-speaker-match.md

结果 mono skill 会带着十几个死链发布。需要确认:

  • 若是误删——非 aitable 的 recipe 不该进本 PR,建议还原;
  • 若是有意瘦身——SKILL.md 和上述 3 个 product 文档必须在同一 PR 一起更新,不能留悬空链接。

注:skill_verify 静态测试只校验命令能否 dispatch,不查 markdown 死链,CI 不会拦住这个问题。

🟠 建议改

1. doc export 进度输出污染 JSON(internal/helpers/doc.go)
进度行从 stderr 移到了 stdout(progressOut := cmd.OutOrStdout()),而最终 JSON payload 也走 stdout。dws doc export --format json 的 stdout 会变成"进度文本 + JSON",拿 jq/脚本解析的消费方会失败。建议进度回到 stderr,或在 json 模式下抑制进度。

2. retry 包住了写操作(aitable_commands.gorunAitableProductTool)
retry 对所有 aitable 工具调用生效,含非幂等的 create_view(form create / view create 都走它)。首次超时但服务端实际成功时,重试会创建重复视图。建议只对读/幂等操作重试,或仅在服务端返回 retryable:true 时重试。

3. aitableMapHasRetryable 递归扫全响应
在整个响应树任意深度匹配 "retryable":true。成功的写操作若返回体里恰好含该字段,会被重试 3 次 → 重复写入。建议只看顶层 / error envelope。

4. 硬编码预发 endpoint(pkg/edition/default.go)
aitable-form 用的是 pre-mcp-gw.dingtalk.com(预发),而 OSS 默认其余地方用 prod mcp-gw.dingtalk.com(direct_runtime.go:77)。test/pre-mcp-discovery 分支上可理解,但别让这个 pre- 地址进 release tag。

🟡 小问题

  • aitableErrorRetryablestrings.Contains 匹配 "timeout"/"temporarily" 等裸子串,易误命中,偏脆。
  • doc export --output 由可选改必填,是破坏性契约变更;现有文档都带 --output,风险低,建议 CHANGELOG 记一笔。

✅ 做得好的

  • build 通过,helpers/cli/app 测试全绿。
  • form 命令服务端路由一致(product ID aitable-formServerInfo.ID,injectStaticServers 注册无误)。
  • batch-update 守卫到位(100 条上限、空值/JSON 校验)。
  • doc export 文件名解析(目录处理、URL 反转义、jobID 兜底)+ job-id 数字校验合理。
  • 抽出 parseAitableCSVValues 等共享 helper,减少重复。

关于 skill_verify

跑出 20 个失败,但全是 dws skill setup --mode mono(multi/* 的 SKILL.md 第 15 行),那些文件本 PR 没碰,是基线既有问题、与本 PR 无关;PR 新增的 aitable form / batch-update / doc export 命令引用全部 dispatch 通过。

建议:先就第 1 条对齐意图再决定合并;代码方向正确,改掉 2–4 会更稳。

@wqyenjoy
Copy link
Copy Markdown
Author

已处理本轮 review 中确认需要修改的两点:

  1. mono skill 死链
  • 按 main 分支方向处理,不新增、不恢复 best_practices 目录。
  • 删除了 skills/mono/SKILL.md 中指向 references/best_practices/ 的入口。
  • 清理了 aisearch/contact/minutes 中指向 ../best_practices/... 的本地死链。
  • 同步清理了 multi minutes 中同类本地死链。
  • 已用 rg '\.\./best_practices|\./references/best_practices' 确认无本地死链残留。
  1. doc export JSON 输出污染
  • 确认该问题有效:--format json 下 stdout 应保持可被 jq/脚本直接解析。
  • 已将 doc export 进度输出从 stdout 改为 stderr,最终 payload 仍由 stdout 输出。
  • 这样保留进度信息,同时不破坏 JSON 输出契约。

验证:

  • go test ./internal/helpers 通过
  • go test ./internal/cli ./internal/app 通过
  • gofmt format check 通过
  • git diff --check 通过

已推送提交:
91dcd3b fix: clean skill dead links and doc export output

@wqyenjoy wqyenjoy force-pushed the test/pre-mcp-discovery branch from 6e0b4b3 to 01df2ad Compare June 1, 2026 15:41
@wqyenjoy wqyenjoy closed this Jun 1, 2026
@wqyenjoy wqyenjoy force-pushed the test/pre-mcp-discovery branch from 01df2ad to 4244032 Compare June 1, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants