diff-executor-and-analyzer
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "diff-executor-and-analyzer" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-031099ea203d73cfda6d67cdf6db09e93aaa49b22c1097f67b7da1a0a6745eff. Verify the upstream source and version against https://skillhub.cn/skills/user_3ddd765c/diff-executor-and-analyzer before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Performs bulk diffs using ng_diff_new, analyzes results against the test_plan expected differences to identify expected_diff and unexpected_diff, and generates a bad_case report. Intended for use by the qa-integration-pipeline Phase 2.
Introduction source: third_party · user_3ddd765c · 1.3.1 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Inputs and outputs
- Translation pending; see source documentation.
- Software, accounts and paid services
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: diff-executor-and-analyzer
description: 执行 ng_diff_new 批量 diff,依据 test_plan 预期差异分析结果,识别 expected_diff / unexpected_diff,生成 bad_case 报告。供 qa-integration-pipeline Phase 2 调用。
slug: diff-executor-and-analyzer
version: 1.3.1
displayName: Diff Executor and Analyzer
changelog:
- '1.3.1: 白名单参数恢复为 driver_id(master/test 共用同一白名单)'
- '1.3.0: Jenkins diff Job 参数变更:请求数改为 req_num,白名单拆分为 master_driver_id/test_driver_id'
- '1.2.9: 增加 Step 0 知识库查询功能'
- '1.2.8: 补充 manifest.json 字段结构说明(含 driver_id、group_type、groups 汇总)'
- '1.2.6: 对照组driver_id按groups配置执行,不再写死为空字符串'
- '1.2.4: 修复bad_case路径、Step编号、多组diff分组返回'
- '1.2.3: 删除本地目录存在性校验,修正执行方式描述为标准 MCP 工具调用'
- '1.2.2: 删除本地目录存在性校验,改为纯 Jenkins MCP 远程执行模式,修正 Jenkins MCP 工具名称为 build_item/get_build/get_build_console_tail,改为通过 artifacts 获取 diff 产物'
- '1.2.1: 同上'
- '1.0.0: 初始版本,整合 diff 执行 + 结果分析'Diff 执行与分析器
角色定位
本 Skill 是 Phase 2 子 Skill,职责:
- 通过 Jenkins MCP 触发 ng_diff_new 批量 diff Job 执行
- 读取 diff 结果,依据
test_plan.md中的预期差异定义进行分析 - 识别
expected_diff和unexpected_diff - 生成结构化报告供上游
qa-integration-pipeline决策
本 Skill 自动执行,不中断询问用户。所有交互交由上游
qa-integration-pipeline处理。执行方式:所有外部工具调用均通过 Jenkins MCP 标准工具(
build_item、get_build、jenkins_get_artifacts、jenkins_download_artifact等)进行,不直接执行本地命令。
输入参数
| 参数 | 必填 | 说明 |
|---|---|---|
feature |
✅ | 功能名,用于目录命名 |
host |
✅ | 目标服务地址(ip:port,由 map-spec / qa-integration-pipeline 传入) |
host_baseline |
✅ | 基线服务地址(ip:port,由 map-spec / qa-integration-pipeline 传入) |
test_plan |
✅ | test_plan.md 路径 |
job_name |
❌ | Jenkins diff Job 名称,默认 ng_diff_new |
driver_id |
❌ | 白名单 ID(单组 diff 回退值,默认 580548822047701)。多组 diff 时以 test_plan.experiment_config.groups[].driver_id 为准,不再使用本参数 |
version |
❌ | 请求 version,默认 999 |
biz_type |
❌ | 请求 biz_type,默认 260 |
max_requests |
❌ | diff 最大请求数,默认 2000。Jenkins 参数名为 req_num |
执行步骤
Step 0: 知识库查询(可选)
在执行 diff 分析前,可查询 LLM-Wiki 知识库获取 diff 分析规则和历史 bad case 模式:
POST http://10.190.56.84:8080/search
Content-Type: application/json
{
"collection": "navi-guide-qa-knowledge",
"query": "<feature> diff分析 expected_diff unexpected_diff 判定规则",
"limit": 5
}
查询时机:
- Step 5 分析 bad case 前:查询同类功能的历史预期差异定义和 bad case 模式
- 遇到差异判定疑问时:查询预期差异匹配规则、字段变化方向判定经验
- 多组 diff 实验组/对照组分析时:查询 AB 实验 diff 分析的最佳实践
检索结果应用:
- 参考历史预期差异定义,完善当前 feature 的 expected_diff 判定
- 借鉴历史 bad case 模式,提升 unexpected_diff 识别准确性
Step 1: 前置校验
- 校验参数完整性:
feature、host、host_baseline、test_plan - 校验
test_plan.md存在且可读 - 确认输出目录结构:
<CASE_DIR>/<feature>/
Step 2: 使用 build_item MCP 工具触发 diff
Step 2.1: 触发构建
{
"tool": "build_item",
"arguments": {
"fullname": "<job_name>",
"build_type": "build",
"params": {
"master_ip": "<host_baseline_ip>",
"master_port": "<host_baseline_port>",
"test_ip": "<host_ip>",
"test_port": "<host_port>",
"driver_id": "<driver_id>",
"version": "<version>",
"biztype": "<biz_type>",
"req_num": "<max_requests>"
}
}
}
job_name默认ng_diff_new,可通过输入参数覆盖。
Step 2.2: 获取实际构建号
build_item 返回的是 Queue Item ID,需先调用 get_queue_item 获取实际 build_number:
{
"tool": "get_queue_item",
"arguments": { "item_id": "<build_item返回的Queue ID>" }
}
返回示例:{"build_number": 70, "result": null, ...}
Step 2.3: 监控构建状态
{
"tool": "get_build",
"arguments": {
"fullname": "<job_name>",
"number": "<build_number>"
}
}
轮询直至状态为 SUCCESS、FAILURE 或 UNSTABLE。
Step 2.4: 获取构建日志(如失败)
{
"tool": "get_build_console_tail",
"arguments": {
"fullname": "<job_name>",
"number": "<build_number>",
"max_bytes": 50000
}
}
Step 2.5: 执行后检查
- 构建状态为
SUCCESS→ 继续 Step 3 - 构建状态为
FAILURE/UNSTABLE→ 获取日志,记录错误,返回 FAIL
Step 3: 多组 diff 执行(若 experiment_config 存在)
读取 test_plan.md 中的 experiment_config:
type=none或不存在 → 执行 1 次 diff(Step 2 流程),使用默认driver_idtype=ab_test→ 执行 2 次 diff:- 对照组(
control):driver_id=groups[0].driver_id(对照组白名单,可能为空字符串) - 实验组(
treatment):driver_id=groups[1].driver_id(实验组白名单)
- 对照组(
type=grayscale→ 执行 2 次 diff:- 非白名单组:
driver_id=groups[0].driver_id(通常为空字符串) - 白名单组:
driver_id=groups[1].driver_id
- 非白名单组:
每组 diff 独立执行 Step 2 完整流程(触发 → get_queue_item → 监控 → 获取产物)。
产物目录:按 experiment_config.groups[].name 分组存放
<CASE_DIR>/<feature>/diff/<group_name>/summary.txt<CASE_DIR>/<feature>/diff/<group_name>/diff_details.jsonl<CASE_DIR>/<feature>/diff/<group_name>/bad_case.md<CASE_DIR>/<feature>/diff/<group_name>/expected_diff.txt<CASE_DIR>/<feature>/diff/<group_name>/manifest.json
若为单次 diff,产物直接放在 <CASE_DIR>/<feature>/diff/ 下(无 group_name 子目录)。
多组 diff 汇总:执行完所有组后,在 <CASE_DIR>/<feature>/diff/ 根目录生成汇总产物:
diff/bad_case.md:汇总所有组的 unexpected_diffdiff/manifest.json:汇总所有组的 manifest 摘要(供 Phase 3 data-filter-executor 使用)diff/expected_diff.txt:汇总所有组的 expected_diff
Step 4: 通过 Jenkins MCP 获取并读取 diff 结果
Step 4.1: 获取 artifacts 列表
{
"tool": "jenkins_get_artifacts",
"arguments": {
"fullname": "<job_name>",
"number": "<build_number>"
}
}
Step 4.2: 下载关键 diff 产物
依据 artifacts 列表,下载分析所需的文件:
{
"tool": "jenkins_download_artifact",
"arguments": {
"fullname": "<job_name>",
"number": "<build_number>",
"artifact_path": "ng_diff_new/output/"
}
}
需下载的文件:
| 文件 | artifact 路径 | 说明 |
|---|---|---|
summary.txt |
output/summary.txt |
diff 汇总统计(含接口统计、diff 率、阈值告警) |
{interface}_{field}.txt |
output/ |
按接口+字段分组的 diff 详情文本 |
diff_details.jsonl |
output/diff_details.jsonl |
每条 diff 记录的详细数据(起终点、字段变化、timing) |
duplicate_events.jsonl |
output/duplicate_events.jsonl |
重复触发事件记录 |
route_link_mapping.json |
output/route_link_mapping.json |
起终点坐标与 esw_link_list 映射 |
下载后转为结构化数据,读取
diff_details.jsonl作为 bad case 分析输入。
diff_details.jsonl 单条记录格式:
{
"request_id": "...",
"route": {"origin": "...", "destination": "..."},
"interface": "GetMultiNaviGuide",
"diff_fields": ["ttsContent", "voiceType"],
"direction": "CHANGED",
"master_value": "...",
"test_value": "...",
"timing": {"begin": 100, "end": 200}
}
Step 5: 依据 test_plan 分析 bad case
读取 test_plan 预期差异:
- 从
test_plan.md中提取 4.2 预期差异(Expected Diff) 表格 - 解析每条预期差异:场景ID、字段、基线值、目标值、方向
分析每条 diff 记录:
for diff_record in all_diff_results:
diff_fields = diff_record['diff_fields']
diff_direction = diff_record['direction'] # CHANGED / ADDED / REMOVED / UNCHANGED
# 匹配 test_plan 预期差异
is_expected = match_expected_diff(diff_record, expected_diff_list)
if is_expected:
diff_record['tag'] = 'expected_diff'
else:
diff_record['tag'] = 'unexpected_diff'
匹配规则:
- 字段名匹配(
diff_fields中的字段在预期差异中) - 变化方向匹配(
direction一致) - 两条同时满足 → 判定为
expected_diff
Step 6: 生成报告
6.1 bad_case.md
输出路径:<CASE_DIR>/<feature>/diff/bad_case.md(单次)或 <CASE_DIR>/<feature>/diff/<group_name>/bad_case.md(多组)
# Diff 执行报告 - <feature>
## 执行摘要
| 项目 | 值 |
|------|-----|
| **基线服务** | <host_baseline> |
| **目标服务** | <host> |
| **总请求数** | N |
| **成功处理** | M |
| **成功率** | M/N |
## 差异统计
| 类型 | 数量 | 说明 |
|------|------|------|
| **expected_diff** | X | 符合 test_plan 预期的差异 |
| **unexpected_diff** | Y | 不符合预期的潜在 bad case |
## unexpected_diff 详情
| 序号 | 字段 | 方向 | 基线值 | 目标值 | 说明 |
|------|------|------|--------|--------|------|
| 1 | `field` | `CHANGED` | `old` | `new` | 该字段变化不在 test_plan 预期中 |
## 结论
- unexpected_diff 数量:Y
- 是否存在明显 bad case:[是 / 否]
6.2 expected_diff.txt
输出路径:<CASE_DIR>/<feature>/diff/expected_diff.txt(单次)或 <CASE_DIR>/<feature>/diff/<group_name>/expected_diff.txt(多组)
列出所有 expected_diff 记录,供下游 search-data-diff 使用:
scene_id|field|direction|baseline|target|count
S001|ttsContent|CHANGED|两条独立播报|合并为一条|42
S001|voiceType|CHANGED|NORMAL|MERGE_VOICE|42
Step 7: 返回结果
向 qa-integration-pipeline 返回执行摘要:
{
"status": "success",
"unexpected_diff_count": Y,
"group_results": {
"control": { "unexpected_diff_count": 0 },
"treatment": { "unexpected_diff_count": Y }
},
"bad_case_path": "<CASE_DIR>/<feature>/diff/bad_case.md",
"manifest_path": "<CASE_DIR>/<feature>/diff/manifest.json",
"expected_diff_path": "<CASE_DIR>/<feature>/diff/expected_diff.txt"
}
路径说明:
- 单次 diff:
bad_case_path/manifest_path/expected_diff_path指向diff/根目录下的文件- 多组 diff:上述路径指向根目录下的汇总产物,各组独立产物在
diff/<group_name>/子目录下。qa-integration-pipeline 通过group_results获取各组统计,通过根目录路径获取汇总报告。
产物清单
| 产物 | 路径 | 说明 |
|---|---|---|
| bad case 报告 | <CASE_DIR>/<feature>/diff/bad_case.md |
单次 diff 报告 或 多组 diff 汇总报告 |
| diff 清单 | <CASE_DIR>/<feature>/diff/manifest.json |
单次 diff 清单 或 多组 diff 汇总清单 |
| 预期差异列表 | <CASE_DIR>/<feature>/diff/expected_diff.txt |
单次 diff 预期差异 或 多组 diff 汇总预期差异 |
| 分组 bad case 报告 | <CASE_DIR>/<feature>/diff/<group_name>/bad_case.md |
多组 diff 时各组独立报告 |
| 分组 diff 清单 | <CASE_DIR>/<feature>/diff/<group_name>/manifest.json |
多组 diff 时各组独立清单 |
| 分组预期差异 | <CASE_DIR>/<feature>/diff/<group_name>/expected_diff.txt |
多组 diff 时各组独立预期差异 |
manifest.json 结构说明
单次 diff:
{
"feature": "<feature>",
"diff_type": "single",
"driver_id": "<driver_id>",
"total_requests": 1000,
"diff_count": 120,
"unexpected_diff_count": 0,
"expected_diff_count": 120,
"diff_items": [
{
"request_id": "...",
"coordinate": {"lat": 39.9, "lon": 116.4},
"scene_tag": "...",
"diff_type": "expected"
}
]
}
多组 diff 汇总(根目录 diff/manifest.json):
{
"feature": "<feature>",
"diff_type": "multi_group",
"groups": [
{
"group_name": "control",
"group_type": "control",
"driver_id": "<control_driver_id>",
"manifest_path": "diff/control/manifest.json",
"total_requests": 1000,
"diff_count": 120,
"unexpected_diff_count": 0,
"expected_diff_count": 120
},
{
"group_name": "treatment",
"group_type": "treatment",
"driver_id": "<treatment_driver_id>",
"manifest_path": "diff/treatment/manifest.json",
"total_requests": 1000,
"diff_count": 120,
"unexpected_diff_count": 3,
"expected_diff_count": 117
}
],
"summary": {
"total_requests": 2000,
"total_diff_count": 240,
"total_unexpected_diff_count": 3
}
}
driver_id记录各组实际使用的白名单,空字符串表示该组未设白名单(如对照组)。下游data-filter-executor通过groups[].driver_id即可区分实验组与对照组。
失败处理
| 失败场景 | 处理 |
|---|---|
| Jenkins diff Job 构建失败 | 返回 {"status": "failed", "reason": "Jenkins diff Job 构建失败", "build_url": "...", "log": "..."} |
| Jenkins 连接异常 | 返回 {"status": "failed", "reason": "Jenkins 连接异常"} |
| test_plan.md 不存在 | 返回 {"status": "failed", "reason": "test_plan.md 不存在"} |
| 成功率 < 90% | 返回 {"status": "failed", "reason": "diff 成功率过低", "success_rate": "..."} |
与 qa-integration-pipeline 的协作
qa-integration-pipeline (Phase 2)
└── 调用 diff-executor-and-analyzer
├── 使用 build_item MCP 工具触发 ng_diff_new Job
├── 读取 diff 结果
├── 分析 bad case(expected / unexpected)
└── 返回 unexpected_diff_count
└── qa-integration-pipeline 决策:
- unexpected_diff_count == 0 → 标记 success,继续 Phase 3
- unexpected_diff_count > 0 → 询问用户(A/B/C 选项)Current listing version
1.3.1
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 作为QA集成流水线Phase 2的核心子模块,直接解决diff执行与bad case分析的明确任务痛点
- 显著提升自动化测试效率,具有高价值和高频刚需特性
Highlights
- description清晰描述了核心功能(执行ng_diff_new批量diff、分析expected_diff/unexpected_diff、生成bad_case报告)
- 明确指出了调用方(qa-integration-pipeline Phase 2),边界清晰
Highlights
- Phase/步骤清晰(Step 0-7),有出口条件(Step 7返回结果)
- 含端到端示例(manifest.json结构、bad_case.md模板),frontmatter完整
Highlights
- 工具来源明确(Jenkins MCP标准工具),参数正确
- 覆盖主要异常(构建失败、连接异常、test_plan不存在、成功率过低)
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- 10.190.56.84
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Translation pending; see source documentation.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.