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
package/README.md CHANGED
@@ -4,46 +4,68 @@
4
4
  [![GitHub release](https://img.shields.io/github/v/release/rsi-gear/agent-hitch)](https://github.com/rsi-gear/agent-hitch/releases)
5
5
  [![Discord](https://img.shields.io/badge/Discord-Join_chat-5865F2?logo=discord&logoColor=white)](https://discord.gg/cZ4NBbHDk)
6
6
 
7
- **Let agents choose their harness with one runtime.**
7
+ [English](README.md) | [简体中文](README.zh-CN.md)
8
8
 
9
- Hitch lets an agent choose which harness and revision to use for each run. It is
10
- an agent-first CLI and daemon for discovering and running native coding agents
11
- through one stable, machine-oriented interface.
9
+ **Content-addressed version control and evidence storage for agent harnesses.**
12
10
 
13
- Hitch is designed as infrastructure for Recursive Self-Improvement (RSI),
14
- including harness evolution and model evolution.
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
15
 
16
- > Status: pre-alpha. Installed-harness discovery, immutable revision resolution,
17
- > prepared artifact caching, direct runs, the local daemon, and Harbor-backed
18
- > agent evals are implemented.
16
+ Git can identify the harness source that changed. Hitch carries that identity
17
+ through build and execution:
19
18
 
20
- ## News
19
+ ```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
30
+ ```
21
31
 
22
- - **2026-08-13:** Hitch now supports DeepSeek Harness.
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.
23
36
 
24
- ## Available now
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.
25
41
 
26
- Hitch currently supports Codex CLI, Claude Code, Pi, OpenCode, and DeepSeek
27
- Harness adapters. It provides:
42
+ ## Why harness version control?
28
43
 
29
- - executable discovery, version probing, and executable fingerprints;
30
- - exact package-version and Git-commit resolution;
31
- - immutable prepared artifacts with integrity-aware caching;
32
- - direct execution with normalized JSONL events;
33
- - a persistent local daemon with bounded concurrency;
34
- - queued and active-run cancellation, timeouts, and process-tree cleanup;
35
- - managed shared, Git worktree, and independent-copy workspace modes;
36
- - Harbor-backed evaluation in Docker with normalized reward summaries;
37
- - atomic manifests/results plus raw stdout and stderr logs; and
38
- - conservative recovery of interrupted records after daemon restart.
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.
39
48
 
40
- Versioned machine-contract schemas live in [`docs/schemas`](docs/schemas).
41
- Runtime validation rejects unknown request fields and preserves typed errors
42
- across the daemon HTTP boundary.
49
+ Hitch preserves an explicit chain from a requested harness reference to the
50
+ evidence generated by its execution:
51
+
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 |
61
+
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.
43
65
 
44
- ## Installation
66
+ ## Quick start
45
67
 
46
- Hitch requires Node.js 22 or newer. Install the CLI globally from npm:
68
+ Hitch requires Node.js 22 or newer. Install it from npm:
47
69
 
48
70
  ```bash
49
71
  npm install --global agent-hitch
@@ -51,25 +73,18 @@ hitch --version
51
73
  hitch list --json
52
74
  ```
53
75
 
54
- You can also try it without a global installation:
76
+ Resolve and prepare an exact harness version:
55
77
 
56
78
  ```bash
57
- npx agent-hitch --help
58
- ```
59
-
60
- For development from a checkout:
61
-
62
- ```bash
63
- npm test
64
- npm link
65
- hitch list --json
79
+ hitch resolve codex@version:0.92.0 --json
80
+ hitch prepare codex@version:0.92.0 --json
66
81
  ```
67
82
 
68
- Run a task directly:
83
+ Run that exact version in an isolated Git worktree:
69
84
 
70
85
  ```bash
71
86
  hitch run \
72
- --harness codex@installed \
87
+ --harness codex@version:0.92.0 \
73
88
  --model gpt-5.6-terra \
74
89
  --cwd /workspace/project \
75
90
  --workspace-mode worktree \
@@ -77,42 +92,96 @@ hitch run \
77
92
  --output jsonl
78
93
  ```
79
94
 
80
- Run through the persistent daemon:
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:
81
98
 
82
99
  ```bash
83
- hitch daemon start --max-concurrent 4
100
+ hitch trajectory inspect RUN_ID --json
101
+ ```
84
102
 
85
- hitch run \
86
- --daemon \
87
- --harness codex@installed \
88
- --model gpt-5.6-terra \
89
- --cwd /workspace/project \
90
- --prompt-file task.md \
91
- --output jsonl
103
+ For development from a checkout:
92
104
 
93
- hitch daemon status --json
94
- hitch daemon stop
105
+ ```bash
106
+ npm install
107
+ npm run check
108
+ npm link
109
+ hitch list --json
95
110
  ```
96
111
 
97
- Submit asynchronously and cancel later:
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.
98
117
 
99
118
  ```bash
100
- hitch daemon submit \
101
- --harness claude@installed \
102
- --cwd /workspace/project \
103
- --prompt-file task.md
119
+ # Use and fingerprint the executable already installed on this machine.
120
+ hitch run --harness codex@installed --prompt "Inspect this repository"
121
+
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
125
+ hitch run --harness codex@version:0.92.0 --prompt "Inspect this repository"
126
+
127
+ # Build a commit from the registered upstream repository.
128
+ hitch run --harness codex@commit:0123456789abcdef --prompt "Inspect this repository"
104
129
 
105
- hitch daemon cancel run_<id>
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"
106
134
  ```
107
135
 
108
- State is stored below `~/.hitch` by default. Use `--root <path>` or
109
- `HITCH_ROOT` to relocate it. Native executable overrides use
110
- `HITCH_CODEX_PATH`, `HITCH_CLAUDE_PATH`, `HITCH_PI_PATH`,
111
- `HITCH_OPENCODE_PATH`, and `HITCH_DEEPSEEK_PATH`.
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.
139
+
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.
149
+
150
+ ## Evidence from every run
151
+
152
+ Hitch keeps lifecycle events and agent trajectories as two related but distinct
153
+ records:
154
+
155
+ - normalized JSONL events describe Hitch's control plane, including resolution,
156
+ preparation, process lifecycle, cancellation, and terminal status;
157
+ - supported adapters preserve redacted provider-native events before any
158
+ translation, while a DSH-compatible canonical trajectory remains available
159
+ as a derived view;
160
+ - `trajectory.ref.json` V2 binds every trajectory file by relative path, byte
161
+ size, role, and SHA-256 digest; and
162
+ - feedback sidecars attach versioned positive or negative ratings and notes to
163
+ assistant messages without rewriting the immutable trajectory.
164
+
165
+ ```bash
166
+ hitch trajectory inspect RUN_ID
167
+ hitch runs list --context-kind benchmark_task --json
168
+ hitch compare model --benchmark BENCHMARK --task TASK --json
169
+ hitch feedback list RUN_ID --json
170
+ hitch feedback put RUN_ID \
171
+ --message MESSAGE_ID \
172
+ --rating positive \
173
+ --note "Kept the change focused" \
174
+ --json
175
+ ```
176
+
177
+ Machine-contract schemas are versioned in [`docs/schemas`](docs/schemas).
178
+ Runtime validation rejects unknown request fields and preserves typed errors
179
+ across the daemon HTTP boundary.
112
180
 
113
181
  ## Harbor-backed evals
114
182
 
115
- Run an agent eval with Harbor:
183
+ Hitch can evaluate an exact, portable harness revision with
184
+ [Harbor](https://github.com/harbor-framework/harbor):
116
185
 
117
186
  ```bash
118
187
  # Installs pinned Harbor into ~/.hitch/tools without changing system Python.
@@ -128,104 +197,138 @@ hitch eval run \
128
197
  --max-concurrent 4
129
198
 
130
199
  hitch eval list
131
- hitch eval inspect eval_<id> --json
200
+ hitch eval inspect EVAL_ID --json
132
201
  ```
133
202
 
134
- `hitch eval setup harbor` requires Python 3.12+ and creates an isolated virtual
135
- environment at `~/.hitch/tools/harbor-<version>`. It does not install or start
136
- Docker. `hitch eval doctor` checks Python, the selected Harbor installation,
137
- the Docker daemon, and whether a common provider credential is present. Hitch
138
- automatically prefers the managed Harbor installation for subsequent evals;
139
- `--harbor` and `HITCH_HARBOR_PATH` remain explicit overrides.
140
-
141
203
  Harbor owns task discovery, Docker lifecycle, verification, and rewards. Its
142
- custom Hitch agent uploads a minimal Hitch runtime into each task container and
143
- runs the exact selected harness revision in `/app`. This ensures the benchmark
144
- measures the Hitch execution path rather than Harbor's native agent adapter.
204
+ custom Hitch agent uploads a minimal, SHA-256-addressed Hitch controller runtime
205
+ into each task container and executes the selected harness revision in `/app`.
206
+ The resulting eval record links the request, resolved revision, controller
207
+ runtime, backend configuration and logs, normalized result, reward summary, and
208
+ trajectory evidence.
209
+
210
+ Eval accepts exact `version:` refs, registered `commit:` refs, and explicit
211
+ local `git+file:///absolute/repo#<full-lowercase-commit>` refs. For local Git,
212
+ Hitch transports a verified exact-commit object pack into each Harbor trial;
213
+ uncommitted files, Git config, credentials, and unrelated history are excluded.
214
+ The local repository must be clean and abbreviated commits, branches, tags,
215
+ `HEAD`, and installed executables are rejected. Common provider credentials are
216
+ forwarded by environment-variable reference; use `--pass-env NAME` for an
217
+ additional variable.
218
+
219
+ See [Harbor-backed agent evals](docs/evals.md) for setup, portability rules, and
220
+ the execution boundary.
221
+
222
+ ## Stable execution layer
223
+
224
+ Versioned artifacts still need a consistent way to run. Hitch provides adapters
225
+ for Codex CLI, Claude Code, Pi, OpenCode, and DeepSeek Harness and normalizes
226
+ their invocation and lifecycle behavior behind one machine-oriented contract.
227
+
228
+ ```text
229
+ caller -> Hitch CLI / daemon -> shared run engine -> Codex CLI
230
+ \----> Claude Code
231
+ \----> Pi
232
+ \----> OpenCode
233
+ \----> DeepSeek Harness
234
+ ```
145
235
 
146
- Eval currently accepts exact `version:` refs and `commit:` refs backed by a
147
- registered remote source. Installed executables and local `git+file://` refs are
148
- rejected because they are not portable into Harbor containers. Common provider
149
- credentials are forwarded by environment-variable reference; use
150
- `--pass-env NAME` for an additional variable. Eval records are stored under
151
- `~/.hitch/evals` and include the request, resolved revision, plan, generated
152
- Harbor config, raw backend logs/result, normalized result, and JSONL events.
236
+ The direct CLI and persistent daemon use the same run engine, so revision
237
+ resolution, records, timeout, cancellation, and event behavior do not drift.
238
+ The runtime currently provides:
153
239
 
154
- ## Select a harness revision
240
+ - executable discovery, version probing, and executable fingerprints;
241
+ - exact package-version and Git-commit resolution;
242
+ - immutable prepared artifacts with integrity-aware caching;
243
+ - direct execution with normalized JSONL events;
244
+ - a persistent local daemon with bounded concurrency;
245
+ - queued and active-run cancellation, timeouts, and process-tree cleanup;
246
+ - managed shared, Git worktree, and independent-copy workspace modes;
247
+ - atomic manifests and results plus raw stdout and stderr logs; and
248
+ - conservative recovery of interrupted records after daemon restart.
155
249
 
156
- Harness selection is explicit for every run. Bare names retain the installed
157
- executable behavior; exact published versions and Git commits resolve to
158
- immutable identities and are prepared in Hitch's artifact store.
250
+ Run through the daemon when a long-lived queue is useful:
159
251
 
160
252
  ```bash
161
- # Bare name is an alias for codex@installed.
162
- hitch run --harness codex --prompt "Inspect this repository"
253
+ hitch daemon start --max-concurrent 4
163
254
 
164
- # Resolve or prewarm an exact published version.
165
- hitch resolve codex@version:0.92.0 --json
166
- hitch prepare codex@version:0.92.0 --json
167
- hitch run --harness codex@version:0.92.0 --prompt "Inspect this repository"
255
+ hitch run \
256
+ --daemon \
257
+ --harness codex@version:0.92.0 \
258
+ --cwd /workspace/project \
259
+ --prompt-file task.md \
260
+ --output jsonl
168
261
 
169
- # Build a commit from the registered upstream repository.
170
- hitch run --harness codex@commit:0123456789abcdef --prompt "Inspect this repository"
262
+ hitch daemon status --json
263
+ hitch daemon stop
264
+ ```
171
265
 
172
- # Build a clean commit from a local harness repository.
173
- hitch run \
174
- --harness 'pi@git+file:///workspace/pi#0123456789abcdef' \
175
- --prompt "Inspect this repository"
266
+ Asynchronous submission and cancellation are also available:
267
+
268
+ ```bash
269
+ hitch daemon submit \
270
+ --harness claude@version:EXACT_VERSION \
271
+ --cwd /workspace/project \
272
+ --prompt-file task.md
273
+
274
+ hitch daemon cancel RUN_ID
176
275
  ```
177
276
 
178
- Version selectors require exact semantic versions; ranges and `latest` are not
179
- accepted. Short commit IDs are expanded and must be unambiguous. Local Git
180
- repositories must be clean. Codex, Pi, and DeepSeek Harness support
181
- source-commit preparation; Claude Code and OpenCode currently support installed
182
- and exact-version sources.
277
+ ## State and isolation
183
278
 
184
- The legacy `--agent <name>` option remains available as an alias for
185
- `--harness <name>@installed`. It cannot select revisions or be combined with
186
- `--harness`.
279
+ State is stored below `~/.hitch` by default. Use `--root <path>` or
280
+ `HITCH_ROOT` to relocate it. Each root owns its artifact store, controller
281
+ runtime store, run and eval records, daemon token, and queue.
187
282
 
188
- Preparation executes the registered package lifecycle or source-build commands
189
- with the permissions of the Hitch process. A resolved identity makes the input
190
- auditable and cacheable; it is not a security sandbox.
283
+ Native executable overrides use `HITCH_CODEX_PATH`, `HITCH_CLAUDE_PATH`,
284
+ `HITCH_PI_PATH`, `HITCH_OPENCODE_PATH`, and `HITCH_DEEPSEEK_PATH`.
191
285
 
192
- ## Why Hitch?
286
+ Workspace modes make mutation boundaries explicit:
193
287
 
194
- Coding-agent CLIs expose different commands, model flags, configuration formats,
195
- session models, event streams, and process behavior. Hitch absorbs that
196
- integration cost behind a small adapter contract while preserving the native
197
- runtime.
288
+ - `shared` runs directly in the source directory;
289
+ - `worktree` creates a detached Git worktree from a clean `HEAD`; and
290
+ - `copy` creates an independent filesystem copy.
198
291
 
199
- ```text
200
- caller -> Hitch CLI / daemon -> shared run engine -> Codex CLI
201
- \----> Claude Code
202
- \----> Pi
203
- \----> OpenCode
204
- \----> DeepSeek Harness
205
- ```
292
+ Workspace isolation is not a process security sandbox.
206
293
 
207
- The direct CLI and daemon use the same engine, so persistence, timeout,
208
- cancellation, and event behavior do not drift.
294
+ ## Design principles
295
+
296
+ - **Traceable by default:** every run links the requested reference, resolved
297
+ revision, runnable artifact, execution record, and evidence.
298
+ - **Immutable resolution:** mutable input is resolved before preparation or
299
+ execution, then recorded by identity.
300
+ - **Content-addressed reuse:** validated artifacts and controller runtimes are
301
+ reused by digest rather than copied per run.
302
+ - **Evidence without lossy abstraction:** stable canonical records coexist with
303
+ raw harness output and explicit trajectory fidelity.
304
+ - **Machine-first contracts:** structured output, versioned schemas, and typed
305
+ failures are the public interface.
306
+ - **Policy lives above Hitch:** mutation, ranking, promotion, and rollback remain
307
+ explicit decisions for the calling system.
308
+ - **Safe interruption:** cancellation targets the complete subprocess tree, and
309
+ interrupted workspace-mutating runs are never replayed implicitly.
209
310
 
210
311
  ## Planned work
211
312
 
313
+ - [x] Strict model/harness comparison primitives over run evidence
314
+ - [ ] Named candidate and champion references
315
+ - [ ] Promotion and rollback records without embedding promotion policy
316
+ - [ ] Remote artifact and evidence synchronization
212
317
  - [ ] Additional harness adapters
213
318
  - [ ] Additional API provider support
214
319
  - [ ] Local model inference support
215
320
 
216
- ## Design principles
321
+ ## News
217
322
 
218
- - **Agent-first:** structured output, stable exit categories, no required UI.
219
- - **Explicit over ambient:** agent, model, workspace, and state root are visible.
220
- - **Minimal common contract:** unknown native events remain available rather
221
- than being forced into misleading abstractions.
222
- - **Isolated control state:** each root has its own daemon, token, queue, and run
223
- records.
224
- - **Safe interruption:** cancellation targets the complete subprocess tree.
225
- - **No implicit replay:** interrupted workspace-mutating runs fail visibly.
323
+ - **2026-08-20:** Hitch 0.2 development moved the project to strict TypeScript
324
+ compiled to ESM, added a shared SHA-256 controller runtime cache, recorded a
325
+ DSH-compatible canonical trajectory for every run, and introduced
326
+ lifecycle-bound message feedback.
327
+ - **2026-08-13:** Hitch added DeepSeek Harness support.
226
328
 
227
329
  ## Documentation
228
330
 
331
+ - [Hitch 0.2 development spec](docs/hitch-0.2-development-spec.md)
229
332
  - [Design document](docs/design.md)
230
333
  - [Agent daemon analysis and port](docs/daemon.md)
231
334
  - [Workspace isolation](docs/workspaces.md)
@@ -235,7 +338,7 @@ cancellation, and event behavior do not drift.
235
338
  ## Community
236
339
 
237
340
  Join the [Hitch community on Discord](https://discord.gg/cZ4NBbHDk) to ask
238
- questions, share feedback, and discuss coding-agent infrastructure.
341
+ questions, share feedback, and discuss agent-harness infrastructure.
239
342
 
240
343
  ## Acknowledgements
241
344