agent-hitch 0.2.1 → 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.
- package/README.md +88 -256
- package/README.zh-CN.md +84 -235
- package/dist/src/artifacts/handoff.js +12 -0
- package/dist/src/artifacts/handoff.js.map +1 -0
- package/dist/src/artifacts/index.js +2 -0
- package/dist/src/artifacts/index.js.map +1 -1
- package/dist/src/artifacts/store.js +72 -2
- package/dist/src/artifacts/store.js.map +1 -1
- package/dist/src/backends/harbor/backend.js +15 -2
- package/dist/src/backends/harbor/backend.js.map +1 -1
- package/dist/src/cli/commands/run.js +65 -3
- package/dist/src/cli/commands/run.js.map +1 -1
- package/dist/src/evals/service.js +54 -1
- package/dist/src/evals/service.js.map +1 -1
- package/dist/src/runs/executor.js +10 -4
- package/dist/src/runs/executor.js.map +1 -1
- package/docs/schemas/eval-result.schema.json +14 -0
- package/integrations/harbor/hitch_harbor_agent.py +112 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,185 +6,126 @@
|
|
|
6
6
|
|
|
7
7
|
[English](README.md) | [简体中文](README.zh-CN.md)
|
|
8
8
|
|
|
9
|
-
**
|
|
9
|
+
**Reproducible runs for agent harnesses.**
|
|
10
10
|
|
|
11
|
-
Hitch
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
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
|
-
|
|
33
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
22
|
+
hitch run \
|
|
23
|
+
--harness codex@version:0.92.0 \
|
|
24
|
+
--prompt "Inspect this repository"
|
|
25
|
+
```
|
|
41
26
|
|
|
42
|
-
|
|
27
|
+
> **Status:** pre-alpha. The core run, provenance, trajectory, feedback,
|
|
28
|
+
> daemon, and Harbor evaluation paths are implemented.
|
|
43
29
|
|
|
44
|
-
|
|
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
|
-
|
|
50
|
-
evidence
|
|
32
|
+
Git tells you which source changed. Hitch tells you exactly what ran and which
|
|
33
|
+
evidence it produced.
|
|
51
34
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
63
|
-
|
|
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.
|
|
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
|
|
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
|
|
58
|
+
--prompt "Inspect this repository" \
|
|
92
59
|
--output jsonl
|
|
93
60
|
```
|
|
94
61
|
|
|
95
|
-
|
|
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
|
|
65
|
+
hitch trajectory inspect RUN_ID
|
|
101
66
|
```
|
|
102
67
|
|
|
103
|
-
|
|
68
|
+
Every run is stored below `~/.hitch/runs/RUN_ID` with its manifest, result,
|
|
69
|
+
events, logs, and trajectory.
|
|
104
70
|
|
|
105
|
-
|
|
106
|
-
npm install
|
|
107
|
-
npm run check
|
|
108
|
-
npm link
|
|
109
|
-
hitch list --json
|
|
110
|
-
```
|
|
71
|
+
## Pin any harness revision
|
|
111
72
|
|
|
112
|
-
|
|
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
|
-
#
|
|
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
|
|
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
|
|
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
|
-
|
|
137
|
-
|
|
138
|
-
|
|
86
|
+
| Harness | Installed | Exact package version | Source commit |
|
|
87
|
+
| --- | :---: | :---: | :---: |
|
|
88
|
+
| Codex | ✓ | ✓ | ✓ |
|
|
89
|
+
| Claude Code | ✓ | ✓ | — |
|
|
90
|
+
| Pi | ✓ | ✓ | ✓ |
|
|
91
|
+
| OpenCode | ✓ | ✓ | — |
|
|
92
|
+
| DeepSeek Harness | ✓ | ✓ | ✓ |
|
|
139
93
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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
|
|
153
|
-
|
|
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
|
-
|
|
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.
|
|
110
|
+
Use the CLI to query runs and attach feedback without rewriting the trajectory:
|
|
164
111
|
|
|
165
112
|
```bash
|
|
166
|
-
hitch
|
|
167
|
-
hitch runs list --context-kind benchmark_task --json
|
|
168
|
-
hitch compare model --benchmark BENCHMARK --task TASK --json
|
|
113
|
+
hitch runs list --json
|
|
169
114
|
hitch feedback list RUN_ID --json
|
|
170
115
|
hitch feedback put RUN_ID \
|
|
171
116
|
--message MESSAGE_ID \
|
|
172
117
|
--rating positive \
|
|
173
|
-
--note "Kept the change focused"
|
|
174
|
-
--json
|
|
118
|
+
--note "Kept the change focused"
|
|
175
119
|
```
|
|
176
120
|
|
|
177
121
|
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.
|
|
180
122
|
|
|
181
|
-
##
|
|
123
|
+
## Reproducible agent evals
|
|
182
124
|
|
|
183
|
-
Hitch
|
|
184
|
-
|
|
125
|
+
Hitch integrates with [Harbor](https://github.com/harbor-framework/harbor) to
|
|
126
|
+
evaluate an exact, portable harness revision in Docker:
|
|
185
127
|
|
|
186
128
|
```bash
|
|
187
|
-
# Installs pinned Harbor into ~/.hitch/tools without changing system Python.
|
|
188
129
|
hitch eval setup harbor
|
|
189
130
|
hitch eval doctor
|
|
190
131
|
|
|
@@ -192,164 +133,55 @@ hitch eval run \
|
|
|
192
133
|
--backend harbor \
|
|
193
134
|
--dataset terminal-bench@2.0 \
|
|
194
135
|
--harness codex@version:0.92.0 \
|
|
195
|
-
--model openai/gpt-5.6
|
|
196
|
-
--attempts 1 \
|
|
197
|
-
--max-concurrent 4
|
|
198
|
-
|
|
199
|
-
hitch eval list
|
|
200
|
-
hitch eval inspect EVAL_ID --json
|
|
136
|
+
--model openai/gpt-5.6
|
|
201
137
|
```
|
|
202
138
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
runtime, backend configuration and logs, normalized result, reward summary, and
|
|
208
|
-
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.
|
|
209
143
|
|
|
210
|
-
|
|
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.
|
|
144
|
+
## Built for automation
|
|
218
145
|
|
|
219
|
-
|
|
220
|
-
|
|
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`
|
|
221
151
|
|
|
222
|
-
|
|
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
|
-
```
|
|
235
|
-
|
|
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:
|
|
239
|
-
|
|
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.
|
|
249
|
-
|
|
250
|
-
Run through the daemon when a long-lived queue is useful:
|
|
152
|
+
Start a queue when you need long-lived execution:
|
|
251
153
|
|
|
252
154
|
```bash
|
|
253
155
|
hitch daemon start --max-concurrent 4
|
|
254
|
-
|
|
255
|
-
hitch run \
|
|
256
|
-
--daemon \
|
|
257
|
-
--harness codex@version:0.92.0 \
|
|
258
|
-
--cwd /workspace/project \
|
|
259
|
-
--prompt-file task.md \
|
|
260
|
-
--output jsonl
|
|
261
|
-
|
|
262
|
-
hitch daemon status --json
|
|
263
|
-
hitch daemon stop
|
|
264
|
-
```
|
|
265
|
-
|
|
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
|
|
156
|
+
hitch run --daemon --harness codex@version:0.92.0 --prompt-file task.md
|
|
275
157
|
```
|
|
276
158
|
|
|
277
|
-
## State and isolation
|
|
278
|
-
|
|
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.
|
|
282
|
-
|
|
283
|
-
Native executable overrides use `HITCH_CODEX_PATH`, `HITCH_CLAUDE_PATH`,
|
|
284
|
-
`HITCH_PI_PATH`, `HITCH_OPENCODE_PATH`, and `HITCH_DEEPSEEK_PATH`.
|
|
285
|
-
|
|
286
|
-
Workspace modes make mutation boundaries explicit:
|
|
287
|
-
|
|
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.
|
|
291
|
-
|
|
292
|
-
Workspace isolation is not a process security sandbox.
|
|
293
|
-
|
|
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.
|
|
310
|
-
|
|
311
|
-
## Planned work
|
|
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
|
|
317
|
-
- [ ] Additional harness adapters
|
|
318
|
-
- [ ] Additional API provider support
|
|
319
|
-
- [ ] Local model inference support
|
|
320
|
-
|
|
321
|
-
## News
|
|
322
|
-
|
|
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.
|
|
328
|
-
|
|
329
159
|
## Documentation
|
|
330
160
|
|
|
331
|
-
- [
|
|
332
|
-
- [Design document](docs/design.md)
|
|
333
|
-
- [Agent daemon analysis and port](docs/daemon.md)
|
|
334
|
-
- [Workspace isolation](docs/workspaces.md)
|
|
161
|
+
- [Design and architecture](docs/design.md)
|
|
335
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)
|
|
336
166
|
- [Release process](docs/releasing.md)
|
|
337
167
|
|
|
338
|
-
##
|
|
168
|
+
## Project status
|
|
339
169
|
|
|
340
|
-
|
|
341
|
-
|
|
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.
|
|
342
173
|
|
|
343
|
-
|
|
174
|
+
Remote artifact synchronization, named candidates, promotion records, and more
|
|
175
|
+
harness adapters are planned.
|
|
344
176
|
|
|
345
|
-
|
|
346
|
-
uses [Harbor](https://github.com/harbor-framework/harbor) as its evaluation
|
|
347
|
-
backend. We are grateful to both projects for the foundations they provide.
|
|
177
|
+
## Community
|
|
348
178
|
|
|
349
|
-
|
|
179
|
+
Join the [Hitch community on Discord](https://discord.gg/cZ4NBbHDk) to ask
|
|
180
|
+
questions, share feedback, and discuss agent-harness infrastructure.
|
|
350
181
|
|
|
351
|
-
|
|
352
|
-
|
|
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.
|
|
353
185
|
|
|
354
186
|
## License
|
|
355
187
|
|