@autotest/agent 0.0.18 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -14
- package/dist/api/types.d.ts +8 -0
- package/dist/autotest-cli.js +1 -1
- package/dist/common/config/config.yaml +4 -2
- package/dist/common/config/types.d.ts +87 -0
- package/dist/common/datetime.d.ts +19 -0
- package/dist/common/dfx/cache_fetch.d.ts +12 -0
- package/dist/common/dfx/client_factory.d.ts +10 -9
- package/dist/common/dfx/context.d.ts +0 -1
- package/dist/common/dfx/index.d.ts +5 -3
- package/dist/common/dfx/recorder.d.ts +13 -1
- package/dist/common/dfx/recorder_sqlite.d.ts +17 -0
- package/dist/common/dfx/recording_fetch.d.ts +2 -2
- package/dist/common/dfx/source.d.ts +1 -0
- package/dist/common/model/custom_model.d.ts +5 -0
- package/dist/core/agent/design_doc/design_doc.d.ts +106 -0
- package/dist/core/agent/report_analyzer_agent/agent.d.ts +6 -1
- package/dist/core/agent/report_analyzer_agent/analysis_progress.d.ts +54 -0
- package/dist/core/agent/report_analyzer_agent/design_tool.d.ts +8 -0
- package/dist/core/agent/report_analyzer_agent/guardrails.d.ts +24 -0
- package/dist/core/agent/report_analyzer_agent/hooks.d.ts +0 -1
- package/dist/core/agent/report_analyzer_agent/index.d.ts +2 -1
- package/dist/core/agent/report_analyzer_agent/mapping.d.ts +1 -1
- package/dist/core/agent/report_analyzer_agent/prompt.d.ts +1 -1
- package/dist/core/agent/report_analyzer_agent/prompts/examples/example_out_of_scope_app_defect.md +13 -0
- package/dist/core/agent/report_analyzer_agent/prompts/examples/example_overturn_executor.md +13 -0
- package/dist/core/agent/report_analyzer_agent/prompts/examples/example_pass_precondition_selfconstruct.md +13 -0
- package/dist/core/agent/report_analyzer_agent/prompts/final_attribution.md +204 -0
- package/dist/core/agent/report_analyzer_agent/prompts/mid_analysis.md +177 -0
- package/dist/core/agent/report_analyzer_agent/report_html_template/_header.d.ts +5 -0
- package/dist/core/agent/report_analyzer_agent/report_html_template/_scripts.d.ts +1 -0
- package/dist/core/agent/report_analyzer_agent/report_html_template/_styles.d.ts +1 -0
- package/dist/core/agent/report_analyzer_agent/report_html_template/_summary.d.ts +2 -0
- package/dist/core/agent/report_analyzer_agent/report_html_template/_trace.d.ts +14 -0
- package/dist/core/agent/report_analyzer_agent/report_html_template/_utils.d.ts +20 -0
- package/dist/core/agent/report_analyzer_agent/report_html_template/_verdict.d.ts +2 -0
- package/dist/core/agent/report_analyzer_agent/report_html_template/index.d.ts +8 -0
- package/dist/core/agent/report_analyzer_agent/report_html_template/render.d.ts +6 -0
- package/dist/core/agent/report_analyzer_agent/report_markdown.d.ts +9 -0
- package/dist/core/agent/report_analyzer_agent/report_writer.d.ts +16 -1
- package/dist/core/agent/report_analyzer_agent/stage_contracts.d.ts +6 -5
- package/dist/core/agent/report_analyzer_agent/tools.d.ts +6 -0
- package/dist/core/agent/report_analyzer_agent/trace_extract.d.ts +49 -0
- package/dist/core/agent/report_analyzer_agent/types.d.ts +5 -1
- package/dist/core/agent/rewrite_agent/agent.d.ts +2 -0
- package/dist/core/agent/rewrite_agent/prompts/rewriter_v1.0.md +224 -168
- package/dist/core/agent/rewrite_agent/result_writer.d.ts +22 -0
- package/dist/core/agent/rewrite_agent/types.d.ts +4 -0
- package/dist/core/agent/single_agent/agent.d.ts +17 -7
- package/dist/core/agent/single_agent/context_builder.d.ts +61 -0
- package/dist/core/agent/single_agent/hook_manager.d.ts +15 -2
- package/dist/core/agent/single_agent/llm_helper.d.ts +84 -0
- package/dist/core/agent/single_agent/processors.d.ts +22 -0
- package/dist/core/agent/single_agent/report_hook.d.ts +22 -0
- package/dist/core/agent/single_agent/subagent_manager.d.ts +3 -4
- package/dist/core/agent/types.d.ts +5 -0
- package/dist/core/device/hdc/index.d.ts +1 -1
- package/dist/core/device/hdc/input.d.ts +7 -0
- package/dist/core/device/hdc/screenshot.d.ts +2 -0
- package/dist/core/mcp/base_adapter.d.ts +5 -0
- package/dist/core/mcp/harmony_hdc_adapter.d.ts +4 -0
- package/dist/core/mcp/mcp_tools.d.ts +1 -0
- package/dist/core/mcp/types.d.ts +2 -0
- package/dist/core/prompt/templates/single/single_v1.0.md +18 -18
- package/dist/core/prompt/templates/single/single_v2.0.md +31 -77
- package/dist/core/prompt/templates/single/single_v2.0_0_1000.md +6 -5
- package/dist/core/prompt/templates/single/single_v2.0_eco.md +14 -3
- package/dist/core/prompt/templates/single/single_v2.0_graph.md +244 -0
- package/dist/core/prompt/templates/single/single_v3.0.md +5 -5
- package/dist/generated/version.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/loop/orchestrator.d.ts +6 -0
- package/dist/loop/types.d.ts +4 -0
- package/dist/prompts/rewriter_v1.0.md +224 -168
- package/dist/reporter/generator.d.ts +12 -1
- package/dist/reporter/types.d.ts +45 -3
- package/dist/tools/batch_runner.d.ts +34 -1
- package/dist/tools/batch_runner.js +1 -1
- package/dist/tools/case_runner/runner.js +1 -1
- package/dist/tools/config/config_tool.js +1 -1
- package/dist/tools/prompt_compare/compare_runner.js +1 -1
- package/dist/tools/token_comparison/comparator.d.ts +74 -0
- package/package.json +10 -4
- package/scripts/bundle-obfuscate.js +111 -0
- package/scripts/gen-native-b64.js +51 -0
- package/scripts/gen_analysis_report.js +724 -0
- package/dist/core/agent/layered_agent/ability_helper.d.ts +0 -35
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared timestamp helper for the reporter layer.
|
|
3
|
+
*
|
|
4
|
+
* Node's `Date.toISOString()` emits a UTC timestamp with a trailing 'Z'
|
|
5
|
+
* (e.g. `2024-01-15T06:30:45.123Z`). The Python reference uses
|
|
6
|
+
* `datetime.now().isoformat()` / `strftime(...)`, which produce a *local naive*
|
|
7
|
+
* timestamp (no 'Z'). To keep serialized output aligned with the Python reports,
|
|
8
|
+
* emit local naive timestamps everywhere via this helper instead of
|
|
9
|
+
* `new Date().toISOString()`.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Local naive ISO-8601 timestamp (no trailing 'Z', local timezone) — mirrors
|
|
13
|
+
* Python `datetime.now().isoformat()` (local naive).
|
|
14
|
+
*
|
|
15
|
+
* @param includeMs When true (default) include millisecond precision (the closest
|
|
16
|
+
* JS analog to Python's microsecond `isoformat()`); when false truncate to
|
|
17
|
+
* seconds (mirrors `isoformat(timespec="seconds")`).
|
|
18
|
+
*/
|
|
19
|
+
export declare function localIso(includeMs?: boolean): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FetchLike } from './recording_fetch';
|
|
2
|
+
export interface CacheFetchOptions {
|
|
3
|
+
/** 缓存 TTL(毫秒),默认 5 分钟。 */
|
|
4
|
+
ttlMs?: number;
|
|
5
|
+
/** 最大条目数,默认 1000(超限驱逐最旧,Map 保持插入序近似 LRU)。 */
|
|
6
|
+
maxEntries?: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 包一层 GET 缓存到 baseFetch。仅缓存 200 OK 的 GET 响应(idempotent 安全)。
|
|
10
|
+
* POST/流式/非 200 一律穿透(不缓存)。
|
|
11
|
+
*/
|
|
12
|
+
export declare function createCacheFetch(baseFetch: FetchLike, opts?: CacheFetchOptions): FetchLike;
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { type OpenAIProvider } from '@ai-sdk/openai';
|
|
2
2
|
import type { AppConfig } from '../config/types';
|
|
3
|
-
import {
|
|
3
|
+
import type { LLMTrafficRecorderLike } from './recorder';
|
|
4
4
|
import { type FetchLike } from './recording_fetch';
|
|
5
|
-
export interface ModelSettings {
|
|
6
|
-
temperature: number;
|
|
7
|
-
topP: number;
|
|
8
|
-
frequencyPenalty: number;
|
|
9
|
-
maxTokens: number;
|
|
10
|
-
}
|
|
11
5
|
export interface CreateLLMClientOptions {
|
|
12
6
|
runId?: string | null;
|
|
13
7
|
reportDir?: string;
|
|
14
8
|
maxRecords?: number;
|
|
9
|
+
/** t32: apiRecord 独立开关——false 时跳过 recorder/recordingFetch(默认读 config.agent.unified.apirec)。 */
|
|
10
|
+
apiRecord?: boolean;
|
|
11
|
+
/** t32: enableCache 独立开关——true 时包 cacheFetch 层(GET 缓存,默认 false,对齐 Python enable_cache 默认语义降级为客户端侧)。 */
|
|
12
|
+
enableCache?: boolean;
|
|
13
|
+
/** t32: 缓存 TTL(毫秒),默认 5 分钟。 */
|
|
14
|
+
cacheTtlMs?: number;
|
|
15
15
|
}
|
|
16
16
|
export interface LLMClientBundle {
|
|
17
17
|
provider: OpenAIProvider;
|
|
18
|
-
|
|
19
|
-
recorder:
|
|
18
|
+
/** t31: apiRecord 关时为 null(无录制);开时为 LLMTrafficRecorderSQLite(SQLite 落盘)。 */
|
|
19
|
+
recorder: LLMTrafficRecorderLike | null;
|
|
20
|
+
/** transport 链最终 fetch(cache→record→base 的最外层),传给 provider/LLMCaller。 */
|
|
20
21
|
recordingFetch: FetchLike;
|
|
21
22
|
}
|
|
22
23
|
export declare function createLLMClient(config: AppConfig, source: string, options?: CreateLLMClientOptions): LLMClientBundle;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export { LLMTrafficRecorder, type LLMTrafficRecord, type RecordParams, type RecordQueryOptions } from './recorder';
|
|
1
|
+
export { LLMTrafficRecorder, type LLMTrafficRecord, type RecordParams, type RecordQueryOptions, type LLMTrafficRecorderLike } from './recorder';
|
|
2
|
+
export { LLMTrafficRecorderSQLite } from './recorder_sqlite';
|
|
2
3
|
export { createRecordingFetch, type FetchLike } from './recording_fetch';
|
|
3
|
-
export {
|
|
4
|
+
export { createCacheFetch, type CacheFetchOptions } from './cache_fetch';
|
|
5
|
+
export { setStepNumber, clearStepNumber } from './context';
|
|
4
6
|
export { RecordingSource } from './source';
|
|
5
|
-
export { createLLMClient, type
|
|
7
|
+
export { createLLMClient, type CreateLLMClientOptions, type LLMClientBundle, } from './client_factory';
|
|
@@ -38,7 +38,19 @@ export interface RecordParams {
|
|
|
38
38
|
streamComplete?: boolean;
|
|
39
39
|
parentRecordId?: number | null;
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
/** t31: 录制器公共接口(JSON 版 LLMTrafficRecorder + SQLite 版 LLMTrafficRecorderSQLite 共同实现)。
|
|
42
|
+
* recording_fetch/client_factory 依赖此接口而非具体类,便于 SQLite 替换。 */
|
|
43
|
+
export interface LLMTrafficRecorderLike {
|
|
44
|
+
initStore(): void;
|
|
45
|
+
record(params: RecordParams): number | null;
|
|
46
|
+
recordRequest(request: Record<string, unknown>): void;
|
|
47
|
+
recordResponse(response: Record<string, unknown>): void;
|
|
48
|
+
getRecords(options?: RecordQueryOptions): LLMTrafficRecord[];
|
|
49
|
+
query(filter?: Record<string, unknown>): LLMTrafficRecord[];
|
|
50
|
+
getRecordCount(): number;
|
|
51
|
+
clear(): void;
|
|
52
|
+
}
|
|
53
|
+
export declare class LLMTrafficRecorder implements LLMTrafficRecorderLike {
|
|
42
54
|
private dbPath;
|
|
43
55
|
private maxRecords;
|
|
44
56
|
private records;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { LLMTrafficRecord, RecordQueryOptions, RecordParams, LLMTrafficRecorderLike } from './recorder';
|
|
2
|
+
export declare class LLMTrafficRecorderSQLite implements LLMTrafficRecorderLike {
|
|
3
|
+
private dbPath;
|
|
4
|
+
private maxRecords;
|
|
5
|
+
private initialized;
|
|
6
|
+
private db;
|
|
7
|
+
constructor(dbPath?: string, maxRecords?: number);
|
|
8
|
+
initStore(): void;
|
|
9
|
+
record(params: RecordParams): number | null;
|
|
10
|
+
recordRequest(request: Record<string, unknown>): void;
|
|
11
|
+
recordResponse(response: Record<string, unknown>): void;
|
|
12
|
+
private cleanupOldRecords;
|
|
13
|
+
getRecords(options?: RecordQueryOptions): LLMTrafficRecord[];
|
|
14
|
+
query(filter?: Record<string, unknown>): LLMTrafficRecord[];
|
|
15
|
+
getRecordCount(): number;
|
|
16
|
+
clear(): void;
|
|
17
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { LLMTrafficRecorderLike } from './recorder';
|
|
2
2
|
export type FetchLike = typeof globalThis.fetch;
|
|
3
|
-
export declare function createRecordingFetch(originalFetch: FetchLike, recorder:
|
|
3
|
+
export declare function createRecordingFetch(originalFetch: FetchLike, recorder: LLMTrafficRecorderLike, source: string, runId?: string | null): FetchLike;
|
|
@@ -12,6 +12,9 @@ export interface LLMCallOptions {
|
|
|
12
12
|
modelConfig: ModelConfig;
|
|
13
13
|
extraBody?: Record<string, unknown>;
|
|
14
14
|
tools?: Record<string, unknown>;
|
|
15
|
+
/** Abort signal (linked to stopTask). When aborted, generateText cancels the
|
|
16
|
+
* in-flight HTTP request promptly instead of waiting for the full response. */
|
|
17
|
+
abortSignal?: AbortSignal;
|
|
15
18
|
}
|
|
16
19
|
export interface LLMCallResult {
|
|
17
20
|
text: string;
|
|
@@ -34,6 +37,8 @@ export interface LLMCallMessagesOptions {
|
|
|
34
37
|
tools?: Record<string, unknown>;
|
|
35
38
|
modelConfig: ModelConfig;
|
|
36
39
|
extraBody?: Record<string, unknown>;
|
|
40
|
+
/** Abort signal (linked to stopTask). See LLMCallOptions.abortSignal. */
|
|
41
|
+
abortSignal?: AbortSignal;
|
|
37
42
|
}
|
|
38
43
|
export declare class LLMCaller {
|
|
39
44
|
private recordingFetch?;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DesignDoc 设计稿文档解析模块(单文件解析 + 目录输入) — 对齐 Python
|
|
3
|
+
* core/agent/design_doc/design_doc.py。
|
|
4
|
+
*
|
|
5
|
+
* 解析 Markdown 图文混合设计稿文档,提取:
|
|
6
|
+
* - fullText:全部文字说明(保留原始章节层次)
|
|
7
|
+
* - sectionIndex:{section_id: 标题} 映射(供注入 prompt)
|
|
8
|
+
* - imageIndex:{section_id: [图片绝对路径]} 索引
|
|
9
|
+
* - sections:有序片段列表(含 id/file/title/text/images)
|
|
10
|
+
* - files:实际加载的文件列表
|
|
11
|
+
* - fileIndex:doc_id → 文档元数据/文本 的索引(供 get_design_doc 拉取)
|
|
12
|
+
* - skippedFiles:因扩展名不支持而跳过的文件列表(相对路径)
|
|
13
|
+
*
|
|
14
|
+
* 支持两种输入模式:
|
|
15
|
+
* - 单文件输入:DesignDoc.load("/path/to/design.md"),section_id 无文件前缀。
|
|
16
|
+
* - 目录输入:DesignDoc.load("/path/to/dir"),递归遍历所有 .md/.markdown/.txt 及
|
|
17
|
+
* 独立图片文件(.png/.jpg 等),多文件 section_id 使用 file::section 命名空间
|
|
18
|
+
* (如 homepage::layout)。
|
|
19
|
+
*
|
|
20
|
+
* C1 合规:仅使用纯标准库(fs/path)+ logger,不 import loop/ 类型。
|
|
21
|
+
*/
|
|
22
|
+
export interface DesignSection {
|
|
23
|
+
id: string;
|
|
24
|
+
file: string;
|
|
25
|
+
title: string;
|
|
26
|
+
text: string;
|
|
27
|
+
images: string[];
|
|
28
|
+
}
|
|
29
|
+
export interface FileIndexEntry {
|
|
30
|
+
id: string;
|
|
31
|
+
filename: string;
|
|
32
|
+
format: string;
|
|
33
|
+
title: string;
|
|
34
|
+
section_titles?: string[];
|
|
35
|
+
char_count?: number;
|
|
36
|
+
image_count?: number;
|
|
37
|
+
preview?: string;
|
|
38
|
+
full_text?: string;
|
|
39
|
+
prefix?: string;
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
}
|
|
42
|
+
export interface DesignDocInit {
|
|
43
|
+
sectionIndex?: Record<string, string>;
|
|
44
|
+
imageIndex?: Record<string, string[]>;
|
|
45
|
+
sections?: DesignSection[];
|
|
46
|
+
files?: string[];
|
|
47
|
+
fileIndex?: FileIndexEntry[];
|
|
48
|
+
skippedFiles?: string[];
|
|
49
|
+
}
|
|
50
|
+
/** 将标题 slug 化为 section_id(保留中文/字母/数字/_-,其余→_,去首尾_,小写;空→"section")。 */
|
|
51
|
+
export declare function slugify(title: string): string;
|
|
52
|
+
/** 为 base 生成同文件内唯一 section_id(首次=base,重复=base_2/3…)。 */
|
|
53
|
+
export declare function uniqueId(base: string, used: Record<string, number>): string;
|
|
54
|
+
/** 将图片引用路径解析为绝对路径(相对路径按 baseDir 解析,normpath 归一)。 */
|
|
55
|
+
export declare function resolveImages(rawPaths: string[], baseDir: string): string[];
|
|
56
|
+
/**
|
|
57
|
+
* 解析 Markdown 设计稿文件为 DesignDoc(含章节与图片提取)。
|
|
58
|
+
* @param filePath 设计稿文件绝对路径(图片路径基准目录)。
|
|
59
|
+
* @param text 文件原始文本内容。
|
|
60
|
+
* @param used 可选全局 id 去重计数器(目录模式跨文件共享)。
|
|
61
|
+
*/
|
|
62
|
+
export declare function parseMarkdownFile(filePath: string, text: string, used?: Record<string, number>): DesignDoc;
|
|
63
|
+
/** 解析单个设计稿文件(.md/.markdown 走 Markdown 解析;.txt/.text 纯文本;其它/图片跳过返回 null)。 */
|
|
64
|
+
export declare function parseSingleFile(filePath: string, enableImages?: boolean): DesignDoc | null;
|
|
65
|
+
/** 递归遍历目录,合并所有支持的文件为单一 DesignDoc(file::section 命名空间)。 */
|
|
66
|
+
export declare function parseDirectory(dirPath: string, enableImages?: boolean): DesignDoc | null;
|
|
67
|
+
/** 注入提示词时附加的「无需调用工具读取设计稿」声明(设计稿全文已在 prompt 内)。 */
|
|
68
|
+
export declare const NO_DOC_READ_HINT = "\uFF08\u8BBE\u8BA1\u7A3F\u5168\u6587\u5DF2\u5728\u4E0A\u65B9\u63D0\u4F9B\uFF0C\u65E0\u9700\u8C03\u7528\u5DE5\u5177\u8BFB\u53D6\uFF0C\u76F4\u63A5\u5F15\u7528\u5373\u53EF\u3002\uFF09";
|
|
69
|
+
/**
|
|
70
|
+
* 格式化设计稿为可注入 prompt 的文本(先走 prompt 内注入最小可用路径)。
|
|
71
|
+
* 无 doc 或 fullText 为空返回空串;否则返回 full_text + NO_DOC_READ_HINT。
|
|
72
|
+
*/
|
|
73
|
+
export declare function formatDesignDocForPrompt(doc: DesignDoc | null | undefined): string;
|
|
74
|
+
export declare class DesignDoc {
|
|
75
|
+
sourcePath: string;
|
|
76
|
+
fullText: string;
|
|
77
|
+
sectionIndex: Record<string, string>;
|
|
78
|
+
imageIndex: Record<string, string[]>;
|
|
79
|
+
sections: DesignSection[];
|
|
80
|
+
files: string[];
|
|
81
|
+
fileIndex: FileIndexEntry[];
|
|
82
|
+
skippedFiles: string[];
|
|
83
|
+
constructor(sourcePath: string, fullText: string, init?: DesignDocInit);
|
|
84
|
+
/** 转 plain dict(深拷贝避免共享可变引用),供注入到归因/改写 Agent。 */
|
|
85
|
+
toDict(): Record<string, unknown>;
|
|
86
|
+
/**
|
|
87
|
+
* 加载设计稿文档(单文件 .md/.markdown/.txt 或目录)。
|
|
88
|
+
* @param p 路径;null/空返回 null(不报错)。
|
|
89
|
+
* @param enableImages 是否启用图片索引(False 净化 image_index + 剔除图片条目,image_count 保留)。
|
|
90
|
+
*/
|
|
91
|
+
static load(p: string | null | undefined, enableImages?: boolean): DesignDoc | null;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* 需求设计稿按环节注入开关(对齐 Python orchestrator.py design_doc_scope)。
|
|
95
|
+
* - 'attribution':仅归因侧注入
|
|
96
|
+
* - 'rewrite':仅改写侧注入
|
|
97
|
+
* - 'both':两侧都注入(默认)
|
|
98
|
+
* 无效/空值回落 'both'(与 Python __main__.py 一致:非法值告警后回退 both)。
|
|
99
|
+
*/
|
|
100
|
+
export type DesignDocScope = 'attribution' | 'rewrite' | 'both';
|
|
101
|
+
/** 归一化 scope 字符串为合法 DesignDocScope(空/非法 → 'both')。 */
|
|
102
|
+
export declare function normalizeDesignDocScope(s?: string | null): DesignDocScope;
|
|
103
|
+
/** scope 是否允许归因侧注入。 */
|
|
104
|
+
export declare function scopeAllowsAttribution(s: DesignDocScope): boolean;
|
|
105
|
+
/** scope 是否允许改写侧注入。 */
|
|
106
|
+
export declare function scopeAllowsRewrite(s: DesignDocScope): boolean;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import type { ModelConfig, AppConfig } from '../../../common/config/types';
|
|
2
2
|
import { type ReportData } from './data_loader';
|
|
3
3
|
import { AnalyzerOutput } from './types';
|
|
4
|
+
import type { DesignDoc } from '../design_doc/design_doc';
|
|
4
5
|
export declare class ReportAnalyzerAgent {
|
|
5
6
|
private modelConfig;
|
|
6
7
|
private appConfig;
|
|
7
8
|
private dataLoader;
|
|
8
9
|
private reportWriter;
|
|
9
10
|
private hooks;
|
|
10
|
-
|
|
11
|
+
/** t29: 设计稿文本(formatDesignDocForPrompt 产出,注入 buildInitialInput attribution scope)。 */
|
|
12
|
+
private designDoc;
|
|
13
|
+
/** D3: 设计稿对象(DesignDoc.load 产出,供 get_design_doc/get_design_image 工具拉取)。 */
|
|
14
|
+
private designDocObj;
|
|
15
|
+
constructor(config: ModelConfig, appConfig?: AppConfig, designDoc?: string, designDocObj?: DesignDoc | null);
|
|
11
16
|
run(reportDir: string): Promise<AnalyzerOutput>;
|
|
12
17
|
runFromData(reportData: ReportData, reportDir?: string): Promise<AnalyzerOutput>;
|
|
13
18
|
private precheck;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 归因分析增量进度跟踪器(过程态实时落盘通道) —
|
|
3
|
+
*
|
|
4
|
+
* AnalysisProgressTracker 在分析运行期间按 turn 级增量把过程态 JSON 全量重写到
|
|
5
|
+
* analysis/analysis_result.json(state=running),供运行中的消费方实时读取;
|
|
6
|
+
* 分析结束后由 ReportWriter.write 终态覆写同一文件(state=completed|error,归档)。
|
|
7
|
+
* 同一文件身份两种时态,state 字段是时态标记——归档/消费分离:运行中读方不能假设
|
|
8
|
+
* 文件完整,须对半写窗口容错(JSON 解析失败视为无数据;本类 flush 全量重写非 append)。
|
|
9
|
+
*
|
|
10
|
+
* port of Python report_analyzer_agent/analysis_progress.py
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* 增量过程态落盘通道:turn 级 flush 全量重写 state=running JSON。
|
|
14
|
+
*
|
|
15
|
+
* report_dir 为 analysis 子目录(agent 接线时传 {report_path}/analysis/);null 时
|
|
16
|
+
* 全接口 no-op(快路径/PASS/precheck 场景不产生任何文件)。
|
|
17
|
+
*/
|
|
18
|
+
export declare class AnalysisProgressTracker {
|
|
19
|
+
private reportDir;
|
|
20
|
+
private readonly taskDescription;
|
|
21
|
+
private readonly taskResultStatus;
|
|
22
|
+
private stage;
|
|
23
|
+
private attempt;
|
|
24
|
+
private retryReasons;
|
|
25
|
+
private trace;
|
|
26
|
+
private screenshotCalls;
|
|
27
|
+
/** 失败轮 trace 归档:attempt 递增时归档前轮 trace(key=attempt 序号),供重试 hint 与事后排障;
|
|
28
|
+
* 终态 flush 只写成功轮 trace(评审锁定语义)。 */
|
|
29
|
+
failedAttempts: Record<number, Array<Record<string, unknown>>>;
|
|
30
|
+
private flushFailures;
|
|
31
|
+
constructor(reportDir: string | null, opts?: {
|
|
32
|
+
taskDescription?: string;
|
|
33
|
+
taskResultStatus?: string;
|
|
34
|
+
});
|
|
35
|
+
/**
|
|
36
|
+
* 阶段切换/重试标记,并立即刷新过程态 JSON。
|
|
37
|
+
*
|
|
38
|
+
* attempt 递增表示重跑两段(guardrail 触发后的整轮重试),已累积的 trace 先归档到
|
|
39
|
+
* failedAttempts 再清空(失败轮输出不无痕丢失);同 attempt 内段切换
|
|
40
|
+
* (mid_analysis → final_attribution)保留 trace。retryReasons 显式传入时更新,缺省时沿用当前值。
|
|
41
|
+
*/
|
|
42
|
+
markStage(stage: string, attempt: number, retryReasons?: string[]): void;
|
|
43
|
+
/**
|
|
44
|
+
* 追加一条 trace 条目并立即 flush(增量落盘)。
|
|
45
|
+
* screenshotCalls 替换而非累加——过程态 JSON 只保留最新快照。
|
|
46
|
+
*/
|
|
47
|
+
appendTurn(stage: string, turnItem: Record<string, unknown>, screenshotCalls: number[]): void;
|
|
48
|
+
/**
|
|
49
|
+
* 全量重写过程态 JSON(state=running),写失败静默降级不阻断。
|
|
50
|
+
* 首次失败 warning、连续 ≥FLUSH_ERROR_THRESHOLD 次 upgrade error(仍不中断分析主流程);
|
|
51
|
+
* flush 成功时计数归零。全量重写(非 append)由读方对半写窗口容错覆盖。
|
|
52
|
+
*/
|
|
53
|
+
flush(): void;
|
|
54
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AnalyzerContext } from './types';
|
|
2
|
+
export interface DesignToolResult {
|
|
3
|
+
text: string;
|
|
4
|
+
}
|
|
5
|
+
/** 加载设计稿指定章节的设计图,用于归因时对照 UX 设计意图。 */
|
|
6
|
+
export declare function getDesignImage(ctx: AnalyzerContext, sectionId: string, desc?: string): Promise<DesignToolResult>;
|
|
7
|
+
/** 获取指定需求文档的全文,用于归因时对照需求描述与设计意图。 */
|
|
8
|
+
export declare function getDesignDoc(ctx: AnalyzerContext, docId: string, desc?: string): Promise<DesignToolResult>;
|
|
@@ -4,5 +4,29 @@ export interface GuardrailResult {
|
|
|
4
4
|
tripwireTriggered: boolean;
|
|
5
5
|
outputInfo: Record<string, unknown>;
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* 从 evidence 文本中提取声称截图分析的步骤号集合。
|
|
9
|
+
* 两条通道:
|
|
10
|
+
* 1. 结构化主通道:[截图:步骤N] / [截图:步骤N-M] — 正向匹配区间展开
|
|
11
|
+
* 2. 兜底通道:SCREENSHOT_CLAIM_PATTERN 命中的条目,步骤号提取同支持区间展开
|
|
12
|
+
* structuredOnly=true 时仅走结构化主通道(guardrail tripwire 校验用——结构化标注是
|
|
13
|
+
* Agent 主动的溯源声明;自然语言兜底通道含对比引用/区间表述,只用于 warning 不做硬校验)。
|
|
14
|
+
*/
|
|
15
|
+
export declare function extractScreenshotSteps(ev: string, structuredOnly?: boolean): Set<number>;
|
|
16
|
+
export interface ConclusionOverlap {
|
|
17
|
+
lcsRatioReason: number;
|
|
18
|
+
lcsRatioResult: number;
|
|
19
|
+
ngram4Overlap: number;
|
|
20
|
+
topSharedPhrases: Array<{
|
|
21
|
+
length: number;
|
|
22
|
+
text: string;
|
|
23
|
+
}>;
|
|
24
|
+
hit: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 计算 reason 与 result_text 的结论重叠度指标(纯函数,无 IO/LLM/网络)。
|
|
28
|
+
* 组合阈值(AND):4-gram ≥ 0.44 且 LCS/reason ≥ 0.84 → hit=true(仅用于 warning 软启动,永不升级 tripwire)。
|
|
29
|
+
*/
|
|
30
|
+
export declare function computeConclusionOverlap(reason: string, resultText: string): ConclusionOverlap;
|
|
7
31
|
export declare function validateOutput(context: AnalyzerContext, output: RootCauseResult): Promise<GuardrailResult>;
|
|
8
32
|
export declare function validateProcess(context: AnalyzerContext, output: RootCauseResult): Promise<GuardrailResult>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { AnalyzerContext, PendingImage } from './types';
|
|
2
2
|
export declare class AnalyzerHooks {
|
|
3
|
-
injectStageContract(context: AnalyzerContext): string;
|
|
4
3
|
drainPendingImages(context: AnalyzerContext): PendingImage[];
|
|
5
4
|
clearPendingImages(context: AnalyzerContext): void;
|
|
6
5
|
resetStageState(context: AnalyzerContext): void;
|
|
@@ -11,6 +11,7 @@ export { mapResultToOutput, createErrorOutput, createPrecheckOutput } from './ma
|
|
|
11
11
|
export { parseRootCauseResult, parseMarkdownToDict } from './parse';
|
|
12
12
|
export { getStepScreenshot } from './tools';
|
|
13
13
|
export type { ScreenshotToolResult } from './tools';
|
|
14
|
+
export { getDesignDoc, getDesignImage } from './design_tool';
|
|
15
|
+
export type { DesignToolResult } from './design_tool';
|
|
14
16
|
export { AnalyzerHooks } from './hooks';
|
|
15
17
|
export { MAIN_AGENT_PROMPT } from './prompt';
|
|
16
|
-
export { selectKeySteps, expandWithContext, type StepVerdict } from './key_steps_builder';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnalyzerOutput, type RootCauseResult } from './types';
|
|
2
2
|
import type { ReportData } from './data_loader';
|
|
3
3
|
export declare function mapResultToOutput(result: RootCauseResult, reportData: ReportData, modelUsed: string, duration: number, llmCalls: number): AnalyzerOutput;
|
|
4
|
-
export declare function createErrorOutput(reportDir: string, errorMsg: string, modelUsed: string, duration: number): AnalyzerOutput;
|
|
4
|
+
export declare function createErrorOutput(reportDir: string, errorMsg: string, modelUsed: string, duration: number, initialInputText?: string): AnalyzerOutput;
|
|
5
5
|
export declare function createPrecheckOutput(reportData: ReportData, reason: string, modelUsed: string, duration: number): AnalyzerOutput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const MAIN_AGENT_PROMPT = "# Role\n\nYou are a senior QA analyst responsible for reviewing automated test reports, judging whether the test Agent's PASS/FAIL conclusion is accurate, and determining who caused the failure.\n\n# Task\n\nReview the test report. By analyzing the Agent's execution process and viewing screenshots, determine who caused the test failure, and based on that judge whether the original conclusion is accurate.\n\n# Thinking Process\n\n**Hard constraint**: Complete each phase in one pass; do not oscillate between phases. Evaluate all 5 attribution layers at once; do not repeatedly reconsider with \"But wait/Actually\". Once you move to the next phase, do not modify the previous phase's conclusion.\n\n## Fact Analysis (no attribution conclusions allowed)\n\nFirst clarify the task intent, then record objective facts step by step. **This phase forbids any attribution conclusions** -- only record \"what was observed\", do not judge \"who caused it\".\n\n1. **Task intent**: One sentence summarizing what function/scenario the task is meant to verify.\n2. **Step-by-step facts**: Record objective observations per step, one sentence each referencing the step number/evidence:\n - What operation did the Agent perform at each step\n - What did the Agent observe at each step (quote key sentences from the thinking)\n - What did the App actually do at each step (what was shown on the interface)\n - What did the test case expect at each step\n - What causal relationships exist between steps; which step is the key turning point\n - Is the Agent's observation self-consistent (any contradictions)\n - Did the Agent ignore evidence contradicting the conclusion\n\n**In this phase, call get_step_screenshot to obtain screenshot evidence**:\n- First output the suspected issues and step numbers that need screenshot review in the text analysis\n- Then call the tool to verify the suspicions (each call returns two screenshots: observed = what the Agent saw at decision time, before_action = the page before execution; compare the two to detect whether the page changed after the Agent observed it, e.g. carousel auto-switch -> operation lag)\n- Append the facts observed from screenshots to the step-by-step facts\n\n**Screenshot element interpretation guide**:\nElements in a screenshot may be real UI (popups, buttons, tab bars) or part of the content (post covers, screenshots inside cards, video frames). When interpreting:\n1. Do not assume an element is one type -- first observe appearance features (position, style, relationship with surrounding elements) and context\n2. When an element \"looks like\" some UI but appears in an unusual location, consider whether it might be part of the content\n\n**Analysis should be concise and focused**: First locate the 1-2 most suspicious steps, then call the tool to verify; do not make lengthy derivations.\n\n**Forbidden**:\n- No attribution conclusions (\"this is an Agent issue\" / \"this is an App bug\", etc.)\n- No \"But wait/Actually\" repeated reconsideration\n- No cross-step jumping reasoning\n\n## 5-Layer Equal Attribution (one-time evaluation, no repetition)\n\nBased on the objective facts recorded in the fact analysis phase, evaluate all 5 layers equally at once, **with no preset priority**. Choose the root cause by **evidence strength**: objective evidence (screenshot directly confirms a layer is wrong) > inferred evidence (LLM speculation). Choose the layer with objective evidence; when multiple layers have objective evidence, choose the more direct/abundant one; when only inference with no objective evidence exists, judge \"Inconclusive\".\n\nEvaluate these 5 layers at once:\n\n1. **App behavior**: What the App \"should do\" vs \"actually did\". **Only look at whether the app functionality/behavior is correct** (not whether the Agent operated correctly, not whether the test case expectation is reasonable)\n2. **Test case expectation**: Whether the expectation itself is reasonable (unrealizable / expectation that should not exist). **Only look at expectation reasonableness** (not Agent/app)\n3. **Test case steps**: Whether the step description is clear (can it correspond to the interface). **Only look at description clarity** (not Agent understanding)\n4. **Environment**: Whether data/account/device/network are satisfied\n5. **Agent execution**: Whether the Agent's understanding/operation is correct (identified the right element / clicked the right position / followed the steps). **Only look at Agent behavior** (not app response)\n\n**Evaluate each layer independently (do not be biased by screenshots)**:\n1. Each layer must independently conclude \"problem / no problem\" -- regardless of whether there are screenshots, no layer can be skipped\n2. Screenshot evidence and logical reasoning are equal -- screenshots are one form of evidence, logical reasoning is also evidence. A layer with screenshots is not prioritized over one without\n3. Having screenshot evidence does not mean that layer is the root cause -- the phenomenon shown in the screenshot may be the result (app/Agent), the root cause may be a layer requiring logical reasoning (test case expectation / step reasonableness). After viewing screenshots still evaluate each layer independently\n\n**Phenomenon vs root cause**: Phenomena (app no response / wrong jump / not matching expectation) are results, not root causes. Root cause = the layer with objective evidence confirming \"this layer is wrong\". E.g.: screenshot confirms Agent coordinate offset (Agent objectively wrong) + app no response (phenomenon) -> Agent has objective evidence, judge Agent. Distinguish phenomenon from root cause by evidence strength, not layer order.\n\n**Key distinction**: Do not simply compare surface differences between \"thinking text\" and \"MCP call\" to judge operation errors. You must deeply understand the operation's contextual intent:\n- An Agent calling wait/swipe etc. inconsistent with the thinking text, if it is a reasonable strategic behavior (waiting for page load, swiping to find a target element), and the final direction is correct, this is a strategic operation, not an operation error\n- Only when the Agent's operation caused a clear, uncorrectable wrong result (clicked the wrong key position, skipped the core verification step, judgment logic has a flaw), judge it as an Agent issue\n\n**Select the main root cause at once**: Choose the main root cause by evidence strength (objective > inferred); when multiple objective evidences exist choose the more direct/abundant one. No \"medium\" leeway. If multiple layers all have problems, give the primary and secondary root causes.\n\n**Forbidden**:\n- No \"But wait/Actually\" repeated reconsideration (e.g. \"might be A... but wait could also be B... actually still A\")\n- No oscillating between the 5 layers -- evaluate all layers at once, select directly\n\n## Verification (one-time)\n\nReverse-verify the determined root cause, complete in one pass:\n\n- **Evidence sufficiency**:\n - Judge App issue -> does the screenshot or Agent observation directly show the bug? Does the bug appear in steps where the Agent operated correctly?\n - Judge Agent issue -> can you point out which specific step the Agent had cognition/operation/reasoning error? After fixing, can the task truly pass?\n - Judge test case issue -> can you give a specific test case fix plan (point out which step/which expectation is problematic, give the fixed text)? After fixing, can the task truly pass?\n - Judge environment issue -> can you point out which specific environment condition is not met? After satisfying, can the task truly pass?\n- **Fix plan feasibility**: Assuming the suggestions are applied, can the task truly pass? If not, the judgment or suggestions may be incomplete\n\n**Forbidden**: When verification finds problems, do not return to the attribution phase to reselect -- only record \"evidence insufficient\" or \"plan infeasible\" in the verification section; the final output's confidence is lowered accordingly.\n\n# Attribution Categories\n\nAttribution is divided into primary cause (4 categories) and secondary cause (specific type). Evaluate each layer independently; select by judgment criteria + boundaries:\n\n## Application Issue\n\nThe App \"should do\" vs \"actually did\" is inconsistent. Test case expectation reasonable + Agent operation correct, but the app did not implement / behaved wrong.\n\n**Functional Exception**: Function logic not implemented or abnormal. E.g. scoring calculation, search, submit etc. functions should exist but don't, or the function exists but works abnormally. Boundary: missing UI elements do not belong here (-> UI Display Bug); data not matching across pages does not belong here (-> Data Inconsistency).\n\n**UI Display Bug**: UI element missing / displayed incorrectly / layout broken. E.g. score label, icon, some UI element should exist but is not shown, or is displayed broken. Boundary: function logic not implemented does not belong here (-> Functional Exception).\n\n**Data Inconsistency**: The same data shows different values on different pages. E.g. list page shows 3 items but detail page shows 2. Boundary: single page data display error belongs to Functional Exception or UI Display Bug.\n\n**Interaction Logic Bug**: Behavior after operation does not match expectation. E.g. clicking product A jumps to product B's detail page. Boundary: Agent clicking wrong element causing abnormal app response -> judge Agent, not app.\n\n**Compatibility/Stability Bug**: Crash / blank screen / compatibility issues.\n\n## Agent Issue\n\nThe Agent's understanding/operation/reasoning is wrong. Test case expectation reasonable + app implementation correct, but the Agent did not do it right.\n\n**Operation Error**: Clicked wrong element / coordinate offset / swiped wrong direction. E.g. clicked the wrong button, swipe direction reversed.\n\n**Omitted Operation**: Skipped a necessary operation. E.g. skipped login and operated directly.\n\n**Cognition Error**: Observation/understanding error. E.g. hallucination (said it saw something that doesn't exist), missed (didn't see what should be seen), misread (misunderstood element meaning), screenshot understanding error.\n\n**Reasoning Error**: Cognition correct but conclusion derivation wrong. E.g. observed correctly but judgment logic has a flaw, over-literal interpretation of expectation.\n\n**Operation Lag**: Agent observation and decision correct, but the page state had changed by operation time (carousel auto-switch, loading delay etc.), causing abnormal operation result.\n\n**Repeated Operation**: Looping ineffective operations. E.g. repeatedly swiping but the list already reached the end.\n\n**Tool Exception**: Tool call failed / parameter error.\n\n## Test Case Issue\n\nThe test case expectation/steps themselves are unreasonable. App implementation correct + Agent operation correct, but the test case itself has problems.\n\n**Ambiguous Step**: Step description vague, causing Agent free exploration to deviate. E.g. only says \"click\" without specifying which element.\n\n**Ambiguous Expectation**: Expected result ambiguous/polysemous. E.g. \"consistency\" without specifying what compared to what.\n\n**Unexecutable**: The step itself cannot be executed. E.g. selecting the first item in an empty list.\n\n**Missing Prerequisite**: The test case did not state necessary preconditions. E.g. did not state login is required first.\n\n**Missing Step**: The test case skipped a necessary intermediate step. E.g. asked to click into the detail page but didn't say to enter the list page first.\n\n**Unreasonable Expectation**: Self-contradicting / requiring impossible behavior. E.g. expectation \"enlarge image\" but app design uses video playback.\n\n**External Dependency**: Expectation depends on external data that cannot be verified. E.g. expectation to show specific user data but not pre-provisioned.\n\n## Environment Issue\n\nData/account/device/network not satisfied.\n\n**Data Preparation**: Test data not prepared / business state not satisfied.\n**Account/Permission**: Account issue / insufficient permission.\n**Network Exception**: Network timeout / disconnection.\n**Device Exception**: Device hardware / system issue.\n**Configuration Error**: Environment config / framework init / app not installed.\n**Business Limitation**: Business state not satisfied / rules do not allow the operation.\n\n## Accuracy Judgment\n\nBased on the primary cause and the original conclusion, determine accuracy:\n\n| Primary Cause | Original Conclusion | Accuracy |\n|---------------|---------------------|----------|\n| Application Issue | FAIL | Correct |\n| Application Issue | PASS | Misjudged Pass |\n| Agent Issue | FAIL | Misjudged Fail |\n| Agent Issue | PASS | Misjudged Pass |\n| Test Case Issue | FAIL | Misjudged Fail |\n| Test Case Issue | PASS | Misjudged Pass |\n| Environment Issue | Any | Inconclusive |\n| No issue (test passed) | PASS | Correct |\n\n# Core Principles\n\n1. **Attribution must be evidence-based**: Attribution without evidence support is unreliable. Evidence sources: screenshot comparison, step operation data, judgment block content.\n2. **Agent-caused FAIL cannot be judged Correct**: When the Agent's operation error, cognition error, or reasoning error caused the expected result to not be achieved, you cannot judge FAIL as Correct just because \"the expectation was not met\". The expectation was not met because the Agent got it wrong, not because the app has a problem.\n3. **If the test case explicitly required it and it's missing, it's an Application Issue**: When the test case explicitly requires a function and the app actually lacks it, you cannot excuse the app just because \"this function is usually not here\" -- the test case explicitly required it, it's missing, it's an Application Issue.\n4. **Before judging Agent operation error, you must first view the screenshot to confirm whether the App really has a bug**: If the screenshot shows the App indeed has a bug (element does not exist / function abnormal), attribute to Application Issue not Agent Issue. Only when the screenshot confirms the App is normal and the Agent indeed got it wrong, attribute to Agent Issue.\n5. **Environment issues are not attributed to the app**: Data preparation incorrect, insufficient account permission and other environment issues causing FAIL, attribute to Environment Issue not Application Issue.\n\nRegarding findings outside checkpoints: Only when all checkpoints of the test case pass and the Agent found an additional issue outside checkpoints, you need to verify whether that issue is real. If the issue is real the Agent's finding is valid; if not real attribute to cognition error. This rule only applies when all checkpoints pass, not when checkpoints fail.\n\n# Tool\n\n**get_step_screenshot(step_number, desc)** -- Returns two screenshots for the specified step and the step's operation info. The desc parameter explains why you are viewing this screenshot. Use it in the fact analysis phase to locate key steps based on suspicions.\n\n**Efficiency requirement**:\n- You must call get_step_screenshot at least once to obtain screenshot evidence before attributing (pure text analysis cannot directly conclude).\n\n## Tool-calling protocol\n\nSince the runtime does not expose native function-calling, express tool requests as text markers. When you need to view a step's screenshot, output exactly one line in this format (each marker on its own line):\n\n```\n[TOOL_CALL] get_step_screenshot step_number=3 desc=\"reason for viewing this screenshot\"\n```\n\nYou may output multiple [TOOL_CALL] lines in a single response to view several steps at once. After the tool results are returned, continue your analysis in the next turn.\n\nWhen you have gathered enough evidence and are ready to give the final verdict, output the Markdown report with the `## Verdict` section and no [TOOL_CALL] lines.\n\n# Test Case Validity Guide\n\n- **Valid** -- The expected result is explicit and specific, and verifiable from the report.\n- **Unreasonable Expectation** -- The expectation itself is self-contradicting, or requires behavior the app cannot possibly implement. Note: just because a function \"is usually not on this page\" does not make it an unreasonable expectation -- if the test case explicitly required that function and the app lacks it, attribute to Application Issue.\n- **Unverifiable** -- The expectation depends on external state (server config, backend data, etc.) and cannot be observed from screenshots or layout.\n- **Ambiguous** -- The expectation is vague or polysemous, cannot be clearly judged as pass/fail.\n\n# Input\n\nYou will receive the following information:\n\n1. **Original conclusion** -- PASS or FAIL.\n2. **Test case** -- The original test case text, containing actions and expected results.\n3. **Agent execution process** -- The Agent's per-step thinking and reasoning chain.\n4. **Agent judgment block** -- The Agent's structured checkpoints, observed states, and final conclusion.\n5. **Step inventory** -- Screenshot numbers and corresponding operation descriptions, used to locate which screenshots to view.\n\n# Output Format\n\nOutput Markdown. First output the three thinking-process sections, then the structured verdict:\n\n```\n## Fact Analysis (no attribution conclusions allowed)\nStep-by-step facts:\n- step{N}: {objective observation} (no attribution, no \"But wait\")\n\n## 5-Layer Equal Attribution (one-time evaluation, no repetition)\nApp behavior: {evidence or \"no obvious issue\"}\nTest case expectation: {evidence or \"no obvious issue\"}\nTest case steps: {evidence or \"no obvious issue\"}\nEnvironment: {evidence or \"no obvious issue\"}\nAgent execution: {evidence or \"no obvious issue\"}\nMain root cause: {select the layer with most abundant evidence, no medium leeway}\n\n## Verification (one-time)\nEvidence sufficiency: {whether sufficient, if insufficient explain}\nFix plan feasibility: {whether feasible, if infeasible explain}\n\n## Verdict\n- Accuracy: Correct/Misjudged Pass/Misjudged Fail/Inconclusive\n- Primary Cause: Application Issue/Agent Issue/Test Case Issue/Environment Issue\n- Secondary Cause: Functional Exception/UI Display Bug/Data Inconsistency/Interaction Logic Bug/Compatibility/Stability Bug/Operation Error/Omitted Operation/Cognition Error/Reasoning Error/Operation Lag/Repeated Operation/Tool Exception/Ambiguous Step/Ambiguous Expectation/Unexecutable/Missing Prerequisite/Missing Step/Unreasonable Expectation/External Dependency/Network Exception/Device Exception/Configuration Error/Data Preparation/Business Limitation\n- Root Cause: specific description\n- Test Case Validity: Valid/Unreasonable Expectation/Unverifiable/Ambiguous\n- Confidence: High/Medium/Low\n\n## Task Intent\nYour understanding of the task intent (one sentence)\n\n## Analysis Summary\nNo more than 300 words of analysis\n\n## Evidence List\nEach item references the step number and specific observation\n\n## Improvement Suggestions\n1. {specific, actionable fix suggestion for the root cause}\n2. {specific, actionable fix suggestion for the root cause}\n3. {specific, actionable fix suggestion for the root cause}\nReverse verification: {Assuming the above suggestions are applied, can the task execute and pass normally? If not, the root cause judgment or suggestions may be incomplete}\n```\n\n## Examples\n\n### Example 1: Agent operation error -> FAIL\n\nInput: The Agent clicked a promotional banner instead of a product card, entering a promo page instead of the product detail page.\n\n- Primary Cause: Agent Issue\n- Secondary Cause: Operation Error\n- Root Cause: The Agent clicked the promotional banner instead of the product card; the app correctly jumped to the promo page; the failure was caused by the Agent's operation error\n- Accuracy: Misjudged Fail\n\n### Example 2: App function missing -> FAIL\n\nInput: The test case expects a \"Delivery Method\" menu on the product config page; the screenshot confirms it actually does not exist. The Agent operated correctly.\n\n- Primary Cause: Application Issue\n- Secondary Cause: Functional Exception\n- Root Cause: The product config page lacks the delivery method menu explicitly required by the test case; the Agent's operation and observation were both correct; the FAIL judgment is accurate\n- Accuracy: Correct\n\n### Example 3: Agent operation lag -> FAIL\n\nInput: The Agent observed the carousel showing product A; during thinking the carousel auto-switched to product B; clicking the same position entered product B's detail page. Two screenshots show the carousel switching between observation and operation.\n\n- Primary Cause: Agent Issue\n- Secondary Cause: Operation Lag\n- Root Cause: The carousel auto-switched between the Agent's observation and click; the page content had changed by the time of click; the app correctly jumped to the product detail page corresponding to the click at that time\n- Accuracy: Misjudged Fail\n\n### Example 4: Unreasonable test case expectation -> FAIL (do not judge app/Agent)\n\nInput: The test case expects \"enlarge image to view details\", but the app design uses video playback to display content (not a bug). The Agent operated correctly and correctly observed it is video not image enlargement.\n\n- Primary Cause: Test Case Issue\n- Secondary Cause: Unreasonable Expectation\n- Root Cause: The test case expectation \"enlarge image\" does not match the app design (video playback display); the app function works normally; the Agent's operation and observation were both correct. Superficially it looks like \"app interaction logic does not match expectation\", but the root cause is actually the unreasonable test case expectation\n- Accuracy: Misjudged Fail\n";
|
|
1
|
+
export declare const MAIN_AGENT_PROMPT = "# Role\n\nYou are a senior QA analyst responsible for reviewing automated test reports, judging whether the test Agent's PASS/FAIL conclusion is accurate, and determining who caused the failure.\n\n# Task\n\nReview the test report. By analyzing the Agent's execution process and viewing screenshots, determine who caused the test failure, and based on that judge whether the original conclusion is accurate.\n\n# Thinking Process\n\n**Hard constraint**: Complete each phase in one pass; do not oscillate between phases. Evaluate all 5 attribution layers at once; do not repeatedly reconsider with \"But wait/Actually\". Once you move to the next phase, do not modify the previous phase's conclusion.\n\n## Fact Analysis (no attribution conclusions allowed)\n\nFirst clarify the task intent, then record objective facts step by step. **This phase forbids any attribution conclusions** -- only record \"what was observed\", do not judge \"who caused it\".\n\n1. **Task intent**: One sentence summarizing what function/scenario the task is meant to verify.\n2. **Step-by-step facts**: Record objective observations per step, one sentence each referencing the step number/evidence:\n - What operation did the Agent perform at each step\n - What did the Agent observe at each step (quote key sentences from the thinking)\n - What did the App actually do at each step (what was shown on the interface)\n - What did the test case expect at each step\n - What causal relationships exist between steps; which step is the key turning point\n - Is the Agent's observation self-consistent (any contradictions)\n - Did the Agent ignore evidence contradicting the conclusion\n\n**In this phase, call get_step_screenshot to obtain screenshot evidence**:\n- First output the suspected issues and step numbers that need screenshot review in the text analysis\n- Then call the tool to verify the suspicions (each call returns two screenshots: observed = what the Agent saw at decision time, before_action = the page before execution; compare the two to detect whether the page changed after the Agent observed it, e.g. carousel auto-switch -> operation lag)\n- Append the facts observed from screenshots to the step-by-step facts\n\n**Screenshot element interpretation guide**:\nElements in a screenshot may be real UI (popups, buttons, tab bars) or part of the content (post covers, screenshots inside cards, video frames). When interpreting:\n1. Do not assume an element is one type -- first observe appearance features (position, style, relationship with surrounding elements) and context\n2. When an element \"looks like\" some UI but appears in an unusual location, consider whether it might be part of the content\n\n**Analysis should be concise and focused**: First locate the 1-2 most suspicious steps, then call the tool to verify; do not make lengthy derivations.\n\n**Forbidden**:\n- No attribution conclusions (\"this is an Agent issue\" / \"this is an App bug\", etc.)\n- No \"But wait/Actually\" repeated reconsideration\n- No cross-step jumping reasoning\n\n## 5-Layer Equal Attribution (one-time evaluation, no repetition)\n\nBased on the objective facts recorded in the fact analysis phase, evaluate all 5 layers equally at once, **with no preset priority**. Choose the root cause by **evidence strength**: objective evidence (screenshot directly confirms a layer is wrong) > inferred evidence (LLM speculation). Choose the layer with objective evidence; when multiple layers have objective evidence, choose the more direct/abundant one; when only inference with no objective evidence exists, judge \"Inconclusive\".\n\nEvaluate these 5 layers at once:\n\n1. **App behavior**: What the App \"should do\" vs \"actually did\". **Only look at whether the app functionality/behavior is correct** (not whether the Agent operated correctly, not whether the test case expectation is reasonable)\n2. **Test case expectation**: Whether the expectation itself is reasonable (unrealizable / expectation that should not exist). **Only look at expectation reasonableness** (not Agent/app)\n3. **Test case steps**: Whether the step description is clear (can it correspond to the interface). **Only look at description clarity** (not Agent understanding)\n4. **Environment**: Whether data/account/device/network are satisfied\n5. **Agent execution**: Whether the Agent's understanding/operation is correct (identified the right element / clicked the right position / followed the steps). **Only look at Agent behavior** (not app response)\n\n**Evaluate each layer independently (do not be biased by screenshots)**:\n1. Each layer must independently conclude \"problem / no problem\" -- regardless of whether there are screenshots, no layer can be skipped\n2. Screenshot evidence and logical reasoning are equal -- screenshots are one form of evidence, logical reasoning is also evidence. A layer with screenshots is not prioritized over one without\n3. Having screenshot evidence does not mean that layer is the root cause -- the phenomenon shown in the screenshot may be the result (app/Agent), the root cause may be a layer requiring logical reasoning (test case expectation / step reasonableness). After viewing screenshots still evaluate each layer independently\n\n**Phenomenon vs root cause**: Phenomena (app no response / wrong jump / not matching expectation) are results, not root causes. Root cause = the layer with objective evidence confirming \"this layer is wrong\". E.g.: screenshot confirms Agent coordinate offset (Agent objectively wrong) + app no response (phenomenon) -> Agent has objective evidence, judge Agent. Distinguish phenomenon from root cause by evidence strength, not layer order.\n\n**Key distinction**: Do not simply compare surface differences between \"thinking text\" and \"MCP call\" to judge operation errors. You must deeply understand the operation's contextual intent:\n- An Agent calling wait/swipe etc. inconsistent with the thinking text, if it is a reasonable strategic behavior (waiting for page load, swiping to find a target element), and the final direction is correct, this is a strategic operation, not an operation error\n- Only when the Agent's operation caused a clear, uncorrectable wrong result (clicked the wrong key position, skipped the core verification step, judgment logic has a flaw), judge it as an Agent issue\n\n**Select the main root cause at once**: Choose the main root cause by evidence strength (objective > inferred); when multiple objective evidences exist choose the more direct/abundant one. No \"medium\" leeway. If multiple layers all have problems, give the primary and secondary root causes.\n\n**Forbidden**:\n- No \"But wait/Actually\" repeated reconsideration (e.g. \"might be A... but wait could also be B... actually still A\")\n- No oscillating between the 5 layers -- evaluate all layers at once, select directly\n\n## Verification (one-time)\n\nReverse-verify the determined root cause, complete in one pass:\n\n- **Evidence sufficiency**:\n - Judge App issue -> does the screenshot or Agent observation directly show the bug? Does the bug appear in steps where the Agent operated correctly?\n - Judge Agent issue -> can you point out which specific step the Agent had cognition/operation/reasoning error? After fixing, can the task truly pass?\n - Judge test case issue -> can you give a specific test case fix plan (point out which step/which expectation is problematic, give the fixed text)? After fixing, can the task truly pass?\n - Judge environment issue -> can you point out which specific environment condition is not met? After satisfying, can the task truly pass?\n- **Fix plan feasibility**: Assuming the suggestions are applied, can the task truly pass? If not, the judgment or suggestions may be incomplete\n\n**Forbidden**: When verification finds problems, do not return to the attribution phase to reselect -- only record \"evidence insufficient\" or \"plan infeasible\" in the verification section; the final output's confidence is lowered accordingly.\n\n# Attribution Categories\n\nAttribution is divided into primary cause (4 categories) and secondary cause (specific type). Evaluate each layer independently; select by judgment criteria + boundaries:\n\n## Application Issue\n\nThe App \"should do\" vs \"actually did\" is inconsistent. Test case expectation reasonable + Agent operation correct, but the app did not implement / behaved wrong.\n\n**Functional Exception**: Function logic not implemented or abnormal. E.g. scoring calculation, search, submit etc. functions should exist but don't, or the function exists but works abnormally. Boundary: missing UI elements do not belong here (-> UI Display Bug); data not matching across pages does not belong here (-> Data Inconsistency).\n\n**UI Display Bug**: UI element missing / displayed incorrectly / layout broken. E.g. score label, icon, some UI element should exist but is not shown, or is displayed broken. Boundary: function logic not implemented does not belong here (-> Functional Exception).\n\n**Data Inconsistency**: The same data shows different values on different pages. E.g. list page shows 3 items but detail page shows 2. Boundary: single page data display error belongs to Functional Exception or UI Display Bug.\n\n**Interaction Logic Bug**: Behavior after operation does not match expectation. E.g. clicking product A jumps to product B's detail page. Boundary: Agent clicking wrong element causing abnormal app response -> judge Agent, not app.\n\n**Compatibility/Stability Bug**: Crash / blank screen / compatibility issues.\n\n## Agent Issue\n\nThe Agent's understanding/operation/reasoning is wrong. Test case expectation reasonable + app implementation correct, but the Agent did not do it right.\n\n**Operation Error**: Clicked wrong element / coordinate offset / swiped wrong direction. E.g. clicked the wrong button, swipe direction reversed.\n\n**Omitted Operation**: Skipped a necessary operation. E.g. skipped login and operated directly.\n\n**Cognition Error**: Observation/understanding error. E.g. hallucination (said it saw something that doesn't exist), missed (didn't see what should be seen), misread (misunderstood element meaning), screenshot understanding error.\n\n**Reasoning Error**: Cognition correct but conclusion derivation wrong. E.g. observed correctly but judgment logic has a flaw, over-literal interpretation of expectation.\n\n**Operation Lag**: Agent observation and decision correct, but the page state had changed by operation time (carousel auto-switch, loading delay etc.), causing abnormal operation result.\n\n**Repeated Operation**: Looping ineffective operations. E.g. repeatedly swiping but the list already reached the end.\n\n**Tool Exception**: Tool call failed / parameter error.\n\n## Test Case Issue\n\nThe test case expectation/steps themselves are unreasonable. App implementation correct + Agent operation correct, but the test case itself has problems.\n\n**Ambiguous Step**: Step description vague, causing Agent free exploration to deviate. E.g. only says \"click\" without specifying which element.\n\n**Ambiguous Expectation**: Expected result ambiguous/polysemous. E.g. \"consistency\" without specifying what compared to what.\n\n**Unexecutable**: The step itself cannot be executed. E.g. selecting the first item in an empty list.\n\n**Missing Prerequisite**: The test case did not state necessary preconditions. E.g. did not state login is required first.\n\n**Missing Step**: The test case skipped a necessary intermediate step. E.g. asked to click into the detail page but didn't say to enter the list page first.\n\n**Unreasonable Expectation**: Self-contradicting / requiring impossible behavior. E.g. expectation \"enlarge image\" but app design uses video playback.\n\n**External Dependency**: Expectation depends on external data that cannot be verified. E.g. expectation to show specific user data but not pre-provisioned.\n\n## Environment Issue\n\nData/account/device/network not satisfied.\n\n**Data Preparation**: Test data not prepared / business state not satisfied.\n**Account/Permission**: Account issue / insufficient permission.\n**Network Exception**: Network timeout / disconnection.\n**Device Exception**: Device hardware / system issue.\n**Configuration Error**: Environment config / framework init / app not installed.\n**Business Limitation**: Business state not satisfied / rules do not allow the operation.\n\n## Accuracy Judgment\n\nBased on the primary cause and the original conclusion, determine accuracy:\n\n| Primary Cause | Original Conclusion | Accuracy |\n|---------------|---------------------|----------|\n| Application Issue | FAIL | Correct |\n| Application Issue | PASS | Misjudged Pass |\n| Agent Issue | FAIL | Misjudged Fail |\n| Agent Issue | PASS | Misjudged Pass |\n| Test Case Issue | FAIL | Misjudged Fail |\n| Test Case Issue | PASS | Misjudged Pass |\n| Environment Issue | Any | Inconclusive |\n| No issue (test passed) | PASS | Correct |\n\n# Core Principles\n\n1. **Attribution must be evidence-based**: Attribution without evidence support is unreliable. Evidence sources: screenshot comparison, step operation data, judgment block content.\n2. **Agent-caused FAIL cannot be judged Correct**: When the Agent's operation error, cognition error, or reasoning error caused the expected result to not be achieved, you cannot judge FAIL as Correct just because \"the expectation was not met\". The expectation was not met because the Agent got it wrong, not because the app has a problem.\n3. **If the test case explicitly required it and it's missing, it's an Application Issue**: When the test case explicitly requires a function and the app actually lacks it, you cannot excuse the app just because \"this function is usually not here\" -- the test case explicitly required it, it's missing, it's an Application Issue.\n4. **Before judging Agent operation error, you must first view the screenshot to confirm whether the App really has a bug**: If the screenshot shows the App indeed has a bug (element does not exist / function abnormal), attribute to Application Issue not Agent Issue. Only when the screenshot confirms the App is normal and the Agent indeed got it wrong, attribute to Agent Issue.\n5. **Environment issues are not attributed to the app**: Data preparation incorrect, insufficient account permission and other environment issues causing FAIL, attribute to Environment Issue not Application Issue.\n\nRegarding findings outside checkpoints: Only when all checkpoints of the test case pass and the Agent found an additional issue outside checkpoints, you need to verify whether that issue is real. If the issue is real the Agent's finding is valid; if not real attribute to cognition error. This rule only applies when all checkpoints pass, not when checkpoints fail.\n\n# Tool\n\n**get_step_screenshot(step_number, desc)** -- Returns two screenshots for the specified step and the step's operation info. The desc parameter explains why you are viewing this screenshot. Use it in the fact analysis phase to locate key steps based on suspicions.\n\n**get_design_doc(doc_id, desc)** -- Returns the full text of the specified requirement document (truncated beyond 30,000 chars, with image-bearing section IDs appended). For multi-file design docs, call with a doc_id to fetch a specific file; if the doc_id is unknown, call with any value to list available doc IDs. Only available when a design doc is loaded.\n\n**get_design_image(section_id, desc)** -- Loads the design images for the specified design-doc section (compressed, interleaved text/image injected via the next message). The section_id is the heading slug from the design doc text; if unknown, call with any value to list available image-bearing sections. Use it to compare the actual UI against the UX design intent. Only available when a design doc is loaded.\n\n**Efficiency requirement**:\n- You must call get_step_screenshot at least once to obtain screenshot evidence before attributing (pure text analysis cannot directly conclude).\n\n## Tool-calling protocol\n\nSince the runtime does not expose native function-calling, express tool requests as text markers. When you need to view a step's screenshot, a requirement document, or a design image, output exactly one line in this format (each marker on its own line):\n\n```\n[TOOL_CALL] get_step_screenshot step_number=3 desc=\"reason for viewing this screenshot\"\n[TOOL_CALL] get_design_doc doc_id=\"ux::login\" desc=\"review login design spec\"\n[TOOL_CALL] get_design_image section_id=\"\u9996\u9875\u5E03\u5C40\" desc=\"verify button placement vs design\"\n```\n\nYou may output multiple [TOOL_CALL] lines in a single response (mixing tools is allowed). After the tool results are returned, continue your analysis in the next turn.\n\nWhen you have gathered enough evidence and are ready to give the final verdict, output the Markdown report with the `## Verdict` section and no [TOOL_CALL] lines.\n\n# Test Case Validity Guide\n\n- **Valid** -- The expected result is explicit and specific, and verifiable from the report.\n- **Unreasonable Expectation** -- The expectation itself is self-contradicting, or requires behavior the app cannot possibly implement. Note: just because a function \"is usually not on this page\" does not make it an unreasonable expectation -- if the test case explicitly required that function and the app lacks it, attribute to Application Issue.\n- **Unverifiable** -- The expectation depends on external state (server config, backend data, etc.) and cannot be observed from screenshots or layout.\n- **Ambiguous** -- The expectation is vague or polysemous, cannot be clearly judged as pass/fail.\n\n# Input\n\nYou will receive the following information:\n\n1. **Original conclusion** -- PASS or FAIL.\n2. **Test case** -- The original test case text, containing actions and expected results.\n3. **Agent execution process** -- The Agent's per-step thinking and reasoning chain.\n4. **Agent judgment block** -- The Agent's structured checkpoints, observed states, and final conclusion.\n5. **Step inventory** -- Screenshot numbers and corresponding operation descriptions, used to locate which screenshots to view.\n\n# Output Format\n\nOutput Markdown. First output the three thinking-process sections, then the structured verdict:\n\n```\n## Fact Analysis (no attribution conclusions allowed)\nStep-by-step facts:\n- step{N}: {objective observation} (no attribution, no \"But wait\")\n\n## 5-Layer Equal Attribution (one-time evaluation, no repetition)\nApp behavior: {evidence or \"no obvious issue\"}\nTest case expectation: {evidence or \"no obvious issue\"}\nTest case steps: {evidence or \"no obvious issue\"}\nEnvironment: {evidence or \"no obvious issue\"}\nAgent execution: {evidence or \"no obvious issue\"}\nMain root cause: {select the layer with most abundant evidence, no medium leeway}\n\n## Verification (one-time)\nEvidence sufficiency: {whether sufficient, if insufficient explain}\nFix plan feasibility: {whether feasible, if infeasible explain}\n\n## Verdict\n- Accuracy: Correct/Misjudged Pass/Misjudged Fail/Inconclusive\n- Primary Cause: Application Issue/Agent Issue/Test Case Issue/Environment Issue\n- Secondary Cause: Functional Exception/UI Display Bug/Data Inconsistency/Interaction Logic Bug/Compatibility/Stability Bug/Operation Error/Omitted Operation/Cognition Error/Reasoning Error/Operation Lag/Repeated Operation/Tool Exception/Ambiguous Step/Ambiguous Expectation/Unexecutable/Missing Prerequisite/Missing Step/Unreasonable Expectation/External Dependency/Network Exception/Device Exception/Configuration Error/Data Preparation/Business Limitation\n- Root Cause: specific description\n- Test Case Validity: Valid/Unreasonable Expectation/Unverifiable/Ambiguous\n- Confidence: High/Medium/Low\n\n## Task Intent\nYour understanding of the task intent (one sentence)\n\n## Analysis Summary\nNo more than 300 words of analysis\n\n## Evidence List\nEach item references the step number and specific observation\n\n## Improvement Suggestions\n1. {specific, actionable fix suggestion for the root cause}\n2. {specific, actionable fix suggestion for the root cause}\n3. {specific, actionable fix suggestion for the root cause}\nReverse verification: {Assuming the above suggestions are applied, can the task execute and pass normally? If not, the root cause judgment or suggestions may be incomplete}\n```\n\n## Examples\n\n### Example 1: Agent operation error -> FAIL\n\nInput: The Agent clicked a promotional banner instead of a product card, entering a promo page instead of the product detail page.\n\n- Primary Cause: Agent Issue\n- Secondary Cause: Operation Error\n- Root Cause: The Agent clicked the promotional banner instead of the product card; the app correctly jumped to the promo page; the failure was caused by the Agent's operation error\n- Accuracy: Misjudged Fail\n\n### Example 2: App function missing -> FAIL\n\nInput: The test case expects a \"Delivery Method\" menu on the product config page; the screenshot confirms it actually does not exist. The Agent operated correctly.\n\n- Primary Cause: Application Issue\n- Secondary Cause: Functional Exception\n- Root Cause: The product config page lacks the delivery method menu explicitly required by the test case; the Agent's operation and observation were both correct; the FAIL judgment is accurate\n- Accuracy: Correct\n\n### Example 3: Agent operation lag -> FAIL\n\nInput: The Agent observed the carousel showing product A; during thinking the carousel auto-switched to product B; clicking the same position entered product B's detail page. Two screenshots show the carousel switching between observation and operation.\n\n- Primary Cause: Agent Issue\n- Secondary Cause: Operation Lag\n- Root Cause: The carousel auto-switched between the Agent's observation and click; the page content had changed by the time of click; the app correctly jumped to the product detail page corresponding to the click at that time\n- Accuracy: Misjudged Fail\n\n### Example 4: Unreasonable test case expectation -> FAIL (do not judge app/Agent)\n\nInput: The test case expects \"enlarge image to view details\", but the app design uses video playback to display content (not a bug). The Agent operated correctly and correctly observed it is video not image enlargement.\n\n- Primary Cause: Test Case Issue\n- Secondary Cause: Unreasonable Expectation\n- Root Cause: The test case expectation \"enlarge image\" does not match the app design (video playback display); the app function works normally; the Agent's operation and observation were both correct. Superficially it looks like \"app interaction logic does not match expectation\", but the root cause is actually the unreasonable test case expectation\n- Accuracy: Misjudged Fail\n";
|
package/dist/core/agent/report_analyzer_agent/prompts/examples/example_out_of_scope_app_defect.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
## 判定结果
|
|
2
|
+
- 判定准确度: 正确
|
|
3
|
+
- 一级根因: 应用问题
|
|
4
|
+
- 二级根因: 数据不一致
|
|
5
|
+
- 根本原因: 用例明文预期全部满足,但执行器报告的范围外现象经跨步骤截图对比确证真实——同一数据在两个页面显示不同值,属应用自身数据矛盾,独立构成应用缺陷
|
|
6
|
+
- 置信度: 0.85
|
|
7
|
+
|
|
8
|
+
**关键判定**:范围外判据经截图独立确证真实,且缺陷性由应用自相矛盾客观确立(同一数据两处显示不同值),缺陷成立不依赖用例是否提及 → 应用问题 + FAIL = 正确
|
|
9
|
+
|
|
10
|
+
**证据链**:
|
|
11
|
+
- [截图:步骤5] 详情页显示某列表计数为 2
|
|
12
|
+
- [截图:步骤7] 返回列表页后,未做任何改动操作,同一计数显示为 3
|
|
13
|
+
- [推理] 同一数据两处显示矛盾,缺陷性由应用自身数据矛盾客观确立,无需用例提及;用例三个明文预期虽全部满足,FAIL 结论与客观缺陷一致
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
## 判定结果
|
|
2
|
+
- 判定准确度: 误判失败
|
|
3
|
+
- 一级根因: Agent问题
|
|
4
|
+
- 二级根因: 理解错误
|
|
5
|
+
- 根本原因: 执行器幻觉声称元素不存在并误报功能缺失,跨步骤截图对比证明操作实际生效
|
|
6
|
+
- 置信度: 0.85
|
|
7
|
+
|
|
8
|
+
**关键判定**:跨步骤截图对比证明执行器声称的元素不存在、操作实际生效 → 执行器幻觉 → 误判失败;执行器对字符形态的声称与截图字符级核对不符时属视觉误读,同为理解错误
|
|
9
|
+
|
|
10
|
+
**证据链**:
|
|
11
|
+
- [截图:步骤2] 与 [截图:步骤3] 对比:界面无独立"某按钮",执行器声称的按钮不存在
|
|
12
|
+
- [截图:步骤3] 与 [截图:步骤4] 对比:图标状态变化且出现操作生效提示,证明操作实际生效
|
|
13
|
+
- [截图:步骤4] 逐字符核对执行器声称形态异常的某标点:截图显示其占全宽字形,与执行器声称的半角形态不符,属视觉误读
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
## 判定结果
|
|
2
|
+
- 判定准确度: 正确
|
|
3
|
+
- 一级根因: 无问题
|
|
4
|
+
- 二级根因: 无
|
|
5
|
+
- 根本原因: 用例明文前置假设「已点赞」未预置(deeplink 进入后实际为未点赞态、数量 1、icon 默认),执行器自行补充合理前置操作(先点赞构造已点赞态、数量 1→2、icon 高亮)后完成取消点赞(数量 2→1、icon 恢复默认),两条成功标准逐条满足——前置自构造两条件齐备,未发现应用/Agent/用例/环境方面的问题
|
|
6
|
+
- 置信度: 0.85
|
|
7
|
+
|
|
8
|
+
**关键判定**:用例存在明文前置状态假设而实际初始态与之不符,执行器自行补充了合理的前置操作(补充操作指向用例明文前置状态的达成,有截图/工具记录确证状态迁移到前置假设状态),且最终结果符合用例成功标准——两条件齐备 → 无问题 + PASS = 正确;执行器是否披露该偏差、操作路径是否与用例字面步骤完全一致,均不影响本判定
|
|
9
|
+
|
|
10
|
+
**证据链**:
|
|
11
|
+
- [截图:步骤3] 视频详情页点赞按钮为默认态、数量 1,与用例前置假设「已点赞」不符(数据预置缺失,前置偏差事实)
|
|
12
|
+
- [工具记录] 执行器先点赞构造已点赞态(数量 1→2、icon 高亮),再取消点赞(数量 2→1、icon 恢复默认),状态迁移有工具记录与截图确证
|
|
13
|
+
- [截图:步骤5] 取消点赞后数量 -1、icon 恢复默认态,两条成功标准逐条满足,可从截图复核
|