From 34d691906e3bcfaed2562925b5cc4e45fee0b926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=89=E6=BE=9C?= Date: Fri, 5 Jun 2026 16:30:12 +0800 Subject: [PATCH] test: cover devapp intent disambiguation --- docs/devapp-yulan-command-routing.md | 2 +- skills/mono/references/intent-guide.md | 31 ++++++++++++++++++-- test/skill_tests.md | 27 ++++++++++++++--- test/skill_tests_results.md | 40 +++++++++++++++++++++++--- 4 files changed, 88 insertions(+), 12 deletions(-) diff --git a/docs/devapp-yulan-command-routing.md b/docs/devapp-yulan-command-routing.md index 398e5835..32ef63b4 100644 --- a/docs/devapp-yulan-command-routing.md +++ b/docs/devapp-yulan-command-routing.md @@ -20,7 +20,7 @@ external release condition until the rollout checklist in section 13 passes. | Mono skill routing | Done in repo | `skills/mono/SKILL.md` routes Open Platform app intents to `devapp`. | | Mono product reference | Done in repo | `skills/mono/references/products/devapp.md` summarizes app CRUD, permissions, credentials, events, versions, and troubleshooting. | | Multi product skill | Done in repo | `skills/multi/dingtalk-devapp/` defines the standalone `dingtalk-devapp` skill and reference file. | -| Agent intent test cases | Done in repo | `test/skill_tests.md` includes 21 devapp cases; `test/skill_tests_results.md` reports 21/21 passing. | +| Agent intent test cases | Done in repo | `test/skill_tests.md` includes 21 devapp cases plus devdoc/workbench counterexamples for the overloaded word `应用`; `test/skill_tests_results.md` reports those cases passing. | | Skill test parser | Done in repo | `test/run_skill_tests.py` now preserves the current `#### dws ...` command section for each case. | | Static/e2e skill verifier handling | Done in repo | `test/skill_static` and `test/skill_e2e` skip `dws devapp ...` as design-only until the MCP product is published. | | Sensitive config guard | Done in repo | `.gitignore` excludes local `docs/mcp/serviceconfig-pre*` files so personal MCP gateway keys are not staged. | diff --git a/skills/mono/references/intent-guide.md b/skills/mono/references/intent-guide.md index 80749e46..30a42ae2 100644 --- a/skills/mono/references/intent-guide.md +++ b/skills/mono/references/intent-guide.md @@ -7,6 +7,10 @@ | 用户说... | 真实意图 | 应该用 | 不要用 | 理由 | |-----------|----------|--------|--------|------| | "搜一下 OAuth2 接入文档" | 搜索开发文档 | `devdoc` | — | 搜索开放平台技术文档,不是钉钉内部内容 | +| "查询开放平台 API 错误码/字段说明" | 搜索开放平台接口文档 | `devdoc` | `devapp` | 查 API 用法和错误码,不是管理企业内部应用 | +| "查开放平台应用 DemoApp 的 appKey" | 查询开发者后台企业内部应用 | `devapp` | `devdoc` | 目标是应用实例和凭证/agentId,不是接口文档 | +| "给应用申请 qyapi_robot_sendmsg 权限" | 管理开放平台应用权限 | `devapp permission` | `devdoc` | 权限点申请属于应用配置变更 | +| "查工作台应用 appXYZ 的详情" | 查询钉钉工作台应用 | `workbench app` | `devapp` | `appXYZ/app001` 这类工作台 app id 不是开放平台 `unifiedAppId` | | "帮我建一个项目跟踪表" | 创建数据表格 | `aitable` | `todo` | 涉及结构化数据/行列操作,不是个人待办 | | "帮我记一下明天要做的事" | 创建个人待办 | `todo` | `aitable` | 个人待办提醒,非数据表 | | "帮我建一个明天下午的日程" | 日历日程 | `calendar` | — | 日历日程管理(可含参与者/会议室)| @@ -40,7 +44,28 @@ --- -### 2. devdoc — 开发文档搜索 +### 2. devapp vs devdoc vs workbench — 应用泛词消歧 + +`应用` 是泛词,不能直接等价为开放平台企业内部应用。 + +**用 `devapp` 的场景**: +- "开放平台应用/开发者后台应用/企业内部应用" — 管理开发者后台应用实例 +- "查 appKey/clientId/agentId/appSecret/clientSecret" — 应用身份和凭证 +- "应用权限/权限点/事件订阅/应用版本/发布审核" — 应用配置或发布链路 + +**用 `devdoc` 的场景**: +- "开放平台 API 怎么调用" — 接口文档 +- "错误码/字段说明/接口参数" — 文档检索 + +**用 `workbench app` 的场景**: +- "工作台应用/钉钉工作台上的应用" +- "应用 app001/appXYZ 的详情" 且没有开放平台上下文 + +**判断关键**:是否在管理一个开发者后台企业内部应用实例?是 → `devapp`。是否在查 API 文档?是 → `devdoc`。是否在查钉钉工作台入口应用?是 → `workbench app`。 + +--- + +### 3. devdoc — 开发文档搜索 **用 `devdoc` 的场景**: - "API 调用报错 403 怎么解决" — 开发调试问题 @@ -50,7 +75,7 @@ --- -### 3. report vs todo — 日志 vs 待办 +### 4. report vs todo — 日志 vs 待办 **用 `report` 的场景**: - "帮我看看收到的日报" — 日志收件箱 @@ -67,7 +92,7 @@ --- -### 4. chat 内部 — 两种消息发送方式 +### 5. chat 内部 — 两种消息发送方式 **用 `chat message send-by-bot` 的场景**: - "让机器人在群里发一条通知" — **机器人身份**发群消息 diff --git a/test/skill_tests.md b/test/skill_tests.md index 423c528b..6d4f4735 100644 --- a/test/skill_tests.md +++ b/test/skill_tests.md @@ -44,12 +44,12 @@ Agent 安装 dws skill 后,仅依据 skill 提供的参考文档,将自然 | `calendar` | `references/products/calendar.md` | 13 | 30 | | `chat` | `references/products/chat.md` | 13 | 31 | | `contact` | `references/products/contact.md` | 7 | 14 | -| `devdoc` | `references/products/simple.md` | 1 | 5 | +| `devdoc` | `references/products/simple.md` | 1 | 7 | | `devapp` | `references/products/devapp.md` | 14 | 21 | | `ding` | `references/products/ding.md` | 2 | 5 | | `report` | `references/products/report.md` | 6 | 26 | | `todo` | `references/products/todo.md` | 6 | 30 | -| `workbench` | `references/products/workbench.md` | 2 | 4 | +| `workbench` | `references/products/workbench.md` | 2 | 6 | --- @@ -1139,7 +1139,7 @@ Agent 安装 dws skill 后,仅依据 skill 提供的参考文档,将自然 --- -### devdoc(5 条) +### devdoc(7 条) #### `dws devdoc article search` @@ -1168,6 +1168,16 @@ Agent 安装 dws skill 后,仅依据 skill 提供的参考文档,将自然 - Expected: `dws devdoc article search --keyword 免登鉴权 --format json` - Flags: `--keyword` = `免登鉴权` +**devdoc_devdoc_article_search_006** +- Prompt: 查询开放平台 API 错误码 403 的处理文档 +- Expected: `dws devdoc article search --keyword "API 错误码 403" --format json` +- Flags: `--keyword` = `API 错误码 403` + +**devdoc_devdoc_article_search_007** +- Prompt: 开放平台机器人发消息接口怎么调用 +- Expected: `dws devdoc article search --keyword "机器人发消息接口" --format json` +- Flags: `--keyword` = `机器人发消息接口` + --- ### todo(30 条) @@ -1334,7 +1344,7 @@ Agent 安装 dws skill 后,仅依据 skill 提供的参考文档,将自然 --- -### workbench(4 条) +### workbench(6 条) #### `dws workbench app get` @@ -1348,6 +1358,11 @@ Agent 安装 dws skill 后,仅依据 skill 提供的参考文档,将自然 - Expected: `dws workbench app get --ids appXYZ --format json` - Flags: `--ids` = `appXYZ` +**workbench_workbench_app_get_003** +- Prompt: 查工作台应用 appXYZ 的详情 +- Expected: `dws workbench app get --ids appXYZ --format json` +- Flags: `--ids` = `appXYZ` + #### `dws workbench app list` **workbench_workbench_app_list_001** @@ -1358,4 +1373,8 @@ Agent 安装 dws skill 后,仅依据 skill 提供的参考文档,将自然 - Prompt: 钉钉工作台上有哪些应用 - Expected: `dws workbench app list --format json` +**workbench_workbench_app_list_003** +- Prompt: 列出所有钉钉工作台应用 +- Expected: `dws workbench app list --format json` + --- diff --git a/test/skill_tests_results.md b/test/skill_tests_results.md index 1e455d26..ab429180 100644 --- a/test/skill_tests_results.md +++ b/test/skill_tests_results.md @@ -2,8 +2,8 @@ ## Summary -- **Total Test Cases**: 223 -- **Passed**: 223 +- **Total Test Cases**: 227 +- **Passed**: 227 - **Failed**: 0 - **Pass Rate**: 100.0% @@ -17,11 +17,11 @@ | chat | 31 | 31 | 0 | 100.0% | | contact | 14 | 14 | 0 | 100.0% | | devapp | 21 | 21 | 0 | 100.0% | -| devdoc | 5 | 5 | 0 | 100.0% | +| devdoc | 7 | 7 | 0 | 100.0% | | ding | 5 | 5 | 0 | 100.0% | | report | 26 | 26 | 0 | 100.0% | | todo | 30 | 30 | 0 | 100.0% | -| workbench | 4 | 4 | 0 | 100.0% | +| workbench | 6 | 6 | 0 | 100.0% | ## All Test Case Results @@ -1304,6 +1304,22 @@ - Command path: PASS (devdoc article search) - Flags: PASS (1 flags validated) +**devdoc_devdoc_article_search_006** ✅ PASS + +- Prompt: 查询开放平台 API 错误码 403 的处理文档 +- Expected: `dws devdoc article search --keyword "API 错误码 403" --format json` +- Skill Reference: references/products/devdoc.md +- Command path: PASS (devdoc article search) +- Flags: PASS (1 flags validated) + +**devdoc_devdoc_article_search_007** ✅ PASS + +- Prompt: 开放平台机器人发消息接口怎么调用 +- Expected: `dws devdoc article search --keyword "机器人发消息接口" --format json` +- Skill Reference: references/products/devdoc.md +- Command path: PASS (devdoc article search) +- Flags: PASS (1 flags validated) + ### ding **ding_ding_message_recall_001** ✅ PASS @@ -1817,6 +1833,14 @@ - Command path: PASS (workbench app get) - Flags: PASS (1 flags validated) +**workbench_workbench_app_get_003** ✅ PASS + +- Prompt: 查工作台应用 appXYZ 的详情 +- Expected: `dws workbench app get --ids appXYZ --format json` +- Skill Reference: references/products/workbench.md +- Command path: PASS (workbench app get) +- Flags: PASS (1 flags validated) + **workbench_workbench_app_list_001** ✅ PASS - Prompt: 查看所有工作台应用列表 @@ -1832,3 +1856,11 @@ - Skill Reference: references/products/workbench.md - Command path: PASS (workbench app list) - Flags: N/A (no flags specified) + +**workbench_workbench_app_list_003** ✅ PASS + +- Prompt: 列出所有钉钉工作台应用 +- Expected: `dws workbench app list --format json` +- Skill Reference: references/products/workbench.md +- Command path: PASS (workbench app list) +- Flags: N/A (no flags specified)