agent-hitch 0.2.0 → 0.2.2

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 (265) hide show
  1. package/README.md +88 -250
  2. package/README.zh-CN.md +84 -230
  3. package/dist/bin/hitch.js +1 -1
  4. package/dist/bin/hitch.js.map +1 -1
  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 +1 -1
  8. package/dist/scripts/check-release.js.map +1 -1
  9. package/dist/src/adapters/catalog.js +55 -0
  10. package/dist/src/adapters/catalog.js.map +1 -0
  11. package/dist/src/adapters/contract.js +2 -0
  12. package/dist/src/adapters/contract.js.map +1 -0
  13. package/dist/src/adapters/discovery.js +22 -0
  14. package/dist/src/adapters/discovery.js.map +1 -0
  15. package/dist/src/adapters/index.js +3 -0
  16. package/dist/src/adapters/index.js.map +1 -0
  17. package/dist/src/adapters/providers/claude.js +69 -0
  18. package/dist/src/adapters/providers/claude.js.map +1 -0
  19. package/dist/src/adapters/providers/codex.js +74 -0
  20. package/dist/src/adapters/providers/codex.js.map +1 -0
  21. package/dist/src/adapters/providers/deepseek.js +51 -0
  22. package/dist/src/adapters/providers/deepseek.js.map +1 -0
  23. package/dist/src/adapters/providers/opencode.js +73 -0
  24. package/dist/src/adapters/providers/opencode.js.map +1 -0
  25. package/dist/src/adapters/providers/pi.js +82 -0
  26. package/dist/src/adapters/providers/pi.js.map +1 -0
  27. package/dist/src/adapters/providers/shared.js +82 -0
  28. package/dist/src/adapters/providers/shared.js.map +1 -0
  29. package/dist/src/artifacts/handoff.js +12 -0
  30. package/dist/src/artifacts/handoff.js.map +1 -0
  31. package/dist/src/artifacts/index.js +5 -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 +157 -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/{harbor-backend.js → backends/harbor/backend.js} +52 -14
  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/{eval-tools.js → backends/harbor/tools.js} +2 -6
  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 +145 -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/index.js +3 -0
  86. package/dist/src/controller-runtime/index.js.map +1 -0
  87. package/dist/src/controller-runtime/store.js +2 -7
  88. package/dist/src/controller-runtime/store.js.map +1 -1
  89. package/dist/src/daemon/auth.js +108 -0
  90. package/dist/src/daemon/auth.js.map +1 -0
  91. package/dist/src/daemon/client.js +76 -0
  92. package/dist/src/daemon/client.js.map +1 -0
  93. package/dist/src/daemon/index.js +5 -0
  94. package/dist/src/daemon/index.js.map +1 -0
  95. package/dist/src/daemon/launcher.js +24 -0
  96. package/dist/src/daemon/launcher.js.map +1 -0
  97. package/dist/src/{scheduler.js → daemon/scheduler.js} +6 -7
  98. package/dist/src/daemon/scheduler.js.map +1 -0
  99. package/dist/src/{daemon.js → daemon/server.js} +10 -155
  100. package/dist/src/daemon/server.js.map +1 -0
  101. package/dist/src/domain/artifacts.js +2 -0
  102. package/dist/src/domain/artifacts.js.map +1 -0
  103. package/dist/src/domain/controller-runtime.js +2 -0
  104. package/dist/src/domain/controller-runtime.js.map +1 -0
  105. package/dist/src/domain/eval-records.js +2 -0
  106. package/dist/src/domain/eval-records.js.map +1 -0
  107. package/dist/src/domain/evals.js +2 -0
  108. package/dist/src/domain/evals.js.map +1 -0
  109. package/dist/src/domain/feedback.js +2 -0
  110. package/dist/src/domain/feedback.js.map +1 -0
  111. package/dist/src/domain/{types.js → ids.js} +1 -1
  112. package/dist/src/domain/ids.js.map +1 -0
  113. package/dist/src/domain/index.js +11 -0
  114. package/dist/src/domain/index.js.map +1 -0
  115. package/dist/src/domain/revisions.js +2 -0
  116. package/dist/src/domain/revisions.js.map +1 -0
  117. package/dist/src/domain/runs.js +3 -0
  118. package/dist/src/domain/runs.js.map +1 -0
  119. package/dist/src/domain/trajectories.js +2 -0
  120. package/dist/src/domain/trajectories.js.map +1 -0
  121. package/dist/src/domain/{validate.js → validation.js} +194 -5
  122. package/dist/src/domain/validation.js.map +1 -0
  123. package/dist/src/domain/workspaces.js +2 -0
  124. package/dist/src/domain/workspaces.js.map +1 -0
  125. package/dist/src/evals/events.js +67 -0
  126. package/dist/src/evals/events.js.map +1 -0
  127. package/dist/src/evals/index.js +5 -0
  128. package/dist/src/evals/index.js.map +1 -0
  129. package/dist/src/evals/records.js +55 -0
  130. package/dist/src/evals/records.js.map +1 -0
  131. package/dist/src/evals/request.js +109 -0
  132. package/dist/src/evals/request.js.map +1 -0
  133. package/dist/src/evals/service.js +280 -0
  134. package/dist/src/evals/service.js.map +1 -0
  135. package/dist/src/evals/trial-import.js +394 -0
  136. package/dist/src/evals/trial-import.js.map +1 -0
  137. package/dist/src/feedback/index.js +2 -0
  138. package/dist/src/feedback/index.js.map +1 -0
  139. package/dist/src/feedback/service.js +3 -4
  140. package/dist/src/feedback/service.js.map +1 -1
  141. package/dist/src/{config.js → foundation/config.js} +1 -0
  142. package/dist/src/foundation/config.js.map +1 -0
  143. package/dist/src/foundation/errors.js.map +1 -0
  144. package/dist/src/foundation/executable.js +135 -0
  145. package/dist/src/foundation/executable.js.map +1 -0
  146. package/dist/src/foundation/fs.js.map +1 -0
  147. package/dist/src/foundation/hash.js +24 -0
  148. package/dist/src/foundation/hash.js.map +1 -0
  149. package/dist/src/foundation/index.js +11 -0
  150. package/dist/src/foundation/index.js.map +1 -0
  151. package/dist/src/foundation/line-stream.js.map +1 -0
  152. package/dist/src/foundation/locks.js +114 -0
  153. package/dist/src/foundation/locks.js.map +1 -0
  154. package/dist/src/{package-root.js → foundation/package-root.js} +3 -2
  155. package/dist/src/foundation/package-root.js.map +1 -0
  156. package/dist/src/foundation/process.js.map +1 -0
  157. package/dist/src/revisions/index.js +4 -0
  158. package/dist/src/revisions/index.js.map +1 -0
  159. package/dist/src/{harness-reference.js → revisions/reference.js} +16 -2
  160. package/dist/src/revisions/reference.js.map +1 -0
  161. package/dist/src/revisions/resolver.js +25 -0
  162. package/dist/src/revisions/resolver.js.map +1 -0
  163. package/dist/src/revisions/sources/git.js +180 -0
  164. package/dist/src/revisions/sources/git.js.map +1 -0
  165. package/dist/src/revisions/sources/installed.js +45 -0
  166. package/dist/src/revisions/sources/installed.js.map +1 -0
  167. package/dist/src/revisions/sources/npm.js +97 -0
  168. package/dist/src/revisions/sources/npm.js.map +1 -0
  169. package/dist/src/runs/compare.js +132 -0
  170. package/dist/src/runs/compare.js.map +1 -0
  171. package/dist/src/{events.js → runs/events.js} +1 -2
  172. package/dist/src/runs/events.js.map +1 -0
  173. package/dist/src/{engine.js → runs/executor.js} +172 -151
  174. package/dist/src/runs/executor.js.map +1 -0
  175. package/dist/src/runs/finalizer.js +22 -0
  176. package/dist/src/runs/finalizer.js.map +1 -0
  177. package/dist/src/runs/identity.js +35 -0
  178. package/dist/src/runs/identity.js.map +1 -0
  179. package/dist/src/runs/index.js +11 -0
  180. package/dist/src/runs/index.js.map +1 -0
  181. package/dist/src/runs/manifest.js +70 -0
  182. package/dist/src/runs/manifest.js.map +1 -0
  183. package/dist/src/runs/outcome.js +49 -0
  184. package/dist/src/runs/outcome.js.map +1 -0
  185. package/dist/src/runs/query.js +104 -0
  186. package/dist/src/runs/query.js.map +1 -0
  187. package/dist/src/runs/queued.js +54 -0
  188. package/dist/src/runs/queued.js.map +1 -0
  189. package/dist/src/runs/records.js +288 -0
  190. package/dist/src/runs/records.js.map +1 -0
  191. package/dist/src/runs/request.js +169 -0
  192. package/dist/src/runs/request.js.map +1 -0
  193. package/dist/src/trajectories/format.js +1 -1
  194. package/dist/src/trajectories/format.js.map +1 -1
  195. package/dist/src/trajectories/index.js +7 -0
  196. package/dist/src/trajectories/index.js.map +1 -0
  197. package/dist/src/trajectories/projector.js +1 -1
  198. package/dist/src/trajectories/projector.js.map +1 -1
  199. package/dist/src/trajectories/provider-capture.js +133 -0
  200. package/dist/src/trajectories/provider-capture.js.map +1 -0
  201. package/dist/src/trajectories/providers/deepseek.js +179 -0
  202. package/dist/src/trajectories/providers/deepseek.js.map +1 -0
  203. package/dist/src/trajectories/store.js +148 -8
  204. package/dist/src/trajectories/store.js.map +1 -1
  205. package/dist/src/workspaces/copy.js +142 -0
  206. package/dist/src/workspaces/copy.js.map +1 -0
  207. package/dist/src/workspaces/digest.js +47 -0
  208. package/dist/src/workspaces/digest.js.map +1 -0
  209. package/dist/src/workspaces/git.js +164 -0
  210. package/dist/src/workspaces/git.js.map +1 -0
  211. package/dist/src/workspaces/index.js +6 -0
  212. package/dist/src/workspaces/index.js.map +1 -0
  213. package/dist/src/workspaces/lifecycle.js +313 -0
  214. package/dist/src/workspaces/lifecycle.js.map +1 -0
  215. package/dist/src/workspaces/planner.js +80 -0
  216. package/dist/src/workspaces/planner.js.map +1 -0
  217. package/dist/src/workspaces/store.js +25 -0
  218. package/dist/src/workspaces/store.js.map +1 -0
  219. package/dist/src/workspaces/types.js +4 -0
  220. package/dist/src/workspaces/types.js.map +1 -0
  221. package/dist/src/workspaces/utils.js +56 -0
  222. package/dist/src/workspaces/utils.js.map +1 -0
  223. package/docs/schemas/eval-request.schema.json +2 -0
  224. package/docs/schemas/eval-result.schema.json +50 -1
  225. package/docs/schemas/local-git-transport-manifest.schema.json +34 -0
  226. package/docs/schemas/result.schema.json +9 -0
  227. package/docs/schemas/run-context.schema.json +39 -0
  228. package/docs/schemas/run-manifest.schema.json +81 -0
  229. package/docs/schemas/run-request.schema.json +16 -1
  230. package/docs/schemas/trajectory-ref.schema.json +66 -23
  231. package/integrations/harbor/hitch_harbor_agent.py +482 -10
  232. package/package.json +21 -3
  233. package/dist/src/adapters.js +0 -461
  234. package/dist/src/adapters.js.map +0 -1
  235. package/dist/src/artifacts.js +0 -1081
  236. package/dist/src/artifacts.js.map +0 -1
  237. package/dist/src/cli.js +0 -699
  238. package/dist/src/cli.js.map +0 -1
  239. package/dist/src/config.js.map +0 -1
  240. package/dist/src/daemon.js.map +0 -1
  241. package/dist/src/domain/types.js.map +0 -1
  242. package/dist/src/domain/validate.js.map +0 -1
  243. package/dist/src/engine.js.map +0 -1
  244. package/dist/src/errors.js.map +0 -1
  245. package/dist/src/eval-tools.js.map +0 -1
  246. package/dist/src/evals.js +0 -313
  247. package/dist/src/evals.js.map +0 -1
  248. package/dist/src/events.js.map +0 -1
  249. package/dist/src/fs.js.map +0 -1
  250. package/dist/src/harbor-backend.js.map +0 -1
  251. package/dist/src/harness-reference.js.map +0 -1
  252. package/dist/src/line-stream.js.map +0 -1
  253. package/dist/src/locks.js +0 -38
  254. package/dist/src/locks.js.map +0 -1
  255. package/dist/src/package-root.js.map +0 -1
  256. package/dist/src/process.js.map +0 -1
  257. package/dist/src/registry.js +0 -81
  258. package/dist/src/registry.js.map +0 -1
  259. package/dist/src/scheduler.js.map +0 -1
  260. package/dist/src/workspaces.js +0 -858
  261. package/dist/src/workspaces.js.map +0 -1
  262. /package/dist/src/{errors.js → foundation/errors.js} +0 -0
  263. /package/dist/src/{fs.js → foundation/fs.js} +0 -0
  264. /package/dist/src/{line-stream.js → foundation/line-stream.js} +0 -0
  265. /package/dist/src/{process.js → foundation/process.js} +0 -0
package/README.md CHANGED
@@ -6,182 +6,126 @@
6
6
 
7
7
  [English](README.md) | [简体中文](README.zh-CN.md)
8
8
 
9
- **Content-addressed version control and evidence storage for agent harnesses.**
9
+ **Reproducible runs for agent harnesses.**
10
10
 
11
- Hitch makes every agent run traceable to an exact harness revision. It resolves
12
- harness references to immutable identities, prepares content-addressed runnable
13
- artifacts, executes them through a stable interface, and preserves the
14
- trajectory and evaluation evidence produced by each run.
15
-
16
- Git can identify the harness source that changed. Hitch carries that identity
17
- through build and execution:
11
+ Hitch runs Codex, Claude Code, Pi, OpenCode, and DeepSeek Harness from exact
12
+ versions or Git commits. Every run links the harness revision, immutable
13
+ artifact, workspace, trajectory, logs, and evaluation evidence.
18
14
 
19
15
  ```text
20
- Harness ref
21
- -> resolved revision
22
- -> prepared artifact
23
- -> run / eval
24
- -> trajectory
25
- -> feedback and evaluation evidence
26
-
27
- Hitch controller
28
- -> content-addressed runtime bundle
29
- -> referenced by containerized evals
16
+ version or commit -> immutable artifact -> run or eval -> verifiable evidence
30
17
  ```
31
18
 
32
- Hitch is infrastructure for systems that develop, compare, and evolve agent
33
- harnesses. It owns version resolution, runnable artifacts, execution records,
34
- and evidence. Candidate generation, comparison policy, and promotion decisions
35
- belong to the system using Hitch.
19
+ ```bash
20
+ npm install --global agent-hitch
36
21
 
37
- > **Status:** pre-alpha. The core identity and evidence path is implemented,
38
- > including immutable revision resolution, prepared artifact caching, direct and
39
- > daemon-backed runs, Harbor-backed evals, content-addressed controller runtimes,
40
- > DSH-compatible canonical trajectories, and message feedback.
22
+ hitch run \
23
+ --harness codex@version:0.92.0 \
24
+ --prompt "Inspect this repository"
25
+ ```
41
26
 
42
- ## Why harness version control?
27
+ > **Status:** pre-alpha. The core run, provenance, trajectory, feedback,
28
+ > daemon, and Harbor evaluation paths are implemented.
43
29
 
44
- An agent harness is more than a source commit. What actually ran can also depend
45
- on the package release, build output, controller code, workspace mode, native
46
- adapter, and mutable executable installed on a machine. A score or transcript
47
- without those identities is difficult to audit and harder to reproduce.
30
+ ## Why Hitch?
48
31
 
49
- Hitch preserves an explicit chain from a requested harness reference to the
50
- evidence generated by its execution:
32
+ Git tells you which source changed. Hitch tells you exactly what ran and which
33
+ evidence it produced.
51
34
 
52
- | Record | What it identifies |
53
- | --- | --- |
54
- | Harness reference | The version, commit, local source, or installed executable requested by the caller |
55
- | Resolved revision | The immutable source identity selected for the run |
56
- | Prepared artifact | The validated, content-addressed runnable build |
57
- | Controller runtime | The exact Hitch runtime uploaded for a containerized eval |
58
- | Run or eval record | The request, workspace, lifecycle, result, and links between identities |
59
- | Canonical trajectory | The agent messages and tool activity in a stable DSH-compatible format |
60
- | Feedback and eval evidence | Message-level feedback, verifier output, rewards, and backend records |
35
+ - **Reproduce** a run from an exact package version or source commit.
36
+ - **Compare** harnesses and models through one execution contract.
37
+ - **Audit** results with immutable artifacts, native events, canonical
38
+ trajectories, logs, feedback, and eval records.
61
39
 
62
- This is a local versioning and evidence layer, not a replacement for Git and not
63
- yet a remote artifact registry. Hitch does not currently provide branches,
64
- tags, diffs, candidate promotion, or rollback policy.
40
+ Hitch is useful for teams building agent evals, harness experiments, coding
41
+ agent infrastructure, and automated promotion pipelines.
65
42
 
66
43
  ## Quick start
67
44
 
68
- Hitch requires Node.js 22 or newer. Install it from npm:
45
+ Hitch requires Node.js 22 or newer.
69
46
 
70
47
  ```bash
71
48
  npm install --global agent-hitch
72
49
  hitch --version
73
- hitch list --json
74
- ```
75
-
76
- Resolve and prepare an exact harness version:
77
-
78
- ```bash
79
- hitch resolve codex@version:0.92.0 --json
80
- hitch prepare codex@version:0.92.0 --json
81
50
  ```
82
51
 
83
- Run that exact version in an isolated Git worktree:
52
+ Run an exact harness version in an isolated Git worktree:
84
53
 
85
54
  ```bash
86
55
  hitch run \
87
56
  --harness codex@version:0.92.0 \
88
- --model gpt-5.6-terra \
89
- --cwd /workspace/project \
90
57
  --workspace-mode worktree \
91
- --prompt-file task.md \
58
+ --prompt "Inspect this repository" \
92
59
  --output jsonl
93
60
  ```
94
61
 
95
- Every run writes an atomic manifest and result, raw process logs, normalized
96
- events, and a canonical trajectory below `~/.hitch/runs/RUN_ID`. Inspect the
97
- trajectory through the CLI:
62
+ The output includes a run ID. Use it to inspect the saved trajectory:
98
63
 
99
64
  ```bash
100
- hitch trajectory inspect RUN_ID --json
65
+ hitch trajectory inspect RUN_ID
101
66
  ```
102
67
 
103
- For development from a checkout:
68
+ Every run is stored below `~/.hitch/runs/RUN_ID` with its manifest, result,
69
+ events, logs, and trajectory.
104
70
 
105
- ```bash
106
- npm install
107
- npm run check
108
- npm link
109
- hitch list --json
110
- ```
71
+ ## Pin any harness revision
111
72
 
112
- ## Harness references
113
-
114
- Harness selection is explicit for every run. Exact package versions and Git
115
- commits resolve to immutable identities and are prepared in Hitch's artifact
116
- store.
73
+ Harness selection is explicit for every run:
117
74
 
118
75
  ```bash
119
- # Use and fingerprint the executable already installed on this machine.
76
+ # Fingerprint and use the executable already installed on this machine.
120
77
  hitch run --harness codex@installed --prompt "Inspect this repository"
121
78
 
122
- # Resolve, prepare, or run an exact published version.
123
- hitch resolve codex@version:0.92.0 --json
124
- hitch prepare codex@version:0.92.0 --json
79
+ # Resolve and run an exact published version.
125
80
  hitch run --harness codex@version:0.92.0 --prompt "Inspect this repository"
126
81
 
127
- # Build a commit from the registered upstream repository.
82
+ # Build and run an exact commit from a registered upstream repository.
128
83
  hitch run --harness codex@commit:0123456789abcdef --prompt "Inspect this repository"
129
-
130
- # Build a clean commit from a local harness repository.
131
- hitch run \
132
- --harness 'pi@git+file:///workspace/pi#0123456789abcdef' \
133
- --prompt "Inspect this repository"
134
84
  ```
135
85
 
136
- Bare names such as `codex` are compatibility aliases for `codex@installed`.
137
- Installed executables are useful for local work, but exact version or commit
138
- references should be preferred when portability matters.
86
+ | Harness | Installed | Exact package version | Source commit |
87
+ | --- | :---: | :---: | :---: |
88
+ | Codex | | | ✓ |
89
+ | Claude Code | ✓ | ✓ | — |
90
+ | Pi | ✓ | ✓ | ✓ |
91
+ | OpenCode | ✓ | ✓ | — |
92
+ | DeepSeek Harness | ✓ | ✓ | ✓ |
139
93
 
140
- Version selectors require exact semantic versions; ranges and mutable tags such
141
- as `latest` are not accepted. Short commit IDs are expanded and must be
142
- unambiguous. Local Git repositories must be clean. Codex, Pi, and DeepSeek
143
- Harness support source-commit preparation; Claude Code and OpenCode currently
144
- support installed and exact-version sources.
145
-
146
- Preparation executes registered package lifecycle or source-build commands with
147
- the permissions of the Hitch process. Content addressing makes an artifact
148
- auditable and cacheable; it does not make untrusted build code safe.
94
+ Exact versions and commits are prepared as validated, content-addressed
95
+ artifacts and reused from Hitch's local cache. Installed executables are useful
96
+ for local work; immutable references are better when portability matters.
149
97
 
150
98
  ## Evidence from every run
151
99
 
152
- Hitch keeps lifecycle events and agent trajectories as two related but distinct
153
- records:
100
+ Hitch records the chain from request to result:
101
+
102
+ - requested reference and immutable resolved revision;
103
+ - validated, content-addressed runnable artifact;
104
+ - workspace, model identity, lifecycle, and terminal result;
105
+ - normalized control-plane events and raw process logs;
106
+ - redacted provider-native events where supported;
107
+ - DSH-compatible canonical trajectory with SHA-256-bound files; and
108
+ - versioned message feedback and evaluation evidence.
154
109
 
155
- - normalized JSONL events describe Hitch's control plane, including resolution,
156
- preparation, process lifecycle, cancellation, and terminal status;
157
- - a DSH-compatible canonical trajectory records the agent session, messages,
158
- tool calls, and tool results with an explicit fidelity level;
159
- - `trajectory.ref.json` binds the run to the canonical trajectory and its
160
- SHA-256 digest; and
161
- - feedback sidecars attach versioned positive or negative ratings and notes to
162
- assistant messages without rewriting the immutable trajectory.
110
+ Use the CLI to query runs and attach feedback without rewriting the trajectory:
163
111
 
164
112
  ```bash
165
- hitch trajectory inspect RUN_ID
113
+ hitch runs list --json
166
114
  hitch feedback list RUN_ID --json
167
115
  hitch feedback put RUN_ID \
168
116
  --message MESSAGE_ID \
169
117
  --rating positive \
170
- --note "Kept the change focused" \
171
- --json
118
+ --note "Kept the change focused"
172
119
  ```
173
120
 
174
121
  Machine-contract schemas are versioned in [`docs/schemas`](docs/schemas).
175
- Runtime validation rejects unknown request fields and preserves typed errors
176
- across the daemon HTTP boundary.
177
122
 
178
- ## Harbor-backed evals
123
+ ## Reproducible agent evals
179
124
 
180
- Hitch can evaluate an exact, portable harness revision with
181
- [Harbor](https://github.com/harbor-framework/harbor):
125
+ Hitch integrates with [Harbor](https://github.com/harbor-framework/harbor) to
126
+ evaluate an exact, portable harness revision in Docker:
182
127
 
183
128
  ```bash
184
- # Installs pinned Harbor into ~/.hitch/tools without changing system Python.
185
129
  hitch eval setup harbor
186
130
  hitch eval doctor
187
131
 
@@ -189,161 +133,55 @@ hitch eval run \
189
133
  --backend harbor \
190
134
  --dataset terminal-bench@2.0 \
191
135
  --harness codex@version:0.92.0 \
192
- --model openai/gpt-5.6 \
193
- --attempts 1 \
194
- --max-concurrent 4
195
-
196
- hitch eval list
197
- hitch eval inspect EVAL_ID --json
136
+ --model openai/gpt-5.6
198
137
  ```
199
138
 
200
- Harbor owns task discovery, Docker lifecycle, verification, and rewards. Its
201
- custom Hitch agent uploads a minimal, SHA-256-addressed Hitch controller runtime
202
- into each task container and executes the selected harness revision in `/app`.
203
- The resulting eval record links the request, resolved revision, controller
204
- runtime, backend configuration and logs, normalized result, reward summary, and
205
- trajectory evidence.
139
+ Each eval links the resolved harness revision, content-addressed Hitch
140
+ controller runtime, backend configuration, rewards, logs, and trajectory
141
+ evidence. See [Harbor-backed agent evals](docs/evals.md) for setup and
142
+ portability rules.
206
143
 
207
- Eval accepts exact `version:` refs and `commit:` refs backed by a registered
208
- remote source. Installed executables and local `git+file://` refs are rejected
209
- because they are not portable into Harbor containers. Common provider
210
- credentials are forwarded by environment-variable reference; use `--pass-env
211
- NAME` for an additional variable.
144
+ ## Built for automation
212
145
 
213
- See [Harbor-backed agent evals](docs/evals.md) for setup, portability rules, and
214
- the execution boundary.
146
+ - JSON and JSONL output with versioned schemas and typed errors
147
+ - Direct execution or a persistent daemon with bounded concurrency
148
+ - Shared, detached Git worktree, and independent-copy workspace modes
149
+ - Timeouts, cancellation, process-tree cleanup, and interrupted-run recovery
150
+ - Local state isolation through `--root <path>` or `HITCH_ROOT`
215
151
 
216
- ## Stable execution layer
217
-
218
- Versioned artifacts still need a consistent way to run. Hitch provides adapters
219
- for Codex CLI, Claude Code, Pi, OpenCode, and DeepSeek Harness and normalizes
220
- their invocation and lifecycle behavior behind one machine-oriented contract.
221
-
222
- ```text
223
- caller -> Hitch CLI / daemon -> shared run engine -> Codex CLI
224
- \----> Claude Code
225
- \----> Pi
226
- \----> OpenCode
227
- \----> DeepSeek Harness
228
- ```
229
-
230
- The direct CLI and persistent daemon use the same run engine, so revision
231
- resolution, records, timeout, cancellation, and event behavior do not drift.
232
- The runtime currently provides:
233
-
234
- - executable discovery, version probing, and executable fingerprints;
235
- - exact package-version and Git-commit resolution;
236
- - immutable prepared artifacts with integrity-aware caching;
237
- - direct execution with normalized JSONL events;
238
- - a persistent local daemon with bounded concurrency;
239
- - queued and active-run cancellation, timeouts, and process-tree cleanup;
240
- - managed shared, Git worktree, and independent-copy workspace modes;
241
- - atomic manifests and results plus raw stdout and stderr logs; and
242
- - conservative recovery of interrupted records after daemon restart.
243
-
244
- Run through the daemon when a long-lived queue is useful:
152
+ Start a queue when you need long-lived execution:
245
153
 
246
154
  ```bash
247
155
  hitch daemon start --max-concurrent 4
248
-
249
- hitch run \
250
- --daemon \
251
- --harness codex@version:0.92.0 \
252
- --cwd /workspace/project \
253
- --prompt-file task.md \
254
- --output jsonl
255
-
256
- hitch daemon status --json
257
- hitch daemon stop
258
- ```
259
-
260
- Asynchronous submission and cancellation are also available:
261
-
262
- ```bash
263
- hitch daemon submit \
264
- --harness claude@version:EXACT_VERSION \
265
- --cwd /workspace/project \
266
- --prompt-file task.md
267
-
268
- hitch daemon cancel RUN_ID
156
+ hitch run --daemon --harness codex@version:0.92.0 --prompt-file task.md
269
157
  ```
270
158
 
271
- ## State and isolation
272
-
273
- State is stored below `~/.hitch` by default. Use `--root <path>` or
274
- `HITCH_ROOT` to relocate it. Each root owns its artifact store, controller
275
- runtime store, run and eval records, daemon token, and queue.
276
-
277
- Native executable overrides use `HITCH_CODEX_PATH`, `HITCH_CLAUDE_PATH`,
278
- `HITCH_PI_PATH`, `HITCH_OPENCODE_PATH`, and `HITCH_DEEPSEEK_PATH`.
279
-
280
- Workspace modes make mutation boundaries explicit:
281
-
282
- - `shared` runs directly in the source directory;
283
- - `worktree` creates a detached Git worktree from a clean `HEAD`; and
284
- - `copy` creates an independent filesystem copy.
285
-
286
- Workspace isolation is not a process security sandbox.
287
-
288
- ## Design principles
289
-
290
- - **Traceable by default:** every run links the requested reference, resolved
291
- revision, runnable artifact, execution record, and evidence.
292
- - **Immutable resolution:** mutable input is resolved before preparation or
293
- execution, then recorded by identity.
294
- - **Content-addressed reuse:** validated artifacts and controller runtimes are
295
- reused by digest rather than copied per run.
296
- - **Evidence without lossy abstraction:** stable canonical records coexist with
297
- raw harness output and explicit trajectory fidelity.
298
- - **Machine-first contracts:** structured output, versioned schemas, and typed
299
- failures are the public interface.
300
- - **Policy lives above Hitch:** mutation, ranking, promotion, and rollback remain
301
- explicit decisions for the calling system.
302
- - **Safe interruption:** cancellation targets the complete subprocess tree, and
303
- interrupted workspace-mutating runs are never replayed implicitly.
304
-
305
- ## Planned work
306
-
307
- - [ ] Comparison primitives for harness revisions and their evidence
308
- - [ ] Named candidate and champion references
309
- - [ ] Promotion and rollback records without embedding promotion policy
310
- - [ ] Remote artifact and evidence synchronization
311
- - [ ] Additional harness adapters
312
- - [ ] Additional API provider support
313
- - [ ] Local model inference support
314
-
315
- ## News
316
-
317
- - **2026-08-20:** Hitch 0.2 development moved the project to strict TypeScript
318
- compiled to ESM, added a shared SHA-256 controller runtime cache, recorded a
319
- DSH-compatible canonical trajectory for every run, and introduced
320
- lifecycle-bound message feedback.
321
- - **2026-08-13:** Hitch added DeepSeek Harness support.
322
-
323
159
  ## Documentation
324
160
 
325
- - [Hitch 0.2 development spec](docs/hitch-0.2-development-spec.md)
326
- - [Design document](docs/design.md)
327
- - [Agent daemon analysis and port](docs/daemon.md)
328
- - [Workspace isolation](docs/workspaces.md)
161
+ - [Design and architecture](docs/design.md)
329
162
  - [Harbor-backed evals](docs/evals.md)
163
+ - [Workspace isolation](docs/workspaces.md)
164
+ - [Daemon design](docs/daemon.md)
165
+ - [Hitch 0.2 development spec](docs/hitch-0.2-development-spec.md)
330
166
  - [Release process](docs/releasing.md)
331
167
 
332
- ## Community
168
+ ## Project status
333
169
 
334
- Join the [Hitch community on Discord](https://discord.gg/cZ4NBbHDk) to ask
335
- questions, share feedback, and discuss agent-harness infrastructure.
170
+ Hitch is a pre-alpha local versioning and evidence layer. It complements Git;
171
+ it does not currently provide a remote artifact registry, branches, tags,
172
+ candidate promotion, or rollback policy.
336
173
 
337
- ## Acknowledgements
174
+ Remote artifact synchronization, named candidates, promotion records, and more
175
+ harness adapters are planned.
338
176
 
339
- Hitch draws inspiration from [Multica](https://github.com/multica-ai/multica) and
340
- uses [Harbor](https://github.com/harbor-framework/harbor) as its evaluation
341
- backend. We are grateful to both projects for the foundations they provide.
177
+ ## Community
342
178
 
343
- ## Naming
179
+ Join the [Hitch community on Discord](https://discord.gg/cZ4NBbHDk) to ask
180
+ questions, share feedback, and discuss agent-harness infrastructure.
344
181
 
345
- The repository is named `agent-hitch`; the product and executable are named
346
- `Hitch` and `hitch`.
182
+ Hitch draws inspiration from [Multica](https://github.com/multica-ai/multica)
183
+ and uses [Harbor](https://github.com/harbor-framework/harbor) as its evaluation
184
+ backend.
347
185
 
348
186
  ## License
349
187