@zhivex-ai/harness 0.5.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 ADDED
@@ -0,0 +1,132 @@
1
+ # Changelog
2
+
3
+ All notable changes to Zhivex Harness are documented in this file.
4
+
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
+
7
+ ## 0.5.0 - 2026-08-17
8
+
9
+ ### Added
10
+
11
+ - Model capability inspection, fail-fast requirements, and deterministic candidate selection before MCP or agent execution.
12
+ - Schema-versioned declarative MCP configuration with explicit server/tool allowlists, permissions, environment-backed headers, bounded discovery, timeouts, and output-size ceilings.
13
+ - A bounded HTTPS/loopback-HTTP MCP JSON-RPC client plus injectable custom clients for library consumers.
14
+ - Named `explorer`, `implementer`, `tester`, and `reviewer` subagent profiles with independent durable budgets, leases, fingerprints, and inherited workspace/scope policy.
15
+ - Application-owned parallel read-only review groups through the `review` CLI command and `runHarnessReviewGroup` library API.
16
+ - Hierarchical child progress, approval identity, usage, cost/budget aggregation, and redacted run-tree inspection.
17
+ - An opt-in Meta/Qwen/OpenAI live orchestration matrix that verifies exact reviewer delegation, child persistence, SQLite reopen, hierarchy, and aggregate usage independently from the legacy reviewed-edit gate.
18
+ - Public npm metadata, security and support policies, exact-tarball inspection and installation gates, and a confirmation-gated GitHub Actions release workflow with npm provenance.
19
+
20
+ ### Changed
21
+
22
+ - Resolved configuration uses schema version `3` and binds required capabilities, normalized MCP configuration, enabled profiles, and child policy into the harness fingerprint.
23
+ - Parent and child token guards enforce aggregate durable usage after each provider step, avoiding double reservation after a child consumes budget.
24
+ - The deterministic evaluation gate adds governed MCP and bounded-subagent scenarios.
25
+
26
+ ### Migration
27
+
28
+ - Review schema-version-pinned configuration and replace `schemaVersion: 2` with `3`; existing scoped SQLite data needs no database rewrite.
29
+ - Named subagents are enabled by default. Pass `subagentProfiles: []` or set an empty `ZHIVEX_HARNESS_SUBAGENTS` value for a parent-only library run.
30
+ - Complete fingerprinted paused `0.4.x` runs with the `0.4.x` binary. They are not silently rebound to the new MCP, capability, approval, or child-policy contract.
31
+ - Keep MCP JSON configuration inside the canonical workspace and store only environment-variable names, never credential values.
32
+
33
+ ### Security
34
+
35
+ - Network MCP calls always require durable interrupt approval, regardless of remote read-only annotations.
36
+ - MCP configuration rejects symlinks, workspace escapes, URL credentials, insecure non-loopback HTTP, unsafe headers, duplicate prefixes, and missing allowlists/permissions.
37
+ - MCP discovery and results fail closed on malformed schemas, prompt-injection directives, timeout, cancellation, and oversized output.
38
+ - Parallel review accepts only the read-only explorer/reviewer profiles; generic shell and `stdio` MCP remain unavailable until enforced execution environments.
39
+
40
+ ## 0.4.0 - 2026-08-17 (private checkpoint)
41
+
42
+ ### Added
43
+
44
+ - Scoped SQLite run and memory persistence as the default local operations store, including leases, compare-and-swap revisions, idempotency claims, and an exactly-once tool journal.
45
+ - `runs list`, `runs inspect`, `runs export`, `runs cancel`, and `runs cleanup` operator commands with schema-versioned JSON output.
46
+ - Step, wall-clock, tool-call, tool-error, input-token, output-token, total-token, and optional user-priced cost budgets.
47
+ - Deterministic bounded context compaction, production trace collection, redacted snapshots, traces, ledgers, and tool-journal inspection.
48
+ - A five-scenario golden evaluation gate covering analysis, edits and checks, denied approval, restart recovery, and provider portability.
49
+
50
+ ### Changed
51
+
52
+ - Resolved configuration uses schema version `2`, includes an explicit durable scope, and defaults to the `sqlite` backend.
53
+ - Tool permissions, production safety policy, redaction, budget termination, durable memory, and harness/approval fingerprints are bound into every run.
54
+ - The installed-package smoke now proves SQLite restart recovery, exactly-once mutation journaling, redacted inspection, and the packaged golden baseline.
55
+
56
+ ### Migration
57
+
58
+ - On first default local/workspace-scope open, legacy `0.3.x` file-backed runs are copied into the scoped backend and marked with `metadata.migratedFrom: "0.3-file-store"`; source files are retained for rollback. Custom scopes require intentional library migration.
59
+ - Use `--store file` or `ZHIVEX_HARNESS_STORE=file` only as a temporary compatibility path. New runs default to `<state-dir>/operations.sqlite`.
60
+ - Scope is part of durable identity. Use the same `--tenant`, `--user`, and `--namespace` values when listing, inspecting, exporting, cancelling, cleaning, or resuming a run.
61
+ - Resume rejects a mismatched workspace, provider/model, tool contract, approval policy, or harness fingerprint. Legacy paused runs receive the current binding only through the explicit resume path.
62
+ - Cost enforcement is enabled only when `--max-cost-usd` and input and/or output pricing are supplied; pricing is operator-provided and measured usage may cross the ceiling by one provider step.
63
+
64
+ ### Security
65
+
66
+ - Operational exports omit raw messages, tool inputs/outputs, approval arguments, metadata, and full output text, and apply secret/email redaction.
67
+ - SQLite files are required to be regular non-symlink files and are created with owner-only permissions inside an owner-only state directory.
68
+ - Cleanup defaults to terminal states and requires an explicit cutoff; cancellation defaults to a cooperative request unless `--final` is supplied.
69
+
70
+ ## 0.3.0 - 2026-08-16 (private checkpoint)
71
+
72
+ ### Added
73
+
74
+ - Deterministic cursor pagination for file discovery and literal search, with SHA-256 content digests carried through inspection.
75
+ - Digest-bound multi-file proposals and conflict-safe patch application with mutation audit evidence.
76
+ - Approved file moves plus recoverable quarantine and restore operations; no permanent-delete model tool.
77
+ - Expanded read-only Git inspection for staged, unstaged, renamed, deleted, and untracked paths.
78
+ - A configurable explicit Bun package-script allowlist.
79
+ - Real Git repository fixtures covering inspect/edit/validate/diff, stale conflicts, rename, quarantine recovery, untracked files, failed checks, and final summaries.
80
+
81
+ ### Changed
82
+
83
+ - Repository discovery respects Git and harness-specific ignore rules while keeping secret and state exclusions non-overridable.
84
+ - File replacement is published atomically, preserves existing modes, and rejects content changed after inspection.
85
+ - Repository-editing tools require reviewed content digests and emit before/after evidence.
86
+ - Upgraded `@zhivex-ai/meta` to `0.2.1`; Meta Chat streaming now preserves fragmented tool arguments and passed four consecutive proposal/approval/restart live gates.
87
+ - Live certification now exercises the contractual `propose_edits` then `apply_patch` sequence for every provider.
88
+ - The manual live-certification workflow defaults to the complete certified Meta, Qwen, and OpenAI matrix, with a documentation gate that rejects support-matrix drift.
89
+
90
+ ### Migration
91
+
92
+ - Consume `nextCursor` until absent instead of treating a truncated list or search result as complete.
93
+ - Replace overwrite-oriented multi-file flows with `propose_edits` followed by approved `apply_patch` using the observed digest for every existing target and `null` for a target that must be new.
94
+ - Complete paused `0.2.x` approvals with the version that created them before upgrading; persisted approvals are not promised to migrate across tool-schema changes.
95
+ - Replace deletion workflows with `quarantine_file` and retain the returned identifier when later recovery may be required.
96
+
97
+ ### Security
98
+
99
+ - Stale create/update/move/quarantine/restore requests fail before overwriting newer workspace content.
100
+ - Direct secret access, symlink escapes, special files, arbitrary host shell, Git writes, and permanent deletion remain unavailable.
101
+
102
+ ## 0.2.0 - 2026-08-16
103
+
104
+ ### Added
105
+
106
+ - Public package metadata and MIT licensing.
107
+ - A single runtime version source for the CLI and agent metadata.
108
+ - Versioned JSON output contracts and documented exit codes.
109
+ - A local `doctor` command that checks the runtime, workspace, Git, scripts, providers, and state directory without exposing credentials.
110
+ - Linux and macOS CI, installed-tarball smoke coverage, negative security regressions, and opt-in live-provider certification.
111
+
112
+ ### Changed
113
+
114
+ - Package builds externalize declared dependencies instead of embedding the complete SDK in both entry points.
115
+ - New files are created with exclusive semantics to prevent concurrent non-overwrite calls from silently replacing one another.
116
+
117
+ ### Migration
118
+
119
+ - `providers --json` now returns `{ schemaVersion: 1, kind: "providers", providers: [...] }` instead of a bare array.
120
+ - JSON run results now include `schemaVersion: 1` and `kind: "run-result"`.
121
+ - Invalid CLI usage exits with code `2`; a blocking `doctor` report exits with code `3`.
122
+ - State directories that target a workspace/filesystem root, protected workspace path, regular file, or symbolic link are rejected before the run store is created.
123
+
124
+ ### Security
125
+
126
+ - Added regression coverage for protected state paths, special files, nested symlink escapes, concurrent creation, bounded output, timeout cleanup, and denied approvals.
127
+
128
+ ## 0.1.0 - 2026-08-16
129
+
130
+ ### Added
131
+
132
+ - Initial provider-portable coding harness MVP for Meta, Qwen, and OpenAI.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Zhivex
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,211 @@
1
+ # Zhivex Harness
2
+
3
+ Zhivex Harness is a Bun-first coding-agent harness portable across Meta, Qwen, and OpenAI, built on the Stable `@zhivex-ai/agents` runtime.
4
+
5
+ The model provides capability; the harness provides repository context, narrow tools, limits, approvals, durable state, diagnostics, and verification. Every provider uses the same agent loop and local-tool contract.
6
+
7
+ Version `0.5.0` is a publication-ready extensibility-and-orchestration candidate. The package manifest and protected release workflow are ready, but the immutable npm publication has not been executed. Public availability begins only after the repository and npm prerequisites in the [release guide](./docs/RELEASE.md) are completed and a maintainer explicitly dispatches the workflow. See [ROADMAP.md](./ROADMAP.md), [CHANGELOG.md](./CHANGELOG.md), the [extensibility guide](./docs/EXTENSIBILITY.md), the [durable-operations guide](./docs/DURABLE_OPERATIONS.md), and the [trusted-editing contract](./docs/REPOSITORY_EDITING.md).
8
+
9
+ ## What 0.5 includes
10
+
11
+ - one-shot execution and interactive chat;
12
+ - provider and model selection through the CLI;
13
+ - versioned configuration and JSON output contracts;
14
+ - a local `doctor` command that diagnoses Bun, workspace, Git, scripts, state, credentials, endpoints, and provider capabilities without making provider requests or exposing secret values;
15
+ - deterministic, cursor-paginated workspace listing and search with SHA-256 content digests;
16
+ - reviewed multi-file proposals and approved atomic application with stale-content rejection;
17
+ - approved moves plus recoverable quarantine and restore operations;
18
+ - an explicit, configurable allowlist of declared `package.json` checks executed through Bun;
19
+ - read-only inspection of staged, unstaged, renamed, deleted, and untracked Git state;
20
+ - per-process mutation audit evidence and a final diff summary;
21
+ - scoped SQLite run/memory state, idempotency, approval resumption, leases, and exactly-once tool journals;
22
+ - run list, redacted inspect/export, cancellation, and retention cleanup commands;
23
+ - production safety policy plus step, time, tool, token, and optional operator-priced cost budgets;
24
+ - bounded context compaction with durable records and a deterministic golden evaluation gate;
25
+ - fail-fast model capability requirements and deterministic library-side candidate selection;
26
+ - governed MCP over bounded HTTPS/loopback HTTP with explicit server/tool allowlists, permissions, timeouts, approvals, output limits, and environment-backed credentials;
27
+ - named explorer, implementer, tester, and reviewer subagents with independent durable budgets and promoted approvals;
28
+ - deterministic application-owned parallel read-only review groups with child progress, hierarchy, usage, and cost evidence;
29
+ - protection against path traversal, symlink escapes, unsafe state targets, secret-file reads, special files, concurrent non-overwrite races, and unbounded output;
30
+ - Linux/macOS CI, installed-tarball smoke coverage, and opt-in live-provider certification.
31
+
32
+ It does not include arbitrary shell access, `stdio` MCP, permanent deletion, Git writes, a desktop UI, OS isolation, or a managed sandbox. Tools and subagents run inside the workspace with the permissions of the local process.
33
+
34
+ ## Requirements
35
+
36
+ - Bun 1.3.7 or newer.
37
+ - Git for repository status and diff inspection.
38
+ - At least one supported provider credential for real model execution.
39
+
40
+ ## Installation
41
+
42
+ After `0.5.0` is published to npm:
43
+
44
+ ```bash
45
+ bun add @zhivex-ai/harness
46
+ bunx zhivex-harness --version
47
+ ```
48
+
49
+ Until then, run the source checkout:
50
+
51
+ ```bash
52
+ bun install --frozen-lockfile
53
+ cp .env.example .env
54
+ bun run dev --version
55
+ ```
56
+
57
+ Configure only the providers you plan to use:
58
+
59
+ ```dotenv
60
+ OPENAI_API_KEY=...
61
+ MODEL_API_KEY=...
62
+ DASHSCOPE_API_KEY=...
63
+ ```
64
+
65
+ `MODEL_API_KEY` is used by the Meta Model API. Qwen also accepts `QWEN_API_KEY`; `DASHSCOPE_API_KEY` takes precedence.
66
+
67
+ ## Diagnose the environment
68
+
69
+ `doctor` is local and does not contact provider endpoints:
70
+
71
+ ```bash
72
+ zhivex-harness doctor
73
+ zhivex-harness doctor --provider qwen --json
74
+ ```
75
+
76
+ For a source checkout, replace `zhivex-harness` with `bun run dev`.
77
+
78
+ ## Usage
79
+
80
+ Show providers and detected configuration without printing secrets:
81
+
82
+ ```bash
83
+ zhivex-harness providers
84
+ zhivex-harness providers --json
85
+ ```
86
+
87
+ Run a task against the current directory:
88
+
89
+ ```bash
90
+ zhivex-harness run --provider openai "review the repository and fix the tests"
91
+ zhivex-harness run --provider meta "document the current architecture"
92
+ zhivex-harness run --provider qwen "implement the pending endpoint"
93
+ ```
94
+
95
+ Operate on another workspace:
96
+
97
+ ```bash
98
+ zhivex-harness run --provider qwen --workspace ../my-app "fix the typecheck errors"
99
+ ```
100
+
101
+ Interactive mode:
102
+
103
+ ```bash
104
+ zhivex-harness chat --provider meta
105
+ ```
106
+
107
+ Writes and checks pause for approval. In a non-interactive execution, state is saved in `.zhivex-harness/runs/operations.sqlite`:
108
+
109
+ ```bash
110
+ zhivex-harness resume <runId> --approve
111
+ zhivex-harness resume <runId> --deny
112
+ ```
113
+
114
+ Duplicate external requests can share a durable run identity:
115
+
116
+ ```bash
117
+ zhivex-harness run --idempotency-key issue-482 "fix the reported regression"
118
+ ```
119
+
120
+ Operate on runs without loading a provider or requiring its credential:
121
+
122
+ ```bash
123
+ zhivex-harness runs list --status waiting_approval
124
+ zhivex-harness runs inspect <runId> --json
125
+ zhivex-harness runs export <runId> --json
126
+ zhivex-harness runs cancel <runId> --reason "superseded"
127
+ zhivex-harness runs cleanup --before 2026-08-01T00:00:00Z
128
+ ```
129
+
130
+ Operations are scope-bound. The defaults are tenant `local` and a namespace derived from the canonical workspace. Supply the same `--tenant`, `--user`, and `--namespace` values across run and operator commands. Migration, budgets, redaction, retention, and compatibility limits are documented in [docs/DURABLE_OPERATIONS.md](./docs/DURABLE_OPERATIONS.md).
131
+
132
+ Use governed MCP and bounded subagents explicitly:
133
+
134
+ ```bash
135
+ zhivex-harness run --mcp-config examples/mcp-config.json "consult the allowed documentation tools"
136
+ zhivex-harness run --subagent explorer --subagent reviewer "analyze the boundary"
137
+ zhivex-harness review --reviewer explorer --reviewer reviewer --json "review the durable runtime"
138
+ ```
139
+
140
+ MCP configuration, capability gates, child budgets, promoted approvals, review groups, migration, and known limits are documented in [docs/EXTENSIBILITY.md](./docs/EXTENSIBILITY.md).
141
+
142
+ `--yes` automatically approves tools with side effects. Use it only inside a disposable or isolated workspace:
143
+
144
+ ```bash
145
+ zhivex-harness run --provider openai --yes "apply the change and validate it"
146
+ ```
147
+
148
+ Structured automation output uses schema version `1`:
149
+
150
+ ```bash
151
+ zhivex-harness run --provider qwen --json "analyze the issue without modifying files"
152
+ ```
153
+
154
+ The JSON shapes and exit codes are documented in [docs/CLI.md](./docs/CLI.md).
155
+
156
+ Repository edits use digest-bound proposals. Discovery returns `nextCursor` when another deterministic page is available; mutating tools reject stale content instead of merging or overwriting it. Deletions move files into harness-owned quarantine and return a recovery identifier. The complete contract and migration from `0.2.x` are documented in [docs/REPOSITORY_EDITING.md](./docs/REPOSITORY_EDITING.md).
157
+
158
+ The default check allowlist is `test`, `typecheck`, `lint`, and `build`. Replace it with repeatable CLI flags when a repository uses different declared scripts:
159
+
160
+ ```bash
161
+ zhivex-harness run --allow-check test:unit --allow-check format "apply the fix and validate it"
162
+ ```
163
+
164
+ ## Providers and defaults
165
+
166
+ | Provider | Default model | Current support |
167
+ | --- | --- | --- |
168
+ | Meta | `muse-spark-1.2` | `MODEL_API_KEY` · 0.4 runtime and 0.5 delegation certified |
169
+ | Qwen | `qwen3.8-max` | `DASHSCOPE_API_KEY` or `QWEN_API_KEY` · 0.4 runtime and 0.5 delegation certified |
170
+ | OpenAI | `gpt-5.4` | `OPENAI_API_KEY` · 0.4 runtime and 0.5 delegation certified |
171
+
172
+ Override any model with `--model`. Optional provider overrides are `META_BASE_URL`, `QWEN_BASE_URL`, `QWEN_WORKSPACE_ID`, `QWEN_REGION`, and `OPENAI_BASE_URL`.
173
+
174
+ Meta, Qwen, and OpenAI completed the 0.4 proposal, scoped-SQLite approval, process restart, and exactly-once patch gate on 2026-08-17. They also completed the separate 0.5 model-directed reviewer-delegation, child persistence, SQLite reopen, hierarchy, and aggregate-usage gate at `2026-08-17T02:21:45.553Z`. Controlled Streamable HTTP MCP interoperability over a real loopback server passed at `2026-08-17T13:05:05.542Z`; third-party server compatibility is not implied. Provider capability claims are date-bound by the [live certification gate](./docs/LIVE_CERTIFICATION.md); credential detection and deterministic tests do not replace real provider evidence.
175
+
176
+ ## Security boundaries
177
+
178
+ - Every workspace path is resolved against a canonical root.
179
+ - Reads and writes that cross an external symlink are rejected.
180
+ - Dependencies, build output, Git internals, harness state, `.env`, `.npmrc`, and private keys are excluded from model exploration.
181
+ - The model has no generic shell.
182
+ - Only explicitly allowed, declared package scripts can run; the model must provide the exact script text for approval binding.
183
+ - Checks run without automatic `.env` loading and with a reduced environment.
184
+ - Patch application, moves, quarantine, restore, and command execution require interruptible approval.
185
+ - Every edit carries the digest observed during inspection; stale creates and updates fail closed.
186
+ - Existing file modes are preserved and successful replacements are published atomically.
187
+ - Unsafe state roots, protected workspace paths, files, and symlink targets are rejected before a run store is created.
188
+ - Environment values are not injected into prompts, diagnostics, or tool responses.
189
+ - Remote MCP output is bounded, schema-checked, treated as untrusted, and rejected on common prompt-injection directives.
190
+ - Network MCP always pauses for approval; custom read-only annotation trust must be explicit and injected by the host application.
191
+ - Subagent children inherit scope, workspace, cancellation, approval, and store policy while retaining independent budgets and fingerprints.
192
+
193
+ These controls reduce risk but do not provide strong isolation. Use a dedicated container or microVM and a disposable workspace for autonomous execution.
194
+
195
+ ## Development
196
+
197
+ ```bash
198
+ bun run typecheck
199
+ bun test
200
+ bun run build
201
+ bun run evaluate
202
+ bun run smoke:package
203
+ bun run pack:inspect
204
+ bun run check
205
+ ```
206
+
207
+ The live gate is opt-in and billable:
208
+
209
+ ```bash
210
+ ZHIVEX_HARNESS_LIVE=1 bun run scripts/live-provider-smoke.ts
211
+ ```
package/ROADMAP.md ADDED
@@ -0,0 +1,239 @@
1
+ # Zhivex Harness Roadmap
2
+
3
+ - Status: active
4
+ - Baseline date: 2026-08-16
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` is a publication-ready extensibility-and-orchestration candidate. Registry publication remains a separate explicit operation. Releases are ordered by dependency and safety risk, not by calendar date. A version ships only when its exit criteria are satisfied.
7
+
8
+ ## Planning principles
9
+
10
+ - Make the harness distributable and observable before expanding its side-effect surface.
11
+ - Keep provider portability in the harness and provider-specific behavior behind capability checks.
12
+ - Reuse Stable `@zhivex-ai/agents` runtime contracts for safety, durability, tracing, evaluation, subagents, and execution environments.
13
+ - Keep generic shell execution behind an enforced container or remote-worker boundary.
14
+ - Treat local, installed-package, live-provider, and published-artifact evidence as separate gates.
15
+ - Keep the CLI Bun-first. JavaScript and TypeScript project checks continue to run through Bun.
16
+
17
+ ## Historical baseline: 0.2.0
18
+
19
+ The tagged source baseline provides:
20
+
21
+ - one-shot and interactive execution;
22
+ - Meta, Qwen, and OpenAI model adapters;
23
+ - bounded repository listing, literal search, file reads, file writes, and exact replacement;
24
+ - approved `test`, `typecheck`, `lint`, and `build` scripts;
25
+ - read-only Git status and unstaged diff;
26
+ - durable file-backed runs and approval resume;
27
+ - path traversal, external symlink, secret-file, size, output, step, and timeout guards.
28
+
29
+ The deterministic baseline, TypeScript typechecking, dependency-externalized build, package inspection, and installed-tarball smoke are implemented. The package is configured for a first public release with MIT metadata, CI, changelog, CLI/config schema versioning, `doctor`, and negative security regressions. All three provider credentials are configured locally without being exposed by diagnostics. Live certification is date-bound and recorded separately; publication and provenance remain external release operations.
30
+
31
+ The release candidate keeps `@zhivex-ai/core@1.5.0`. Although `1.6.0` is published, the installed `agents@1.2.0` and provider adapters still resolve their compatible runtime to `1.5.0`; upgrading only the direct dependency produced duplicate core types. The `1.6.0` move is deferred until the agents/providers batch can be installed and certified against one runtime version.
32
+
33
+ ## Release sequence
34
+
35
+ | Version | Theme | Primary outcome | Status | Relative size |
36
+ | --- | --- | --- | --- | --- |
37
+ | `0.2.0` | Releasable foundation | A versioned, installable, diagnosable CLI | Local release baseline | M |
38
+ | `0.3.0` | Trusted repository editing | Reviewable and recoverable multi-file changes | Private checkpoint | M |
39
+ | `0.4.0` | Durable operations | Inspectable, budgeted, cancellable, evaluable runs | Private checkpoint | L |
40
+ | `0.5.0` | Extensibility and orchestration | Governed MCP and bounded multi-agent work | Publication-ready candidate | L |
41
+ | `0.6.0` | Enforced execution | Shell and checks inside a real isolation boundary | Planned | XL |
42
+ | `1.0.0` | Stable contract | Supported compatibility and release guarantees | Planned | L |
43
+
44
+ Relative size is for sequencing only; dates require a capacity decision.
45
+
46
+ ## 0.2.0 — Releasable foundation (release candidate)
47
+
48
+ Goal: make the existing narrow harness safe to install, automate, diagnose, and release without broadening its write or command surface.
49
+
50
+ Scope:
51
+
52
+ - Add license, repository, issue tracker, `publishConfig`, changelog, release notes, and an explicit public/private publication decision.
53
+ - Replace duplicated version literals in `package.json`, agent metadata, and CLI output with one generated or imported version source.
54
+ - Define versioned config and JSON output schemas, documented exit codes, and a compatibility policy for `0.x`.
55
+ - Add `doctor` for Bun version, workspace, Git, scripts, provider capability, credential presence, state-directory permissions, and endpoint diagnostics without printing secrets.
56
+ - Add CI for typecheck, tests, build, CLI smoke, and package-content inspection on Linux and macOS.
57
+ - Pack the tarball, install it into a clean fixture, and exercise `--help`, `--version`, `providers`, one mock run, and approval resume through the installed binary.
58
+ - Add negative security tests for state paths, special files, nested symlinks, race-sensitive writes, output truncation, timeout cleanup, and denied approvals.
59
+ - Add an opt-in live gate for Meta, Qwen, and OpenAI: forced local tool call, approval pause, process restart, resume, and exactly-once side effect.
60
+
61
+ Exit criteria:
62
+
63
+ - `bun run check` and the installed-tarball smoke pass from a clean checkout.
64
+ - CI is required on the default branch and produces no tracked build artifacts.
65
+ - Config, JSON output, exit codes, and security boundaries are documented.
66
+ - Every advertised provider passes the live gate, or is explicitly marked uncertified and excluded from the supported matrix.
67
+ - Publishing remains a separate, intentional operation after artifact inspection.
68
+
69
+ ## 0.3.0 — Trusted repository editing
70
+
71
+ Goal: let the agent make realistic multi-file changes while every mutation remains bounded, reviewable, conflict-safe, and recoverable.
72
+
73
+ Status: validated private candidate. It is not configured for registry publication. Contract and migration details live in [docs/REPOSITORY_EDITING.md](./docs/REPOSITORY_EDITING.md).
74
+
75
+ Scope:
76
+
77
+ - Respect hierarchical `.gitignore` files plus `.zhivex-harnessignore` while preserving hard secret exclusions.
78
+ - Add paginated file discovery and search with deterministic ordering and explicit truncation cursors.
79
+ - Add a patch proposal/apply flow with expected-content digests, atomic writes, file-mode preservation, and stale-workspace rejection.
80
+ - Extend Git inspection to staged, unstaged, renamed, deleted, and untracked files without exposing Git writes.
81
+ - Add approved move and recoverable delete operations. Deletions go to a harness-owned quarantine with an explicit restore path; permanent deletion is not a model tool.
82
+ - Make the check allowlist configurable but explicit. Do not add arbitrary in-process shell execution.
83
+ - Add fixture-repository end-to-end tests covering multi-file edits, conflicts, restore, formatting, failed checks, and final diff review.
84
+
85
+ Exit criteria:
86
+
87
+ - No write can silently overwrite content changed after the model inspected it.
88
+ - Every mutation produces a before/after audit record and appears in the final diff summary.
89
+ - Delete/restore and interrupted atomic-write tests pass on supported platforms.
90
+ - Real repository fixtures prove a complete inspect, edit, validate, and summarize loop.
91
+
92
+ Required release evidence:
93
+
94
+ - focused workspace and fixture-repository tests pass on Linux and macOS;
95
+ - pagination is deterministic and cursors reject incompatible reuse;
96
+ - a stale precondition leaves every proposed target unchanged;
97
+ - move, quarantine, restore, failed check, and final Git/audit summaries are exercised from a real Git repository;
98
+ - migration and safety boundaries are documented without claiming host isolation or permanent deletion;
99
+ - `0.3.0` remains private until an explicit publication decision is made.
100
+
101
+ Validation snapshot (2026-08-16):
102
+
103
+ - the trusted-editing implementation is merged into `main`;
104
+ - deterministic, installed-package, and package-inspection CI gates pass on Linux and macOS;
105
+ - the date-bound Meta, Qwen, and OpenAI proposal/approval/restart matrix is recorded in [docs/LIVE_CERTIFICATION.md](./docs/LIVE_CERTIFICATION.md);
106
+ - publication, registry integrity, and provenance have not been attempted or claimed.
107
+
108
+ ## 0.4.0 — Durable operations and evaluation
109
+
110
+ Goal: make runs supportable over time instead of only executable from one terminal.
111
+
112
+ Status: validated private candidate. Operations and migration details live in [docs/DURABLE_OPERATIONS.md](./docs/DURABLE_OPERATIONS.md).
113
+
114
+ Scope:
115
+
116
+ - Adopt the Stable production safety policy, explicit permission metadata, budget guards, and redacted telemetry from `@zhivex-ai/agents`.
117
+ - Add run list, inspect, cancel, resume, retention, and cleanup commands with machine-readable output.
118
+ - Add idempotency keys, scope, durable cancellation, tool-journal evidence, and SQLite as the default concurrent local store; retain file-store migration support.
119
+ - Add token, step, wall-clock, tool-call, and optional cost budgets with clear termination reasons.
120
+ - Add bounded memory and context compaction with durable compaction records.
121
+ - Export redacted snapshots, traces, tool audit records, and run ledgers.
122
+ - Add deterministic evaluation fixtures and golden traces for analysis-only, edit-and-test, denied-approval, failure-recovery, and provider-switch scenarios.
123
+ - Add an evaluation regression gate for success, safety, tool use, latency, and cost budgets.
124
+
125
+ Exit criteria:
126
+
127
+ - Restart, duplicate request, concurrent resume, cancellation, expired work, and retention tests pass without repeated side effects.
128
+ - State migration from `0.3.x` is tested and documented.
129
+ - Golden fixtures are deterministic and the regression gate runs in CI.
130
+ - Exported operational artifacts are redacted by default and schema-versioned.
131
+
132
+ Validation snapshot (2026-08-17):
133
+
134
+ - deterministic tests, the five-case golden evaluation gate, typecheck, docs, build, and installed-tarball smoke pass;
135
+ - migration, idempotency, concurrent ownership, expired-lease recovery, cancellation, retention, Qwen token enforcement, and export redaction have regression coverage;
136
+ - Meta, Qwen, and OpenAI passed the scoped-SQLite approval/restart/exactly-once live matrix;
137
+ - registry publication, provenance, tag creation, commit, and push have not been attempted or claimed.
138
+
139
+ ## 0.5.0 — Extensibility and orchestration
140
+
141
+ Goal: support larger tasks through governed external tools and bounded delegation without weakening workspace policy.
142
+
143
+ Status: publication-ready candidate. Configuration, migration, MCP, and orchestration contracts live in [docs/EXTENSIBILITY.md](./docs/EXTENSIBILITY.md); registry publication remains pending an explicit maintainer dispatch and the external prerequisites in [docs/RELEASE.md](./docs/RELEASE.md).
144
+
145
+ Scope:
146
+
147
+ - Add capability-based provider/model selection and reject unsupported requested capabilities before a run begins.
148
+ - Add declarative MCP server configuration with server/tool allowlists, permission metadata, timeouts, output limits, and approval policies.
149
+ - Start with read-only MCP tools; network or write-like MCP tools always require explicit approval and durable audit evidence.
150
+ - Add named subagent profiles such as explorer, implementer, tester, and reviewer using Stable SDK subagent and handoff contracts.
151
+ - Give child runs independent step/token/time budgets while inheriting workspace, secret, approval, and execution-environment policies.
152
+ - Add deterministic application-owned parallel review through agent groups; reserve model-directed delegation for true subagent cases.
153
+ - Surface child progress, promoted approvals, hierarchy, and cost in streaming and JSON output.
154
+
155
+ Exit criteria:
156
+
157
+ - An unconfigured or capability-incompatible model cannot enter an MCP or subagent flow.
158
+ - Child approval pause/resume, cancellation propagation, exactly-once recovery, hierarchy traces, and aggregate budgets pass end-to-end tests.
159
+ - MCP prompt injection and oversized/malformed result tests fail safely.
160
+ - Provider-specific limitations are recorded in a live support matrix.
161
+
162
+ Validation snapshot (2026-08-17 UTC):
163
+
164
+ - deterministic tests, the seven-case golden evaluation gate, typecheck, docs, build, dependency audit, dry-run package inspection, and installed-tarball smoke pass;
165
+ - malformed MCP, HTTP handshake/session, injection/output bounds, approval/restart, child mutation exactly-once, cancellation, scoped hierarchy, aggregate budget, and parallel review have regression coverage;
166
+ - controlled Streamable HTTP MCP interoperability passed over a real loopback server with session negotiation, JSON and SSE responses, tool discovery, bounded execution, and forced network approval at `2026-08-17T13:05:05.542Z`;
167
+ - Meta `muse-spark-1.2`, Qwen `qwen3.8-max`, and OpenAI `gpt-5.4` passed the separate model-directed reviewer delegation, child persistence, SQLite reopen, hierarchy, and aggregate-usage matrix at `2026-08-17T02:21:45.553Z`;
168
+ - exact-artifact and publication controls are prepared, while registry publication, provenance, tag creation, and push have not been attempted or claimed.
169
+
170
+ ## 0.6.0 — Enforced execution environments
171
+
172
+ Goal: introduce shell-class capabilities only when the declared filesystem, process, network, and resource controls are real.
173
+
174
+ Scope:
175
+
176
+ - Implement the SDK execution-environment contract for a local OCI/container backend, with an adapter boundary for future remote workers.
177
+ - Bind run resume to the environment manifest, workspace identity, image digest, policy version, and harness fingerprint.
178
+ - Execute approved shell and package checks only inside the acquired environment; keep in-process generic shell unavailable.
179
+ - Default to no network, bounded CPU/memory/process/time/output, a non-root user, and an ephemeral workspace snapshot.
180
+ - Export a patch/artifact from the snapshot and require a separate approval before applying it to the host workspace.
181
+ - Add image lifecycle, orphan cleanup, cancellation, crash recovery, and auditable environment acquisition/release.
182
+ - Document Docker/OCI prerequisites and the weaker fallback behavior when enforced execution is unavailable.
183
+
184
+ Exit criteria:
185
+
186
+ - Escape, network-denial, resource-exhaustion, fork-bomb, secret-mount, changed-fingerprint resume, cancellation, and orphan-cleanup tests pass.
187
+ - Host workspace changes occur only through the approved patch import path.
188
+ - Installed-artifact and live-provider tests exercise the enforced backend.
189
+ - The product is described as a local enforced runner, not a managed sandbox service.
190
+
191
+ ## 1.0.0 — Stable CLI and library contract
192
+
193
+ Goal: freeze a supportable public contract after the pre-1.0 safety and operational surfaces have been exercised in real repositories.
194
+
195
+ Scope:
196
+
197
+ - Stabilize CLI commands, config schema, JSON/event schemas, library exports, state migrations, and error taxonomy.
198
+ - Publish a support matrix for Bun, operating systems, Git, container backend, providers, models, MCP modes, and store backends.
199
+ - Guarantee tested migration from the final two `0.x` state/config formats or provide an explicit export/import tool.
200
+ - Complete threat model, security review, dependency audit, provenance, integrity, and rollback documentation.
201
+ - Run a representative repository evaluation matrix across every supported provider and publish date-bound evidence.
202
+ - Add full installation, operations, policy, MCP, isolation, troubleshooting, migration, and release documentation.
203
+ - Require release candidates before `latest`; no direct `0.6.x` to untested GA promotion.
204
+
205
+ Exit criteria:
206
+
207
+ - Two release candidates complete without a contract-breaking defect.
208
+ - Clean-machine install, installed-tarball, migration, evaluation, live-provider, and enforced-environment gates pass.
209
+ - Versioned artifacts, checksums/provenance, tag, changelog, and published package metadata agree with the source commit.
210
+ - No open critical/high security finding and no undocumented unsupported provider path.
211
+
212
+ ## Cross-release definition of done
213
+
214
+ Every version must include:
215
+
216
+ - unit, integration, failure-path, and security regression tests proportional to the changed surface;
217
+ - typecheck, build, source CLI smoke, packed-artifact inspection, and installed CLI smoke;
218
+ - documentation and changelog entries for behavior, config, state, and compatibility changes;
219
+ - a migration note for every persisted-state or user-facing schema change;
220
+ - provider live certification when provider behavior, tools, approvals, or streaming changes;
221
+ - explicit separation of local proof, installed-artifact proof, live proof, and publication proof;
222
+ - a clean worktree and reproducible Bun lockfile before the release commit.
223
+
224
+ ## Explicit non-goals through 1.0
225
+
226
+ - A desktop IDE or hosted operator UI.
227
+ - A Zhivex-managed remote sandbox service or hosted control plane.
228
+ - Automatic Git commit, push, pull request creation, deployment, or publication.
229
+ - Unapproved permanent deletion or arbitrary host shell execution.
230
+ - Claiming provider parity where upstream capabilities differ.
231
+
232
+ These can become separate post-1.0 tracks after the CLI/runtime contract and security model are stable.
233
+
234
+ ## Immediate next actions
235
+
236
+ 1. Dogfood governed MCP and bounded delegation on representative repositories before freezing the contract.
237
+ 2. Validate additional third-party Streamable HTTP servers without broadening the transport or trust claims.
238
+ 3. Make the repository public, enable private vulnerability reporting, protect the `npm` environment, and verify `@zhivex-ai` scope rights before dispatching publication.
239
+ 4. Bootstrap the first npm version through the protected workflow, configure `release.yml` as the package Trusted Publisher, revoke the temporary bootstrap token, and verify registry integrity/provenance against the tagged commit.
package/SECURITY.md ADDED
@@ -0,0 +1,23 @@
1
+ # Security policy
2
+
3
+ ## Supported versions
4
+
5
+ Security fixes are provided for the latest published `0.5.x` version. Pre-release source snapshots and older private checkpoints are not supported release channels.
6
+
7
+ ## Reporting a vulnerability
8
+
9
+ Do not open a public issue for a suspected vulnerability. Use [GitHub private vulnerability reporting](https://github.com/Zhivex/zhivex-harness/security/advisories/new) and include:
10
+
11
+ - the affected version and operating system;
12
+ - a minimal reproduction or proof of concept;
13
+ - the expected and observed security boundary;
14
+ - the practical impact; and
15
+ - any suggested mitigation.
16
+
17
+ Private vulnerability reporting must be enabled before the repository is made public. If that channel is unavailable, do not disclose exploit details in a public issue.
18
+
19
+ ## Scope
20
+
21
+ Reports are in scope when they affect packaged runtime code, workspace or state isolation, approval enforcement, secret handling, MCP boundaries, provider communication, dependency integrity, or the build and release pipeline.
22
+
23
+ The absence of an OS sandbox is a documented product boundary rather than a vulnerability by itself. The harness does not expose generic host shell or permanent-delete model tools.
package/SUPPORT.md ADDED
@@ -0,0 +1,21 @@
1
+ # Support
2
+
3
+ Zhivex Harness `0.5.x` is a pre-1.0 CLI and TypeScript library for Bun. Observable contracts may change in a later minor release when the change and migration path are documented in [CHANGELOG.md](./CHANGELOG.md).
4
+
5
+ ## Supported baseline
6
+
7
+ - Bun `1.3.7` or newer;
8
+ - macOS and Linux, as exercised by CI;
9
+ - Git workspaces;
10
+ - the provider/model combinations marked certified in the package documentation; and
11
+ - HTTPS or explicitly allowed loopback-HTTP MCP endpoints using the documented bounded JSON-RPC subset.
12
+
13
+ Only the most recent published `0.5.x` patch receives routine fixes. Live provider evidence is account-, model-, endpoint-, and date-dependent; see [docs/LIVE_CERTIFICATION.md](./docs/LIVE_CERTIFICATION.md).
14
+
15
+ ## Support channels
16
+
17
+ Use [GitHub Issues](https://github.com/Zhivex/zhivex-harness/issues) for reproducible bugs and feature requests. For vulnerabilities, follow [SECURITY.md](./SECURITY.md) and do not post exploit details publicly.
18
+
19
+ ## Explicit limits
20
+
21
+ The harness does not promise arbitrary shell access, `stdio` MCP, permanent deletion, Windows support, a managed sandbox, a desktop UI, or exact feature parity between upstream providers. Tools run with the permissions of the local harness process unless an application supplies a stronger execution environment.