agent-hitch 0.1.1 → 0.2.1

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 (263) hide show
  1. package/README.md +235 -132
  2. package/README.zh-CN.md +335 -0
  3. package/dist/bin/hitch.js +9 -0
  4. package/dist/bin/hitch.js.map +1 -0
  5. package/dist/scripts/check-architecture.js +159 -0
  6. package/dist/scripts/check-architecture.js.map +1 -0
  7. package/dist/scripts/check-release.js +25 -0
  8. package/dist/scripts/check-release.js.map +1 -0
  9. package/dist/scripts/check-syntax.js +32 -0
  10. package/dist/scripts/check-syntax.js.map +1 -0
  11. package/dist/src/adapters/catalog.js +55 -0
  12. package/dist/src/adapters/catalog.js.map +1 -0
  13. package/dist/src/adapters/contract.js +2 -0
  14. package/dist/src/adapters/contract.js.map +1 -0
  15. package/dist/src/adapters/discovery.js +22 -0
  16. package/dist/src/adapters/discovery.js.map +1 -0
  17. package/dist/src/adapters/index.js +3 -0
  18. package/dist/src/adapters/index.js.map +1 -0
  19. package/dist/src/adapters/providers/claude.js +69 -0
  20. package/dist/src/adapters/providers/claude.js.map +1 -0
  21. package/dist/src/adapters/providers/codex.js +74 -0
  22. package/dist/src/adapters/providers/codex.js.map +1 -0
  23. package/dist/src/adapters/providers/deepseek.js +51 -0
  24. package/dist/src/adapters/providers/deepseek.js.map +1 -0
  25. package/dist/src/adapters/providers/opencode.js +73 -0
  26. package/dist/src/adapters/providers/opencode.js.map +1 -0
  27. package/dist/src/adapters/providers/pi.js +82 -0
  28. package/dist/src/adapters/providers/pi.js.map +1 -0
  29. package/dist/src/adapters/providers/shared.js +82 -0
  30. package/dist/src/adapters/providers/shared.js.map +1 -0
  31. package/dist/src/artifacts/index.js +3 -0
  32. package/dist/src/artifacts/index.js.map +1 -0
  33. package/dist/src/artifacts/integrity.js +188 -0
  34. package/dist/src/artifacts/integrity.js.map +1 -0
  35. package/dist/src/artifacts/preparer.js +379 -0
  36. package/dist/src/artifacts/preparer.js.map +1 -0
  37. package/dist/src/artifacts/store.js +87 -0
  38. package/dist/src/artifacts/store.js.map +1 -0
  39. package/dist/src/artifacts/types.js +2 -0
  40. package/dist/src/artifacts/types.js.map +1 -0
  41. package/dist/src/backends/contract.js +2 -0
  42. package/dist/src/backends/contract.js.map +1 -0
  43. package/dist/src/backends/harbor/backend.js +305 -0
  44. package/dist/src/backends/harbor/backend.js.map +1 -0
  45. package/dist/src/backends/harbor/index.js +4 -0
  46. package/dist/src/backends/harbor/index.js.map +1 -0
  47. package/dist/src/backends/harbor/local-git-transport.js +447 -0
  48. package/dist/src/backends/harbor/local-git-transport.js.map +1 -0
  49. package/dist/src/backends/harbor/tools.js +314 -0
  50. package/dist/src/backends/harbor/tools.js.map +1 -0
  51. package/dist/src/backends/index.js +4 -0
  52. package/dist/src/backends/index.js.map +1 -0
  53. package/dist/src/cli/arguments.js +123 -0
  54. package/dist/src/cli/arguments.js.map +1 -0
  55. package/dist/src/cli/commands/compare.js +55 -0
  56. package/dist/src/cli/commands/compare.js.map +1 -0
  57. package/dist/src/cli/commands/daemon.js +106 -0
  58. package/dist/src/cli/commands/daemon.js.map +1 -0
  59. package/dist/src/cli/commands/eval.js +126 -0
  60. package/dist/src/cli/commands/eval.js.map +1 -0
  61. package/dist/src/cli/commands/feedback.js +84 -0
  62. package/dist/src/cli/commands/feedback.js.map +1 -0
  63. package/dist/src/cli/commands/inspect.js +20 -0
  64. package/dist/src/cli/commands/inspect.js.map +1 -0
  65. package/dist/src/cli/commands/list.js +17 -0
  66. package/dist/src/cli/commands/list.js.map +1 -0
  67. package/dist/src/cli/commands/prepare.js +21 -0
  68. package/dist/src/cli/commands/prepare.js.map +1 -0
  69. package/dist/src/cli/commands/resolve.js +17 -0
  70. package/dist/src/cli/commands/resolve.js.map +1 -0
  71. package/dist/src/cli/commands/run.js +83 -0
  72. package/dist/src/cli/commands/run.js.map +1 -0
  73. package/dist/src/cli/commands/runs.js +45 -0
  74. package/dist/src/cli/commands/runs.js.map +1 -0
  75. package/dist/src/cli/commands/trajectory.js +31 -0
  76. package/dist/src/cli/commands/trajectory.js.map +1 -0
  77. package/dist/src/cli/commands/workspace.js +44 -0
  78. package/dist/src/cli/commands/workspace.js.map +1 -0
  79. package/dist/src/cli/index.js +2 -0
  80. package/dist/src/cli/index.js.map +1 -0
  81. package/dist/src/cli/main.js +48 -0
  82. package/dist/src/cli/main.js.map +1 -0
  83. package/dist/src/cli/output.js +96 -0
  84. package/dist/src/cli/output.js.map +1 -0
  85. package/dist/src/controller-runtime/hash.js +353 -0
  86. package/dist/src/controller-runtime/hash.js.map +1 -0
  87. package/dist/src/controller-runtime/index.js +3 -0
  88. package/dist/src/controller-runtime/index.js.map +1 -0
  89. package/dist/src/controller-runtime/store.js +318 -0
  90. package/dist/src/controller-runtime/store.js.map +1 -0
  91. package/dist/src/daemon/auth.js +108 -0
  92. package/dist/src/daemon/auth.js.map +1 -0
  93. package/dist/src/daemon/client.js +76 -0
  94. package/dist/src/daemon/client.js.map +1 -0
  95. package/dist/src/daemon/index.js +5 -0
  96. package/dist/src/daemon/index.js.map +1 -0
  97. package/dist/src/daemon/launcher.js +24 -0
  98. package/dist/src/daemon/launcher.js.map +1 -0
  99. package/dist/src/daemon/scheduler.js +161 -0
  100. package/dist/src/daemon/scheduler.js.map +1 -0
  101. package/dist/src/daemon/server.js +316 -0
  102. package/dist/src/daemon/server.js.map +1 -0
  103. package/dist/src/domain/artifacts.js +2 -0
  104. package/dist/src/domain/artifacts.js.map +1 -0
  105. package/dist/src/domain/controller-runtime.js +2 -0
  106. package/dist/src/domain/controller-runtime.js.map +1 -0
  107. package/dist/src/domain/eval-records.js +2 -0
  108. package/dist/src/domain/eval-records.js.map +1 -0
  109. package/dist/src/domain/evals.js +2 -0
  110. package/dist/src/domain/evals.js.map +1 -0
  111. package/dist/src/domain/feedback.js +2 -0
  112. package/dist/src/domain/feedback.js.map +1 -0
  113. package/dist/src/domain/ids.js +10 -0
  114. package/dist/src/domain/ids.js.map +1 -0
  115. package/dist/src/domain/index.js +11 -0
  116. package/dist/src/domain/index.js.map +1 -0
  117. package/dist/src/domain/revisions.js +2 -0
  118. package/dist/src/domain/revisions.js.map +1 -0
  119. package/dist/src/domain/runs.js +3 -0
  120. package/dist/src/domain/runs.js.map +1 -0
  121. package/dist/src/domain/trajectories.js +2 -0
  122. package/dist/src/domain/trajectories.js.map +1 -0
  123. package/dist/src/domain/validation.js +429 -0
  124. package/dist/src/domain/validation.js.map +1 -0
  125. package/dist/src/domain/workspaces.js +2 -0
  126. package/dist/src/domain/workspaces.js.map +1 -0
  127. package/dist/src/evals/events.js +67 -0
  128. package/dist/src/evals/events.js.map +1 -0
  129. package/dist/src/evals/index.js +5 -0
  130. package/dist/src/evals/index.js.map +1 -0
  131. package/dist/src/evals/records.js +55 -0
  132. package/dist/src/evals/records.js.map +1 -0
  133. package/dist/src/evals/request.js +109 -0
  134. package/dist/src/evals/request.js.map +1 -0
  135. package/dist/src/evals/service.js +227 -0
  136. package/dist/src/evals/service.js.map +1 -0
  137. package/dist/src/evals/trial-import.js +394 -0
  138. package/dist/src/evals/trial-import.js.map +1 -0
  139. package/dist/src/feedback/index.js +2 -0
  140. package/dist/src/feedback/index.js.map +1 -0
  141. package/dist/src/feedback/service.js +314 -0
  142. package/dist/src/feedback/service.js.map +1 -0
  143. package/dist/src/foundation/config.js +54 -0
  144. package/dist/src/foundation/config.js.map +1 -0
  145. package/dist/src/foundation/errors.js +14 -0
  146. package/dist/src/foundation/errors.js.map +1 -0
  147. package/dist/src/foundation/executable.js +135 -0
  148. package/dist/src/foundation/executable.js.map +1 -0
  149. package/dist/src/foundation/fs.js +45 -0
  150. package/dist/src/foundation/fs.js.map +1 -0
  151. package/dist/src/foundation/hash.js +24 -0
  152. package/dist/src/foundation/hash.js.map +1 -0
  153. package/dist/src/foundation/index.js +11 -0
  154. package/dist/src/foundation/index.js.map +1 -0
  155. package/dist/src/foundation/line-stream.js +20 -0
  156. package/dist/src/foundation/line-stream.js.map +1 -0
  157. package/dist/src/foundation/locks.js +114 -0
  158. package/dist/src/foundation/locks.js.map +1 -0
  159. package/dist/src/foundation/package-root.js +41 -0
  160. package/dist/src/foundation/package-root.js.map +1 -0
  161. package/dist/src/foundation/process.js +50 -0
  162. package/dist/src/foundation/process.js.map +1 -0
  163. package/dist/src/revisions/index.js +4 -0
  164. package/dist/src/revisions/index.js.map +1 -0
  165. package/dist/src/revisions/reference.js +97 -0
  166. package/dist/src/revisions/reference.js.map +1 -0
  167. package/dist/src/revisions/resolver.js +25 -0
  168. package/dist/src/revisions/resolver.js.map +1 -0
  169. package/dist/src/revisions/sources/git.js +180 -0
  170. package/dist/src/revisions/sources/git.js.map +1 -0
  171. package/dist/src/revisions/sources/installed.js +45 -0
  172. package/dist/src/revisions/sources/installed.js.map +1 -0
  173. package/dist/src/revisions/sources/npm.js +97 -0
  174. package/dist/src/revisions/sources/npm.js.map +1 -0
  175. package/dist/src/runs/compare.js +132 -0
  176. package/dist/src/runs/compare.js.map +1 -0
  177. package/dist/src/runs/events.js +79 -0
  178. package/dist/src/runs/events.js.map +1 -0
  179. package/dist/src/runs/executor.js +480 -0
  180. package/dist/src/runs/executor.js.map +1 -0
  181. package/dist/src/runs/finalizer.js +22 -0
  182. package/dist/src/runs/finalizer.js.map +1 -0
  183. package/dist/src/runs/identity.js +35 -0
  184. package/dist/src/runs/identity.js.map +1 -0
  185. package/dist/src/runs/index.js +11 -0
  186. package/dist/src/runs/index.js.map +1 -0
  187. package/dist/src/runs/manifest.js +70 -0
  188. package/dist/src/runs/manifest.js.map +1 -0
  189. package/dist/src/runs/outcome.js +49 -0
  190. package/dist/src/runs/outcome.js.map +1 -0
  191. package/dist/src/runs/query.js +104 -0
  192. package/dist/src/runs/query.js.map +1 -0
  193. package/dist/src/runs/queued.js +54 -0
  194. package/dist/src/runs/queued.js.map +1 -0
  195. package/dist/src/runs/records.js +288 -0
  196. package/dist/src/runs/records.js.map +1 -0
  197. package/dist/src/runs/request.js +169 -0
  198. package/dist/src/runs/request.js.map +1 -0
  199. package/dist/src/trajectories/contract.js +17 -0
  200. package/dist/src/trajectories/contract.js.map +1 -0
  201. package/dist/src/trajectories/format.js +127 -0
  202. package/dist/src/trajectories/format.js.map +1 -0
  203. package/dist/src/trajectories/index.js +7 -0
  204. package/dist/src/trajectories/index.js.map +1 -0
  205. package/dist/src/trajectories/projector.js +385 -0
  206. package/dist/src/trajectories/projector.js.map +1 -0
  207. package/dist/src/trajectories/provider-capture.js +133 -0
  208. package/dist/src/trajectories/provider-capture.js.map +1 -0
  209. package/dist/src/trajectories/providers/deepseek.js +179 -0
  210. package/dist/src/trajectories/providers/deepseek.js.map +1 -0
  211. package/dist/src/trajectories/store.js +421 -0
  212. package/dist/src/trajectories/store.js.map +1 -0
  213. package/dist/src/workspaces/copy.js +142 -0
  214. package/dist/src/workspaces/copy.js.map +1 -0
  215. package/dist/src/workspaces/digest.js +47 -0
  216. package/dist/src/workspaces/digest.js.map +1 -0
  217. package/dist/src/workspaces/git.js +164 -0
  218. package/dist/src/workspaces/git.js.map +1 -0
  219. package/dist/src/workspaces/index.js +6 -0
  220. package/dist/src/workspaces/index.js.map +1 -0
  221. package/dist/src/workspaces/lifecycle.js +313 -0
  222. package/dist/src/workspaces/lifecycle.js.map +1 -0
  223. package/dist/src/workspaces/planner.js +80 -0
  224. package/dist/src/workspaces/planner.js.map +1 -0
  225. package/dist/src/workspaces/store.js +25 -0
  226. package/dist/src/workspaces/store.js.map +1 -0
  227. package/dist/src/workspaces/types.js +4 -0
  228. package/dist/src/workspaces/types.js.map +1 -0
  229. package/dist/src/workspaces/utils.js +56 -0
  230. package/dist/src/workspaces/utils.js.map +1 -0
  231. package/docs/schemas/controller-runtime-manifest.schema.json +57 -0
  232. package/docs/schemas/controller-runtime-ref.schema.json +16 -0
  233. package/docs/schemas/eval-request.schema.json +2 -0
  234. package/docs/schemas/eval-result.schema.json +36 -1
  235. package/docs/schemas/local-git-transport-manifest.schema.json +34 -0
  236. package/docs/schemas/message-feedback.schema.json +37 -0
  237. package/docs/schemas/result.schema.json +9 -0
  238. package/docs/schemas/run-context.schema.json +39 -0
  239. package/docs/schemas/run-manifest.schema.json +81 -0
  240. package/docs/schemas/run-request.schema.json +16 -1
  241. package/docs/schemas/trajectory-ref.schema.json +73 -0
  242. package/integrations/harbor/hitch_harbor_agent.py +551 -5
  243. package/package.json +37 -11
  244. package/bin/hitch.js +0 -9
  245. package/src/adapters.js +0 -435
  246. package/src/artifacts.js +0 -949
  247. package/src/cli.js +0 -505
  248. package/src/config.js +0 -51
  249. package/src/daemon.js +0 -416
  250. package/src/engine.js +0 -400
  251. package/src/errors.js +0 -12
  252. package/src/eval-tools.js +0 -334
  253. package/src/evals.js +0 -276
  254. package/src/events.js +0 -69
  255. package/src/fs.js +0 -43
  256. package/src/harbor-backend.js +0 -285
  257. package/src/harness-reference.js +0 -78
  258. package/src/line-stream.js +0 -17
  259. package/src/locks.js +0 -33
  260. package/src/process.js +0 -49
  261. package/src/registry.js +0 -84
  262. package/src/scheduler.js +0 -156
  263. package/src/workspaces.js +0 -893
@@ -4,7 +4,7 @@
4
4
  "title": "Hitch eval result",
5
5
  "type": "object",
6
6
  "additionalProperties": true,
7
- "required": ["schema_version", "eval_id", "status", "exit_code", "started_at", "completed_at"],
7
+ "required": ["schema_version", "eval_id", "benchmark_id", "benchmark_revision", "status", "exit_code", "trials", "started_at", "completed_at"],
8
8
  "properties": {
9
9
  "schema_version": { "const": "1" },
10
10
  "eval_id": { "type": "string", "pattern": "^eval_[a-f0-9]{32}$" },
@@ -25,6 +25,41 @@
25
25
  "additionalProperties": true
26
26
  },
27
27
  "summary": { "type": ["object", "null"] },
28
+ "benchmark_id": { "type": "string", "minLength": 1 },
29
+ "benchmark_revision": { "type": "string", "minLength": 1 },
30
+ "trials": {
31
+ "type": "array",
32
+ "items": {
33
+ "type": "object",
34
+ "additionalProperties": false,
35
+ "required": ["trial_id", "run_id", "task_id", "attempt", "observation_status"],
36
+ "properties": {
37
+ "trial_id": { "type": "string", "minLength": 1 },
38
+ "run_id": { "type": "string", "pattern": "^run_[a-f0-9]{32}$" },
39
+ "task_id": { "type": "string", "minLength": 1 },
40
+ "attempt": { "type": "integer", "minimum": 1 },
41
+ "observation_status": { "enum": ["valid", "invalid"] },
42
+ "reward": { "type": "number" },
43
+ "verifier_result_ref": { "type": "string", "minLength": 1 },
44
+ "invalid_reason": { "type": "string", "minLength": 1 }
45
+ }
46
+ }
47
+ },
48
+ "local_source_transport": {
49
+ "type": "object",
50
+ "required": ["kind", "resolution_identity", "commit", "tree", "payload_sha256", "payload_bytes"],
51
+ "properties": {
52
+ "kind": { "const": "local-git-commit" },
53
+ "resolution_identity": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
54
+ "commit": { "type": "string", "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$" },
55
+ "tree": { "type": "string", "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$" },
56
+ "payload_sha256": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
57
+ "payload_bytes": { "type": "integer", "minimum": 0 },
58
+ "object_count": { "type": "integer", "minimum": 0 },
59
+ "file_count": { "type": "integer", "minimum": 0 }
60
+ },
61
+ "additionalProperties": false
62
+ },
28
63
  "error": {
29
64
  "type": "object",
30
65
  "required": ["code", "message"],
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agent-hitch.local/schemas/local-git-transport-manifest.schema.json",
4
+ "title": "Hitch local Git commit transport manifest",
5
+ "description": "Proof for a size-limited Git object pack containing one exact local commit and its checkout tree. The Git commit remains the harness revision identity; payload_sha256 only proves transport integrity.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schema_version",
10
+ "kind",
11
+ "harness_id",
12
+ "resolution_identity",
13
+ "commit",
14
+ "tree",
15
+ "payload_sha256",
16
+ "payload_bytes",
17
+ "object_count",
18
+ "file_count",
19
+ "created_at"
20
+ ],
21
+ "properties": {
22
+ "schema_version": { "const": "1" },
23
+ "kind": { "const": "local-git-commit" },
24
+ "harness_id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" },
25
+ "resolution_identity": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
26
+ "commit": { "type": "string", "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$" },
27
+ "tree": { "type": "string", "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$" },
28
+ "payload_sha256": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
29
+ "payload_bytes": { "type": "integer", "minimum": 0 },
30
+ "object_count": { "type": "integer", "minimum": 0 },
31
+ "file_count": { "type": "integer", "minimum": 0 },
32
+ "created_at": { "type": "string", "format": "date-time" }
33
+ }
34
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://github.com/rsi-gear/agent-hitch/docs/schemas/message-feedback.schema.json",
4
+ "title": "Message feedback sidecar row",
5
+ "description": "Lifecycle-bound editable message feedback sidecar, one whole-session row per session (spec §6.2). A lifecycle identity mismatch is treated as absence. Compare-and-set uses opaque UUID versions; ifVersion null requests creation only.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["session", "items"],
9
+ "properties": {
10
+ "session": {
11
+ "type": "object",
12
+ "additionalProperties": false,
13
+ "required": ["createdAt"],
14
+ "properties": {
15
+ "sessionId": { "type": "string" },
16
+ "createdAt": { "type": "integer", "minimum": 0 },
17
+ "cwd": { "type": "string" }
18
+ }
19
+ },
20
+ "items": {
21
+ "type": "array",
22
+ "items": {
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": ["messageId", "rating", "version", "createdAt", "updatedAt"],
26
+ "properties": {
27
+ "messageId": { "type": "string", "minLength": 1 },
28
+ "rating": { "enum": ["positive", "negative"] },
29
+ "note": { "type": "string" },
30
+ "version": { "type": "string", "minLength": 1 },
31
+ "createdAt": { "type": "integer", "minimum": 0 },
32
+ "updatedAt": { "type": "integer", "minimum": 0 }
33
+ }
34
+ }
35
+ }
36
+ }
37
+ }
@@ -32,6 +32,15 @@
32
32
  },
33
33
  "additionalProperties": true
34
34
  },
35
+ "trajectory_warning": {
36
+ "type": "object",
37
+ "required": ["code", "message"],
38
+ "properties": {
39
+ "code": { "const": "trajectory_recording_failed" },
40
+ "message": { "type": "string" }
41
+ },
42
+ "additionalProperties": true
43
+ },
35
44
  "started_at": {
36
45
  "type": "string",
37
46
  "format": "date-time"
@@ -0,0 +1,39 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agent-hitch.local/schemas/run-context.schema.json",
4
+ "title": "Hitch run context V1",
5
+ "oneOf": [
6
+ {
7
+ "type": "object",
8
+ "additionalProperties": false,
9
+ "required": ["kind"],
10
+ "properties": { "kind": { "const": "ad_hoc" } }
11
+ },
12
+ {
13
+ "type": "object",
14
+ "additionalProperties": false,
15
+ "required": ["kind", "seed_task_id", "seed_task_digest"],
16
+ "properties": {
17
+ "kind": { "const": "seed_task" },
18
+ "seed_task_id": { "type": "string", "minLength": 1 },
19
+ "seed_task_digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
20
+ "seed_set_id": { "type": "string", "minLength": 1 },
21
+ "seed_set_revision": { "type": "string", "minLength": 1 },
22
+ "iteration_id": { "type": "string", "minLength": 1 }
23
+ }
24
+ },
25
+ {
26
+ "type": "object",
27
+ "additionalProperties": false,
28
+ "required": ["kind", "benchmark_id", "benchmark_revision", "task_id", "task_digest", "verifier_identity"],
29
+ "properties": {
30
+ "kind": { "const": "benchmark_task" },
31
+ "benchmark_id": { "type": "string", "minLength": 1 },
32
+ "benchmark_revision": { "type": "string", "minLength": 1, "not": { "pattern": "^[Ll][Aa][Tt][Ee][Ss][Tt]$" } },
33
+ "task_id": { "type": "string", "minLength": 1 },
34
+ "task_digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
35
+ "verifier_identity": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }
36
+ }
37
+ }
38
+ ]
39
+ }
@@ -0,0 +1,81 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agent-hitch.local/schemas/run-manifest.schema.json",
4
+ "title": "Hitch RunRecord manifest V1",
5
+ "type": "object",
6
+ "additionalProperties": true,
7
+ "required": ["schema_version", "run_id", "context", "status", "harness", "model", "protocol", "request_ref", "resolution_ref", "created_at"],
8
+ "properties": {
9
+ "schema_version": { "const": "1" },
10
+ "run_id": { "type": "string", "pattern": "^run_[a-f0-9]{32}$" },
11
+ "context": { "$ref": "run-context.schema.json" },
12
+ "parent": {
13
+ "type": "object",
14
+ "additionalProperties": false,
15
+ "required": ["kind", "eval_id", "trial_id", "attempt"],
16
+ "properties": {
17
+ "kind": { "const": "eval" },
18
+ "eval_id": { "type": "string", "pattern": "^eval_[a-f0-9]{32}$" },
19
+ "trial_id": { "type": "string", "minLength": 1 },
20
+ "attempt": { "type": "integer", "minimum": 1 }
21
+ }
22
+ },
23
+ "status": { "enum": ["queued", "preparing", "running", "succeeded", "failed", "timed_out", "cancelled"] },
24
+ "harness": {
25
+ "type": "object",
26
+ "additionalProperties": false,
27
+ "required": ["harness_id", "requested_ref", "revision_identity"],
28
+ "properties": {
29
+ "harness_id": { "type": "string", "minLength": 1 },
30
+ "requested_ref": { "type": "string", "minLength": 1 },
31
+ "revision_identity": { "type": ["string", "null"], "pattern": "^sha256:[0-9a-f]{64}$" },
32
+ "artifact_id": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
33
+ "agent_args_sha256": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }
34
+ }
35
+ },
36
+ "model": {
37
+ "type": "object",
38
+ "additionalProperties": false,
39
+ "required": ["requested_id", "effective_id"],
40
+ "properties": {
41
+ "provider": { "type": "string", "minLength": 1 },
42
+ "requested_id": { "type": "string" },
43
+ "effective_id": { "type": "string" },
44
+ "parameters_sha256": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
45
+ "identity_resolved": { "type": "boolean" }
46
+ }
47
+ },
48
+ "protocol": {
49
+ "type": "object",
50
+ "additionalProperties": false,
51
+ "required": ["timeout_ms", "workspace_mode"],
52
+ "properties": {
53
+ "timeout_ms": { "type": "number", "minimum": 0 },
54
+ "workspace_mode": { "type": "string", "minLength": 1 },
55
+ "initial_workspace_digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
56
+ "environment_identity": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
57
+ "tool_policy_sha256": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }
58
+ }
59
+ },
60
+ "observation": {
61
+ "type": "object",
62
+ "additionalProperties": false,
63
+ "required": ["status"],
64
+ "properties": {
65
+ "status": { "enum": ["valid", "invalid"] },
66
+ "reward": { "type": "number" },
67
+ "verifier_result_ref": { "$ref": "#/$defs/relativePath" },
68
+ "invalid_reason": { "type": "string", "minLength": 1 }
69
+ }
70
+ },
71
+ "request_ref": { "$ref": "#/$defs/relativePath" },
72
+ "resolution_ref": { "$ref": "#/$defs/relativePath" },
73
+ "result_ref": { "$ref": "#/$defs/relativePath" },
74
+ "trajectory_ref": { "$ref": "#/$defs/relativePath" },
75
+ "created_at": { "type": "string", "format": "date-time" },
76
+ "completed_at": { "type": "string", "format": "date-time" }
77
+ },
78
+ "$defs": {
79
+ "relativePath": { "type": "string", "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\).+$" }
80
+ }
81
+ }
@@ -51,6 +51,21 @@
51
51
  "items": {
52
52
  "type": "string"
53
53
  }
54
- }
54
+ },
55
+ "context": { "$ref": "run-context.schema.json" },
56
+ "parent": {
57
+ "type": "object",
58
+ "additionalProperties": false,
59
+ "required": ["kind", "eval_id", "trial_id", "attempt"],
60
+ "properties": {
61
+ "kind": { "const": "eval" },
62
+ "eval_id": { "type": "string", "pattern": "^eval_[a-f0-9]{32}$" },
63
+ "trial_id": { "type": "string", "minLength": 1 },
64
+ "attempt": { "type": "integer", "minimum": 1 }
65
+ }
66
+ },
67
+ "model_identity": { "type": "object" },
68
+ "protocol_identity": { "type": "object" },
69
+ "defer_benchmark_observation": { "type": "boolean" }
55
70
  }
56
71
  }
@@ -0,0 +1,73 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agent-hitch.local/schemas/trajectory-ref.schema.json",
4
+ "title": "Hitch trajectory reference",
5
+ "oneOf": [
6
+ {
7
+ "type": "object",
8
+ "additionalProperties": false,
9
+ "required": ["schema_version", "run_id", "session_id", "format", "fidelity", "path"],
10
+ "properties": {
11
+ "schema_version": { "const": "1" },
12
+ "run_id": { "type": "string", "pattern": "^run_[a-f0-9]{32}$" },
13
+ "session_id": { "type": "string", "minLength": 1 },
14
+ "provider_session_id": { "type": "string" },
15
+ "format": {
16
+ "type": "object",
17
+ "additionalProperties": false,
18
+ "required": ["family", "version", "contract_commit", "compression", "pack_chunks"],
19
+ "properties": {
20
+ "family": { "const": "dsh-session" },
21
+ "version": { "const": 0 },
22
+ "contract_commit": { "type": "string", "pattern": "^[0-9a-f]{40}$" },
23
+ "compression": { "const": "none" },
24
+ "pack_chunks": { "const": false }
25
+ }
26
+ },
27
+ "fidelity": { "enum": ["native", "normalized", "minimal"] },
28
+ "path": { "type": "string", "minLength": 1 },
29
+ "sha256": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }
30
+ }
31
+ },
32
+ {
33
+ "type": "object",
34
+ "additionalProperties": false,
35
+ "required": ["schema_version", "run_id", "fidelity", "files"],
36
+ "properties": {
37
+ "schema_version": { "const": "2" },
38
+ "run_id": { "type": "string", "pattern": "^run_[a-f0-9]{32}$" },
39
+ "fidelity": { "enum": ["provider_native", "normalized", "minimal"] },
40
+ "provider": { "type": "string", "minLength": 1 },
41
+ "provider_session_id": { "type": "string", "minLength": 1 },
42
+ "files": {
43
+ "type": "array",
44
+ "minItems": 1,
45
+ "items": {
46
+ "type": "object",
47
+ "additionalProperties": false,
48
+ "required": ["role", "path", "media_type", "sha256", "bytes"],
49
+ "properties": {
50
+ "role": { "enum": ["provider_events", "provider_transcript", "provider_artifact", "canonical_session"] },
51
+ "path": { "type": "string", "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\).+$" },
52
+ "media_type": { "type": "string", "minLength": 1 },
53
+ "sha256": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
54
+ "bytes": { "type": "integer", "minimum": 0 }
55
+ }
56
+ }
57
+ },
58
+ "redactions": {
59
+ "type": "array",
60
+ "items": {
61
+ "type": "object",
62
+ "additionalProperties": false,
63
+ "required": ["rule_id", "count"],
64
+ "properties": {
65
+ "rule_id": { "type": "string", "minLength": 1 },
66
+ "count": { "type": "integer", "minimum": 1 }
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
72
+ ]
73
+ }