agent-scenario-loop 0.1.2 → 0.1.4

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.
Files changed (87) hide show
  1. package/README.md +9 -9
  2. package/app/profile-session.ts +352 -12
  3. package/dist/core/agent-summary.d.ts +3 -2
  4. package/dist/core/agent-summary.js +44 -2
  5. package/dist/core/artifact-contract.d.ts +28 -8
  6. package/dist/core/artifact-contract.js +676 -26
  7. package/dist/core/comparison.d.ts +57 -3
  8. package/dist/core/comparison.js +113 -1
  9. package/dist/core/planner.d.ts +32 -1
  10. package/dist/core/planner.js +144 -0
  11. package/dist/core/run-index.d.ts +4 -0
  12. package/dist/core/run-index.js +55 -1
  13. package/dist/core/schema-validator.d.ts +2 -0
  14. package/dist/core/schema-validator.js +2 -0
  15. package/dist/runner/android-adb-driver.d.ts +7 -2
  16. package/dist/runner/android-adb-driver.js +7 -1
  17. package/dist/runner/android-adb.d.ts +40 -5
  18. package/dist/runner/android-adb.js +1046 -664
  19. package/dist/runner/compare-latest.d.ts +8 -4
  20. package/dist/runner/compare-latest.js +24 -5
  21. package/dist/runner/example-android-live.d.ts +10 -1
  22. package/dist/runner/example-android-live.js +55 -0
  23. package/dist/runner/example-ios-live.d.ts +10 -1
  24. package/dist/runner/example-ios-live.js +55 -0
  25. package/dist/runner/ios-simctl.d.ts +6 -0
  26. package/dist/runner/ios-simctl.js +7 -0
  27. package/dist/runner/live-comparison.d.ts +2 -2
  28. package/dist/runner/live-comparison.js +2 -1
  29. package/dist/runner/live-proof-summary.d.ts +5 -4
  30. package/dist/runner/live-proof-summary.js +12 -2
  31. package/dist/runner/live-proof.d.ts +3 -2
  32. package/dist/runner/live-proof.js +9 -2
  33. package/dist/runner/profile-android.d.ts +16 -1
  34. package/dist/runner/profile-android.js +364 -26
  35. package/dist/runner/profile-ios.d.ts +13 -2
  36. package/dist/runner/profile-ios.js +341 -19
  37. package/dist/runner/profile-mobile.d.ts +39 -3
  38. package/dist/runner/profile-mobile.js +1054 -42
  39. package/dist/runner/validate-project.js +3 -0
  40. package/dist/scripts/consumer-rehearsal.d.ts +119 -0
  41. package/dist/scripts/consumer-rehearsal.js +757 -0
  42. package/dist/scripts/downstream-local-package-gate.d.ts +2 -0
  43. package/dist/scripts/downstream-local-package-gate.js +264 -0
  44. package/dist/scripts/package-smoke.d.ts +96 -0
  45. package/dist/scripts/package-smoke.js +2282 -0
  46. package/dist/scripts/release-readiness.d.ts +2 -0
  47. package/dist/scripts/release-readiness.js +520 -0
  48. package/docs/adapters.md +7 -1
  49. package/docs/api.md +2 -2
  50. package/docs/architecture.md +90 -0
  51. package/docs/authoring.md +39 -3
  52. package/docs/concepts.md +3 -24
  53. package/docs/consumer-rehearsal.md +31 -1
  54. package/docs/contracts.md +45 -101
  55. package/docs/external-adapter-protocol.md +219 -0
  56. package/docs/live-proofs.md +86 -3
  57. package/docs/principles.md +9 -15
  58. package/examples/mobile-app/README.md +12 -0
  59. package/examples/mobile-app/runner-manifests/evidence-provider.json +3 -3
  60. package/examples/mobile-app/runner-manifests/primary-runner.json +1 -0
  61. package/examples/mobile-app/scripts/asl-capture-profiler-provider.mjs +25 -0
  62. package/examples/runners/README.md +4 -3
  63. package/examples/runners/adb-android.json +1 -0
  64. package/examples/runners/agent-device-android.json +1 -0
  65. package/examples/runners/agent-device-ios.json +1 -0
  66. package/examples/runners/argent-android.json +1 -0
  67. package/examples/runners/argent-ios.json +1 -0
  68. package/examples/runners/axe-accessibility-provider.json +2 -2
  69. package/examples/runners/script-accessibility-provider.json +2 -2
  70. package/examples/runners/script-memory-provider.json +2 -2
  71. package/examples/runners/script-network-provider.json +2 -2
  72. package/examples/runners/script-profiler-provider.json +2 -2
  73. package/examples/runners/xcodebuildmcp-ios.json +1 -0
  74. package/package.json +12 -3
  75. package/schemas/causal-run.schema.json +85 -2
  76. package/schemas/comparison.schema.json +130 -2
  77. package/schemas/external-adapter-message.schema.json +693 -0
  78. package/schemas/health.schema.json +72 -0
  79. package/schemas/live-proof-set.schema.json +1 -1
  80. package/schemas/live-proof.schema.json +14 -6
  81. package/schemas/manifest.schema.json +515 -4
  82. package/schemas/profiler.schema.json +243 -0
  83. package/schemas/runner-capabilities.schema.json +28 -2
  84. package/schemas/scenario.schema.json +34 -2
  85. package/templates/evidence-provider.json +3 -3
  86. package/templates/primary-runner.json +1 -0
  87. package/templates/scripts/asl-capture-profiler-provider.mjs +20 -0
@@ -13,6 +13,9 @@
13
13
  "endedAt",
14
14
  "durationMs",
15
15
  "interactionDriver",
16
+ "provenance",
17
+ "attempt",
18
+ "environment",
16
19
  "simulator",
17
20
  "bundleId",
18
21
  "gitSha",
@@ -55,6 +58,283 @@
55
58
  "comparisonLane": {
56
59
  "type": "string"
57
60
  },
61
+ "provenance": {
62
+ "type": "object",
63
+ "additionalProperties": false,
64
+ "required": ["gitSha", "toolVersions"],
65
+ "properties": {
66
+ "scenarioHash": {
67
+ "type": "string",
68
+ "pattern": "^[a-f0-9]{64}$"
69
+ },
70
+ "cohort": {
71
+ "$ref": "#/$defs/provenanceCohort"
72
+ },
73
+ "cohortHash": {
74
+ "type": "string",
75
+ "pattern": "^[a-f0-9]{64}$"
76
+ },
77
+ "gitSha": {
78
+ "type": "string"
79
+ },
80
+ "toolVersions": {
81
+ "type": "object",
82
+ "additionalProperties": {
83
+ "type": "string"
84
+ }
85
+ }
86
+ }
87
+ },
88
+ "attempt": {
89
+ "type": "object",
90
+ "additionalProperties": false,
91
+ "required": [
92
+ "attemptId",
93
+ "runId",
94
+ "status",
95
+ "terminalState",
96
+ "startedAt",
97
+ "endedAt",
98
+ "durationMs",
99
+ "interactionDriver",
100
+ "classification",
101
+ "cleanup",
102
+ "partialArtifacts"
103
+ ],
104
+ "properties": {
105
+ "attemptId": {
106
+ "type": "string",
107
+ "minLength": 1
108
+ },
109
+ "attemptNumber": {
110
+ "type": "integer",
111
+ "minimum": 1
112
+ },
113
+ "maxAttempts": {
114
+ "type": "integer",
115
+ "minimum": 1
116
+ },
117
+ "retryOfAttemptId": {
118
+ "type": "string",
119
+ "minLength": 1
120
+ },
121
+ "retryReason": {
122
+ "type": "string",
123
+ "minLength": 1
124
+ },
125
+ "runId": {
126
+ "type": "string"
127
+ },
128
+ "status": {
129
+ "type": "string",
130
+ "enum": ["passed", "failed"]
131
+ },
132
+ "terminalState": {
133
+ "$ref": "#/$defs/terminalState"
134
+ },
135
+ "startedAt": {
136
+ "type": "string"
137
+ },
138
+ "endedAt": {
139
+ "type": "string"
140
+ },
141
+ "durationMs": {
142
+ "type": "number",
143
+ "minimum": 0
144
+ },
145
+ "interactionDriver": {
146
+ "type": "string"
147
+ },
148
+ "comparisonLane": {
149
+ "type": "string"
150
+ },
151
+ "classification": {
152
+ "type": "object",
153
+ "additionalProperties": false,
154
+ "required": ["category"],
155
+ "properties": {
156
+ "category": {
157
+ "type": "string",
158
+ "enum": ["none", "product", "runner", "environment", "timeout", "cancelled", "instrumentation", "evidence", "unknown"]
159
+ },
160
+ "code": {
161
+ "type": "string",
162
+ "minLength": 1
163
+ },
164
+ "message": {
165
+ "type": "string",
166
+ "minLength": 1
167
+ },
168
+ "retryable": {
169
+ "type": "boolean"
170
+ }
171
+ }
172
+ },
173
+ "cleanup": {
174
+ "type": "object",
175
+ "additionalProperties": false,
176
+ "required": ["status"],
177
+ "properties": {
178
+ "status": {
179
+ "type": "string",
180
+ "enum": ["not-required", "passed", "failed", "partial", "unknown"]
181
+ },
182
+ "message": {
183
+ "type": "string",
184
+ "minLength": 1
185
+ },
186
+ "artifacts": {
187
+ "type": "array",
188
+ "items": {
189
+ "type": "string",
190
+ "minLength": 1
191
+ }
192
+ }
193
+ }
194
+ },
195
+ "partialArtifacts": {
196
+ "type": "object",
197
+ "additionalProperties": false,
198
+ "required": ["valid", "reason"],
199
+ "properties": {
200
+ "valid": {
201
+ "type": "boolean"
202
+ },
203
+ "reason": {
204
+ "type": "string",
205
+ "minLength": 1
206
+ },
207
+ "paths": {
208
+ "type": "array",
209
+ "items": {
210
+ "type": "string",
211
+ "minLength": 1
212
+ }
213
+ }
214
+ }
215
+ }
216
+ }
217
+ },
218
+ "environment": {
219
+ "type": "object",
220
+ "additionalProperties": false,
221
+ "required": ["platform", "bundleId", "runtimeTarget", "preconditions", "postconditions"],
222
+ "properties": {
223
+ "platform": {
224
+ "type": "string",
225
+ "enum": ["ios", "android"]
226
+ },
227
+ "bundleId": {
228
+ "type": "string"
229
+ },
230
+ "runtimeTarget": {
231
+ "type": "object",
232
+ "additionalProperties": false,
233
+ "required": ["name", "udid"],
234
+ "properties": {
235
+ "name": {
236
+ "type": "string"
237
+ },
238
+ "udid": {
239
+ "type": "string"
240
+ }
241
+ }
242
+ },
243
+ "nodeVersion": {
244
+ "type": "string"
245
+ },
246
+ "preconditions": {
247
+ "type": "object",
248
+ "additionalProperties": false,
249
+ "required": [
250
+ "installedState",
251
+ "appDataState",
252
+ "authState",
253
+ "initialRoute",
254
+ "foregroundState",
255
+ "lifecyclePhase",
256
+ "deviceLockState",
257
+ "permissions",
258
+ "locale",
259
+ "timezone",
260
+ "theme",
261
+ "fontScale",
262
+ "orientation",
263
+ "networkState",
264
+ "animations"
265
+ ],
266
+ "properties": {
267
+ "installedState": {
268
+ "$ref": "#/$defs/lifecycleAssertion"
269
+ },
270
+ "appDataState": {
271
+ "$ref": "#/$defs/lifecycleAssertion"
272
+ },
273
+ "authState": {
274
+ "$ref": "#/$defs/lifecycleAssertion"
275
+ },
276
+ "initialRoute": {
277
+ "$ref": "#/$defs/lifecycleAssertion"
278
+ },
279
+ "foregroundState": {
280
+ "$ref": "#/$defs/lifecycleAssertion"
281
+ },
282
+ "lifecyclePhase": {
283
+ "$ref": "#/$defs/lifecycleStateAssertion"
284
+ },
285
+ "deviceLockState": {
286
+ "$ref": "#/$defs/lifecycleAssertion"
287
+ },
288
+ "permissions": {
289
+ "$ref": "#/$defs/lifecycleAssertion"
290
+ },
291
+ "locale": {
292
+ "$ref": "#/$defs/lifecycleAssertion"
293
+ },
294
+ "timezone": {
295
+ "$ref": "#/$defs/lifecycleAssertion"
296
+ },
297
+ "theme": {
298
+ "$ref": "#/$defs/lifecycleAssertion"
299
+ },
300
+ "fontScale": {
301
+ "$ref": "#/$defs/lifecycleAssertion"
302
+ },
303
+ "orientation": {
304
+ "$ref": "#/$defs/lifecycleAssertion"
305
+ },
306
+ "networkState": {
307
+ "$ref": "#/$defs/lifecycleAssertion"
308
+ },
309
+ "animations": {
310
+ "$ref": "#/$defs/lifecycleAssertion"
311
+ }
312
+ }
313
+ },
314
+ "postconditions": {
315
+ "type": "object",
316
+ "additionalProperties": false,
317
+ "required": ["appState", "lifecyclePhase", "cleanupState", "dataState", "artifactState"],
318
+ "properties": {
319
+ "appState": {
320
+ "$ref": "#/$defs/lifecycleAssertion"
321
+ },
322
+ "lifecyclePhase": {
323
+ "$ref": "#/$defs/lifecycleStateAssertion"
324
+ },
325
+ "cleanupState": {
326
+ "$ref": "#/$defs/lifecycleAssertion"
327
+ },
328
+ "dataState": {
329
+ "$ref": "#/$defs/lifecycleAssertion"
330
+ },
331
+ "artifactState": {
332
+ "$ref": "#/$defs/lifecycleAssertion"
333
+ }
334
+ }
335
+ }
336
+ }
337
+ },
58
338
  "simulator": {
59
339
  "type": "object",
60
340
  "additionalProperties": false,
@@ -83,7 +363,7 @@
83
363
  "artifacts": {
84
364
  "type": "object",
85
365
  "additionalProperties": false,
86
- "required": ["causalRun", "budgetVerdict", "manifest", "metrics", "summary", "scenario", "raw", "captures", "signals"],
366
+ "required": ["causalRun", "budgetVerdict", "manifest", "metrics", "summary", "scenario", "raw", "captures", "signals", "diagnostics"],
87
367
  "properties": {
88
368
  "causalRun": {
89
369
  "type": "string"
@@ -106,20 +386,21 @@
106
386
  "raw": {
107
387
  "type": "object",
108
388
  "additionalProperties": false,
109
- "required": ["interactionLog", "deviceLog"],
110
389
  "properties": {
111
390
  "interactionLog": {
112
391
  "type": "string"
113
392
  },
114
393
  "deviceLog": {
115
394
  "type": "string"
395
+ },
396
+ "profileSessionEntries": {
397
+ "type": "string"
116
398
  }
117
399
  }
118
400
  },
119
401
  "captures": {
120
402
  "type": "object",
121
403
  "additionalProperties": false,
122
- "required": ["video", "uiTree"],
123
404
  "properties": {
124
405
  "video": {
125
406
  "type": "string"
@@ -135,6 +416,75 @@
135
416
  }
136
417
  }
137
418
  },
419
+ "diagnostics": {
420
+ "type": "array",
421
+ "minItems": 1,
422
+ "items": {
423
+ "type": "object",
424
+ "additionalProperties": false,
425
+ "required": ["kind", "status", "required"],
426
+ "properties": {
427
+ "kind": {
428
+ "type": "string",
429
+ "enum": ["accessibility", "js", "logs", "memory", "network", "profiler", "screenshot", "uiTree", "video"]
430
+ },
431
+ "status": {
432
+ "type": "string",
433
+ "enum": ["captured", "not_requested", "not_supported", "unavailable", "failed", "skipped", "missing"]
434
+ },
435
+ "required": {
436
+ "type": "boolean"
437
+ },
438
+ "name": {
439
+ "type": "string",
440
+ "minLength": 1
441
+ },
442
+ "provider": {
443
+ "type": "string",
444
+ "minLength": 1
445
+ },
446
+ "runnerId": {
447
+ "type": "string",
448
+ "minLength": 1
449
+ },
450
+ "path": {
451
+ "type": "string",
452
+ "minLength": 1
453
+ },
454
+ "reason": {
455
+ "type": "string",
456
+ "minLength": 1
457
+ },
458
+ "nextAction": {
459
+ "type": "string",
460
+ "minLength": 1
461
+ },
462
+ "sidecarRoot": {
463
+ "type": "string",
464
+ "minLength": 1
465
+ },
466
+ "evidenceDependency": {
467
+ "type": "object",
468
+ "additionalProperties": false,
469
+ "required": ["kind", "path"],
470
+ "properties": {
471
+ "kind": {
472
+ "type": "string",
473
+ "minLength": 1
474
+ },
475
+ "root": {
476
+ "type": "string",
477
+ "enum": ["run", "sidecar"]
478
+ },
479
+ "path": {
480
+ "type": "string",
481
+ "minLength": 1
482
+ }
483
+ }
484
+ }
485
+ }
486
+ }
487
+ },
138
488
  "signals": {
139
489
  "type": "object",
140
490
  "additionalProperties": false,
@@ -166,12 +516,31 @@
166
516
  "items": {
167
517
  "type": "object",
168
518
  "additionalProperties": false,
169
- "required": ["channel", "kind", "path", "sha256", "sizeBytes", "sourceFileName"],
519
+ "required": [
520
+ "channel",
521
+ "completenessStatus",
522
+ "corruptionStatus",
523
+ "kind",
524
+ "path",
525
+ "redactionStatus",
526
+ "sha256",
527
+ "sizeBytes",
528
+ "sourceFileName",
529
+ "transformations"
530
+ ],
170
531
  "properties": {
171
532
  "channel": {
172
533
  "type": "string",
173
534
  "enum": ["capture", "provider", "signal"]
174
535
  },
536
+ "completenessStatus": {
537
+ "type": "string",
538
+ "enum": ["complete", "truncated", "unknown"]
539
+ },
540
+ "corruptionStatus": {
541
+ "type": "string",
542
+ "enum": ["valid", "corrupt", "unknown"]
543
+ },
175
544
  "kind": {
176
545
  "type": "string",
177
546
  "enum": ["accessibility", "js", "logs", "memory", "network", "profiler", "screenshot", "uiTree", "video"]
@@ -180,6 +549,10 @@
180
549
  "type": "string",
181
550
  "minLength": 1
182
551
  },
552
+ "redactionStatus": {
553
+ "type": "string",
554
+ "enum": ["not-redacted", "redacted", "unknown"]
555
+ },
183
556
  "sha256": {
184
557
  "type": "string",
185
558
  "pattern": "^[a-f0-9]{64}$"
@@ -191,6 +564,15 @@
191
564
  "sourceFileName": {
192
565
  "type": "string",
193
566
  "minLength": 1
567
+ },
568
+ "transformations": {
569
+ "type": "array",
570
+ "minItems": 1,
571
+ "uniqueItems": true,
572
+ "items": {
573
+ "type": "string",
574
+ "enum": ["copied", "normalized", "redacted", "truncated", "compressed", "transcoded", "unknown"]
575
+ }
194
576
  }
195
577
  }
196
578
  }
@@ -200,5 +582,134 @@
200
582
  "failureReason": {
201
583
  "type": ["string", "null"]
202
584
  }
585
+ },
586
+ "$defs": {
587
+ "provenanceCohort": {
588
+ "type": "object",
589
+ "additionalProperties": false,
590
+ "properties": {
591
+ "appVersion": {
592
+ "type": "string"
593
+ },
594
+ "appId": {
595
+ "type": "string"
596
+ },
597
+ "buildId": {
598
+ "type": "string"
599
+ },
600
+ "buildMode": {
601
+ "type": "string"
602
+ },
603
+ "commandTransport": {
604
+ "type": "string"
605
+ },
606
+ "deviceClass": {
607
+ "type": "string"
608
+ },
609
+ "featureFlags": {
610
+ "type": "object",
611
+ "additionalProperties": {
612
+ "type": ["boolean", "string", "number", "null"]
613
+ }
614
+ },
615
+ "osVersion": {
616
+ "type": "string"
617
+ },
618
+ "platform": {
619
+ "type": "string"
620
+ },
621
+ "providers": {
622
+ "type": "array",
623
+ "items": {
624
+ "type": "object",
625
+ "additionalProperties": false,
626
+ "properties": {
627
+ "name": {
628
+ "type": "string"
629
+ },
630
+ "version": {
631
+ "type": "string"
632
+ }
633
+ }
634
+ }
635
+ },
636
+ "runnerName": {
637
+ "type": "string"
638
+ },
639
+ "runnerVersion": {
640
+ "type": "string"
641
+ },
642
+ "seedIdentity": {
643
+ "type": "string"
644
+ }
645
+ }
646
+ },
647
+ "terminalState": {
648
+ "type": "string",
649
+ "enum": ["passed", "failed", "timeout", "cancelled", "aborted", "inconclusive", "unsupported", "skipped", "unhealthy"]
650
+ },
651
+ "lifecycleState": {
652
+ "type": "string",
653
+ "enum": [
654
+ "unknown",
655
+ "cold-launch",
656
+ "warm-launch",
657
+ "hot-launch",
658
+ "resume",
659
+ "foreground",
660
+ "background",
661
+ "force-stop",
662
+ "process-death",
663
+ "scene-recreation",
664
+ "activity-recreation",
665
+ "os-reclaim",
666
+ "reboot",
667
+ "relaunch"
668
+ ]
669
+ },
670
+ "lifecycleAssertion": {
671
+ "type": "object",
672
+ "additionalProperties": false,
673
+ "required": ["value", "evidence"],
674
+ "properties": {
675
+ "value": {
676
+ "type": ["string", "number", "boolean", "null"]
677
+ },
678
+ "evidence": {
679
+ "type": "string",
680
+ "enum": ["not-asserted", "unknown", "asserted", "observed", "inferred"]
681
+ },
682
+ "source": {
683
+ "type": "string",
684
+ "minLength": 1
685
+ },
686
+ "artifact": {
687
+ "type": "string",
688
+ "minLength": 1
689
+ }
690
+ }
691
+ },
692
+ "lifecycleStateAssertion": {
693
+ "type": "object",
694
+ "additionalProperties": false,
695
+ "required": ["value", "evidence"],
696
+ "properties": {
697
+ "value": {
698
+ "$ref": "#/$defs/lifecycleState"
699
+ },
700
+ "evidence": {
701
+ "type": "string",
702
+ "enum": ["not-asserted", "unknown", "asserted", "observed", "inferred"]
703
+ },
704
+ "source": {
705
+ "type": "string",
706
+ "minLength": 1
707
+ },
708
+ "artifact": {
709
+ "type": "string",
710
+ "minLength": 1
711
+ }
712
+ }
713
+ }
203
714
  }
204
715
  }