@zhivex-ai/harness 1.2.0 → 1.3.0-rc.7
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 +64 -0
- package/README.md +9 -10
- package/contracts/engine-api.json +2921 -0
- package/contracts/public-api.json +267 -1
- package/contracts/stable-api-signatures.json +43 -43
- package/dist/acp-cli.js +137 -15002
- package/dist/approvals/approval-history.d.ts +22 -0
- package/dist/approvals/explicit-review.d.ts +24 -0
- package/dist/approvals/host-policy-identity.d.ts +3 -0
- package/dist/cli/arguments.d.ts +6 -2
- package/dist/cli/checkpoints.d.ts +230 -0
- package/dist/cli/cli-options.d.ts +2 -41
- package/dist/cli/cli-profiles.d.ts +4 -2
- package/dist/cli/cli-stream.d.ts +2 -167
- package/dist/cli/governance-report.d.ts +5 -0
- package/dist/cli/policy-decisions.d.ts +9 -0
- package/dist/cli/policy.d.ts +5 -0
- package/dist/cli/presentation.d.ts +3 -1
- package/dist/cli/run-document.d.ts +2 -91
- package/dist/cli/terminal/terminal-continuation.d.ts +2 -3
- package/dist/cli/terminal/terminal-ui.d.ts +4 -0
- package/dist/{cli-entry-c2f58zj2.js → cli-entry-ae7x44d4.js} +14969 -10731
- package/dist/{cli-entry-427869g9.js → cli-entry-d5788aay.js} +388 -47
- package/dist/cli-entry-ev76ezcd.js +656 -0
- package/dist/{cli-3jmy4h5h.js → cli-t7hrhayq.js} +918 -2223
- package/dist/cli.js +3 -5
- package/dist/client/acp-mcp-admission.d.ts +32 -0
- package/dist/client/acp-mcp-host.d.ts +19 -0
- package/dist/client/acp-mcp-session.d.ts +14 -0
- package/dist/client/acp-stdio.d.ts +2 -0
- package/dist/client/acp.d.ts +4 -1
- package/dist/client/adapter.d.ts +13 -1
- package/dist/client/continuation.d.ts +3 -0
- package/dist/client/json-contracts.d.ts +107 -4
- package/dist/client/local-service.d.ts +2 -0
- package/dist/client/protocol.d.ts +127 -1
- package/dist/client/run-document.d.ts +91 -0
- package/dist/client/service-events.d.ts +4 -0
- package/dist/client/stream.d.ts +167 -0
- package/dist/compat/cli-options.d.ts +53 -0
- package/dist/compat/code-support.d.ts +22 -0
- package/dist/compat/code-support.js +74 -0
- package/dist/{config-1k9t4jhh.js → config-c002f06f.js} +1 -1
- package/dist/config-j3jga5wh.js +61 -0
- package/dist/context/adaptive-compaction.d.ts +1 -0
- package/dist/context/compaction.d.ts +1 -1
- package/dist/context/request-measurements.d.ts +17 -0
- package/dist/context/request-projection.d.ts +10 -0
- package/dist/context/task-memory.d.ts +1 -0
- package/dist/engine/acp.d.ts +6 -0
- package/dist/engine/acp.js +205 -0
- package/dist/engine/client.d.ts +6 -0
- package/dist/engine/client.js +28 -0
- package/dist/engine/desktop-providers-v1.d.ts +4 -0
- package/dist/engine/desktop-providers-v1.js +18 -0
- package/dist/engine/desktop-state-v1.d.ts +10 -0
- package/dist/engine/desktop-state-v1.js +168 -0
- package/dist/engine/index.d.ts +73 -0
- package/dist/engine/index.js +977 -0
- package/dist/engine/mcp-stdio-v1.d.ts +11 -0
- package/dist/engine/mcp-stdio-v1.js +108 -0
- package/dist/engine/models.d.ts +3 -0
- package/dist/engine/models.js +894 -0
- package/dist/engine/protocol.d.ts +7 -0
- package/dist/engine/protocol.js +182 -0
- package/dist/engine/service.d.ts +5 -0
- package/dist/engine/service.js +28 -0
- package/dist/execution/acceptance-snapshot.d.ts +2 -0
- package/dist/execution/execution-environment.d.ts +10 -0
- package/dist/execution/mcp-oci-channel.d.ts +11 -0
- package/dist/execution/mcp-oci-server.d.ts +38 -0
- package/dist/execution/mcp-oci-workspace.d.ts +23 -0
- package/dist/execution/mcp-resource-recovery.d.ts +19 -0
- package/dist/execution/mcp-workspace-snapshot.d.ts +20 -0
- package/dist/hostile-repository-demo.js +3368 -1304
- package/dist/index-1bx83sw4.js +4 -0
- package/dist/index-2gz7jv7g.js +549 -0
- package/dist/{cli-entry-b1mfvmxe.js → index-2jrdcj6b.js} +72 -115
- package/dist/index-3ah1f369.js +356 -0
- package/dist/index-42gp2hy8.js +1555 -0
- package/dist/index-4jw3tvy8.js +301 -0
- package/dist/index-8705zxpr.js +145 -0
- package/dist/index-8vm2m34s.js +2080 -0
- package/dist/index-8zzhggxv.js +477 -0
- package/dist/index-a97bezbz.js +1073 -0
- package/dist/index-gq9xagx2.js +1343 -0
- package/dist/index-h0mqx2ed.js +1373 -0
- package/dist/index-jgrx804e.js +5589 -0
- package/dist/index-qfpz5y2v.js +174 -0
- package/dist/index-t60rva31.js +1004 -0
- package/dist/index-wg1sd3at.js +80 -0
- package/dist/index-xqxeypt5.js +888 -0
- package/dist/index-yb239ghk.js +961 -0
- package/dist/index-z0qxmkm2.js +3389 -0
- package/dist/index-z4e8d0ph.js +1768 -0
- package/dist/index.js +251 -18649
- package/dist/integrations/mcp-host-session.d.ts +26 -0
- package/dist/integrations/mcp-stdio-admission.d.ts +54 -0
- package/dist/integrations/mcp-stdio-client.d.ts +44 -0
- package/dist/integrations/mcp-stdio-framing.d.ts +18 -0
- package/dist/integrations/mcp-stdio-launch.d.ts +20 -0
- package/dist/integrations/mcp-stdio-session.d.ts +7 -0
- package/dist/integrations/mcp-stdio-tools.d.ts +12 -0
- package/dist/internal/desktop/catalog.d.ts +2 -0
- package/dist/internal/desktop/persistence.d.ts +2 -3
- package/dist/internal/desktop/providers.d.ts +1 -0
- package/dist/models/catalog.d.ts +2 -0
- package/dist/persistence/governance-context.d.ts +126 -0
- package/dist/persistence/governance-report.d.ts +299 -0
- package/dist/persistence/host-database-backup.d.ts +28 -0
- package/dist/persistence/mcp-execution-journal.d.ts +19 -0
- package/dist/persistence/mcp-reconciliation.d.ts +33 -0
- package/dist/persistence/mcp-resource-journal.d.ts +54 -0
- package/dist/persistence/workspace-checkpoints.d.ts +138 -0
- package/dist/providers/anthropic-continuation.d.ts +5 -0
- package/dist/providers/providers.d.ts +1 -1
- package/dist/providers/vertex-auth.d.ts +27 -0
- package/dist/runtime/delegation-contracts.d.ts +9 -0
- package/dist/runtime/delegation-correction.d.ts +9 -0
- package/dist/runtime/delegation-result.d.ts +73 -0
- package/dist/runtime/error-diagnostics.d.ts +86 -0
- package/dist/runtime/harness.d.ts +11 -1
- package/dist/runtime/policy-decisions.d.ts +66 -0
- package/dist/runtime/policy-inspection.d.ts +52 -0
- package/dist/runtime/provider-diagnostics.d.ts +1 -0
- package/dist/runtime/runtime-instructions.d.ts +8 -0
- package/dist/runtime/task-acceptance-checks.d.ts +103 -0
- package/dist/runtime/task-acceptance-delivery.d.ts +107 -0
- package/dist/runtime/task-acceptance-host.d.ts +20 -0
- package/dist/runtime/task-acceptance-record.d.ts +107 -0
- package/dist/runtime/task-acceptance-validation.d.ts +25 -0
- package/dist/runtime/task-acceptance.d.ts +47 -0
- package/dist/runtime/time-to-safe-fix.d.ts +83 -0
- package/dist/runtime/tool-policy-file.d.ts +23 -0
- package/dist/runtime/tool-policy-paths.d.ts +5 -0
- package/dist/runtime/tool-policy.d.ts +6 -0
- package/dist/service-cli.js +19 -14504
- package/dist/{service-client-cli-yx56n0hc.js → service-client-cli-kns4mf57.js} +307 -248
- package/dist/verify-historical-migrations.js +3314 -1251
- package/dist/workspace/path-policy.d.ts +4 -0
- package/dist/zhx.js +3 -5
- package/docs/ACP.md +14 -2
- package/docs/ANTHROPIC.md +33 -0
- package/docs/CLI.md +132 -0
- package/docs/CLIENT_PROTOCOL.md +45 -0
- package/docs/CODE_RELEASE.md +93 -0
- package/docs/ENGINE_API.md +319 -0
- package/docs/EXTENSIBILITY.md +46 -3
- package/docs/FIRST_USE.md +6 -6
- package/docs/LOCAL_SERVICE.md +13 -0
- package/docs/MCP_STDIO.md +20 -0
- package/docs/README.md +6 -0
- package/docs/STABILITY.md +9 -1
- package/docs/SUPPORT_MATRIX.md +1 -1
- package/docs/TOOL_POLICY.md +81 -0
- package/docs/VERTEX.md +50 -0
- package/docs/adr/0002-isolated-mcp-stdio.md +135 -0
- package/docs/fixtures/mcp-stdio-contract-v1.json +189 -0
- package/docs/support-matrix.json +2 -0
- package/evaluations/representative-assembly-matrix.json +64 -1
- package/evaluations/task-acceptance-routes.json +7 -0
- package/examples/README.md +1 -1
- package/package.json +74 -12
- package/dist/cli-entry-64pdp3k5.js +0 -17
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
# Engine API and Code integration
|
|
2
|
+
|
|
3
|
+
This checkout adds terminal-independent package entrypoints for
|
|
4
|
+
Harness 1.3.0-rc.7. They are not present in the previously published Harness 1.2.0.
|
|
5
|
+
Publication is pending the protected workflow; use the documented
|
|
6
|
+
local candidate smoke to validate these bytes. Do not install registry 1.2.0 and
|
|
7
|
+
expect the new entrypoints to exist.
|
|
8
|
+
|
|
9
|
+
## Entry points
|
|
10
|
+
|
|
11
|
+
| Import | Use | Runtime |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| `@zhivex-ai/harness/engine` | Configuration, execution, policies, approvals, tools, stores, providers and historical non-terminal library APIs | Node |
|
|
14
|
+
| `@zhivex-ai/harness/protocol` | Wire request schemas, client types and JSON/event serialization | Browser or Node |
|
|
15
|
+
| `@zhivex-ai/harness/client` | In-process client adapter, result projection and durable continuation helpers | Node |
|
|
16
|
+
| `@zhivex-ai/harness/service` | Authenticated local service, recovery and activity events | Node |
|
|
17
|
+
| `@zhivex-ai/harness/acp` | Experimental text-session ACP adapter and stream transport | Node |
|
|
18
|
+
| `@zhivex-ai/harness/code-support` | Named host helpers used by Code, including a read-only SQLite diagnostic projection | Node |
|
|
19
|
+
| `@zhivex-ai/harness/models` | Beta catalog schemas, bundled metadata, model selection and display helpers; no host loading | Browser or Node |
|
|
20
|
+
| `@zhivex-ai/harness/mcp/stdio/v1` | Experimental host admission, isolated MCP sessions, recovery and reconciliation; see [host flow](MCP_STDIO.md) | Node or Bun |
|
|
21
|
+
| `@zhivex-ai/harness/desktop/v1/state` | Versioned host-only snapshot, validation, safe-file-read and lease handoff operations for Desktop updates | Node |
|
|
22
|
+
|
|
23
|
+
[`contracts/engine-api.json`](../contracts/engine-api.json) enumerates every named
|
|
24
|
+
export and its stability tier. Existing aliases keep their root tier. New helpers
|
|
25
|
+
have their explicitly recorded tier; importing through a new subpath does not
|
|
26
|
+
upgrade an experimental API. The historical root export and its stable signature
|
|
27
|
+
baseline remain supported. Host-loading JSON document schemas are available from
|
|
28
|
+
`/engine`, not the browser protocol entrypoint.
|
|
29
|
+
|
|
30
|
+
Imports do not open a terminal, start a service, create a Harness instance or
|
|
31
|
+
prompt for credentials. Hosts explicitly construct and close the runtime, supply
|
|
32
|
+
credentials/model instances, resolve approvals and choose their storage policy.
|
|
33
|
+
Importing the engine does not itself execute a task or grant permissions.
|
|
34
|
+
|
|
35
|
+
The `/models` subpath is an **unpublished addition after RC3**, introduced for
|
|
36
|
+
HAR-HU-39. It is present in local candidate tarballs from this checkout, not the
|
|
37
|
+
previously deployed RC3 bytes. Its six runtime exports and two types are listed
|
|
38
|
+
in `contracts/engine-api.json`. It performs no file access, credential resolution,
|
|
39
|
+
provider requests or process startup. Remote catalog loading remains host-owned.
|
|
40
|
+
Installed-package smoke compiles the public subpath for a browser and checks its
|
|
41
|
+
exports and type declarations in a clean consumer. Desktop migration and packaged
|
|
42
|
+
app acceptance are recorded separately in the repository-only report `docs/reports/HAR_HU_39_2026-09-29.md`.
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
import { createHarness } from "@zhivex-ai/harness/engine";
|
|
46
|
+
import { createHarnessClientAdapter } from "@zhivex-ai/harness/client";
|
|
47
|
+
|
|
48
|
+
const harness = await createHarness({
|
|
49
|
+
workspace: "/absolute/path/to/project",
|
|
50
|
+
provider: "openai",
|
|
51
|
+
model: "your-supported-model"
|
|
52
|
+
});
|
|
53
|
+
const client = await createHarnessClientAdapter(harness);
|
|
54
|
+
try {
|
|
55
|
+
// Dispatch requests using the documented client protocol and explicit approvals.
|
|
56
|
+
// Keep the host alive for the work it starts; close only when it is finished.
|
|
57
|
+
} finally {
|
|
58
|
+
client.close();
|
|
59
|
+
await harness.close();
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
See [the client protocol](CLIENT_PROTOCOL.md), [local service](LOCAL_SERVICE.md)
|
|
64
|
+
and [durable operations](DURABLE_OPERATIONS.md) for execution, approval and recovery
|
|
65
|
+
semantics. Persistence and approval fingerprints are shared across clients;
|
|
66
|
+
switching presentation does not migrate state or authorize new effects.
|
|
67
|
+
|
|
68
|
+
## Terminal product
|
|
69
|
+
|
|
70
|
+
`packages/code` is the independently built terminal product. Its current version
|
|
71
|
+
is `0.1.0-rc.2`, prepared for independent publication to `next` with the exact
|
|
72
|
+
engine dependency `@zhivex-ai/harness@1.3.0-rc.7`. Publication remains gated by
|
|
73
|
+
reviewed main, CI and registry evidence in the [Code release procedure](CODE_RELEASE.md).
|
|
74
|
+
Code imports declared package APIs, never Harness source paths. Its build leaves
|
|
75
|
+
Harness external.
|
|
76
|
+
|
|
77
|
+
Code owns `zhivex-code`. Harness 1.x continues to own `zhx`, `zhivex-harness` and
|
|
78
|
+
`zhx-acp`, preserving commands, flags, exit codes, JSON contracts and state paths.
|
|
79
|
+
The Code version/help identify the terminal product; engine diagnostics continue
|
|
80
|
+
to identify Harness. The historical CLI stays a Harness compatibility snapshot,
|
|
81
|
+
without a Harness dependency on Code. Desktop now consumes installed engine,
|
|
82
|
+
protocol, service, models and versioned host contracts; it does not import the
|
|
83
|
+
old internal source bridges.
|
|
84
|
+
|
|
85
|
+
Node >=22.13.0 is the runtime requirement. Bun builds and tests the source but is
|
|
86
|
+
not required to install or run the JavaScript tarballs. Consumer projects retain
|
|
87
|
+
their own package manager and lockfile.
|
|
88
|
+
|
|
89
|
+
## Contributor validation
|
|
90
|
+
|
|
91
|
+
The local candidate also adds `/desktop/v1/state`, an explicitly versioned
|
|
92
|
+
integration contract for trusted Desktop main/worker processes. New names are
|
|
93
|
+
experimental; aliases of historical names retain their existing tiers. Exact
|
|
94
|
+
exports are recorded in `contracts/engine-api.json`. This is not a general SQL
|
|
95
|
+
interface: `SqliteDatabase`, arbitrary queries and migrations are not exported.
|
|
96
|
+
|
|
97
|
+
`createHostDatabaseSnapshot`, `verifyHostDatabaseSnapshot` and
|
|
98
|
+
`verifyHostDatabaseState` own whole-database checks, WAL snapshots and receipt
|
|
99
|
+
validation. Desktop remains responsible for closing admission, stopping workers,
|
|
100
|
+
coordinating multiple projects, and verifying the application before restoration.
|
|
101
|
+
Snapshot callers supply host-controlled paths. Existing `DESKTOP_*` error codes
|
|
102
|
+
are preserved. The 128 MiB limit, private permissions, no-follow reads, all-scope
|
|
103
|
+
idle checks and logical backup validation are unchanged.
|
|
104
|
+
|
|
105
|
+
The additional file-read/path validators serve updater artifact verification and
|
|
106
|
+
do not authorize writes. `SqliteAccessLease` and its acquire/adopt/descriptor
|
|
107
|
+
operations retain the macOS cooperative lock protocol. Inherited lease adoption
|
|
108
|
+
requires the trusted native handoff helper; it is never a renderer IPC operation.
|
|
109
|
+
Different copies of the package must not exchange lease objects. Installed smoke
|
|
110
|
+
verifies that engine and state entrypoints in one installation share ownership.
|
|
111
|
+
Compatibility with older clients that do not participate in this locking
|
|
112
|
+
protocol is not implied.
|
|
113
|
+
|
|
114
|
+
The new subpaths are unpublished local additions after the deployed RC3.
|
|
115
|
+
Desktop migration and packaged acceptance are documented in
|
|
116
|
+
the repository-only report `docs/reports/HAR_HU_39_2026-09-29.md`. Its dependency is pinned to the
|
|
117
|
+
candidate version and checked for required contracts/artifact identity; this does
|
|
118
|
+
not claim compatibility with the earlier published RC3 bytes or a broader range.
|
|
119
|
+
|
|
120
|
+
```sh
|
|
121
|
+
bun run dev:code
|
|
122
|
+
bun run typecheck:code
|
|
123
|
+
bun run test:code
|
|
124
|
+
bun run architecture:check
|
|
125
|
+
bun run contract:check
|
|
126
|
+
bun run smoke:engine-code
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
The smoke packs the current Harness candidate without changing its version. The
|
|
130
|
+
release workflow supplies the exact tarball via `HARNESS_CODE_HARNESS_ARTIFACT`;
|
|
131
|
+
its bytes are copied, never repacked. The report identifies hashes, installed
|
|
132
|
+
versions and observed results. Node execution uses a restricted PATH excluding
|
|
133
|
+
Bun. Local fixtures exercise approval, persistence and restart, Code execution
|
|
134
|
+
and cancellation without live keys. Each manager has independent Harness-first
|
|
135
|
+
and Code-first consumers. Every installation step exercises the manager-created
|
|
136
|
+
launchers; final checks reject overlapping binary ownership, a reverse Code
|
|
137
|
+
dependency and unresolved local/workspace dependency references. Tarball overrides
|
|
138
|
+
use consistent relative paths to preserve Yarn Classic launchers across installs.
|
|
139
|
+
This is deterministic installed evidence,
|
|
140
|
+
not provider certification or a registry release. Historical HU37/38 reports
|
|
141
|
+
used temporary 1.3.0-dev.0 metadata; those reports do not certify RC1.
|
|
142
|
+
|
|
143
|
+
`dev:code` explicitly links the built local Harness for contributor tests; it
|
|
144
|
+
preserves an existing dependency and is never run by package installation.
|
|
145
|
+
Installed acceptance uses tarballs instead of that link. The CI workflow defines
|
|
146
|
+
the same four-manager check on Node 22.13.0 and Node 24; a workflow definition is
|
|
147
|
+
not evidence that remote CI has run.
|
|
148
|
+
|
|
149
|
+
For a historical version boundary, run
|
|
150
|
+
`bun run smoke:state-upgrade /absolute/old-harness.tgz /absolute/candidate-harness.tgz incompatible`.
|
|
151
|
+
This installs both supplied artifacts in separate consumers and creates a pending
|
|
152
|
+
approval with the historical root API. The candidate must explain its incompatible
|
|
153
|
+
Harness identity without model calls, file effects or changes to the pending run.
|
|
154
|
+
The historical runtime must then complete that run with explicit approval. Artifact
|
|
155
|
+
hashes and observed versions are retained in the report. This test does not rewrite
|
|
156
|
+
fingerprints, certify an automatic migration or verify registry provenance.
|
|
157
|
+
Use `compatible` instead to require an unchanged binding and candidate completion
|
|
158
|
+
after explicit approval. Both modes preserve historical session metadata across
|
|
159
|
+
candidate and historical reopen. Distinct tarball bytes are required, and the
|
|
160
|
+
caller chooses the expected outcome before execution; a rejected compatible case
|
|
161
|
+
is a failure, not silently reclassified as success.
|
|
162
|
+
Set `HARNESS_COMPAT_RUNTIME=/absolute/path/to/node` to select the runtime for
|
|
163
|
+
both installed consumers; set it to `bun` to verify Bun runtime separately from
|
|
164
|
+
Bun package installation. Reports record the selected executable and observed
|
|
165
|
+
runtime version. The installer remains Bun regardless of the selected runtime.
|
|
166
|
+
|
|
167
|
+
`bun run smoke:global-code /absolute/harness.tgz /absolute/code.tgz` tests both
|
|
168
|
+
global installation orders with Bun in separate temporary global and binary
|
|
169
|
+
directories. It checks the manager-created launchers after each install, exact
|
|
170
|
+
resolved engine bytes, and deterministic CLI execution with Node and no Bun in
|
|
171
|
+
runtime PATH. These prefixed installs do not modify the operator's global tools.
|
|
172
|
+
Global locations use Bun's documented `BUN_INSTALL_GLOBAL_DIR` and
|
|
173
|
+
`BUN_INSTALL_BIN` controls (see [Bun configuration](https://bun.com/docs/runtime/bunfig)).
|
|
174
|
+
The default mode certifies Bun global installation; local manager coverage remains a
|
|
175
|
+
separate matrix and neither test establishes registry publication or provenance.
|
|
176
|
+
An optional third argument supplies a historical Harness tarball. Each temporary
|
|
177
|
+
prefix first installs it and verifies legacy help/version, then tests both orders
|
|
178
|
+
of candidate Harness and Code installation. Legacy launchers are checked after
|
|
179
|
+
every step, including when Code is installed before upgrading Harness. The
|
|
180
|
+
candidate override is explicit; this is local artifact acceptance, not evidence
|
|
181
|
+
of registry dependency resolution or a historical Code release.
|
|
182
|
+
`HARNESS_GLOBAL_MANAGER=npm` selects isolated npm global prefixes. This mode
|
|
183
|
+
retains the exact-engine assertion and records failures per order. npm global
|
|
184
|
+
may resolve Code's pinned Harness from the registry instead of reusing a locally
|
|
185
|
+
installed tarball with the same version; such a result does not certify the local
|
|
186
|
+
candidate. Reports retain both orders and exit nonzero if either fails.
|
|
187
|
+
Set `HARNESS_GLOBAL_REGISTRY_FIXTURE=1` for npm candidate acceptance: a read-only
|
|
188
|
+
loopback registry child serves the supplied Harness tarball unchanged, including
|
|
189
|
+
its SHA-512 integrity, and redirects other package requests to the public registry.
|
|
190
|
+
The child closes after the smoke. Reports label this `loopback-exact-candidate`,
|
|
191
|
+
distinct from default registry resolution; passing it does not erase a failed
|
|
192
|
+
default-registry attempt or certify publication/provenance.
|
|
193
|
+
Global acceptance also supports `HARNESS_GLOBAL_MANAGER=pnpm` (11.x) and `yarn`
|
|
194
|
+
(Classic 1.x), with `SMOKE_PNPM_PATH`/`SMOKE_YARN_PATH` selecting the executables.
|
|
195
|
+
Both use isolated package/bin directories and explicit temporary registry config.
|
|
196
|
+
pnpm's separate global installation roots are inspected individually. Shell
|
|
197
|
+
utilities needed by generated launchers remain available; Bun is absent from the
|
|
198
|
+
runtime PATH. These modes should use the exact-candidate registry fixture.
|
|
199
|
+
|
|
200
|
+
The architecture gate follows transitive imports, re-exports and type references
|
|
201
|
+
from the engine surfaces, rejecting CLI/Desktop/Code dependencies and computed
|
|
202
|
+
module loads. Code has separate checks for public-package imports and manifest/bin
|
|
203
|
+
ownership. Stable root declaration signatures are checked without regenerating
|
|
204
|
+
the baseline to accommodate this extraction.
|
|
205
|
+
|
|
206
|
+
Publishing Code requires a compatible Harness release, authenticated scope/name
|
|
207
|
+
verification and the release compatibility gates in
|
|
208
|
+
[ADR 0001](https://github.com/Zhivex/zhivex-harness/blob/main/docs/adr/0001-harness-code-public-boundary.md).
|
|
209
|
+
Local packing does not establish npm permissions or public availability.
|
|
210
|
+
## Experimental task acceptance contracts
|
|
211
|
+
|
|
212
|
+
`runHarness(host, input, { taskAcceptance })` accepts application-owned requirements
|
|
213
|
+
for a new run. The strict `taskAcceptanceContractSchema` is exported from `/engine`.
|
|
214
|
+
It binds exact file paths, required check argv/backend/approval policy, and human
|
|
215
|
+
review requirements that remain `pending`. It does not introduce arbitrary shell
|
|
216
|
+
scripts or grant tool permissions. `compileTaskAcceptanceContract` provides the
|
|
217
|
+
canonical digest; compilation alone does not validate the workspace or authorize
|
|
218
|
+
execution. Runtime admission additionally validates the real workspace and host.
|
|
219
|
+
|
|
220
|
+
```ts
|
|
221
|
+
import {
|
|
222
|
+
taskAcceptanceContractSchema, runHarness,
|
|
223
|
+
inspectHarnessTaskAcceptance, reviseHarnessTaskAcceptance
|
|
224
|
+
} from '@zhivex-ai/harness/engine';
|
|
225
|
+
|
|
226
|
+
const contract = taskAcceptanceContractSchema.parse({
|
|
227
|
+
schemaVersion: 1,
|
|
228
|
+
taskId: 'repair-parser',
|
|
229
|
+
allowedWritePaths: ['src/parser.ts', 'tests/parser.test.ts'],
|
|
230
|
+
protectedFiles: ['package.json'],
|
|
231
|
+
requiredChecks: [{
|
|
232
|
+
id: 'test', kind: 'package-script', script: 'test', expectedScript: 'bun test',
|
|
233
|
+
command: 'bun', args: ['--no-env-file', 'run', 'test'], purpose: 'Parser regression',
|
|
234
|
+
execution: { backend: 'none', approval: 'required' }
|
|
235
|
+
}],
|
|
236
|
+
humanReview: [{ id: 'readability', requirement: 'Review readability', status: 'pending' }]
|
|
237
|
+
});
|
|
238
|
+
const result = await runHarness(host, { prompt: 'Repair the parser' }, { taskAcceptance: contract });
|
|
239
|
+
const ledger = await inspectHarnessTaskAcceptance(host, result.state.runId);
|
|
240
|
+
// After an operator approves changed requirements, while the run is stopped:
|
|
241
|
+
const state = await host.store.load(result.state.runId, host.config.scope);
|
|
242
|
+
await reviseHarnessTaskAcceptance(host, {
|
|
243
|
+
runId: result.state.runId,
|
|
244
|
+
expectedRunRevision: state!.revision!,
|
|
245
|
+
expectedContractRevision: ledger!.revisions.at(-1)!.revision,
|
|
246
|
+
contract: { ...contract, humanReview: [{ id: 'readability', requirement: 'Review revised behavior', status: 'pending' }] }
|
|
247
|
+
});
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
The package example requires a Bun-declared manifest with the exact `test` script,
|
|
251
|
+
an allowlisted `test` check, and a `run_check` tool. OCI argv checks use
|
|
252
|
+
`kind: 'argv'` and `execution: { backend: 'oci', approval: 'required', network: 'none' }`;
|
|
253
|
+
their executable must be in the host allowlist. File paths are exact, not globs.
|
|
254
|
+
Contracts are limited to 64 KiB and 32 checks. Revision history is bounded to
|
|
255
|
+
16 revisions/1 MiB; capacity errors never silently discard prior requirements.
|
|
256
|
+
|
|
257
|
+
Inspection reads the host's durable store. Revision uses both run and contract
|
|
258
|
+
revisions for compare-and-swap, rejects active runs, and invalidates acceptance
|
|
259
|
+
evidence. Reload the state before resuming after a revision. Contract metadata
|
|
260
|
+
cannot be supplied through run input; the optional third argument is the trusted
|
|
261
|
+
application boundary. Runs with contracts use the host's configured scope.
|
|
262
|
+
Resumes use the stored contract, and `read_task` exposes its current revision even
|
|
263
|
+
after compaction. Existing runs without a contract keep their previous behavior.
|
|
264
|
+
|
|
265
|
+
For OCI execution, imports enforce the exact allowed paths and protected files,
|
|
266
|
+
then require every declared check to succeed against the same contract revision,
|
|
267
|
+
run, environment, patch and complete snapshot bytes. Altering a package script
|
|
268
|
+
or changing the snapshot invalidates verification. Recovery reconciles check
|
|
269
|
+
receipts against the durable tool journal; ambiguous or interrupted effects are
|
|
270
|
+
not replayed automatically.
|
|
271
|
+
|
|
272
|
+
The host-owned `zhivexTaskAcceptanceEvidenceV1` metadata adds acceptance outcomes
|
|
273
|
+
without changing SDK run statuses or `ChangeEnvelope` v1. Active work is `pending`;
|
|
274
|
+
terminal work without sufficient delivery evidence is `incomplete`; failed runs
|
|
275
|
+
or scope violations are `failed`. A completed run with a normal stop becomes
|
|
276
|
+
`verified` only after a confirmed import and a final inspection of delivered host
|
|
277
|
+
files and snapshot bytes. Required human review produces `pending_review` instead.
|
|
278
|
+
Model prose cannot supply this evidence. The `none` backend does not receive OCI
|
|
279
|
+
acceptance guarantees. Recovered import metadata is diagnostic evidence only until
|
|
280
|
+
its delivery can be confirmed; it cannot alone restore a verified outcome.
|
|
281
|
+
|
|
282
|
+
### Portable governance projection (Experimental)
|
|
283
|
+
|
|
284
|
+
`exportHarnessGovernanceReport(store, scope, runId, options?)` reads durable runs
|
|
285
|
+
and journals into `HarnessGovernanceReport`. Validate portable JSON with
|
|
286
|
+
`harnessGovernanceReportSchema`; `renderHarnessGovernanceMarkdown(report)` renders
|
|
287
|
+
its bounded summary. `options.changeEnvelopes` accepts up to 32 existing v1
|
|
288
|
+
objects; `options.now` fixes the verification timestamp for reproducible exports.
|
|
289
|
+
Neither patch bytes nor producer authenticity are certified by an envelope digest.
|
|
290
|
+
|
|
291
|
+
Optional `options.session` is `{ id, index, history? }`: `index.get` and
|
|
292
|
+
`history.replay` must already be bound to the same workspace/scope as the run
|
|
293
|
+
store. The root must belong to the selected session. No current application policy
|
|
294
|
+
is substituted for missing historical evidence. Recorded child acceptance remains
|
|
295
|
+
separate from semantic review; exporting does not rerun child validation or tools.
|
|
296
|
+
See the CLI portable report documentation for redaction, retention and limits.
|
|
297
|
+
|
|
298
|
+
## Request context and measurements
|
|
299
|
+
|
|
300
|
+
The default engine advertises a smaller common tool catalog. `discover_tools`
|
|
301
|
+
loads additional authorized schemas on demand; it does not change executors,
|
|
302
|
+
permissions, approval requirements or execution boundaries. Applications that
|
|
303
|
+
supply `toolNames` without `discover_tools` retain a fully advertised explicit
|
|
304
|
+
catalog. An explicit `toolChoice` keeps that authorized tool advertised.
|
|
305
|
+
|
|
306
|
+
Large successful check, search, dependency and diff results can appear as bounded
|
|
307
|
+
excerpts with a `resultId`. `read_tool_result` retrieves 4,000-character slices of
|
|
308
|
+
the original evidence from the current durable run. Originals remain unchanged;
|
|
309
|
+
unknown references and references from another run are rejected. If no durable
|
|
310
|
+
source exists, the engine sends the original result instead of an unreadable
|
|
311
|
+
reference. A partial excerpt is not proof that an omitted error or match does
|
|
312
|
+
not exist. Mutation receipts and tool failures remain intact.
|
|
313
|
+
|
|
314
|
+
The optional `runHarness(..., { onDiagnostics })` callback includes
|
|
315
|
+
`requestMeasurements`: numeric context sizes, estimated input tokens, reported
|
|
316
|
+
input/output/cache tokens and terminal completion for the current invocation.
|
|
317
|
+
It retains at most 128 requests plus an omitted count and contains no prompt or
|
|
318
|
+
result text. Missing usage is null, including an interrupted paid request; these
|
|
319
|
+
measurements do not claim invoice accuracy or provider tokenizer equivalence.
|
package/docs/EXTENSIBILITY.md
CHANGED
|
@@ -8,7 +8,7 @@ Built-in registrations are Meta, Qwen, OpenAI, and Gemini. Each registration own
|
|
|
8
8
|
|
|
9
9
|
Library callers can use `DEFAULT_PROVIDER_REGISTRY`, `BUILTIN_PROVIDER_REGISTRATIONS`, `createProviderRegistry`, or `DEFAULT_PROVIDER_REGISTRY.extend(...)`, then pass the registry to `resolveHarnessConfig`, `createProviderModel`, provider diagnostics, or `createHarness({ providerRegistry })`. Registration IDs, environment-variable names, defaults, diagnostics, and factories are validated before they become selectable.
|
|
10
10
|
|
|
11
|
-
The coordinated stable SDK batch pins `@zhivex-ai/agents@1.10.
|
|
11
|
+
The coordinated stable SDK batch pins `@zhivex-ai/agents@1.10.2`, `@zhivex-ai/core@1.28.0`, `@zhivex-ai/meta@0.2.8`, `@zhivex-ai/qwen@0.16.3`, `@zhivex-ai/openai@0.13.7`, and `@zhivex-ai/gemini@0.13.0`. Qwen 0.16.2 types malformed Responses tool arguments and malformed SSE events; Core 1.28.0 satisfies its published dependency range. These exact versions are pinned in the lockfile. Stable SDK publication does not replace Harness release-bound certification. Qwen `0.11.x` normalizes missing, placeholder, and continuation tool-call identifiers inside the adapter; Harness retains its deterministic provider-boundary normalizer as defense in depth until the exact candidate passes the complete release-bound representative matrix. A Core override keeps one runtime contract identity across every adapter, while Core `1.13.0` corrects compaction usage accounting and interaction-group retention. OpenAI `0.11.2` preserves synthetic assistant history in Responses, so the harness no longer requires its compaction transport or accounting workarounds.
|
|
12
12
|
|
|
13
13
|
OpenAI is based on the GPT-5.6 family: `gpt-5.6-luna` is the default, with `gpt-5.6-terra` and `gpt-5.6-sol` available through `--model`. Availability remains organization-dependent while the upstream family is in limited preview, and the adapter uses the Responses API by default.
|
|
14
14
|
|
|
@@ -75,7 +75,7 @@ The schema is versioned independently:
|
|
|
75
75
|
|
|
76
76
|
Every server requires a non-empty tool or exact-resource allowlist and permission set. Tool discovery is paginated and bounded. Tool names are prefixed with `<server>_` unless an explicit safe prefix is supplied. Configuration contains environment-variable names rather than credential values; diagnostics and fingerprints never include resolved header values. Credential variables must use the dedicated `ZHIVEX_MCP_*` namespace, and HTTP authentication is limited to the canonical `authorization` and `x-api-key` headers so a workspace file cannot select unrelated process credentials or arbitrary outbound headers.
|
|
77
77
|
|
|
78
|
-
The legacy built-in transport supports HTTPS and loopback HTTP; the opt-in SDK transport requires HTTPS. Redirects, URL credentials, unsafe configurable headers, oversized configuration, symlinked configuration, and configuration outside the workspace are rejected. `stdio` is intentionally unavailable because spawning an MCP server is process execution;
|
|
78
|
+
The legacy built-in transport supports HTTPS and loopback HTTP; the opt-in SDK transport requires HTTPS. Redirects, URL credentials, unsafe configurable headers, oversized configuration, symlinked configuration, and configuration outside the workspace are rejected. `stdio` is intentionally unavailable because spawning an MCP server is process execution; the proposed admission and isolated-stream contract is documented in [ADR 0002](adr/0002-isolated-mcp-stdio.md). This design does not enable the transport.
|
|
79
79
|
|
|
80
80
|
Library callers can inject a custom `McpClient`. Trusted read-only annotations are accepted only for an explicitly injected custom transport whose sole declared permission is `read`. HTTP always declares `network` and therefore always pauses for operator approval, even when a server claims a tool is read-only.
|
|
81
81
|
|
|
@@ -175,9 +175,52 @@ child must perform a successful allowed read and return `requiredOutput`; the pa
|
|
|
175
175
|
without completed, accepted children for all configured contracts. The token
|
|
176
176
|
checks a protocol condition, not the semantic correctness of the review.
|
|
177
177
|
|
|
178
|
+
An opt-in experimental `resultContract` replaces marker acceptance with versioned
|
|
179
|
+
JSON evidence for reviewer/explorer contracts:
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
resultContract: {
|
|
183
|
+
schemaVersion: 1,
|
|
184
|
+
requiredReadPaths: ["target.txt"],
|
|
185
|
+
humanReviewRequired: true,
|
|
186
|
+
maxCorrections: 0
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Required paths must be a subset of `allowedReadPaths`. The result contains
|
|
191
|
+
`schemaVersion`, `taskId`, `status`, `inspectedFiles` and `findings`. Each inspected
|
|
192
|
+
file declares its digest and evidence entries with `toolCallId`, `startLine` and
|
|
193
|
+
`endLine`; findings reference those successful reads by path and call ID. Required
|
|
194
|
+
files need complete line coverage from receipts with the same digest. Clipped
|
|
195
|
+
lines, gaps, invented IDs, tool errors and invalid JSON cannot satisfy the
|
|
196
|
+
contract. Results are bounded to 64 KiB, 32 files and 32 findings.
|
|
197
|
+
|
|
198
|
+
The parent independently validates the durable child state and records
|
|
199
|
+
`zhivexDelegationAcceptanceV1` evaluations containing child status, contract
|
|
200
|
+
acceptance and semantic review status separately. An accepted schema and evidence
|
|
201
|
+
coverage never certify the semantic correctness of findings. This option adds no
|
|
202
|
+
write tools or arbitrary delegation authority.
|
|
203
|
+
|
|
204
|
+
`maxCorrections` allows zero to two feedback attempts for invalid structured
|
|
205
|
+
results. Each attempt remains in the same child run and consumes ordinary SDK
|
|
206
|
+
steps, tokens and an internal feedback tool call; existing limits can stop it
|
|
207
|
+
earlier. The model still sees only `read_file`. Invalid candidates remain in the
|
|
208
|
+
durable history as data, and exhausted attempts fail acceptance. No tool or path
|
|
209
|
+
permission is broadened for a correction.
|
|
210
|
+
|
|
211
|
+
Installed deterministic acceptance is available with
|
|
212
|
+
`bun run scripts/delegation-result-installed-smoke.ts <tarball> <node-path>`.
|
|
213
|
+
The shared HU44 cohort covers fabricated evidence, incomplete reads, tool errors,
|
|
214
|
+
invalid results, bounded correction, cancellation and durable reopen. It does not
|
|
215
|
+
certify a provider route. For the separate live orchestration gate, set
|
|
216
|
+
`ZHIVEX_HARNESS_LIVE_STRUCTURED_DELEGATION=1` alongside the normal live opt-in and
|
|
217
|
+
installed-artifact runtime settings. That mode checks structured acceptance and
|
|
218
|
+
pending semantic review before and after reopening; legacy marker certification
|
|
219
|
+
remains the default. Missing credentials or failed calls are not successful gates.
|
|
220
|
+
|
|
178
221
|
Contracts are copied at construction and bound into parent/child fingerprints;
|
|
179
222
|
resuming under a different contract is rejected. This mode retains SDK child
|
|
180
|
-
linkage, usage, cancellation and persistence.
|
|
223
|
+
linkage, usage, cancellation and persistence. Legacy marker contracts do not retry invalid proposals
|
|
181
224
|
or increase a budget automatically. Callers without contracts keep the existing
|
|
182
225
|
general-purpose delegation API, including approval-gated mutation profiles; the
|
|
183
226
|
contract guarantees do not apply to that legacy mode. CLI configuration does not
|
package/docs/FIRST_USE.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# First use
|
|
2
2
|
|
|
3
|
-
This guide targets the prepared `1.
|
|
3
|
+
This guide targets the prepared `1.3.0-rc.7` candidate. Installation commands become available after protected publication to npm `next`; stable users can keep npm `latest`.
|
|
4
4
|
|
|
5
5
|
## Install and start
|
|
6
6
|
|
|
7
7
|
Install Node.js 22.13.0 or newer and Git. Then:
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
|
-
npm install -g @zhivex-ai/harness@1.
|
|
10
|
+
npm install -g @zhivex-ai/harness@1.3.0-rc.7
|
|
11
11
|
cd /path/to/your/project
|
|
12
12
|
zhx
|
|
13
13
|
```
|
|
@@ -82,16 +82,16 @@ For command execution, configure [OCI isolation](EXECUTION_ENVIRONMENTS.md).
|
|
|
82
82
|
With Bun 1.4.0 or newer and a supported Node runtime:
|
|
83
83
|
|
|
84
84
|
```sh
|
|
85
|
-
bun add --global @zhivex-ai/harness@1.
|
|
85
|
+
bun add --global @zhivex-ai/harness@1.3.0-rc.7
|
|
86
86
|
zhx
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
For a disposable version/help/environment check without a global installation:
|
|
90
90
|
|
|
91
91
|
```sh
|
|
92
|
-
bunx @zhivex-ai/harness@1.
|
|
93
|
-
bunx @zhivex-ai/harness@1.
|
|
94
|
-
bunx @zhivex-ai/harness@1.
|
|
92
|
+
bunx @zhivex-ai/harness@1.3.0-rc.7 --version
|
|
93
|
+
bunx @zhivex-ai/harness@1.3.0-rc.7 --help
|
|
94
|
+
bunx @zhivex-ai/harness@1.3.0-rc.7 doctor
|
|
95
95
|
```
|
|
96
96
|
|
|
97
97
|
For source development, use the [contributor guide](https://github.com/Zhivex/zhivex-harness/blob/main/CONTRIBUTING.md).
|
package/docs/LOCAL_SERVICE.md
CHANGED
|
@@ -140,3 +140,16 @@ busy timeout for its ownership transaction. Contention fails immediately rather
|
|
|
140
140
|
than blocking the event loop while another recovery awaits filesystem I/O.
|
|
141
141
|
`OpenSessionStoreOptions.busyTimeoutMs` accepts 0–5000 ms and preserves the prior
|
|
142
142
|
5000 ms default for other callers. The additive signature snapshot is reviewed.
|
|
143
|
+
|
|
144
|
+
Policy-enabled hosts append sanitized `policy-decision` activity through the same
|
|
145
|
+
session event channel. These records describe policy evaluation before entering
|
|
146
|
+
the tool executor, including rule IDs, reason, approval/review requirements, digest
|
|
147
|
+
and backend. They are not execution receipts and cannot authorize an action.
|
|
148
|
+
Reasons are bounded and carry `reasonTruncated` when shortened. Replay pages expose
|
|
149
|
+
`hasMore`; `policyEvidenceIncomplete` remains true after retention removes evidence,
|
|
150
|
+
even after the client adopts the recovery cursor or the service reopens its store.
|
|
151
|
+
|
|
152
|
+
The decision `phase` distinguishes `approval-request` from `tool-entry`. A pending
|
|
153
|
+
approval emits the former before the tool executor is entered. Baseline decisions
|
|
154
|
+
without an additional policy are observable too; an allow evaluation does not
|
|
155
|
+
bypass the tool's own permission checks or certify successful execution.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Isolated MCP stdio for trusted hosts
|
|
2
|
+
|
|
3
|
+
`@zhivex-ai/harness/mcp/stdio/v1` is an **experimental**, Node/Bun host-only entry point. It requires a local Docker daemon and previously provisioned immutable images. It does not enable `stdio` in workspace MCP JSON or ACP configuration. Never construct host policy, authorization callbacks, secret resolvers or host identity from model output or repository instructions.
|
|
4
|
+
|
|
5
|
+
The host owns the flow:
|
|
6
|
+
|
|
7
|
+
1. Open the canonical workspace and SQLite persistence using the root `Workspace`, `resolveHarnessConfig` and `openHarnessPersistence` APIs. Choose a scoped run ID before launching.
|
|
8
|
+
2. Call `prepareMcpWorkspaceSnapshot(workspace, maxWorkspaceBytes)`. Review the snapshot digest, explicit tool allowlist, permissions, image digest, command, literal environment, secret references and limits in a `McpStdioLaunchProposal`. Host authority must constrain every resource limit.
|
|
9
|
+
3. Create `createMcpStdioAdmissionAuthority({ policyVersion, maximumLimits, authorize })`. Its authorization callback receives the reviewed proposal; require your explicit operator/policy decision. `admit(proposal)` returns a short-lived, one-use receipt bound to the exact proposal.
|
|
10
|
+
4. Call `launchIsolatedMcpSession` with authority, receipt, proposal, snapshot, authenticated scope, immutable provisioner image ID, host secret resolver and `journal: { store, runId, scope, hostId }`. It recovers prior dead-owner resources before launch and refuses unresolved live/foreign resources. `hostId` must be a stable identity owned by the host, not the repository.
|
|
11
|
+
5. Pass the returned `hostSession` as `isolatedMcpSession` to `createHarness`, with the same store, canonical workspace and scope. Call `runHarness` with the admitted run ID. Every MCP call requires interrupt approval, including tools claiming to be read-only. Closing the harness closes the isolated session.
|
|
12
|
+
6. To resume a persisted approval after closing the host, reopen SQLite, create and admit a new session with the same reviewed proposal/snapshot, recreate the harness, and resume the saved state. Proposal changes invalidate the old approval. Secret values are resolved afresh by the trusted host.
|
|
13
|
+
|
|
14
|
+
A host can use `recoverDockerMcpResources({ store, runId, scope, hostId })` on startup without starting a new server. Recovery only considers persisted names and matching scope/host/daemon/images/labels. It refuses live or inaccessible owner PIDs and confirms resource absence before recording closure. Docker administrative access remains a trusted boundary.
|
|
15
|
+
|
|
16
|
+
Timeout, cancellation or loss of an execution acknowledgement leaves an uncertain outcome and blocks further MCP calls in that run. After cleanup and external inspection, `createMcpReconciliationAuthority` lets the host authorize a decision bound to call ID, expected revision, confirmed effect/no-effect and evidence digest. The previous outcome remains in the audit record. The original call key never becomes replayable. A new call still needs a new session admission and tool approval. This API supplies policy hooks, not a human review interface.
|
|
17
|
+
|
|
18
|
+
The snapshot is private and size-bounded. It does not mount the host workspace; changes inside it do not automatically return to the host. No host fallback or outbound network is granted. JSON Schema regex/reference features outside the supported bounded subset fail discovery. The entry point deliberately omits raw launch clients, arbitrary Docker execution and host capability issuers.
|
|
19
|
+
|
|
20
|
+
See [the isolation decision](adr/0002-isolated-mcp-stdio.md) and [API stability](STABILITY.md). Local candidate verification is distinct from registry publication.
|
package/docs/README.md
CHANGED
|
@@ -8,6 +8,7 @@ Start with [First use](FIRST_USE.md). You only need `zhx` for everyday conversat
|
|
|
8
8
|
- [Worked example](FIRST_USE_EXAMPLE.md): a small change with approval and restart recovery.
|
|
9
9
|
- [Usage reference](USAGE.md): scripts, providers and security boundaries.
|
|
10
10
|
- [Model catalog administration](MODEL_CATALOG.md): shared CLI/Desktop recommendations and remote distribution.
|
|
11
|
+
- [Anthropic direct API](ANTHROPIC.md): provisional setup and continuity contract.
|
|
11
12
|
- [Credentials](CREDENTIALS.md): system keychain, temporary keys and automation.
|
|
12
13
|
- [Project instructions and context](CONTEXT_ENGINEERING.md).
|
|
13
14
|
- [Execution environments](EXECUTION_ENVIRONMENTS.md): isolated command execution.
|
|
@@ -16,6 +17,9 @@ Start with [First use](FIRST_USE.md). You only need `zhx` for everyday conversat
|
|
|
16
17
|
|
|
17
18
|
## Integrate Harness
|
|
18
19
|
|
|
20
|
+
- [Engine API and Code integration](ENGINE_API.md): terminal-independent imports and local candidate validation.
|
|
21
|
+
- [Code release procedure](CODE_RELEASE.md): independent RC publication, exact artifact, bootstrap provenance and Trusted Publishing.
|
|
22
|
+
|
|
19
23
|
- [CLI reference](CLI.md): command options, JSON/JSONL and exit codes.
|
|
20
24
|
- [Extensibility](EXTENSIBILITY.md): providers, MCP, routing and subagents.
|
|
21
25
|
- [API stability](STABILITY.md) and [deprecations](DEPRECATIONS.md).
|
|
@@ -26,6 +30,8 @@ Start with [First use](FIRST_USE.md). You only need `zhx` for everyday conversat
|
|
|
26
30
|
|
|
27
31
|
## Contribute and maintain
|
|
28
32
|
|
|
33
|
+
- [Harness/Code boundary proposal (ADR 0001)](https://github.com/Zhivex/zhivex-harness/blob/main/docs/adr/0001-harness-code-public-boundary.md): ownership, public APIs and the proposed 1.x transition.
|
|
34
|
+
|
|
29
35
|
[Contributor guide](https://github.com/Zhivex/zhivex-harness/blob/main/CONTRIBUTING.md) ·
|
|
30
36
|
[Maintenance and release evidence](https://github.com/Zhivex/zhivex-harness/blob/main/docs/MAINTENANCE.md) ·
|
|
31
37
|
[Changelog](../CHANGELOG.md)
|
package/docs/STABILITY.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# API stability
|
|
2
2
|
|
|
3
|
+
The additive [engine entrypoints](ENGINE_API.md) are enumerated in
|
|
4
|
+
[`../contracts/engine-api.json`](../contracts/engine-api.json). Aliases preserve
|
|
5
|
+
their existing root tiers; newly exposed helpers have explicit tiers. The root
|
|
6
|
+
compatibility surface remains unchanged. These entrypoints are source changes
|
|
7
|
+
for the planned 1.3 line, not APIs available in the registry 1.2.0 package.
|
|
8
|
+
|
|
3
9
|
[`../contracts/public-api.json`](../contracts/public-api.json) is the machine-checked 1.0 baseline for the package root, binaries, CLI commands/subcommands, exit codes, and document schemas. Every runtime and type export is present in the snapshot and belongs to exactly one explicit tier. Exports listed as stable form the intended 1.x compatibility surface; Time-to-Safe-Fix exports are experimental; the explicitly listed beta exports may evolve under the policy below.
|
|
4
10
|
|
|
5
11
|
[`../contracts/stable-api-signatures.json`](../contracts/stable-api-signatures.json) binds every Stable runtime and type export to a reproducible SHA-256 signature derived from emitted TypeScript declarations. Each signature includes the local declaration dependency closure, so a Beta helper type cannot change the effective signature of a Stable API unnoticed. `bun run contract:check` regenerates declarations in a temporary directory and fails on drift; `bun run contract:signatures:update` is only for a reviewed compatible baseline update or the next major version. The installed-package smoke repeats the comparison against the exact tarball declarations.
|
|
@@ -10,6 +16,8 @@ The schema-1 observational parsers preserve unknown additive fields and distingu
|
|
|
10
16
|
|
|
11
17
|
Beta APIs may change in a minor with changelog and migration guidance. Experimental APIs may change without a deprecation window and must not be the sole supported route for a stable operation. Human-readable terminal text and error messages are not contracts; command identity, exit codes, structured document schemas, and `HarnessError.code/category/retryable` are.
|
|
12
18
|
|
|
13
|
-
The
|
|
19
|
+
The host-only `/mcp/stdio/v1` entry point and `CreateHarnessOptions.isolatedMcpSession` option are experimental additive capabilities. Workspace MCP configuration does not enable stdio; see [host admission and lifecycle](MCP_STDIO.md).
|
|
20
|
+
|
|
21
|
+
The semantic compactor, compaction recommendations, declarative tool policy (including `toolPolicyFile` and `--tool-policy`), progress monitor, ACP text-session adapter, and workspace checkpoint restoration APIs are experimental. ACP implements the documented text-session subset; it does not claim full editor interoperability. Deterministic compaction and the existing client protocol remain available. See [tool policy semantics](TOOL_POLICY.md), [ACP limitations](ACP.md), [context behavior](CONTEXT_ENGINEERING.md), and [checkpoint constraints](WORKSPACE_CHECKPOINTS.md).
|
|
14
22
|
|
|
15
23
|
Before `1.0.0-rc.1`, maintainers classified every current runtime and type export as stable, beta, or experimental. The gate rejects unreviewed additions, removals, omissions, and membership in more than one tier so future stability changes remain deliberate. Root aliases remain available during 1.x; any future beta subpath must be additive until the next major release.
|
package/docs/SUPPORT_MATRIX.md
CHANGED
|
@@ -10,7 +10,7 @@ The machine-readable source is [`support-matrix.json`](./support-matrix.json). `
|
|
|
10
10
|
| OCI | Docker on Linux | — | Podman | managed remote sandbox |
|
|
11
11
|
| Target package manager | npm | Bun | pnpm, Yarn | — |
|
|
12
12
|
| MCP | bounded Streamable HTTP | — | broader remote implementations | stdio |
|
|
13
|
-
| Provider | Meta `muse-spark-1.2`, Qwen `qwen3.8-max`, OpenAI `gpt-5.6-luna` | — | Gemini | undocumented providers |
|
|
13
|
+
| Provider | Meta `muse-spark-1.2`, Qwen `qwen3.8-max`, OpenAI `gpt-5.6-luna` | — | Gemini, Anthropic, Vertex (ADC) | undocumented providers |
|
|
14
14
|
|
|
15
15
|
Provider evidence is release-, account-, endpoint-, model-, and date-bound. A provider is supported for a release only when the exact candidate passes base, orchestration, routing, and model-directed execution gates. The table does not imply upstream feature parity.
|
|
16
16
|
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Trusted tool policy (experimental)
|
|
2
|
+
|
|
3
|
+
An application can pass `toolPolicyFile` to `createHarness`. The CLI accepts
|
|
4
|
+
`--tool-policy /absolute/private/policy.json` for run, chat, review and resume.
|
|
5
|
+
The local service host accepts the same flag at startup. Service clients cannot
|
|
6
|
+
supply it: policy belongs to the process constructing the runtime.
|
|
7
|
+
|
|
8
|
+
```json
|
|
9
|
+
{
|
|
10
|
+
"schemaVersion": 1,
|
|
11
|
+
"rules": [
|
|
12
|
+
{
|
|
13
|
+
"id": "protect-private-file",
|
|
14
|
+
"tools": ["read_file", "read_files"],
|
|
15
|
+
"paths": ["private.txt"],
|
|
16
|
+
"decision": "deny",
|
|
17
|
+
"reason": "This file is outside the task scope"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Choose the file explicitly outside the workspace and its containing repository.
|
|
24
|
+
The loader does not read policy instructions from AGENTS.md, skills, model output,
|
|
25
|
+
environment variables or client requests. It requires a regular file owned by the
|
|
26
|
+
current user, private permissions such as `0600`, one hard link, no symlink in the
|
|
27
|
+
path, valid UTF-8, a strict schema and at most 128 KiB. Unknown fields, versions
|
|
28
|
+
and unavailable tool names are errors. Never place secrets in rule reasons.
|
|
29
|
+
|
|
30
|
+
Rules use exact tool and workspace-relative file names, without wildcards.
|
|
31
|
+
The strongest matching decision wins: deny, then ask_user, then allow. Allow
|
|
32
|
+
does not grant filesystem permissions or remove an existing approval. ask_user
|
|
33
|
+
uses the current approval mechanism, including its configured automatic mode;
|
|
34
|
+
it does not independently require a human. Human-only review is separate work.
|
|
35
|
+
|
|
36
|
+
Built-in file resolvers cover read_file, read_files, propose_edits, apply_patch,
|
|
37
|
+
apply_reviewed_edits, apply_reviewed_replacement, move_file and quarantine_file.
|
|
38
|
+
Move rules inspect both endpoints; multi-file tools inspect every target.
|
|
39
|
+
Path-scoped rules for other tools fail at construction because shell commands,
|
|
40
|
+
directory queries and opaque restore IDs do not enumerate exact affected files.
|
|
41
|
+
Use a tool-wide rule when appropriate. A rule on one named tool does not restrict
|
|
42
|
+
other tools that could access the same data; this is an additional control, not
|
|
43
|
+
a replacement for the workspace permission boundary or sandbox.
|
|
44
|
+
|
|
45
|
+
File policies use `builtin-exact-files-v1`. Existing application-supplied policy
|
|
46
|
+
objects retain their explicit custom resolver interface; do not combine that
|
|
47
|
+
interface with toolPolicyFile. The policy and resolver version affect the durable
|
|
48
|
+
runtime fingerprint inherited by children. An already-open runtime keeps its
|
|
49
|
+
compiled policy when the file changes. Restart to load a change; incompatible
|
|
50
|
+
durable runs must not be resumed under the replacement policy. CLI resume requires
|
|
51
|
+
the operator to supply the policy again; the saved run does not authorize reading
|
|
52
|
+
an arbitrary policy path.
|
|
53
|
+
|
|
54
|
+
This capability remains experimental and has no effect when omitted. Local test
|
|
55
|
+
results and installed-package acceptance are tracked separately in the HU52 report.
|
|
56
|
+
|
|
57
|
+
HU53 adds an experimental opt-in `explicitReview: { "schemaVersion": 1 }` at
|
|
58
|
+
the policy root. It requires host-issued review evidence for all positive approval
|
|
59
|
+
resolutions and affects the policy digest. It does not add approval requirements
|
|
60
|
+
to otherwise unrestricted tools. Automatic resolution cannot satisfy it. Client
|
|
61
|
+
channels without compatible review evidence receive EXPLICIT_REVIEW_REQUIRED and
|
|
62
|
+
leave the operation pending. The local CLI in ask mode displays a complete bounded
|
|
63
|
+
payload and issues host evidence after explicit confirmation, without cached session
|
|
64
|
+
grants. With this policy, `resume --approve` also requires interactive review;
|
|
65
|
+
noninteractive invocation remains pending. Desktop accepts the operator-owned
|
|
66
|
+
policy through its `--tool-policy` startup argument. Its main process consumes a
|
|
67
|
+
bounded, expiring review ticket and sends the exact decision to the runtime through
|
|
68
|
+
their private process channel. The renderer cannot issue review evidence, and the
|
|
69
|
+
public HTTP command endpoint cannot use this private channel. Ordinary service
|
|
70
|
+
clients must leave positive approvals pending under this policy.
|
|
71
|
+
Local review evidence is not corporate identity and does not protect against a
|
|
72
|
+
compromised host process.
|
|
73
|
+
|
|
74
|
+
Approval history records the decision origin before effects: interactive for a
|
|
75
|
+
local answer, automatic for automatic modes or reused session grants, application
|
|
76
|
+
for ordinary API/protocol decisions, and unknown for historical records without
|
|
77
|
+
provenance. Each row includes its channel and the host policy digest when present.
|
|
78
|
+
Origin describes how the decision entered the host; an interactive label alone
|
|
79
|
+
is not evidence of the complete review required by explicitReview. Without that
|
|
80
|
+
option, recording provenance does not impose its five-minute review deadline.
|
|
81
|
+
An incompatible runtime fingerprint is rejected before recording approval intent.
|