File size: 2,165 Bytes
94193b5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
export type TestAssertion =
  | { type: 'file_exists'; path: string; description: string }
  | { type: 'file_not_exists'; path: string; description: string }
  | { type: 'file_contains'; path: string; value: string; description: string }
  | { type: 'file_not_contains'; path: string; value: string; description: string }
  | { type: 'file_matches'; path: string; pattern: string; description: string }
  | { type: 'file_matches_any'; paths: string[]; pattern: string; description: string }
  | { type: 'valid_json'; path: string; description: string }
  | { type: 'tool_used'; toolName: string; description: string }
  | { type: 'tool_args_match'; toolName: string; pattern: string; description: string }
  | { type: 'output_matches'; pattern: string; description: string }
  | { type: 'tool_output_matches'; toolName: string; pattern: string; description: string }
  | { type: 'any_of'; assertions: TestAssertion[]; description: string }
  | { type: 'judge'; criteria: string; description: string };

export interface AssertionResult {
  assertion: TestAssertion;
  passed: boolean;
  actual?: string;
}

export interface TestScenario {
  id: string;
  name: string;
  category: 'bash-read' | 'bash-write' | 'bash-search' | 'bash-text' | 'bash-preview' | 'file-editing' | 'status' | 'multi-tool' | 'agent' | 'delegate' | 'compaction' | 'setup';
  prompt: string;
  setupFiles?: Record<string, string>;
  assertions?: TestAssertion[];
  timeout?: number;
  /** Agent type to use (defaults to 'orchestrator'). */
  agentType?: import('@/lib/llm/agent').AgentType;
  /** If true, skip VFS project creation (e.g. setup agent tests). */
  skipProjectSetup?: boolean;
}

export interface TestStep {
  id: string;
  name: string;
  prompt: string;
  assertions?: TestAssertion[];
  timeout?: number;
}

export interface TestSequence {
  id: string;
  name: string;
  category: string;
  setupFiles?: Record<string, string>;
  steps: TestStep[];
  agentType?: import('@/lib/llm/agent').AgentType;
  skipProjectSetup?: boolean;
  requires?: ('compaction')[];
}

export interface TestTrack {
  id: string;
  name: string;
  description: string;
  scenarioIds: string[];
}