harnex 0.7.13 → 0.8.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +82 -1
- data/README.md +53 -11
- data/TECHNICAL.md +20 -1
- data/guides/01_dispatch.md +29 -9
- data/guides/04_monitoring.md +58 -6
- data/lib/harnex/artifact_report.rb +507 -35
- data/lib/harnex/cli.rb +17 -0
- data/lib/harnex/commands/artifact_report.rb +94 -0
- data/lib/harnex/commands/history.rb +52 -2
- data/lib/harnex/commands/orchestration.rb +170 -0
- data/lib/harnex/commands/run.rb +93 -6
- data/lib/harnex/commands/status.rb +43 -4
- data/lib/harnex/commands/wait.rb +164 -62
- data/lib/harnex/commands/watch.rb +5 -2
- data/lib/harnex/core.rb +11 -1
- data/lib/harnex/dispatch_history.rb +95 -0
- data/lib/harnex/orchestration.rb +458 -0
- data/lib/harnex/runtime/session.rb +295 -15
- data/lib/harnex/terminal_status.rb +8 -0
- data/lib/harnex/version.rb +2 -2
- data/lib/harnex.rb +3 -0
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9142cc69cec0a0cf0dc3961ccc27dc3728baea445c7d83b4c2d69a34b7e6a499
|
|
4
|
+
data.tar.gz: b89c616cb2484d48e74ef88985a438f7ebb1c22b1af17dd44cbaab3ee0c020cd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 220566d1c646ca49b7f41f8ed053b2909dda8468ab3dc877bfcfe5f47b52988492d54b9d2fcc42ff0e42154921fde97af0824688b27df69e94bd9fc49b77c2f8
|
|
7
|
+
data.tar.gz: e52eca128c1f078171ab991acd25bafa810e8341a7f6c8f199535cd03b7a881ee03f2c4193afb01ece92cc00d0a8025a6bdb564739aeb13cbe6a02a4f4d87d0a
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,87 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [
|
|
3
|
+
## [0.8.0] - 2026-08-02 | 08:46 PM | IST
|
|
4
|
+
|
|
5
|
+
Minor bump: two behavior changes below (`wait --until done` exit codes,
|
|
6
|
+
`--attempt-kind retry` now requiring `--parent-dispatch-id`).
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
- Dispatch-start records (#62): every dispatch appends a durable
|
|
11
|
+
`dispatch_start` row to the repo dispatch stream at registration (id,
|
|
12
|
+
session_id, pid, host, started_at, meta, schema_version); the
|
|
13
|
+
`dispatch_end` row written at teardown completes it. End rows now carry
|
|
14
|
+
`record_type` and `session_id` so readers can pair them.
|
|
15
|
+
- `harnex history` now shows uncompleted dispatches as `running` (pid alive
|
|
16
|
+
on this host) or `interrupted` (pid gone, no end row) instead of hiding
|
|
17
|
+
them until teardown.
|
|
18
|
+
- Duplicate-dispatch guard (#62): `harnex run --attempt-kind retry` requires
|
|
19
|
+
`--parent-dispatch-id`, and retry/fix/superseding dispatches naming a
|
|
20
|
+
still-running parent in the same repo are refused with a clear error.
|
|
21
|
+
`--allow-live-parent` overrides for intentional parallelism; `review` is
|
|
22
|
+
exempt.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- `harnex wait --until done` now has a documented exit-code contract
|
|
27
|
+
(guides/04_monitoring.md): `0` accepted work, `1` failed, `2` completed but
|
|
28
|
+
proof rejected, `3` no such session, `124` timeout. The wrapped process's
|
|
29
|
+
exit code is reported as payload data instead of being passed through.
|
|
30
|
+
Payloads carry a `wait_result` field.
|
|
31
|
+
- `harnex wait --until done` re-checks liveness every poll (registry, then
|
|
32
|
+
uncompleted start row with alive pid) and blocks while the session's pid
|
|
33
|
+
is alive. Stale exit-status files and events from an earlier dispatch that
|
|
34
|
+
reused the same id are ignored while a live session is in view.
|
|
35
|
+
- `harnex status` no longer silently reports stale registry data as live:
|
|
36
|
+
rows are labelled `source: live|registry|dispatch_start` with
|
|
37
|
+
`degraded: true` when the live status API was unreachable. With `--id`, a
|
|
38
|
+
running session whose registry row is missing is still reported running
|
|
39
|
+
from its uncompleted start row.
|
|
40
|
+
- One canonical repo resolution for all dispatch-stream writers and readers:
|
|
41
|
+
history rows now key off the session's `repo_root` (matching the summary
|
|
42
|
+
path) instead of the launch cwd, and `repo_key` canonicalizes symlinked
|
|
43
|
+
paths via realpath so registries written from a symlinked cwd stay visible
|
|
44
|
+
to checkers resolving the physical path.
|
|
45
|
+
- Refreshed the codex app-server schema fixtures against codex-cli 0.145.0
|
|
46
|
+
(10 fixtures; upstream-additive changes only, no adapter impact).
|
|
47
|
+
|
|
48
|
+
## [0.7.14] - 2026-07-15 | 10:06 PM | IST
|
|
49
|
+
|
|
50
|
+
### Added
|
|
51
|
+
|
|
52
|
+
- `harnex run` now accepts opt-in orchestration metadata flags
|
|
53
|
+
(`--orchestration-run-id`, `--orchestration-generation-id`,
|
|
54
|
+
`--orchestration-role`, `--orchestration-session-id`, and
|
|
55
|
+
`--orchestration-rotation-reason`) and emits a top-level `orchestration`
|
|
56
|
+
block when present.
|
|
57
|
+
- New `harnex orchestration sample` / `harnex orchestration report` commands
|
|
58
|
+
ingest bounded external-primary samples and compute primary-versus-worker
|
|
59
|
+
queue rollups without storing prompts, transcripts, tool payloads, or secrets.
|
|
60
|
+
- New `harnex artifact-report init PATH` and `harnex artifact-report validate
|
|
61
|
+
PATH [--final]` commands provide a bounded v1 report skeleton and
|
|
62
|
+
machine-readable field diagnostics without echoing report payloads.
|
|
63
|
+
- `harnex run --require-artifact-report` makes fresh accepted/no-change report
|
|
64
|
+
proof part of the work verdict and exposes strict mode to workers through
|
|
65
|
+
`HARNEX_ARTIFACT_REPORT_REQUIRED=1`.
|
|
66
|
+
|
|
67
|
+
### Changed
|
|
68
|
+
|
|
69
|
+
- Autonomous Codex app-server turns launched with `--context` now distinguish
|
|
70
|
+
provider turn completion from accepted work completion. Harnex requires
|
|
71
|
+
structured command/tool activity, a Git delta, or a fresh accepted/no-change
|
|
72
|
+
report before emitting `task_complete`; the classifier never parses final
|
|
73
|
+
prose and applies equally to flex and fast service tiers.
|
|
74
|
+
- Dispatch outcomes now include additive `class` and `report_status` fields,
|
|
75
|
+
and watch/wait/status/marker payloads preserve typed proof failures.
|
|
76
|
+
|
|
77
|
+
### Fixed
|
|
78
|
+
|
|
79
|
+
- Acknowledgment-only Codex turns now emit `completed_no_activity` and return a
|
|
80
|
+
non-zero work/auto-stop verdict instead of being reported as successful work.
|
|
81
|
+
- Strict report mode fails closed for missing, malformed, unsupported,
|
|
82
|
+
oversized, schema-incomplete, rejected, and unchanged stale sidecars. A valid
|
|
83
|
+
explicit `no_change` report remains an accepted proof path for intentional
|
|
84
|
+
no-delta work, while report-shaped JSON printed in final prose is ignored.
|
|
4
85
|
|
|
5
86
|
## [0.7.13] - 2026-07-15 | 12:24 PM | IST
|
|
6
87
|
|
data/README.md
CHANGED
|
@@ -203,8 +203,14 @@ For file-change hooks, use `--watch-file PATH`. The older
|
|
|
203
203
|
`--watch PATH`/`--watch=PATH` form is still accepted for compatibility, while
|
|
204
204
|
bare `--watch` means babysitter mode.
|
|
205
205
|
|
|
206
|
-
For one-shot startup prompts, add `--auto-stop`. It requires `--context
|
|
207
|
-
|
|
206
|
+
For one-shot startup prompts, add `--auto-stop`. It requires `--context`.
|
|
207
|
+
A Codex app-server turn launched from `--context` only counts as accepted
|
|
208
|
+
autonomous work when structured command/tool activity, a Git delta, or a fresh
|
|
209
|
+
accepted/no-change artifact report proves activity. An acknowledgment-only turn emits
|
|
210
|
+
`outcome.class=completed_no_activity`, makes `watch --until done` return
|
|
211
|
+
non-zero, and auto-stops with a non-zero verdict instead of reporting success.
|
|
212
|
+
PTY adapters still stop on prompt return because they do not expose equivalent
|
|
213
|
+
structured activity signals.
|
|
208
214
|
|
|
209
215
|
## Completion and waiting
|
|
210
216
|
|
|
@@ -269,21 +275,35 @@ harnex run pi --meta '{"read_budget_lines":2000,"output_ceiling_lines":800}' ...
|
|
|
269
275
|
```
|
|
270
276
|
|
|
271
277
|
Workers can also write a small machine-readable proof sidecar while keeping the
|
|
272
|
-
canonical explanation in plain-text `koder/` files
|
|
278
|
+
canonical explanation in plain-text `koder/` files. Initialize the real schema
|
|
279
|
+
instead of asking a model to reproduce it from prose:
|
|
273
280
|
|
|
274
281
|
```bash
|
|
275
|
-
harnex
|
|
276
|
-
|
|
277
|
-
--
|
|
282
|
+
harnex artifact-report init .harnex/reports/pi-i-61.json
|
|
283
|
+
harnex run pi --id pi-i-61 \
|
|
284
|
+
--artifact-report .harnex/reports/pi-i-61.json \
|
|
285
|
+
--require-artifact-report \
|
|
286
|
+
--context 'Run validation, update the canonical koder artifact, finalize $HARNEX_ARTIFACT_REPORT_PATH, and validate it with harnex artifact-report validate "$HARNEX_ARTIFACT_REPORT_PATH" --final' \
|
|
278
287
|
--auto-stop
|
|
279
288
|
```
|
|
280
289
|
|
|
281
290
|
The sidecar schema is `harnex.artifact_report.v1`; harnex exposes the path as
|
|
282
|
-
`HARNEX_ARTIFACT_REPORT_PATH` / `HARNEX_VALIDATION_REPORT_PATH`,
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
291
|
+
`HARNEX_ARTIFACT_REPORT_PATH` / `HARNEX_VALIDATION_REPORT_PATH`, the schema as
|
|
292
|
+
`HARNEX_ARTIFACT_REPORT_SCHEMA`, and strict mode as
|
|
293
|
+
`HARNEX_ARTIFACT_REPORT_REQUIRED=1`. `harnex artifact-report validate PATH`
|
|
294
|
+
checks field shapes; add `--final` to require `status=pass`, an
|
|
295
|
+
`accepted`/`no_change` outcome with a summary, valid command exit codes, and
|
|
296
|
+
`validation.final_reported=true`. Diagnostics contain bounded field paths and
|
|
297
|
+
shape errors, not report payloads or transcripts.
|
|
298
|
+
|
|
299
|
+
Without `--require-artifact-report`, report defects remain fail-soft warning
|
|
300
|
+
telemetry. With it, a missing, malformed, unsupported, oversized,
|
|
301
|
+
contract-incomplete, rejected, or unchanged stale report makes the work verdict
|
|
302
|
+
non-zero. A fresh explicit `no_change` report can prove an intentional no-delta
|
|
303
|
+
task without fake edits. Harnex records compact `artifact_report`, `validation`,
|
|
304
|
+
and `artifacts` blocks plus `outcome.class` / `outcome.report_status`; Git
|
|
305
|
+
changes alone never imply semantic acceptance, and JSON printed in final prose
|
|
306
|
+
is never scraped as a sidecar.
|
|
287
307
|
|
|
288
308
|
Queue runners can pass first-class attribution without hiding it in prose:
|
|
289
309
|
|
|
@@ -303,6 +323,27 @@ operational counters (`stalls`, `force_resumes`, `disconnections`,
|
|
|
303
323
|
`tool_calls`, `commands_executed`), output/event log paths, and rough volume
|
|
304
324
|
measurements such as `lines_changed`, `output_lines`, `output_bytes`, and
|
|
305
325
|
`event_records`.
|
|
326
|
+
|
|
327
|
+
Long queue runners can also opt into logical primary-orchestrator rollups:
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
harnex run pi --orchestration-run-id queue-005 --orchestration-generation-id gen-1 \
|
|
331
|
+
--orchestration-role worker --project-id harnex --queue-id queue-005 \
|
|
332
|
+
--entry-id SP-4 --phase implement --intent queue-work ...
|
|
333
|
+
|
|
334
|
+
harnex orchestration sample --out .harnex/orchestrator.jsonl \
|
|
335
|
+
--run-id queue-005 --generation-id primary-1 --session-id pi-primary-1 \
|
|
336
|
+
--context-tokens 64000 --context-window-tokens 200000 \
|
|
337
|
+
--usage-status observed --usage-total-tokens 129000 --tool-calls 31
|
|
338
|
+
|
|
339
|
+
harnex orchestration report --dispatch .harnex/dispatch.jsonl \
|
|
340
|
+
--samples .harnex/orchestrator.jsonl --run-id queue-005 --json
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
External samples use the bounded `harnex.orchestrator_sample.v1` schema. They
|
|
344
|
+
record ids, lifecycle/sample event names, aggregate usage/context counters,
|
|
345
|
+
tool-call counts, compactions, and rotation reasons only; prompts, transcripts,
|
|
346
|
+
tool arguments/results, secrets, and private payloads are out of scope.
|
|
306
347
|
Harnex records the data only; consumers decide whether to fail closed. See
|
|
307
348
|
[docs/dispatch-telemetry.md](docs/dispatch-telemetry.md) for the field
|
|
308
349
|
contract.
|
|
@@ -381,6 +422,7 @@ See [recipes/03_buddy.md](recipes/03_buddy.md) for the full pattern.
|
|
|
381
422
|
| `harnex events --id <id>` | Stream structured session events (`--snapshot` for non-blocking dump) |
|
|
382
423
|
| `harnex history` | List completed dispatches from `.harnex/dispatch.jsonl` |
|
|
383
424
|
| `harnex wait --id <id>` | Block until process exit by default; use `--until done` for unattended work completion or `--until task_complete` for exact structured turn completion |
|
|
425
|
+
| `harnex artifact-report init\|validate PATH` | Create or validate bounded `harnex.artifact_report.v1` proof; use `validate --final` before strict completion |
|
|
384
426
|
| `harnex doctor` | Run adapter dependency preflight checks; add `--sweep` for read-only session drift diagnostics |
|
|
385
427
|
| `harnex guide` | Getting started walkthrough |
|
|
386
428
|
| `harnex agents-guide` | Agent-facing dispatch, chain, buddy, monitoring, and naming guides |
|
data/TECHNICAL.md
CHANGED
|
@@ -28,10 +28,29 @@ harnex run codex -- --cd ~/other/repo
|
|
|
28
28
|
| `--preset NAME` | Watch preset (`impl`, `plan`, `gate`), requires `--watch` |
|
|
29
29
|
| `--watch-file PATH` | Auto-send a file-change hook (`--watch PATH`/`--watch=PATH` legacy) |
|
|
30
30
|
| `--context TXT` | Give the agent a task on startup |
|
|
31
|
-
| `--auto-stop` | With `--context`, stop after
|
|
31
|
+
| `--auto-stop` | With `--context`, stop after accepted task completion |
|
|
32
|
+
| `--artifact-report PATH` | Expose and ingest a bounded v1 proof sidecar |
|
|
33
|
+
| `--require-artifact-report` | Fail closed unless the sidecar is accepted final proof |
|
|
32
34
|
| `--fast` | For Codex, use `service_tier="fast"` instead of default `flex` |
|
|
33
35
|
| `--timeout SEC` | Wait budget for detached registration |
|
|
34
36
|
|
|
37
|
+
Codex app-server auto-stop rejects completion with no structured command/tool
|
|
38
|
+
activity, Git delta, or fresh accepted/no-change report as
|
|
39
|
+
`completed_no_activity`. Strict artifact-report mode works across transports
|
|
40
|
+
and returns non-zero for missing, invalid, rejected, or stale proof.
|
|
41
|
+
|
|
42
|
+
### `harnex artifact-report` — Initialize and validate proof
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
harnex artifact-report init .harnex/reports/worker.json
|
|
46
|
+
harnex artifact-report validate .harnex/reports/worker.json --final
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`init` writes a schema-valid in-progress skeleton (`--force` replaces an
|
|
50
|
+
existing file). `validate` emits bounded machine-readable field diagnostics;
|
|
51
|
+
`--final` additionally requires accepted/no-change final proof and successful
|
|
52
|
+
validation records.
|
|
53
|
+
|
|
35
54
|
### `harnex send` — Talk to a running agent
|
|
36
55
|
|
|
37
56
|
```bash
|
data/guides/01_dispatch.md
CHANGED
|
@@ -22,6 +22,9 @@ Inside a harnex-managed session, these environment variables are available:
|
|
|
22
22
|
| `HARNEX_SESSION_REPO_ROOT` | Repo root for the session |
|
|
23
23
|
| `HARNEX_SESSION_ID` | Internal harnex instance ID |
|
|
24
24
|
| `HARNEX_SPAWNER_PANE` | Tmux pane ID of the invoker |
|
|
25
|
+
| `HARNEX_ARTIFACT_REPORT_PATH` | Absolute configured proof-sidecar path |
|
|
26
|
+
| `HARNEX_ARTIFACT_REPORT_SCHEMA` | Required sidecar schema identifier |
|
|
27
|
+
| `HARNEX_ARTIFACT_REPORT_REQUIRED` | `1` when report proof is fail-closed |
|
|
25
28
|
|
|
26
29
|
Use `harnex send`, `harnex status`, `harnex wait`, `harnex pane`, and
|
|
27
30
|
`harnex logs` to coordinate with peers. If you are not inside harnex,
|
|
@@ -64,9 +67,14 @@ harnex run pi --id pi-i-NN --tmux pi-i-NN \
|
|
|
64
67
|
```
|
|
65
68
|
|
|
66
69
|
For one-shot context dispatches that should clean themselves up, add
|
|
67
|
-
`--auto-stop`. It requires `--context
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
`--auto-stop`. It requires `--context` and does not keep the session alive for
|
|
71
|
+
later reuse. On Codex app-server, a turn launched from `--context` is accepted
|
|
72
|
+
only after structured command/tool activity, Git delta, or fresh
|
|
73
|
+
accepted/no-change sidecar proof. A prose-only acknowledgment emits
|
|
74
|
+
`completed_no_activity`, is
|
|
75
|
+
visible as `task_failed` before teardown, and exits non-zero. This keeps
|
|
76
|
+
parallel orchestration compact without converting agent turn completion into
|
|
77
|
+
accepted work completion:
|
|
70
78
|
|
|
71
79
|
```bash
|
|
72
80
|
for i in 1 2 3; do
|
|
@@ -96,20 +104,32 @@ harnex run codex --cwd /tmp/leximaze_eval_run_001 \
|
|
|
96
104
|
child process cwd. Neither flag is a sandbox.
|
|
97
105
|
|
|
98
106
|
For queue closeout, ask workers to write a compact sidecar in addition to their
|
|
99
|
-
plain-text `koder/` artifact
|
|
107
|
+
plain-text `koder/` artifact. For blind/unattended work, initialize and require
|
|
108
|
+
the report so a normal final answer cannot bypass proof acceptance:
|
|
100
109
|
|
|
101
110
|
```bash
|
|
111
|
+
harnex artifact-report init .harnex/reports/pi-i-NN.json
|
|
102
112
|
harnex run pi --id pi-i-NN --tmux pi-i-NN \
|
|
103
113
|
--artifact-report .harnex/reports/pi-i-NN.json \
|
|
104
|
-
--
|
|
114
|
+
--require-artifact-report \
|
|
115
|
+
--context 'Update the canonical koder file, finalize $HARNEX_ARTIFACT_REPORT_PATH, then run harnex artifact-report validate "$HARNEX_ARTIFACT_REPORT_PATH" --final' \
|
|
105
116
|
--auto-stop
|
|
106
117
|
```
|
|
107
118
|
|
|
108
119
|
The worker should keep the full explanation in `koder/` and put only compact
|
|
109
|
-
machine-readable proof in the sidecar:
|
|
110
|
-
artifact summaries (`finding`,
|
|
111
|
-
confidence, and canonical refs.
|
|
112
|
-
|
|
120
|
+
machine-readable proof in the sidecar: an `accepted` or `no_change` outcome,
|
|
121
|
+
validation command/status/exit codes, typed artifact summaries (`finding`,
|
|
122
|
+
`review`, `gate`, `blocker`, etc.), evidence, confidence, and canonical refs.
|
|
123
|
+
`harnex artifact-report validate PATH` checks the schema without echoing report
|
|
124
|
+
payloads; `--final` additionally requires accepted final proof and
|
|
125
|
+
`validation.final_reported=true`.
|
|
126
|
+
|
|
127
|
+
Without `--require-artifact-report`, missing/malformed reports remain warning
|
|
128
|
+
telemetry. Strict mode fails closed for missing, malformed, unsupported,
|
|
129
|
+
oversized, schema-incomplete, rejected, or unchanged stale reports. JSON in the
|
|
130
|
+
agent's final prose does not count: only the configured sidecar path is read.
|
|
131
|
+
A fresh valid `no_change` report is the explicit proof path for intentional
|
|
132
|
+
no-delta work.
|
|
113
133
|
|
|
114
134
|
Queue runners should pass first-class attribution so dispatch rows can be grouped
|
|
115
135
|
without path/id heuristics:
|
data/guides/04_monitoring.md
CHANGED
|
@@ -22,10 +22,59 @@ For unattended monitors on existing visible/detached sessions, prefer
|
|
|
22
22
|
`task_failed` signal, or terminal exit, whichever comes first. Successful work
|
|
23
23
|
exits `0`, failed work exits non-zero, and wall-clock caps exit `124`. For
|
|
24
24
|
callers that need the lower-level primitive, `harnex wait --until done` exposes
|
|
25
|
-
the same work fence.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
the same work fence.
|
|
26
|
+
|
|
27
|
+
## Live-Run Visibility
|
|
28
|
+
|
|
29
|
+
Every dispatch appends a `dispatch_start` row to the repo's dispatch stream
|
|
30
|
+
(`.harnex/dispatch.jsonl`) at registration; the `dispatch_end` row at teardown
|
|
31
|
+
completes it. Between those two rows the run is visible to every documented
|
|
32
|
+
signal, from any cwd in the same repo:
|
|
33
|
+
|
|
34
|
+
- `harnex status --id X` reports `state=running` for a live session. When the
|
|
35
|
+
live HTTP status API is unreachable it still reports running from the
|
|
36
|
+
registry (or, failing that, from the uncompleted start row) and labels the
|
|
37
|
+
row `degraded: true` with `source` set to `registry` or `dispatch_start`.
|
|
38
|
+
- `harnex history` shows uncompleted dispatches as `running` (pid alive) or
|
|
39
|
+
`interrupted` (pid gone, no end row). Completed dispatches render one
|
|
40
|
+
`dispatch_end` row.
|
|
41
|
+
- `harnex wait --until done` blocks while the session's pid is alive, up to
|
|
42
|
+
`--timeout`. "No signal yet" from a live worker is never terminal.
|
|
43
|
+
|
|
44
|
+
A monitor consulting these signals can never classify a healthy mid-run
|
|
45
|
+
worker as dead. If `status` says running, do not dispatch a replacement.
|
|
46
|
+
|
|
47
|
+
## `wait --until done` Exit-Code Contract
|
|
48
|
+
|
|
49
|
+
| Code | `wait_result` | Meaning |
|
|
50
|
+
| --- | --- | --- |
|
|
51
|
+
| `0` | `done` | Completed with accepted work |
|
|
52
|
+
| `1` | `failed` | Work failed, process failed, or killed |
|
|
53
|
+
| `2` | `rejected_proof` | Completed but proof rejected (`completed_no_activity`, `report_missing`, `report_invalid`, `report_rejected`) |
|
|
54
|
+
| `3` | `no_such_session` | No live, start, event, or terminal signal for the id |
|
|
55
|
+
| `124` | `timeout` | `--timeout` elapsed while the session was still running |
|
|
56
|
+
|
|
57
|
+
The JSON payload always carries `wait_result` plus the work-state fields
|
|
58
|
+
(`done`, `work_state`, `outcome_class`, `artifact_report_status`). The child
|
|
59
|
+
process's own exit code is reported as data (`exit_code`), never passed
|
|
60
|
+
through as wait's exit status. Treat `2` as a work-acceptance failure, `3` as
|
|
61
|
+
a coordination error (wrong id or wrong repo), and only `0` as success.
|
|
62
|
+
|
|
63
|
+
## Duplicate-Dispatch Guard
|
|
64
|
+
|
|
65
|
+
`harnex run --attempt-kind retry` requires `--parent-dispatch-id`, and any
|
|
66
|
+
retry/fix/superseding dispatch whose named parent is still running in the
|
|
67
|
+
same repo is refused. Wait for the parent
|
|
68
|
+
(`harnex wait --id <parent> --until done`) or stop it first. Pass
|
|
69
|
+
`--allow-live-parent` only for intentional parallelism (e.g. isolated
|
|
70
|
+
worktrees). `--attempt-kind review` is exempt: a completed parent may still
|
|
71
|
+
sit at a live prompt while its work is reviewed. For structured sessions (Pi RPC and Codex app-server),
|
|
72
|
+
`harnex wait --until task_complete` remains the exact accepted-turn fence.
|
|
73
|
+
Codex acknowledgment-only auto-stop turns are typed
|
|
74
|
+
`completed_no_activity` and fail this fence without transcript parsing.
|
|
75
|
+
`--require-artifact-report` can additionally make sidecar shape/final-proof
|
|
76
|
+
acceptance part of the verdict. Harnex still does not judge semantic quality;
|
|
77
|
+
verify the expected artifact or tests afterward.
|
|
29
78
|
|
|
30
79
|
## Completion Test
|
|
31
80
|
|
|
@@ -103,8 +152,11 @@ harnex watch --id pi-i-NN --until done --max-wait 90m \
|
|
|
103
152
|
```
|
|
104
153
|
|
|
105
154
|
If that exits `124`, inspect the pane/logs/events and decide whether to nudge,
|
|
106
|
-
stop, or continue. If it exits any other non-zero code,
|
|
107
|
-
|
|
155
|
+
stop, or continue. If it exits any other non-zero code, inspect
|
|
156
|
+
`outcome_class` / `artifact_report_status` in the JSON or fail marker, treat the
|
|
157
|
+
work as failed, and do not continue polling the same task as though it were
|
|
158
|
+
still running. `completed_no_activity`, `report_missing`, `report_invalid`, and
|
|
159
|
+
`report_rejected` are work-acceptance failures rather than successful turns.
|
|
108
160
|
|
|
109
161
|
Recommended caps:
|
|
110
162
|
|