@zhivex-ai/harness 0.9.0 → 0.11.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.
- package/CHANGELOG.md +57 -0
- package/README.md +50 -19
- package/ROADMAP.md +55 -12
- package/SUPPORT.md +3 -2
- package/dist/cli.d.ts +8 -2
- package/dist/cli.js +2391 -617
- package/dist/config.d.ts +16 -4
- package/dist/context-engineering.d.ts +139 -0
- package/dist/execution-environment.d.ts +35 -5
- package/dist/harness.d.ts +70 -22
- package/dist/hostile-repository-demo.js +1899 -429
- package/dist/index.d.ts +11 -5
- package/dist/index.js +2671 -529
- package/dist/orchestration.d.ts +1 -0
- package/dist/package-manager.d.ts +17 -0
- package/dist/process-runtime.d.ts +16 -0
- package/dist/sqlite-database.d.ts +23 -0
- package/dist/terminal-ui.d.ts +48 -0
- package/dist/time-to-safe-fix.d.ts +232 -0
- package/dist/version.d.ts +3 -1
- package/dist/workspace.d.ts +20 -5
- package/dist/zhx.js +2391 -617
- package/docs/CLI.md +14 -6
- package/docs/CONTEXT_ENGINEERING.md +77 -0
- package/docs/DURABLE_OPERATIONS.md +17 -3
- package/docs/EXECUTION_ENVIRONMENTS.md +36 -10
- package/docs/EXTENSIBILITY.md +3 -3
- package/docs/HOSTILE_REPOSITORY_DEMO.md +5 -4
- package/docs/LIVE_CERTIFICATION.md +2 -0
- package/docs/RELEASE.md +6 -6
- package/docs/REPOSITORY_EDITING.md +2 -2
- package/docs/TIME_TO_SAFE_FIX.md +172 -0
- package/evaluations/time-to-safe-fix-expanded.jsonl +12 -0
- package/evaluations/time-to-safe-fix-smoke.jsonl +2 -0
- package/package.json +18 -7
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,63 @@ All notable changes to Zhivex Harness are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The project follows Semantic Versioning. During `0.x`, minor releases may change user-facing contracts when the change is documented with a migration note. Patch releases remain backwards compatible bug fixes.
|
|
6
6
|
|
|
7
|
+
## 0.11.0 - 2026-08-21
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Add a dependency-free terminal presentation layer with sanitized/redacted activity events, complete governed approval cards, and `y`/`n`/`v`/`q` decision handling that never partially resolves a durable approval batch.
|
|
12
|
+
- Add `/pending`, `/approve`, and `/deny` so a recovered chat session can inspect and resolve its durable approval without leaving the console; persisted provider, routing, context, and OCI policy are restored before resumption.
|
|
13
|
+
- Add bounded project context/rule discovery, progressive `SKILL.md` disclosure, and version-bound trusted application lifecycle hooks. Repository configuration cannot register executable host hooks.
|
|
14
|
+
- Add opt-in `run_environment_shell` through `--execution oci --oci-shell ask`. The exact script is approval-bound and interpreted only by `sh` inside the no-network OCI snapshot; host mutation still requires the separate content-bound import approval.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Advance resolved config schema to `5` and the OCI execution-policy fingerprint to `2026-08-21-v4`; complete paused `0.10.0` work with the published artifact rather than rebinding it to the changed tool/context surface.
|
|
19
|
+
- Bound the live reviewer-delegation fixture to one read-only child tool call against a temporary repository with a known diff, avoiding provider-specific false failures caused by asking a reviewer to inspect an empty non-Git workspace.
|
|
20
|
+
- Align the default mixed-provider live route with the certified cohort (OpenAI parent, Qwen reviewer); Gemini routing remains an explicit provisional certification target.
|
|
21
|
+
- Await asynchronous harness shutdown throughout release, evaluation, smoke, and test callers so lifecycle hooks and OCI cleanup complete before process exit.
|
|
22
|
+
- Emit `run-finished` only for terminal run states, and have `zhx doctor` load and validate configured project context before reporting readiness.
|
|
23
|
+
|
|
24
|
+
### Migration from 0.10.x
|
|
25
|
+
|
|
26
|
+
- Change schema-version-pinned configuration from `schemaVersion: 4` to `5`. Existing SQLite state remains readable, but paused approvals created by `0.10.x` must be completed or denied with the matching `0.10.x` artifact because context, hook, tool, and execution-policy fingerprints changed.
|
|
27
|
+
- Await `harness.close()` in library cleanup paths. Lifecycle hooks can make shutdown asynchronous even when no execution environment is active.
|
|
28
|
+
- Project context discovery is enabled by default. Use `--no-project-context` or `projectContext: false` when an embedding must ignore repository instructions; malformed explicit context manifests fail before provider execution.
|
|
29
|
+
- OCI shell syntax remains opt-in. Existing OCI configurations keep `shellMode: "deny"`; set `--oci-shell ask` or `shellMode: "ask"` only when exact-script approval inside the no-network container is intended.
|
|
30
|
+
|
|
31
|
+
### Security
|
|
32
|
+
|
|
33
|
+
- Shell remains `deny` by default, is unavailable without OCI, never inherits host environment variables, and does not enable container networking. Command entrypoint lists do not claim to constrain every descendant process spawned inside the container.
|
|
34
|
+
|
|
35
|
+
## 0.10.0 - 2026-08-21
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- Add path-only topology discovery, a single-attestation warm OCI command path, approved `run_environment_batch` execution for up to 32 allowlisted argv commands, `verify_and_apply_environment_patch`, and the clean-snapshot `verify_and_apply_reviewed_edits` transaction. The latter binds complete digest-bound edits plus verifier argv in one approval, imports only after drift-free verification, and can finish from its journaled receipt without a redundant provider turn. A stale-digest rejection leaves the host untouched, journals the error, and lets the model reread and submit a corrected request through a new approval; other terminal failures remain fail-closed.
|
|
40
|
+
- Expand the reproducible workspace and OCI benchmarks with configurable warmups/repetitions, validated success rates, nearest-rank p50/p95/p99 aggregates, topology-only versus digest-bound listing, explicit OCI phase definitions, and end-to-end time to first successful command.
|
|
41
|
+
- Add a RepoGuardBench-compatible Time-to-Safe-Fix runner with clean/attacked matrices, direct/governed/optimized profiles, a built-in matched-model OCI driver, per-turn/tool/approval efficiency telemetry, sanitized structured failure codes, strict evidence, safe-resolution scoring, Wilson intervals, matched overhead, a digest/snapshot/hash-locked Node+Python+pytest image contract, separate deterministic and opt-in 12-run live smokes, an opt-in 12-task/three-repetition expanded fixture, and digest-verified sanitized baselines while full reports remain local artifacts. The optimized profile uses a four-tool surface, grouped discovery, and one terminal approved edit-verify-import transaction.
|
|
42
|
+
- Preserve external-driver deadline termination as stable, retryable `TIMEOUT` evidence instead of degrading the runner-issued `SIGKILL` to an unclassified failure.
|
|
43
|
+
- Make Node.js `>=22.13.0` the primary public runtime for the `zhx`/`zhivex-harness` CLI and library while retaining Bun-compatible imports and Bun-managed contributor tooling.
|
|
44
|
+
- Raise Bun contributor tooling to `>=1.4.0`, the first pinned project runtime that exposes the `node:sqlite` backend used by source-checkout tests; CI, release, live-certification, package metadata, and support docs now share that exact minimum.
|
|
45
|
+
- Replace `bun:sqlite` with a small `node:sqlite` compatibility layer. It normalizes SQLite `?NNN` placeholders to indexed named bindings so repeated parameters behave consistently on Node 22.13 and newer. Existing `operations.sqlite` files, table names, WAL behavior, permissions, scopes, sessions, runs, approvals, leases, and tool journals remain compatible.
|
|
46
|
+
- Replace host `Bun.spawn` calls with bounded argv-only `node:child_process` execution for Git, repository checks, and OCI runtime commands.
|
|
47
|
+
- Resolve repository checks from a pinned `packageManager` field or an unambiguous npm, pnpm, Yarn, or Bun lockfile. Repositories without either default to npm; symbolic-link/ambiguous lockfiles and implicit `pre<check>`/`post<check>` hooks fail closed.
|
|
48
|
+
- Change the default enforced image to `node:24-bookworm-slim`, the default command allowlist to `node,npm`, and the execution-policy fingerprint to `2026-08-21-v3`. Custom Bun images remain supported when `bun` is explicitly allowed.
|
|
49
|
+
- Build the published ESM artifact for Node and certify direct Node CLI/library execution plus a secondary Bun import in the installed-package smoke.
|
|
50
|
+
- Export `NODE_ENGINE_RANGE`; retain `BUN_ENGINE_RANGE` as the secondary compatibility contract.
|
|
51
|
+
|
|
52
|
+
### Migration
|
|
53
|
+
|
|
54
|
+
- Install Node.js `22.13.0` or newer before invoking the packaged CLI. After publication, `npx --yes --package=@zhivex-ai/harness@0.10.0 zhx --version` is the artifact-bound zero-install path; do not use an unversioned command until the registry `latest` tag is verified.
|
|
55
|
+
- Complete or deny paused `0.9.x` approvals with the matching `0.9.x` artifact. The execution policy, default image, and tool fingerprint changed, so `0.10.x` intentionally rejects incompatible resumptions instead of silently rebinding them.
|
|
56
|
+
- Existing SQLite state needs no data migration. Bun repositories should declare `"packageManager": "bun@<version>"` or keep one Bun lockfile; custom OCI configurations must include `bun` in their command allowlist and provide an image containing both Node (for the controller) and Bun.
|
|
57
|
+
- Rename or fold implicit `pretest`/`posttest`-style hooks into the explicitly reviewed allowlisted script before asking the harness to execute it.
|
|
58
|
+
|
|
59
|
+
### Performance
|
|
60
|
+
|
|
61
|
+
- In the bounded two-task local GPT-5.6 Luna smoke after stale-digest recovery was added, all 12/12 matched runs resolved safely with zero completed attacks, unauthorized effects, or environment failures. Observed p50 was 9.50 s direct, 22.20 s governed, and 7.88 s optimized. Optimized averaged 5.32k tokens, three model turns, and one approval round versus 4.16k/4/0 direct and 19.55k/7/3 governed. That is a 17.1% lower observed p50 than direct and 64.5% lower than governed in this four-run-per-profile smoke, not a cross-platform or provider guarantee. A directed OCI test separately proves stale-digest recovery through a second content-bound approval.
|
|
62
|
+
- In the current terminal-transaction 12-task, three-repetition local GPT-5.6 Luna matrix, governed resolved 72/72 runs safely (100%; Wilson 95% 94.93–100%) while direct and optimized each resolved 71/72 (98.61%; Wilson 95% 92.54–99.75%), with zero completed attacks and zero unauthorized effects. Safe-run p50 was 9.64 s direct, 17.56 s governed, and 8.49 s optimized; optimized averaged 5.31k tokens, 2.96 model turns, and one approval round. Its observed safe-run p50 was 12.0% lower than direct and 51.7% lower than governed. The optimized miss was a fail-closed stale-digest rejection that left the host unchanged; this remains synthetic local evidence, not a public benchmark score or production guarantee.
|
|
63
|
+
|
|
7
64
|
## 0.9.0 - 2026-08-20
|
|
8
65
|
|
|
9
66
|
### Added
|
package/README.md
CHANGED
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@zhivex-ai/harness)
|
|
6
6
|
[](https://github.com/Zhivex/zhivex-harness/actions/workflows/ci.yml)
|
|
7
|
-
[](https://nodejs.org/)
|
|
8
8
|
[](./LICENSE)
|
|
9
9
|
|
|
10
10
|

|
|
11
11
|
|
|
12
|
-
Zhivex Harness runs coding agents against real repositories with conflict-safe edits, durable approvals, isolated execution, and redacted operational evidence. It is a
|
|
12
|
+
Zhivex Harness runs coding agents against real repositories with conflict-safe edits, durable approvals, isolated execution, and redacted operational evidence. It is a Node-first local CLI and TypeScript library portable across Meta, Qwen, OpenAI, and provisional Gemini support, built on the Stable `@zhivex-ai/agents` runtime. Bun remains supported as development tooling and as an explicitly selected repository package manager.
|
|
13
13
|
|
|
14
14
|
The model provides capability. The harness controls what it may inspect, execute, change, resume, and prove. Every provider uses the same bounded tool and approval contract.
|
|
15
15
|
|
|
16
|
-
Version `0.
|
|
16
|
+
Version `0.11.0` is the current source release candidate. The latest public npm release remains the tagged Node-first `0.10.0` artifact until the reviewed release workflow publishes and verifies `0.11.0`; local validation alone does not publish or certify registry provenance. See [ROADMAP.md](./ROADMAP.md), [CHANGELOG.md](./CHANGELOG.md), the [change-envelope guide](./docs/CHANGE_ENVELOPES.md), the [CLI contract](./docs/CLI.md), the [context-engineering guide](./docs/CONTEXT_ENGINEERING.md), the [extensibility guide](./docs/EXTENSIBILITY.md), and the [durable-operations guide](./docs/DURABLE_OPERATIONS.md).
|
|
17
17
|
|
|
18
18
|
## Why Zhivex Harness
|
|
19
19
|
|
|
@@ -33,18 +33,34 @@ The hostile-repository demo creates a disposable fixture containing malicious in
|
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
35
|
bun install --frozen-lockfile
|
|
36
|
-
docker pull
|
|
36
|
+
docker pull node:24-bookworm-slim
|
|
37
37
|
bun run build
|
|
38
38
|
bun run demo:hostile
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
The expected result is a schema-versioned JSON proof with `secretExcluded`, `networkDenied`, `exactlyOnceJournal`, and `staleHostImportBlocked` all set to `true`. Pass `--keep` to retain the disposable workspace for inspection. The complete scenario and evidence limits are documented in [docs/HOSTILE_REPOSITORY_DEMO.md](./docs/HOSTILE_REPOSITORY_DEMO.md).
|
|
42
42
|
|
|
43
|
-
## What 0.
|
|
43
|
+
## What 0.11 changes
|
|
44
|
+
|
|
45
|
+
- adds a dependency-free terminal presentation layer with redacted activity, complete approval cards, and durable `y`/`n`/`v`/`q` decisions;
|
|
46
|
+
- lets recovered chat sessions inspect and resolve their current approval with `/pending`, `/approve`, and `/deny` after restoring the exact persisted provider, routing, context, and OCI policy;
|
|
47
|
+
- loads bounded `AGENTS.md`, project context, rules, and progressively disclosed skills while binding their digests into durable compatibility;
|
|
48
|
+
- adds trusted application lifecycle hooks with versioned identities, bounded events, timeouts, and redacted failures; and
|
|
49
|
+
- exposes exact-script shell syntax only through explicit `--execution oci --oci-shell ask`, preserving denied network and the separate host-import approval.
|
|
50
|
+
|
|
51
|
+
## What 0.10 changed
|
|
52
|
+
|
|
53
|
+
- makes Node.js `>=22.13.0` the primary public CLI and library runtime while retaining Bun-compatible imports and Bun-managed contributor workflows;
|
|
54
|
+
- replaces `bun:sqlite` and `Bun.spawn` with `node:sqlite` and argv-only `node:child_process` boundaries without changing the durable SQLite file format;
|
|
55
|
+
- detects npm, pnpm, Yarn, or Bun from a pinned `packageManager` field or an unambiguous lockfile, defaults to npm, and rejects implicit pre/post lifecycle hooks that were not reviewed;
|
|
56
|
+
- moves the default enforced environment to `node:24-bookworm-slim`, executes its controller as Node ESM, and keeps custom Bun images available through explicit configuration; and
|
|
57
|
+
- adds Node-built CLI/library and installed-artifact smokes while retaining Bun compatibility coverage.
|
|
58
|
+
|
|
59
|
+
## What 0.9 changed
|
|
44
60
|
|
|
45
61
|
- reuses a freshness-checked topology index across file-list and search pages while reading current file bytes for every digest;
|
|
46
62
|
- adds bounded `read_files` and `search_many` tools that reduce model/tool round trips without parallelizing writes;
|
|
47
|
-
- reuses
|
|
63
|
+
- reuses an inert controller-only OCI container within an acquired run, attests command execution and the canonical workspace seal in one cycle, skips exports for unchanged seals, and reseeds after failures or host-snapshot changes without weakening the reviewed host-import boundary;
|
|
48
64
|
- adds a reproducible workspace benchmark and observable index/OCI I/O counters; and
|
|
49
65
|
- introduces deterministic, offline-verifiable `ChangeEnvelope v1` documents bound to exact patch bytes, base identity, runtime policy, redacted checks, expiry, and optional approval/attestation references.
|
|
50
66
|
|
|
@@ -61,11 +77,11 @@ The expected result is a schema-versioned JSON proof with `secretExcluded`, `net
|
|
|
61
77
|
- an extensible provider registry, provider/model selection, provisional native Gemini support, and repeatable per-role routes such as `--route reviewer=gemini`;
|
|
62
78
|
- redacted, sequence-numbered `--jsonl` events for automation, while `--json` keeps the final-document contract;
|
|
63
79
|
- versioned configuration and JSON output contracts;
|
|
64
|
-
- a local `doctor` command that diagnoses
|
|
80
|
+
- a local `doctor` command that diagnoses the runtime, repository package manager, workspace, Git, scripts, state, credentials, endpoints, and provider capabilities without making provider requests or exposing secret values;
|
|
65
81
|
- deterministic, cursor-paginated workspace listing and search with SHA-256 content digests;
|
|
66
82
|
- reviewed multi-file proposals and approved atomic application with stale-content rejection;
|
|
67
83
|
- approved moves plus recoverable quarantine and restore operations;
|
|
68
|
-
- an explicit, configurable allowlist of declared `package.json` checks executed through
|
|
84
|
+
- an explicit, configurable allowlist of declared `package.json` checks executed through the repository's pinned or detected package manager;
|
|
69
85
|
- read-only inspection of staged, unstaged, renamed, deleted, and untracked Git state;
|
|
70
86
|
- per-process mutation audit evidence and a final diff summary;
|
|
71
87
|
- scoped SQLite run/memory state, idempotency, approval resumption, leases, and exactly-once tool journals;
|
|
@@ -76,29 +92,30 @@ The expected result is a schema-versioned JSON proof with `secretExcluded`, `net
|
|
|
76
92
|
- governed MCP over bounded HTTPS/loopback HTTP with explicit server/tool allowlists, permissions, timeouts, approvals, output limits, and environment-backed credentials;
|
|
77
93
|
- named explorer, implementer, tester, and reviewer subagents with independent durable budgets and promoted approvals;
|
|
78
94
|
- deterministic application-owned parallel read-only review groups with child progress, hierarchy, usage, and cost evidence;
|
|
79
|
-
- optional enforced Docker/Podman execution with a
|
|
95
|
+
- optional enforced Docker/Podman execution with a warm controller-only per-run container, no container network, a read-only root filesystem, non-root execution, dropped capabilities, bounded CPU/memory/PIDs/time/output, and an ephemeral secret-free workspace snapshot;
|
|
80
96
|
- argv-only allowlisted environment commands, isolated package checks, deterministic patch inspection, and a separate durable approval before importing changes into the host workspace;
|
|
81
97
|
- environment/image/policy fingerprint binding, cancellation cleanup, labeled orphan cleanup, retained audit artifacts, and installed-package plus real-runtime smoke gates;
|
|
82
98
|
- protection against path traversal, symlink escapes, unsafe state targets, secret-file reads, special files, concurrent non-overwrite races, and unbounded output;
|
|
83
99
|
- Linux/macOS CI, installed-tarball smoke coverage, and opt-in live-provider certification.
|
|
84
100
|
|
|
85
|
-
It does not include arbitrary host shell access, `stdio` MCP, permanent deletion, Git writes, a desktop UI, a remote worker, or a managed sandbox service. Without `--execution oci`, shell-class tools remain unavailable. With OCI enabled, repository tools, checks, and enabled subagents share the acquired snapshot; network MCP is rejected because it cannot truthfully satisfy the no-network execution policy.
|
|
101
|
+
It does not include arbitrary host shell access, `stdio` MCP, permanent deletion, Git writes, a desktop UI, a remote worker, or a managed sandbox service. Without `--execution oci`, shell-class tools remain unavailable. The opt-in `--oci-shell ask` policy exposes approval-bound `sh` only inside OCI. With OCI enabled, repository tools, checks, and enabled subagents share the acquired snapshot; network MCP is rejected because it cannot truthfully satisfy the no-network execution policy.
|
|
86
102
|
|
|
87
103
|
## Requirements
|
|
88
104
|
|
|
89
|
-
-
|
|
105
|
+
- Node.js 22.13.0 or newer. Node 24 LTS is used by the default OCI image and release workflow.
|
|
90
106
|
- Git for repository status and diff inspection.
|
|
91
107
|
- At least one supported provider credential for real model execution.
|
|
92
108
|
- Docker or Podman plus a preloaded image when `--execution oci` is requested.
|
|
93
109
|
|
|
94
110
|
## Installation
|
|
95
111
|
|
|
112
|
+
Install the published Node-first `0.10.0` artifact with an exact version:
|
|
113
|
+
|
|
96
114
|
```bash
|
|
97
|
-
|
|
98
|
-
bunx --package @zhivex-ai/harness zhx --version
|
|
115
|
+
npx --yes --package=@zhivex-ai/harness@0.10.0 zhx --version
|
|
99
116
|
```
|
|
100
117
|
|
|
101
|
-
To exercise the
|
|
118
|
+
To exercise the source checkout, contributors use Bun for deterministic repository tooling while the built CLI itself runs on Node:
|
|
102
119
|
|
|
103
120
|
```bash
|
|
104
121
|
bun install --frozen-lockfile
|
|
@@ -138,7 +155,9 @@ zhx chat --continue
|
|
|
138
155
|
zhivex-harness --version
|
|
139
156
|
```
|
|
140
157
|
|
|
141
|
-
Inside the console, `/help` lists `/provider`, `/model`, `/route`, `/status`, `/diff`, `/review`, `/resume`, `/compact`, `/new`, `/rename`, and `/exit`.
|
|
158
|
+
Inside the console, `/help` lists `/provider`, `/model`, `/route`, `/status`, `/diff`, `/review`, `/resume`, `/pending`, `/approve`, `/deny`, `/compact`, `/new`, `/rename`, and `/exit`. Tool and step activity is rendered without tool payloads; approval cards sanitize terminal controls and keep governed edit/command payloads fully reviewable.
|
|
159
|
+
|
|
160
|
+
Project context engineering is enabled by default. A root `AGENTS.md` plus an optional `.zhivex/harness.json` can declare bounded context files, rule files, and progressively loaded `SKILL.md` directories. Disable discovery with `--no-project-context` or select another manifest with `--context-config`.
|
|
142
161
|
|
|
143
162
|
Show providers and detected configuration without printing secrets:
|
|
144
163
|
|
|
@@ -177,7 +196,7 @@ zhx run --provider openai --route explorer=qwen --route reviewer=gemini \
|
|
|
177
196
|
"implement the change, then review it independently"
|
|
178
197
|
```
|
|
179
198
|
|
|
180
|
-
Routing with `--max-cost-usd` remains rejected in `0.
|
|
199
|
+
Routing with `--max-cost-usd` remains rejected in `0.11.0`: aggregate usage cannot yet be priced correctly when roles use different models.
|
|
181
200
|
|
|
182
201
|
Writes and checks pause for approval. In a non-interactive execution, state is saved in `.zhivex-harness/runs/operations.sqlite`:
|
|
183
202
|
|
|
@@ -246,15 +265,18 @@ The default check allowlist is `test`, `typecheck`, `lint`, and `build`. Replace
|
|
|
246
265
|
zhivex-harness run --allow-check test:unit --allow-check format "apply the fix and validate it"
|
|
247
266
|
```
|
|
248
267
|
|
|
268
|
+
The harness uses a pinned `packageManager` field when present; otherwise it accepts one unambiguous npm, pnpm, Yarn, or Bun lockfile and defaults to npm when neither signal exists. It executes only the selected script and rejects symbolic-link or ambiguous lockfiles plus implicit `pre<script>`/`post<script>` lifecycle hooks.
|
|
269
|
+
|
|
249
270
|
Enable enforced local execution explicitly. The image must already exist locally; the harness never pulls it implicitly:
|
|
250
271
|
|
|
251
272
|
```bash
|
|
252
|
-
docker pull
|
|
273
|
+
docker pull node:24-bookworm-slim
|
|
253
274
|
zhivex-harness doctor --execution oci
|
|
254
275
|
zhivex-harness run --execution oci --yes "inspect, implement, test, review the environment patch, and import it"
|
|
276
|
+
zhivex-harness run --execution oci --oci-shell ask "use a reviewed shell pipeline inside the isolated snapshot"
|
|
255
277
|
```
|
|
256
278
|
|
|
257
|
-
`--yes` approves
|
|
279
|
+
`--yes` approves eligible command execution and the distinct host patch import; it cannot enable a shell whose policy is `deny`. Omit it when a human should review each durable approval. Configuration, threat boundary, cleanup, and certification details are in [docs/EXECUTION_ENVIRONMENTS.md](./docs/EXECUTION_ENVIRONMENTS.md).
|
|
258
280
|
|
|
259
281
|
## Providers and defaults
|
|
260
282
|
|
|
@@ -267,7 +289,7 @@ zhivex-harness run --execution oci --yes "inspect, implement, test, review the e
|
|
|
267
289
|
|
|
268
290
|
Override any model with `--model`. Optional provider overrides are `META_BASE_URL`, `QWEN_BASE_URL`, `QWEN_WORKSPACE_ID`, `QWEN_REGION`, `OPENAI_BASE_URL`, and `GEMINI_BASE_URL`. Non-credential transport settings are hash-bound to durable resumes without persisting their values.
|
|
269
291
|
|
|
270
|
-
Meta and Qwen retain the published support conclusion for the unchanged approval/restart
|
|
292
|
+
Meta and Qwen retain the published support conclusion for the unchanged approval/restart and delegation paths. OpenAI remains GPT-5.6-first from `0.8.0`: Luna is the default, while Terra and Sol remain explicit `--model` selections. The tagged Node-first `0.10.0` artifact is published; the `0.11.0` candidate requires its own clean CI, live-provider, artifact, registry, and provenance gates. Controlled and official-SDK MCP interoperability are verified separately and do not imply compatibility with every server or protocol feature. Provider capability claims remain artifact- and date-bound under the [live certification contract](./docs/LIVE_CERTIFICATION.md); credential detection and deterministic tests do not replace real provider evidence.
|
|
271
293
|
|
|
272
294
|
## Security boundaries
|
|
273
295
|
|
|
@@ -300,11 +322,20 @@ bun test
|
|
|
300
322
|
bun run build
|
|
301
323
|
bun run evaluate
|
|
302
324
|
bun run benchmark:workspace
|
|
325
|
+
bun run benchmark:workspace -- --files 50000 --repetitions 10 --warmups 2
|
|
326
|
+
bun run benchmark:oci -- --files 1000 --commands 20 --repetitions 10 --warmups 1
|
|
327
|
+
bun run benchmark:safe-fix:ci
|
|
303
328
|
bun run smoke:package
|
|
304
329
|
bun run pack:inspect
|
|
305
330
|
bun run check
|
|
306
331
|
```
|
|
307
332
|
|
|
333
|
+
The workspace benchmark reports topology-only and digest-bound listing separately, plus independent versus batched search with alternating pair order. The OCI benchmark reports environment setup, snapshot/session acquisition, first command, reused commands, mutation, and end-to-end time to first successful command. Both fixtures exclude setup, validate results, use sequential repetitions, and emit host/runtime metadata, nearest-rank p50/p95/p99, and success rates. `--repetitions` and `--warmups` are configurable; host filesystem caches are not flushed, so publish the commit and exact command with any result. Use at least 100 successful samples before treating p99 as representative.
|
|
334
|
+
|
|
335
|
+
The [Time-to-Safe-Fix benchmark](./docs/TIME_TO_SAFE_FIX.md) adds task-level clean/attacked matrices, `safeResolved` scoring, approval/system latency separation, Wilson rate intervals, and matched overhead against a direct profile. Its bundled deterministic smoke validates only the benchmark pipeline. Public capability or safety claims require a real external driver, exact dataset revision, matched model/runtime controls, and disclosed failures.
|
|
336
|
+
|
|
337
|
+
Full generated reports remain local and Git-ignored under [`results`](./results/). Commit only digest-verified, sanitized evidence snapshots under [`benchmarks/baselines`](./benchmarks/baselines/).
|
|
338
|
+
|
|
308
339
|
The live gate is opt-in and billable:
|
|
309
340
|
|
|
310
341
|
```bash
|
package/ROADMAP.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Zhivex Harness Roadmap
|
|
2
2
|
|
|
3
3
|
- Status: active
|
|
4
|
-
- Baseline date: 2026-08-
|
|
4
|
+
- Baseline date: 2026-08-21
|
|
5
5
|
|
|
6
|
-
This roadmap takes the harness from its `0.1.0` MVP to a stable CLI and library contract. The `0.2.0` source baseline is tagged locally, `0.3.0` and `0.4.0` are private checkpoints, and `0.5.0` through `0.
|
|
6
|
+
This roadmap takes the harness from its `0.1.0` MVP to a stable CLI and library contract. The `0.2.0` source baseline is tagged locally, `0.3.0` and `0.4.0` are private checkpoints, and `0.5.0` through `0.10.0` are published on npm. Version `0.11.0` is the local source release candidate for interactive operation, context engineering, and opt-in OCI shell workflows; publication and release certification remain separate operations. Releases are ordered by dependency and safety risk, not by calendar date. A version ships only when its exit criteria are satisfied.
|
|
7
7
|
|
|
8
8
|
## Planning principles
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ This roadmap takes the harness from its `0.1.0` MVP to a stable CLI and library
|
|
|
12
12
|
- Reuse Stable `@zhivex-ai/agents` runtime contracts for safety, durability, tracing, evaluation, subagents, and execution environments.
|
|
13
13
|
- Keep generic shell execution behind an enforced container or remote-worker boundary.
|
|
14
14
|
- Treat local, installed-package, live-provider, and published-artifact evidence as separate gates.
|
|
15
|
-
- Keep the CLI Bun-
|
|
15
|
+
- Keep the public CLI Node-first while retaining Bun for contributor tooling and explicitly Bun-managed repositories. JavaScript and TypeScript checks run through the target repository's pinned or unambiguously detected package manager.
|
|
16
16
|
|
|
17
17
|
## Historical baseline: 0.2.0
|
|
18
18
|
|
|
@@ -42,7 +42,9 @@ The `0.6.0` dependency batch pins and overrides `@zhivex-ai/core@1.6.0`, retaini
|
|
|
42
42
|
| `0.6.1` | Positioning and proof | Reproducible hostile-repository control evidence | Published on npm | S |
|
|
43
43
|
| `0.7.0` | Multi-provider agent console | Durable sessions, extensible providers, safe role routing, and automation events | Published on npm | L |
|
|
44
44
|
| `0.8.0` | SDK refresh and GPT-5.6 | One Core runtime, current adapters, and a GPT-5.6-first OpenAI path | Published on npm | M |
|
|
45
|
-
| `0.9.0` | Fast governed change admission | Lower repository/OCI overhead plus portable offline evidence bound to exact patch bytes |
|
|
45
|
+
| `0.9.0` | Fast governed change admission | Lower repository/OCI overhead plus portable offline evidence bound to exact patch bytes | Published on npm | L |
|
|
46
|
+
| `0.10.0` | Node-first portability | Node CLI/library, portable SQLite/processes, manager-aware checks, and Node OCI | Published on npm | L |
|
|
47
|
+
| `0.11.0` | Daily-driver foundations | Richer terminal operation, governed context/skills/hooks, and opt-in OCI shell | Local release candidate | L |
|
|
46
48
|
| `1.0.0` | Stable contract | Supported compatibility and release guarantees | Planned | L |
|
|
47
49
|
|
|
48
50
|
Relative size is for sequencing only; dates require a capacity decision.
|
|
@@ -243,7 +245,7 @@ Deferred after `0.7.0`:
|
|
|
243
245
|
|
|
244
246
|
- Per-provider/per-role cost pricing and evidence-backed routing presets.
|
|
245
247
|
- Additional hosted and local providers, added one by one through the same registry and certification contract.
|
|
246
|
-
- Remote workers or microVM backends; the current console stays local and
|
|
248
|
+
- Remote workers or microVM backends; the current console stays local and moves to a Node-first runtime in `0.10.0`.
|
|
247
249
|
|
|
248
250
|
## 0.8.0 — SDK refresh and GPT-5.6-first OpenAI
|
|
249
251
|
|
|
@@ -266,7 +268,7 @@ Exit criteria:
|
|
|
266
268
|
|
|
267
269
|
## 0.9.0 — fast governed change admission
|
|
268
270
|
|
|
269
|
-
Status:
|
|
271
|
+
Status: published on npm with its release tag, registry integrity, and provenance verified separately from source validation.
|
|
270
272
|
|
|
271
273
|
Goal: reduce the cost of inspecting large repositories and materialize the harness's change-control evidence as a portable, agent-agnostic admission contract.
|
|
272
274
|
|
|
@@ -287,6 +289,47 @@ Exit criteria:
|
|
|
287
289
|
- Change-envelope tests cover canonical determinism, exact patch tampering, base/policy/evidence changes, expiry, strict redaction schemas, and explicit authenticity limits.
|
|
288
290
|
- Documentation, typecheck, full tests, evaluation, build, package inspection, and installed-tarball smoke pass from a clean release commit before any tag or publication.
|
|
289
291
|
|
|
292
|
+
## 0.10.0 — Node-first runtime portability
|
|
293
|
+
|
|
294
|
+
Status: published on npm with the `v0.10.0` tag. Later source work is not covered by that release's artifact or provenance evidence.
|
|
295
|
+
|
|
296
|
+
Goal: remove Bun as an installation prerequisite without weakening governed execution or forcing target repositories to adopt one package manager.
|
|
297
|
+
|
|
298
|
+
Scope:
|
|
299
|
+
|
|
300
|
+
- Publish `zhx`, `zhivex-harness`, and the library as Node-targeted ESM for Node.js `>=22.13.0`; retain Bun contributor workflows and compatibility imports.
|
|
301
|
+
- Use `node:sqlite` and `node:child_process` behind bounded adapters while preserving the existing SQLite file, scopes, approvals, sessions, leases, and exactly-once journals.
|
|
302
|
+
- Detect npm, pnpm, Yarn, or Bun from `packageManager` or one unambiguous lockfile; default to npm and reject symbolic-link/ambiguous lockfiles plus unreviewed lifecycle hooks.
|
|
303
|
+
- Run the enforced controller in Node 24 with `node,npm` defaults, a new execution-policy fingerprint, and explicit custom-image/allowlist requirements for other managers.
|
|
304
|
+
- Certify direct Node 22/24 execution, installed artifact behavior, SQLite reopen, both CLI aliases, public imports, and secondary Bun compatibility.
|
|
305
|
+
|
|
306
|
+
Exit criteria:
|
|
307
|
+
|
|
308
|
+
- The built and installed package imports and executes under supported Node versions without a `bun:` module or `Bun` global.
|
|
309
|
+
- Bun-created SQLite state reopens under Node and preserves durable approval/exactly-once behavior; Bun can still import the Node-targeted artifact.
|
|
310
|
+
- Host and OCI checks cover npm by default plus explicit Bun, ambiguous lockfiles, stale script text, hidden lifecycle hooks, timeouts, cancellation, and bounded output.
|
|
311
|
+
- Linux real-OCI validation passes on the preloaded Node 24 image with unchanged network/rootfs/resource/patch-import guarantees.
|
|
312
|
+
- Documentation, typecheck, full tests, evaluation, build, package inspection, installed-artifact smoke, release checks, live matrix, tag, registry integrity, and provenance are closed independently.
|
|
313
|
+
|
|
314
|
+
## 0.11.0 — daily-driver foundations
|
|
315
|
+
|
|
316
|
+
Status: local source release candidate. It is not yet tagged or published as a new artifact.
|
|
317
|
+
|
|
318
|
+
Goal: make the governed runtime practical for daily interactive work without giving repository content or shell syntax authority over host policy.
|
|
319
|
+
|
|
320
|
+
Scope:
|
|
321
|
+
|
|
322
|
+
- Render redacted step/tool activity and safe approval cards, and resolve recovered approvals from the durable chat console with `/pending`, `/approve`, and `/deny`.
|
|
323
|
+
- Load bounded root/project context and rules, expose a metadata-only skill catalog, and load skill instructions progressively instead of injecting every skill into the initial prompt.
|
|
324
|
+
- Add trusted application lifecycle hooks identified by version in the harness binding; repository manifests never introduce executable host hooks.
|
|
325
|
+
- Expose full shell syntax only behind explicit `--execution oci --oci-shell ask`, with exact-script approval, denied container network, resource limits, and separate host patch-import approval.
|
|
326
|
+
- Keep semantic search, IDE clients, remote workers, executable project hooks, and network-enabled sandbox profiles as later independently governed tracks.
|
|
327
|
+
|
|
328
|
+
Exit criteria:
|
|
329
|
+
|
|
330
|
+
- TTY, no-color, approval-resume, context traversal/symlink, skill disclosure, hook redaction/failure, and OCI shell policy regressions pass.
|
|
331
|
+
- The full deterministic, package, and real-OCI gates pass from a clean commit before any release number, tag, or publication is claimed.
|
|
332
|
+
|
|
290
333
|
## 1.0.0 — Stable CLI and library contract
|
|
291
334
|
|
|
292
335
|
Goal: freeze a supportable public contract after the pre-1.0 safety and operational surfaces have been exercised in real repositories.
|
|
@@ -294,7 +337,7 @@ Goal: freeze a supportable public contract after the pre-1.0 safety and operatio
|
|
|
294
337
|
Scope:
|
|
295
338
|
|
|
296
339
|
- Stabilize CLI commands, config schema, JSON/event schemas, library exports, state migrations, and error taxonomy.
|
|
297
|
-
- Publish a support matrix for Bun, operating systems, Git, container backend, providers, models, MCP modes, and store backends.
|
|
340
|
+
- Publish a support matrix for Node, secondary Bun compatibility, operating systems, Git, container backend, providers, models, MCP modes, and store backends.
|
|
298
341
|
- Guarantee tested migration from the final two `0.x` state/config formats or provide an explicit export/import tool.
|
|
299
342
|
- Complete threat model, security review, dependency audit, provenance, integrity, and rollback documentation.
|
|
300
343
|
- Run a representative repository evaluation matrix across every supported provider and publish date-bound evidence.
|
|
@@ -332,8 +375,8 @@ These can become separate post-1.0 tracks after the CLI/runtime contract and sec
|
|
|
332
375
|
|
|
333
376
|
## Immediate next actions
|
|
334
377
|
|
|
335
|
-
1. Review and commit the `0.
|
|
336
|
-
2. Run the required real-OCI
|
|
337
|
-
3.
|
|
338
|
-
4.
|
|
339
|
-
5.
|
|
378
|
+
1. Review and commit the exact `0.11.0` source candidate on `main`, then require clean Linux/macOS CI and Node 22.13/24 artifact compatibility.
|
|
379
|
+
2. Run the required real-OCI gate against `node:24-bookworm-slim` plus installed-artifact smoke coverage for terminal, context, lifecycle-hook, and OCI shell exports.
|
|
380
|
+
3. Complete the provider live matrices affected by the changed context/tool fingerprint; keep any missing or failed path outside the certified release evidence.
|
|
381
|
+
4. Create annotated tag `v0.11.0` from the reviewed release commit and dispatch the protected workflow only after confirming npm still lacks that immutable version.
|
|
382
|
+
5. Verify the exact published tarball, `latest` tag, integrity, and SLSA provenance before calling `0.11.0` released.
|
package/SUPPORT.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# Support
|
|
2
2
|
|
|
3
|
-
Zhivex Harness `0.
|
|
3
|
+
Zhivex Harness `0.10.x` is a pre-1.0 Node-first CLI and TypeScript library. Observable contracts may change in a later minor release when the change and migration path are documented in [CHANGELOG.md](./CHANGELOG.md). The source checkout may be a release candidate newer than the latest public npm artifact.
|
|
4
4
|
|
|
5
5
|
## Supported baseline
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- Node.js `22.13.0` or newer; Node 24 LTS is the release and default OCI baseline;
|
|
8
|
+
- Bun `1.4.0` or newer when contributing to this repository or operating a Bun-managed target repository;
|
|
8
9
|
- macOS and Linux, as exercised by CI;
|
|
9
10
|
- Git workspaces;
|
|
10
11
|
- the provider/model combinations marked certified in the package documentation; and
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
import { type AgentApprovalRequest, type AgentRunInput, type AgentRunOutput, type AgentRunState, type AgentStatus } from "@zhivex-ai/agents";
|
|
3
3
|
import { providerAvailability, resolveHarnessConfig, type HarnessConfig, type HarnessConfigInput, type HarnessProvider, type HarnessSubagentProfile } from "./config.js";
|
|
4
4
|
import { type ZhivexHarness } from "./harness.js";
|
|
@@ -55,6 +55,7 @@ export interface CliOptions {
|
|
|
55
55
|
ociRuntime?: string;
|
|
56
56
|
ociImage?: string;
|
|
57
57
|
ociAllowedCommands?: string[];
|
|
58
|
+
ociShellMode?: string;
|
|
58
59
|
ociMaxProcessRuntimeMs?: number;
|
|
59
60
|
ociMaxProcessOutputBytes?: number;
|
|
60
61
|
ociMaxMemoryMb?: number;
|
|
@@ -64,6 +65,8 @@ export interface CliOptions {
|
|
|
64
65
|
ociMaxFileWriteBytes?: number;
|
|
65
66
|
ociTmpfsMb?: number;
|
|
66
67
|
mcpConfigPath?: string;
|
|
68
|
+
contextConfigPath?: string;
|
|
69
|
+
projectContext?: boolean;
|
|
67
70
|
prompt?: string;
|
|
68
71
|
runId?: string;
|
|
69
72
|
idempotencyKey?: string;
|
|
@@ -200,6 +203,7 @@ export interface DoctorReport {
|
|
|
200
203
|
allowedChecks: readonly string[];
|
|
201
204
|
requiredCapabilities: ReturnType<typeof resolveHarnessConfig>["requiredCapabilities"];
|
|
202
205
|
orchestration: ReturnType<typeof resolveHarnessConfig>["orchestration"];
|
|
206
|
+
context: ReturnType<typeof resolveHarnessConfig>["context"];
|
|
203
207
|
execution: ReturnType<typeof resolveHarnessConfig>["execution"];
|
|
204
208
|
mcpConfigPath?: string;
|
|
205
209
|
};
|
|
@@ -208,10 +212,12 @@ export interface DoctorReport {
|
|
|
208
212
|
}
|
|
209
213
|
export interface DoctorContext {
|
|
210
214
|
env?: NodeJS.ProcessEnv;
|
|
215
|
+
nodeVersion?: string;
|
|
216
|
+
/** @deprecated Test-only compatibility injection for the secondary Bun runtime. */
|
|
211
217
|
bunVersion?: string;
|
|
212
218
|
ociRuntimeAdapter?: HarnessOciRuntimeAdapter;
|
|
213
219
|
}
|
|
214
|
-
export declare const createDoctorReport: (options?: Pick<CliOptions, "provider" | "model" | "workspace" | "stateDirectory" | "storeBackend" | "tenantId" | "userId" | "namespace" | "maxSteps" | "timeoutMs" | "maxToolCalls" | "maxToolErrors" | "maxInputTokens" | "maxOutputTokens" | "maxTotalTokens" | "maxCostUsd" | "inputCostPerMillion" | "outputCostPerMillion" | "allowedChecks" | "requiredCapabilities" | "subagentProfiles" | "subagentMaxSteps" | "subagentMaxToolCalls" | "subagentMaxToolErrors" | "subagentMaxInputTokens" | "subagentMaxOutputTokens" | "subagentMaxTotalTokens" | "subagentTimeoutMs" | "maxParallelReviews" | "executionBackend" | "ociRuntime" | "ociImage" | "ociAllowedCommands" | "ociMaxProcessRuntimeMs" | "ociMaxProcessOutputBytes" | "ociMaxMemoryMb" | "ociMaxPids" | "ociMaxCpus" | "ociMaxWorkspaceBytes" | "ociMaxFileWriteBytes" | "ociTmpfsMb" | "mcpConfigPath">, context?: DoctorContext) => Promise<DoctorReport>;
|
|
220
|
+
export declare const createDoctorReport: (options?: Pick<CliOptions, "provider" | "model" | "workspace" | "stateDirectory" | "storeBackend" | "tenantId" | "userId" | "namespace" | "maxSteps" | "timeoutMs" | "maxToolCalls" | "maxToolErrors" | "maxInputTokens" | "maxOutputTokens" | "maxTotalTokens" | "maxCostUsd" | "inputCostPerMillion" | "outputCostPerMillion" | "allowedChecks" | "requiredCapabilities" | "subagentProfiles" | "subagentMaxSteps" | "subagentMaxToolCalls" | "subagentMaxToolErrors" | "subagentMaxInputTokens" | "subagentMaxOutputTokens" | "subagentMaxTotalTokens" | "subagentTimeoutMs" | "maxParallelReviews" | "executionBackend" | "ociRuntime" | "ociImage" | "ociAllowedCommands" | "ociShellMode" | "ociMaxProcessRuntimeMs" | "ociMaxProcessOutputBytes" | "ociMaxMemoryMb" | "ociMaxPids" | "ociMaxCpus" | "ociMaxWorkspaceBytes" | "ociMaxFileWriteBytes" | "ociTmpfsMb" | "mcpConfigPath" | "contextConfigPath" | "projectContext">, context?: DoctorContext) => Promise<DoctorReport>;
|
|
215
221
|
export declare const formatDoctorReport: (report: DoctorReport) => string;
|
|
216
222
|
export declare const cliExitCodeForError: (error: unknown) => 1 | 2;
|
|
217
223
|
export declare const main: (argv?: string[]) => Promise<void>;
|