agent-hitch 0.2.13 → 0.2.15

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 (132) hide show
  1. package/benchmark-packages/automationbench/RESOURCES.md +27 -0
  2. package/benchmark-packages/automationbench/resources.mjs +86 -0
  3. package/benchmark-packages/shared-tree/README.md +14 -0
  4. package/benchmark-packages/shared-tree/import.mjs +39 -0
  5. package/dist/scripts/canary-automation-resources.js +86 -0
  6. package/dist/scripts/canary-automation-resources.js.map +1 -0
  7. package/dist/scripts/canary-resource-empty-daemon.js +195 -0
  8. package/dist/scripts/canary-resource-empty-daemon.js.map +1 -0
  9. package/dist/scripts/canary-resources.js +89 -0
  10. package/dist/scripts/canary-resources.js.map +1 -0
  11. package/dist/scripts/check-architecture.js +6 -5
  12. package/dist/scripts/check-architecture.js.map +1 -1
  13. package/dist/scripts/resource-space-sampler.js +83 -0
  14. package/dist/scripts/resource-space-sampler.js.map +1 -0
  15. package/dist/src/backends/harbor/backend.js +5 -1
  16. package/dist/src/backends/harbor/backend.js.map +1 -1
  17. package/dist/src/backends/harbor/resource-admission.js +23 -0
  18. package/dist/src/backends/harbor/resource-admission.js.map +1 -0
  19. package/dist/src/cli/commands/resources.js +23 -0
  20. package/dist/src/cli/commands/resources.js.map +1 -0
  21. package/dist/src/cli/main.js +2 -0
  22. package/dist/src/cli/main.js.map +1 -1
  23. package/dist/src/control-plane/remote-offer-contract.js +11 -2
  24. package/dist/src/control-plane/remote-offer-contract.js.map +1 -1
  25. package/dist/src/control-plane/remote-result-transport.js +10 -0
  26. package/dist/src/control-plane/remote-result-transport.js.map +1 -1
  27. package/dist/src/control-plane/remote-work-coordinator.js +4 -1
  28. package/dist/src/control-plane/remote-work-coordinator.js.map +1 -1
  29. package/dist/src/control-plane/remote-work-inputs.js +16 -4
  30. package/dist/src/control-plane/remote-work-inputs.js.map +1 -1
  31. package/dist/src/control-plane/remote-worker-client.js +22 -0
  32. package/dist/src/control-plane/remote-worker-client.js.map +1 -1
  33. package/dist/src/control-plane/remote-worker-codecs.js +1 -1
  34. package/dist/src/control-plane/remote-worker-codecs.js.map +1 -1
  35. package/dist/src/control-plane/remote-worker-protocol.js +12 -2
  36. package/dist/src/control-plane/remote-worker-protocol.js.map +1 -1
  37. package/dist/src/control-plane/remote-worker-runner.js +1 -1
  38. package/dist/src/control-plane/remote-worker-runner.js.map +1 -1
  39. package/dist/src/control-plane/remote-workers.js +2 -1
  40. package/dist/src/control-plane/remote-workers.js.map +1 -1
  41. package/dist/src/evals/benchmark-adapter-manifest.js +4 -0
  42. package/dist/src/evals/benchmark-adapter-manifest.js.map +1 -1
  43. package/dist/src/evals/benchmark-candidate.js +11 -3
  44. package/dist/src/evals/benchmark-candidate.js.map +1 -1
  45. package/dist/src/evals/eval-result-builder.js +22 -1
  46. package/dist/src/evals/eval-result-builder.js.map +1 -1
  47. package/dist/src/evals/index.js +1 -0
  48. package/dist/src/evals/index.js.map +1 -1
  49. package/dist/src/evals/planned-execution.js +5 -14
  50. package/dist/src/evals/planned-execution.js.map +1 -1
  51. package/dist/src/evals/request.js +9 -0
  52. package/dist/src/evals/request.js.map +1 -1
  53. package/dist/src/evals/resource-eval-lifecycle.js +31 -0
  54. package/dist/src/evals/resource-eval-lifecycle.js.map +1 -0
  55. package/dist/src/evals/resource-legacy-export.js +57 -0
  56. package/dist/src/evals/resource-legacy-export.js.map +1 -0
  57. package/dist/src/evals/service.js +5 -20
  58. package/dist/src/evals/service.js.map +1 -1
  59. package/dist/src/evals/task-resources.js +12 -4
  60. package/dist/src/evals/task-resources.js.map +1 -1
  61. package/dist/src/evals/trial-bundle-files.js +81 -0
  62. package/dist/src/evals/trial-bundle-files.js.map +1 -0
  63. package/dist/src/evals/trial-import.js +7 -78
  64. package/dist/src/evals/trial-import.js.map +1 -1
  65. package/dist/src/foundation/durable-json.js +33 -0
  66. package/dist/src/foundation/durable-json.js.map +1 -0
  67. package/dist/src/foundation/index.js +2 -0
  68. package/dist/src/foundation/index.js.map +1 -1
  69. package/dist/src/foundation/resource-image-references.js +52 -0
  70. package/dist/src/foundation/resource-image-references.js.map +1 -0
  71. package/dist/src/images/gc.js +2 -2
  72. package/dist/src/images/gc.js.map +1 -1
  73. package/dist/src/images/registry.js +27 -2
  74. package/dist/src/images/registry.js.map +1 -1
  75. package/dist/src/resources/api.js +207 -0
  76. package/dist/src/resources/api.js.map +1 -0
  77. package/dist/src/resources/bundle.js +117 -0
  78. package/dist/src/resources/bundle.js.map +1 -0
  79. package/dist/src/resources/evidence.js +93 -0
  80. package/dist/src/resources/evidence.js.map +1 -0
  81. package/dist/src/resources/gc.js +123 -0
  82. package/dist/src/resources/gc.js.map +1 -0
  83. package/dist/src/resources/index.js +14 -0
  84. package/dist/src/resources/index.js.map +1 -0
  85. package/dist/src/resources/materialize.js +143 -0
  86. package/dist/src/resources/materialize.js.map +1 -0
  87. package/dist/src/resources/object-store.js +191 -0
  88. package/dist/src/resources/object-store.js.map +1 -0
  89. package/dist/src/resources/oci-layer-validation.js +202 -0
  90. package/dist/src/resources/oci-layer-validation.js.map +1 -0
  91. package/dist/src/resources/oci-provider.js +101 -0
  92. package/dist/src/resources/oci-provider.js.map +1 -0
  93. package/dist/src/resources/oci-registry-bundle.js +253 -0
  94. package/dist/src/resources/oci-registry-bundle.js.map +1 -0
  95. package/dist/src/resources/protocol.js +222 -0
  96. package/dist/src/resources/protocol.js.map +1 -0
  97. package/dist/src/resources/result-retention.js +93 -0
  98. package/dist/src/resources/result-retention.js.map +1 -0
  99. package/dist/src/resources/role-context.js +54 -0
  100. package/dist/src/resources/role-context.js.map +1 -0
  101. package/dist/src/resources/stats.js +36 -0
  102. package/dist/src/resources/stats.js.map +1 -0
  103. package/dist/src/resources/store.js +310 -0
  104. package/dist/src/resources/store.js.map +1 -0
  105. package/dist/src/resources/tasks.js +153 -0
  106. package/dist/src/resources/tasks.js.map +1 -0
  107. package/dist/src/resources/transfer.js +162 -0
  108. package/dist/src/resources/transfer.js.map +1 -0
  109. package/dist/src/resources/views.js +130 -0
  110. package/dist/src/resources/views.js.map +1 -0
  111. package/dist/src/runs/adapter-process.js +10 -0
  112. package/dist/src/runs/adapter-process.js.map +1 -1
  113. package/dist/src/runs/executor.js +2 -2
  114. package/dist/src/runs/executor.js.map +1 -1
  115. package/dist/src/trajectories/providers/deepseek.js +6 -1
  116. package/dist/src/trajectories/providers/deepseek.js.map +1 -1
  117. package/dist/src/workers/remote-harbor-work-spec.js +9 -3
  118. package/dist/src/workers/remote-harbor-work-spec.js.map +1 -1
  119. package/dist/src/workers/remote-harbor-worker.js +24 -9
  120. package/dist/src/workers/remote-harbor-worker.js.map +1 -1
  121. package/docs/resource-storage.zh-CN.md +95 -0
  122. package/docs/schemas/execution-provider-status.schema.json +20 -0
  123. package/docs/schemas/hitch-resource-dataset-v2.schema.json +590 -0
  124. package/docs/schemas/hitch-resource-lock-v1.schema.json +341 -0
  125. package/docs/schemas/hitch-resource-plan-v1.schema.json +423 -0
  126. package/docs/schemas/hitch-resource-selection-v1.schema.json +608 -0
  127. package/docs/schemas/hitch-tree-v1.schema.json +75 -0
  128. package/docs/schemas/remote-harbor-work-spec.schema.json +47 -3
  129. package/docs/schemas/remote-work-offer.schema.json +2 -1
  130. package/docs/schemas/remote-worker-registration.schema.json +20 -0
  131. package/package.json +9 -3
  132. package/test-contracts/hitch-resources-v1.json +197 -0
@@ -0,0 +1,590 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://hitch.dev/schemas/hitch-resource-dataset-v2.schema.json",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "properties": {
7
+ "schema_version": {
8
+ "const": "2"
9
+ },
10
+ "kind": {
11
+ "const": "gear-harbor-benchmark"
12
+ },
13
+ "resource_protocol": {
14
+ "const": "hitch-resource-lock@1"
15
+ },
16
+ "execution": {
17
+ "type": "object",
18
+ "additionalProperties": false,
19
+ "properties": {
20
+ "backend": {
21
+ "const": "harbor-role-context@1"
22
+ },
23
+ "resolver": {
24
+ "const": "hitch-resource-resolver@1"
25
+ },
26
+ "platform": {
27
+ "type": "string",
28
+ "pattern": "^linux/(amd64|arm64)(/v[0-9]+)?$"
29
+ }
30
+ },
31
+ "required": [
32
+ "backend",
33
+ "resolver",
34
+ "platform"
35
+ ]
36
+ },
37
+ "required_capabilities": {
38
+ "type": "array",
39
+ "uniqueItems": true,
40
+ "items": {
41
+ "type": "string",
42
+ "pattern": "^[a-z][a-z0-9-]*@[1-9][0-9]*$"
43
+ }
44
+ },
45
+ "benchmark": {
46
+ "type": "object",
47
+ "additionalProperties": false,
48
+ "properties": {
49
+ "id": {
50
+ "type": "string",
51
+ "minLength": 1
52
+ },
53
+ "revision": {
54
+ "type": "string",
55
+ "minLength": 1
56
+ }
57
+ },
58
+ "required": [
59
+ "id",
60
+ "revision"
61
+ ]
62
+ },
63
+ "adapter": {
64
+ "type": "object",
65
+ "additionalProperties": false,
66
+ "properties": {
67
+ "id": {
68
+ "type": "string",
69
+ "minLength": 1
70
+ },
71
+ "revision": {
72
+ "type": "string",
73
+ "minLength": 1
74
+ },
75
+ "output_protocol": {
76
+ "const": "gear-harbor-eval-result-v1"
77
+ }
78
+ },
79
+ "required": [
80
+ "id",
81
+ "revision",
82
+ "output_protocol"
83
+ ]
84
+ },
85
+ "scoring": {
86
+ "type": "object",
87
+ "additionalProperties": false,
88
+ "properties": {
89
+ "total_score": {
90
+ "type": "object",
91
+ "additionalProperties": false,
92
+ "properties": {
93
+ "source_metric": {
94
+ "type": "string",
95
+ "minLength": 1
96
+ },
97
+ "direction": {
98
+ "enum": [
99
+ "maximize",
100
+ "minimize"
101
+ ]
102
+ },
103
+ "range": {
104
+ "type": "array",
105
+ "minItems": 2,
106
+ "maxItems": 2,
107
+ "items": {
108
+ "type": "number"
109
+ }
110
+ },
111
+ "reducer": {
112
+ "const": "task-macro-mean"
113
+ }
114
+ },
115
+ "required": [
116
+ "source_metric",
117
+ "direction",
118
+ "range",
119
+ "reducer"
120
+ ]
121
+ },
122
+ "process_score": {
123
+ "type": "object",
124
+ "additionalProperties": false,
125
+ "properties": {
126
+ "source_metric": {
127
+ "type": "string",
128
+ "minLength": 1
129
+ },
130
+ "direction": {
131
+ "enum": [
132
+ "maximize",
133
+ "minimize"
134
+ ]
135
+ },
136
+ "range": {
137
+ "type": "array",
138
+ "minItems": 2,
139
+ "maxItems": 2,
140
+ "items": {
141
+ "type": "number"
142
+ }
143
+ },
144
+ "reducer": {
145
+ "const": "task-macro-mean"
146
+ }
147
+ },
148
+ "required": [
149
+ "source_metric",
150
+ "direction",
151
+ "range",
152
+ "reducer"
153
+ ]
154
+ }
155
+ },
156
+ "required": [
157
+ "total_score"
158
+ ]
159
+ },
160
+ "raw_metrics": {
161
+ "type": "object",
162
+ "additionalProperties": false,
163
+ "properties": {
164
+ "schema_version": {
165
+ "const": "1"
166
+ },
167
+ "metrics": {
168
+ "type": "array",
169
+ "items": {
170
+ "type": "object"
171
+ }
172
+ }
173
+ },
174
+ "required": [
175
+ "schema_version",
176
+ "metrics"
177
+ ]
178
+ },
179
+ "tasks": {
180
+ "type": "array",
181
+ "minItems": 1,
182
+ "items": {
183
+ "type": "object",
184
+ "additionalProperties": false,
185
+ "properties": {
186
+ "task_id": {
187
+ "type": "string",
188
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$"
189
+ },
190
+ "source_task_digest": {
191
+ "type": "string",
192
+ "pattern": "^sha256:[a-f0-9]{64}$"
193
+ },
194
+ "resource_closure_digest": {
195
+ "type": "string",
196
+ "pattern": "^sha256:[a-f0-9]{64}$"
197
+ },
198
+ "task_digest": {
199
+ "type": "string",
200
+ "pattern": "^sha256:[a-f0-9]{64}$"
201
+ },
202
+ "sourceTree": {
203
+ "type": "object",
204
+ "additionalProperties": false,
205
+ "properties": {
206
+ "kind": {
207
+ "const": "tree"
208
+ },
209
+ "format": {
210
+ "const": "hitch-tree@1"
211
+ },
212
+ "manifestDigest": {
213
+ "type": "string",
214
+ "pattern": "^sha256:[a-f0-9]{64}$"
215
+ }
216
+ },
217
+ "required": [
218
+ "kind",
219
+ "format",
220
+ "manifestDigest"
221
+ ]
222
+ },
223
+ "lock": {
224
+ "type": "object",
225
+ "additionalProperties": false,
226
+ "properties": {
227
+ "protocol": {
228
+ "const": "hitch-resource-lock@1"
229
+ },
230
+ "resources": {
231
+ "type": "object",
232
+ "propertyNames": {
233
+ "type": "string",
234
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$"
235
+ },
236
+ "additionalProperties": {
237
+ "oneOf": [
238
+ {
239
+ "type": "object",
240
+ "additionalProperties": false,
241
+ "properties": {
242
+ "kind": {
243
+ "const": "blob"
244
+ },
245
+ "digest": {
246
+ "type": "string",
247
+ "pattern": "^sha256:[a-f0-9]{64}$"
248
+ },
249
+ "size": {
250
+ "type": "integer",
251
+ "minimum": 0,
252
+ "maximum": 9007199254740991
253
+ }
254
+ },
255
+ "required": [
256
+ "kind",
257
+ "digest",
258
+ "size"
259
+ ]
260
+ },
261
+ {
262
+ "type": "object",
263
+ "additionalProperties": false,
264
+ "properties": {
265
+ "kind": {
266
+ "const": "tree"
267
+ },
268
+ "format": {
269
+ "const": "hitch-tree@1"
270
+ },
271
+ "manifestDigest": {
272
+ "type": "string",
273
+ "pattern": "^sha256:[a-f0-9]{64}$"
274
+ }
275
+ },
276
+ "required": [
277
+ "kind",
278
+ "format",
279
+ "manifestDigest"
280
+ ]
281
+ },
282
+ {
283
+ "type": "object",
284
+ "additionalProperties": false,
285
+ "properties": {
286
+ "kind": {
287
+ "const": "oci-image"
288
+ },
289
+ "manifestDigest": {
290
+ "type": "string",
291
+ "pattern": "^sha256:[a-f0-9]{64}$"
292
+ },
293
+ "platform": {
294
+ "type": "string",
295
+ "pattern": "^linux/(amd64|arm64)(/v[0-9]+)?$"
296
+ },
297
+ "indexDigest": {
298
+ "type": "string",
299
+ "pattern": "^sha256:[a-f0-9]{64}$"
300
+ }
301
+ },
302
+ "required": [
303
+ "kind",
304
+ "manifestDigest",
305
+ "platform"
306
+ ]
307
+ }
308
+ ]
309
+ }
310
+ },
311
+ "bindings": {
312
+ "type": "array",
313
+ "items": {
314
+ "oneOf": [
315
+ {
316
+ "type": "object",
317
+ "additionalProperties": false,
318
+ "properties": {
319
+ "resource": {
320
+ "type": "string",
321
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$"
322
+ },
323
+ "consumer": {
324
+ "oneOf": [
325
+ {
326
+ "type": "object",
327
+ "additionalProperties": false,
328
+ "properties": {
329
+ "role": {
330
+ "const": "candidate"
331
+ }
332
+ },
333
+ "required": [
334
+ "role"
335
+ ]
336
+ },
337
+ {
338
+ "type": "object",
339
+ "additionalProperties": false,
340
+ "properties": {
341
+ "role": {
342
+ "const": "verifier"
343
+ }
344
+ },
345
+ "required": [
346
+ "role"
347
+ ]
348
+ },
349
+ {
350
+ "type": "object",
351
+ "additionalProperties": false,
352
+ "properties": {
353
+ "role": {
354
+ "const": "service"
355
+ },
356
+ "serviceId": {
357
+ "type": "string",
358
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$"
359
+ }
360
+ },
361
+ "required": [
362
+ "role",
363
+ "serviceId"
364
+ ]
365
+ }
366
+ ]
367
+ },
368
+ "use": {
369
+ "const": "input-file"
370
+ },
371
+ "target": {
372
+ "type": "string",
373
+ "minLength": 1,
374
+ "maxLength": 4096,
375
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.?(/|$))(?!.*[\\\\\\u0000-\\u001f\\u007f:])(?!.*//)(?!.*[/ ]$).+"
376
+ },
377
+ "executable": {
378
+ "type": "boolean"
379
+ },
380
+ "access": {
381
+ "enum": [
382
+ "read-only",
383
+ "private-copy"
384
+ ]
385
+ }
386
+ },
387
+ "required": [
388
+ "resource",
389
+ "consumer",
390
+ "use",
391
+ "target",
392
+ "executable",
393
+ "access"
394
+ ]
395
+ },
396
+ {
397
+ "type": "object",
398
+ "additionalProperties": false,
399
+ "properties": {
400
+ "resource": {
401
+ "type": "string",
402
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$"
403
+ },
404
+ "consumer": {
405
+ "oneOf": [
406
+ {
407
+ "type": "object",
408
+ "additionalProperties": false,
409
+ "properties": {
410
+ "role": {
411
+ "const": "candidate"
412
+ }
413
+ },
414
+ "required": [
415
+ "role"
416
+ ]
417
+ },
418
+ {
419
+ "type": "object",
420
+ "additionalProperties": false,
421
+ "properties": {
422
+ "role": {
423
+ "const": "verifier"
424
+ }
425
+ },
426
+ "required": [
427
+ "role"
428
+ ]
429
+ },
430
+ {
431
+ "type": "object",
432
+ "additionalProperties": false,
433
+ "properties": {
434
+ "role": {
435
+ "const": "service"
436
+ },
437
+ "serviceId": {
438
+ "type": "string",
439
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$"
440
+ }
441
+ },
442
+ "required": [
443
+ "role",
444
+ "serviceId"
445
+ ]
446
+ }
447
+ ]
448
+ },
449
+ "use": {
450
+ "const": "input-tree"
451
+ },
452
+ "target": {
453
+ "type": "string",
454
+ "minLength": 1,
455
+ "maxLength": 4096,
456
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.?(/|$))(?!.*[\\\\\\u0000-\\u001f\\u007f:])(?!.*//)(?!.*[/ ]$).+"
457
+ },
458
+ "access": {
459
+ "enum": [
460
+ "read-only",
461
+ "private-copy"
462
+ ]
463
+ }
464
+ },
465
+ "required": [
466
+ "resource",
467
+ "consumer",
468
+ "use",
469
+ "target",
470
+ "access"
471
+ ]
472
+ },
473
+ {
474
+ "type": "object",
475
+ "additionalProperties": false,
476
+ "properties": {
477
+ "resource": {
478
+ "type": "string",
479
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$"
480
+ },
481
+ "consumer": {
482
+ "oneOf": [
483
+ {
484
+ "type": "object",
485
+ "additionalProperties": false,
486
+ "properties": {
487
+ "role": {
488
+ "const": "candidate"
489
+ }
490
+ },
491
+ "required": [
492
+ "role"
493
+ ]
494
+ },
495
+ {
496
+ "type": "object",
497
+ "additionalProperties": false,
498
+ "properties": {
499
+ "role": {
500
+ "const": "verifier"
501
+ }
502
+ },
503
+ "required": [
504
+ "role"
505
+ ]
506
+ },
507
+ {
508
+ "type": "object",
509
+ "additionalProperties": false,
510
+ "properties": {
511
+ "role": {
512
+ "const": "service"
513
+ },
514
+ "serviceId": {
515
+ "type": "string",
516
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$"
517
+ }
518
+ },
519
+ "required": [
520
+ "role",
521
+ "serviceId"
522
+ ]
523
+ }
524
+ ]
525
+ },
526
+ "use": {
527
+ "const": "environment-image"
528
+ },
529
+ "slot": {
530
+ "enum": [
531
+ "runtime",
532
+ "build-base"
533
+ ]
534
+ }
535
+ },
536
+ "required": [
537
+ "resource",
538
+ "consumer",
539
+ "use",
540
+ "slot"
541
+ ]
542
+ }
543
+ ]
544
+ }
545
+ },
546
+ "requiredCapabilities": {
547
+ "type": "array",
548
+ "uniqueItems": true,
549
+ "items": {
550
+ "type": "string",
551
+ "pattern": "^[a-z][a-z0-9-]*@[1-9][0-9]*$"
552
+ }
553
+ }
554
+ },
555
+ "required": [
556
+ "protocol",
557
+ "resources",
558
+ "bindings",
559
+ "requiredCapabilities"
560
+ ]
561
+ }
562
+ },
563
+ "required": [
564
+ "task_id",
565
+ "source_task_digest",
566
+ "resource_closure_digest",
567
+ "task_digest",
568
+ "sourceTree",
569
+ "lock"
570
+ ]
571
+ }
572
+ },
573
+ "dataset_digest": {
574
+ "type": "string",
575
+ "pattern": "^sha256:[a-f0-9]{64}$"
576
+ }
577
+ },
578
+ "required": [
579
+ "schema_version",
580
+ "kind",
581
+ "resource_protocol",
582
+ "execution",
583
+ "required_capabilities",
584
+ "benchmark",
585
+ "adapter",
586
+ "scoring",
587
+ "tasks",
588
+ "dataset_digest"
589
+ ]
590
+ }