-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask-schema.json
More file actions
818 lines (818 loc) Β· 21.8 KB
/
task-schema.json
File metadata and controls
818 lines (818 loc) Β· 21.8 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
{
"$defs": {
"AppConfig": {
"description": "Application deployment configuration. The 'type' field selects the deployment model.",
"oneOf": [
{
"additionalProperties": false,
"description": "Deploy an AppImage file into the container.",
"properties": {
"electron": {
"default": false,
"description": "Whether this is an Electron app.",
"type": "boolean"
},
"path": {
"description": "Path to the AppImage file.",
"type": "string"
},
"type": {
"const": "appimage"
}
},
"required": [
"type",
"path"
],
"type": "object"
},
{
"additionalProperties": false,
"description": "Deploy a folder-based app with a shell entrypoint.",
"properties": {
"dir": {
"description": "Path to the app directory.",
"type": "string"
},
"electron": {
"default": false,
"description": "Whether this is an Electron app.",
"type": "boolean"
},
"entrypoint": {
"description": "Shell script to launch the app.",
"type": "string"
},
"type": {
"const": "folder"
}
},
"required": [
"type",
"dir",
"entrypoint"
],
"type": "object"
},
{
"additionalProperties": false,
"description": "Use a pre-built custom Docker image.",
"properties": {
"digest": {
"description": "Optional image digest for pinning.",
"pattern": "^sha256:[a-f0-9]{64}$",
"type": "string"
},
"entrypoint_cmd": {
"description": "Custom entrypoint command.",
"type": "string"
},
"image": {
"description": "Docker image name (e.g., my-app:latest).",
"type": "string"
},
"needs_fuse": {
"default": false,
"description": "Grant CAP_SYS_ADMIN and /dev/fuse access.",
"type": "boolean"
},
"type": {
"const": "docker_image"
}
},
"required": [
"type",
"image"
],
"type": "object"
},
{
"additionalProperties": false,
"description": "Attach to an existing running desktop (for `desktest attach` mode).",
"properties": {
"note": {
"description": "Optional note about the attach target.",
"type": "string"
},
"type": {
"const": "vnc_attach"
}
},
"required": [
"type"
],
"type": "object"
},
{
"additionalProperties": false,
"anyOf": [
{
"required": [
"bundle_id"
]
},
{
"required": [
"app_path"
]
},
{
"required": [
"launch_cmd"
]
}
],
"description": "Run a macOS app inside a Tart VM.",
"properties": {
"app_path": {
"description": "Path to a .app bundle.",
"type": "string"
},
"base_image": {
"description": "Tart base image to clone (e.g., desktest-macos:latest).",
"type": "string"
},
"bundle_id": {
"description": "macOS bundle identifier (e.g., com.apple.TextEdit).",
"type": "string"
},
"electron": {
"default": false,
"description": "Whether this is an Electron app.",
"type": "boolean"
},
"launch_cmd": {
"description": "Arbitrary launch command (takes precedence).",
"type": "string"
},
"type": {
"const": "macos_tart"
}
},
"required": [
"type",
"base_image"
],
"type": "object"
},
{
"additionalProperties": false,
"anyOf": [
{
"required": [
"bundle_id"
]
},
{
"required": [
"app_path"
]
}
],
"description": "Test a macOS app on the host desktop (no VM).",
"properties": {
"app_path": {
"description": "Path to a .app bundle on the host.",
"type": "string"
},
"bundle_id": {
"description": "macOS bundle identifier.",
"type": "string"
},
"type": {
"const": "macos_native"
}
},
"required": [
"type"
],
"type": "object"
},
{
"additionalProperties": false,
"anyOf": [
{
"required": [
"app_path"
]
},
{
"required": [
"launch_cmd"
]
}
],
"description": "Run a Windows app inside a QEMU/KVM VM.",
"properties": {
"app_path": {
"description": "App file to deploy into the VM.",
"type": "string"
},
"base_image": {
"description": "Path to QCOW2 golden image.",
"type": "string"
},
"installer_cmd": {
"description": "Installer command to run after deployment.",
"type": "string"
},
"launch_cmd": {
"description": "PowerShell launch command.",
"type": "string"
},
"type": {
"const": "windows_vm"
}
},
"required": [
"type",
"base_image"
],
"type": "object"
},
{
"additionalProperties": false,
"anyOf": [
{
"required": [
"app_path"
]
},
{
"required": [
"launch_cmd"
]
}
],
"description": "Test a Windows app on the host desktop (no VM).",
"properties": {
"app_path": {
"description": "Path to the application executable.",
"type": "string"
},
"launch_cmd": {
"description": "PowerShell/cmd launch command.",
"type": "string"
},
"type": {
"const": "windows_native"
}
},
"required": [
"type"
],
"type": "object"
}
]
},
"EarlyExitCondition": {
"description": "Condition for early exit β programmatic check or LLM judgment.",
"oneOf": [
{
"additionalProperties": false,
"properties": {
"actual_path": {
"type": "string"
},
"compare_mode": {
"default": "exact",
"enum": [
"exact",
"normalized"
],
"type": "string"
},
"expected_path": {
"type": "string"
},
"type": {
"const": "file_compare"
}
},
"required": [
"type",
"actual_path",
"expected_path"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"command": {
"type": "string"
},
"expected": {
"type": "string"
},
"match_mode": {
"default": "contains",
"enum": [
"contains",
"equals",
"regex"
],
"type": "string"
},
"type": {
"const": "command_output"
}
},
"required": [
"type",
"command",
"expected"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"path": {
"type": "string"
},
"should_not_exist": {
"default": false,
"type": "boolean"
},
"type": {
"const": "file_exists"
}
},
"required": [
"type",
"path"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"command": {
"type": "string"
},
"expected": {
"type": "integer"
},
"type": {
"const": "exit_code"
}
},
"required": [
"type",
"command",
"expected"
],
"type": "object"
},
{
"additionalProperties": false,
"description": "Use the agent's LLM to evaluate a natural language condition.",
"properties": {
"prompt": {
"description": "Natural language condition to evaluate.",
"type": "string"
},
"type": {
"const": "llm_judge"
}
},
"required": [
"type",
"prompt"
],
"type": "object"
}
]
},
"EarlyExitConfig": {
"additionalProperties": false,
"description": "Early exit configuration β exit the agent loop early when a condition is met.",
"properties": {
"check_every": {
"default": 1,
"description": "Check every N steps.",
"minimum": 1,
"type": "integer"
},
"condition": {
"$ref": "#/$defs/EarlyExitCondition"
},
"message": {
"description": "Human-readable message for the early exit reason.",
"type": "string"
}
},
"required": [
"condition"
],
"type": "object"
},
"EvaluatorConfig": {
"additionalProperties": false,
"description": "Evaluation configuration for determining test pass/fail.",
"properties": {
"conjunction": {
"default": "and",
"description": "How to combine multiple metrics: 'and' (all must pass) or 'or' (any must pass).",
"enum": [
"and",
"or"
],
"type": "string"
},
"eval_timeout_secs": {
"description": "Per-execution timeout in seconds for evaluator commands.",
"minimum": 1,
"type": "integer"
},
"metrics": {
"description": "Programmatic metrics (used in programmatic and hybrid modes).",
"items": {
"$ref": "#/$defs/MetricConfig"
},
"type": "array"
},
"mode": {
"description": "llm = agent verdict only, programmatic = metrics only (no agent loop), hybrid = both required.",
"enum": [
"llm",
"programmatic",
"hybrid"
],
"type": "string"
}
},
"required": [
"mode"
],
"type": "object"
},
"MetricConfig": {
"description": "A programmatic evaluation metric.",
"oneOf": [
{
"additionalProperties": false,
"description": "Compare a file from the container against an expected file.",
"properties": {
"actual_path": {
"description": "Path to the file inside the container.",
"type": "string"
},
"compare_mode": {
"default": "exact",
"description": "Comparison mode.",
"enum": [
"exact",
"normalized"
],
"type": "string"
},
"expected_path": {
"description": "Path to the expected file on the host.",
"type": "string"
},
"type": {
"const": "file_compare"
}
},
"required": [
"type",
"actual_path",
"expected_path"
],
"type": "object"
},
{
"additionalProperties": false,
"description": "Semantically compare structured data files.",
"properties": {
"actual_path": {
"type": "string"
},
"expected_path": {
"type": "string"
},
"format": {
"description": "File format for semantic parsing.",
"enum": [
"json",
"yaml",
"xml",
"csv"
],
"type": "string"
},
"type": {
"const": "file_compare_semantic"
}
},
"required": [
"type",
"actual_path",
"expected_path",
"format"
],
"type": "object"
},
{
"additionalProperties": false,
"description": "Run a command and check stdout.",
"properties": {
"command": {
"description": "Command to run inside the container.",
"type": "string"
},
"expected": {
"description": "Expected output.",
"type": "string"
},
"match_mode": {
"default": "contains",
"enum": [
"contains",
"equals",
"regex"
],
"type": "string"
},
"type": {
"const": "command_output"
}
},
"required": [
"type",
"command",
"expected"
],
"type": "object"
},
{
"additionalProperties": false,
"description": "Check if a file exists (or does not exist) in the container.",
"properties": {
"path": {
"description": "Path to check inside the container.",
"type": "string"
},
"should_not_exist": {
"default": false,
"description": "If true, assert the file does NOT exist.",
"type": "boolean"
},
"type": {
"const": "file_exists"
}
},
"required": [
"type",
"path"
],
"type": "object"
},
{
"additionalProperties": false,
"description": "Run a command and check its exit code.",
"properties": {
"command": {
"description": "Command to run inside the container.",
"type": "string"
},
"expected": {
"description": "Expected exit code.",
"type": "integer"
},
"type": {
"const": "exit_code"
}
},
"required": [
"type",
"command",
"expected"
],
"type": "object"
},
{
"additionalProperties": false,
"description": "Run a Python replay script inside the container.",
"properties": {
"screenshots_dir": {
"description": "Directory containing expected screenshots.",
"type": "string"
},
"script_path": {
"description": "Path to the Python script on the host.",
"type": "string"
},
"type": {
"const": "script_replay"
}
},
"required": [
"type",
"script_path"
],
"type": "object"
}
]
},
"SecretDef": {
"additionalProperties": false,
"properties": {
"default": {
"description": "Optional default value when the environment variable is not set.",
"type": "string"
},
"env": {
"description": "Environment variable name to read the secret value from.",
"type": "string"
}
},
"required": [
"env"
],
"type": "object"
},
"SetupStep": {
"description": "A setup step to execute before the agent loop.",
"oneOf": [
{
"additionalProperties": false,
"description": "Run a shell command inside the container.",
"properties": {
"command": {
"minLength": 1,
"type": "string"
},
"type": {
"const": "execute"
}
},
"required": [
"type",
"command"
],
"type": "object"
},
{
"additionalProperties": false,
"description": "Copy a file or directory into the container.",
"properties": {
"dest": {
"description": "Destination path in the container.",
"minLength": 1,
"type": "string"
},
"src": {
"description": "Source path on the host.",
"minLength": 1,
"type": "string"
},
"type": {
"const": "copy"
}
},
"required": [
"type",
"src",
"dest"
],
"type": "object"
},
{
"additionalProperties": false,
"description": "Open a file with xdg-open or a specified application.",
"properties": {
"app": {
"description": "Application to open with (optional).",
"type": "string"
},
"target": {
"description": "File or URL to open.",
"minLength": 1,
"type": "string"
},
"type": {
"const": "open"
}
},
"required": [
"type",
"target"
],
"type": "object"
},
{
"additionalProperties": false,
"description": "Wait for a specified number of seconds.",
"properties": {
"seconds": {
"exclusiveMinimum": 0,
"type": "number"
},
"type": {
"const": "sleep"
}
},
"required": [
"type",
"seconds"
],
"type": "object"
}
]
}
},
"$id": "https://desktest.dev/schemas/task-v1.0.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "Schema for desktest task JSON files (schema_version 1.0)",
"properties": {
"a11y_timeout_secs": {
"description": "Accessibility tree extraction timeout in seconds. Skips adaptive probe if set.",
"minimum": 1,
"type": "integer"
},
"app": {
"$ref": "#/$defs/AppConfig"
},
"completion_condition": {
"description": "Optional description of when the agent should consider the task done.",
"type": "string"
},
"config": {
"default": [],
"description": "Setup steps to execute before the agent loop.",
"items": {
"$ref": "#/$defs/SetupStep"
},
"type": "array"
},
"early_exit": {
"$ref": "#/$defs/EarlyExitConfig"
},
"evaluator": {
"$ref": "#/$defs/EvaluatorConfig"
},
"id": {
"description": "Unique identifier for this task.",
"minLength": 1,
"type": "string"
},
"instruction": {
"description": "Natural language instruction for the agent β what it should do.",
"minLength": 1,
"type": "string"
},
"max_a11y_nodes": {
"default": 10000,
"description": "Maximum number of accessibility tree nodes to extract.",
"minimum": 1,
"type": "integer"
},
"max_steps": {
"default": 15,
"description": "Maximum steps for the agent loop.",
"minimum": 1,
"type": "integer"
},
"metadata": {
"description": "Arbitrary metadata (tags, author, description, etc.)."
},
"replay_screenshots_dir": {
"description": "Directory containing expected screenshots for replay visual assertions.",
"type": "string"
},
"replay_script": {
"description": "Path to a codified Python replay script (generated by `desktest codify`).",
"type": "string"
},
"schema_version": {
"const": "1.0",
"description": "Schema version. Must be \"1.0\".",
"type": "string"
},
"secrets": {
"additionalProperties": {
"$ref": "#/$defs/SecretDef"
},
"description": "Named secrets sourced from environment variables. Keys are placeholder names for {{key}} substitution.",
"type": "object"
},
"timeout": {
"default": 300,
"description": "Overall test timeout in seconds.",
"minimum": 1,
"type": "integer"
}
},
"required": [
"schema_version",
"id",
"instruction",
"app"
],
"title": "Desktest Task Definition",
"type": "object"
}