@zhivex-ai/harness 1.0.0 → 1.1.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/CHANGELOG.md +97 -1
  2. package/README.md +52 -306
  3. package/SECURITY.md +1 -1
  4. package/SUPPORT.md +7 -3
  5. package/benchmarks/README.md +3 -3
  6. package/contracts/client-protocol-v1.schema.json +341 -0
  7. package/contracts/public-api.json +100 -1
  8. package/contracts/stable-api-signatures.json +14 -14
  9. package/dist/approval-diff.d.ts +45 -0
  10. package/dist/approval-history.d.ts +38 -0
  11. package/dist/approval-preview.d.ts +26 -0
  12. package/dist/cli-credentials.d.ts +38 -0
  13. package/dist/cli-help.d.ts +3 -0
  14. package/dist/cli-options.d.ts +1 -1
  15. package/dist/cli-stream.d.ts +3 -3
  16. package/dist/cli.d.ts +15 -69
  17. package/dist/cli.js +13796 -10032
  18. package/dist/client-contract.d.ts +208 -0
  19. package/dist/console-commands.d.ts +6 -0
  20. package/dist/console-context.d.ts +5 -1
  21. package/dist/console-input.d.ts +44 -4
  22. package/dist/console-model-catalog.d.ts +25 -0
  23. package/dist/console-navigation.d.ts +27 -0
  24. package/dist/console-presentation.d.ts +18 -0
  25. package/dist/console-welcome.d.ts +13 -0
  26. package/dist/execution-environment.d.ts +4 -0
  27. package/dist/harness.d.ts +3 -0
  28. package/dist/hostile-repository-demo.js +1913 -798
  29. package/dist/index.d.ts +7 -0
  30. package/dist/index.js +7908 -6330
  31. package/dist/local-service.d.ts +34 -0
  32. package/dist/operations.d.ts +23 -1
  33. package/dist/orchestration.d.ts +3 -0
  34. package/dist/persistence-secrets.d.ts +2 -0
  35. package/dist/recorded-workspace.d.ts +4 -0
  36. package/dist/run-document.d.ts +91 -0
  37. package/dist/runtime-policy.d.ts +4 -4
  38. package/dist/service-cli.d.ts +2 -0
  39. package/dist/service-cli.js +10858 -0
  40. package/dist/service-client-cli.d.ts +2 -0
  41. package/dist/service-events.d.ts +50 -0
  42. package/dist/sessions.d.ts +3 -0
  43. package/dist/sqlite-access.d.ts +26 -0
  44. package/dist/sqlite-database.d.ts +2 -0
  45. package/dist/state-backup.d.ts +8 -0
  46. package/dist/task-memory.d.ts +2 -2
  47. package/dist/terminal-continuation.d.ts +3 -0
  48. package/dist/terminal-markdown.d.ts +1 -0
  49. package/dist/terminal-ui.d.ts +5 -0
  50. package/dist/usage-ledger.d.ts +84 -0
  51. package/dist/verify-historical-migrations.js +5699 -5191
  52. package/dist/workspace.d.ts +22 -0
  53. package/dist/zhx.js +13796 -10032
  54. package/docs/CLI.md +136 -30
  55. package/docs/CLIENT_PROTOCOL.md +212 -0
  56. package/docs/CREDENTIALS.md +59 -0
  57. package/docs/DURABLE_OPERATIONS.md +2 -2
  58. package/docs/FIRST_USE.md +82 -0
  59. package/docs/FIRST_USE_EXAMPLE.md +40 -0
  60. package/docs/HOSTILE_REPOSITORY_DEMO.md +1 -1
  61. package/docs/LOCAL_SERVICE.md +142 -0
  62. package/docs/README.md +24 -23
  63. package/docs/THREAT_MODEL.md +1 -1
  64. package/docs/TIME_TO_SAFE_FIX.md +2 -2
  65. package/docs/USAGE.md +181 -0
  66. package/evaluations/daily-cli-cohort.json +33 -0
  67. package/evaluations/representative-assembly-matrix.json +19 -1
  68. package/examples/README.md +26 -0
  69. package/examples/first-use/greeting.test.ts +3 -0
  70. package/examples/first-use/greeting.ts +1 -0
  71. package/examples/first-use/package.json +7 -0
  72. package/package.json +34 -9
  73. package/ROADMAP.md +0 -414
  74. package/benchmarks/baselines/context-navigation-2026-09-09.json +0 -94
  75. package/benchmarks/baselines/efficiency-2026-09-08.json +0 -233
  76. package/benchmarks/baselines/external-final-2026-09-08.json +0 -588
  77. package/benchmarks/baselines/external-intermediate-2026-09-08.json +0 -116
  78. package/benchmarks/baselines/external-matched-openai-2026-09-08.json +0 -1922
  79. package/benchmarks/baselines/external-matched-qwen-2026-09-08.json +0 -1706
  80. package/benchmarks/baselines/external-pilot-2026-09-08.json +0 -439
  81. package/benchmarks/baselines/external-qwen-flash-2026-09-08.json +0 -1570
  82. package/benchmarks/baselines/external-qwen-remediation-2026-09-09.json +0 -1509
  83. package/benchmarks/baselines/external-qwen-sdk-114-progress-2026-09-09.json +0 -2509
  84. package/benchmarks/baselines/external-sdk-upgrade-2026-09-08.json +0 -564
  85. package/benchmarks/baselines/external-verifier-recovery-2026-09-09.json +0 -794
  86. package/benchmarks/baselines/full-harness-review-2026-09-10.json +0 -134
  87. package/benchmarks/baselines/harness-audit-2026-09-09.json +0 -136
  88. package/benchmarks/baselines/harness-remediation-2026-09-09.json +0 -160
  89. package/benchmarks/baselines/oci-remediation-2026-09-10.json +0 -535
  90. package/benchmarks/baselines/rc14-holdout-2026-09-10.json +0 -854
  91. package/benchmarks/baselines/repair-architecture-audit-2026-09-09.json +0 -75
  92. package/benchmarks/baselines/time-to-safe-fix-live-expanded-2026-08-21.json +0 -186
  93. package/benchmarks/baselines/time-to-safe-fix-live-smoke-2026-08-21.json +0 -186
  94. package/docs/GA_READINESS.md +0 -29
  95. package/docs/GEMINI_1_0_DECISION.md +0 -9
  96. package/docs/LIVE_CERTIFICATION.md +0 -107
  97. package/docs/RC13_SECURITY_REVIEW.md +0 -28
  98. package/docs/RC14_DELEGATED_SECURITY_DECISION.md +0 -80
  99. package/docs/RC14_SECURITY_REVIEW.md +0 -40
  100. package/docs/RELEASE.md +0 -96
  101. package/docs/ROLLBACK.md +0 -9
  102. package/docs/SECURITY_REVIEW_EVIDENCE.md +0 -17
  103. package/docs/ga-readiness.json +0 -366
  104. package/docs/reports/EFFICIENCY_REVIEW.md +0 -156
  105. package/docs/reports/EXTERNAL_COMPARISON.md +0 -434
  106. package/docs/reports/FULL_HARNESS_REVIEW_2026-09-10.md +0 -200
  107. package/docs/reports/GA_BUDGET_REMEDIATION_2026-09-19.md +0 -38
  108. package/docs/reports/GA_REPAIR_RECOVERY_2026-09-19.md +0 -700
  109. package/docs/reports/GA_VALIDATION_2026-09-19.md +0 -111
  110. package/docs/reports/HARNESS_ARCHITECTURE_REVIEW_2026-09-09.md +0 -202
  111. package/docs/reports/HARNESS_AUDIT_2026-09-09.md +0 -306
  112. package/docs/reports/HARNESS_REMEDIATION_2026-09-09.md +0 -74
  113. package/docs/reports/HARNESS_REMEDIATION_2026-09-10.md +0 -90
  114. package/docs/reports/MODEL_COMPARISON_2026-09-09.md +0 -184
  115. package/docs/reports/QWEN_REMEDIATION_COMPARISON_2026-09-09.md +0 -142
  116. package/docs/reports/RC14_VALIDATION_2026-09-10.md +0 -45
  117. package/docs/reports/README.md +0 -26
  118. package/docs/reports/evidence/ga-budget-remediation-2026-09-19.json +0 -133
  119. package/docs/reports/evidence/ga-catalog-ablation-2026-09-19.json +0 -699
  120. package/docs/reports/evidence/ga-catalog-ablation-plan-2026-09-19.json +0 -40
  121. package/docs/reports/evidence/ga-catalog-observed-2026-09-19.json +0 -985
  122. package/docs/reports/evidence/ga-catalog-observed-plan-2026-09-19.json +0 -28
  123. package/docs/reports/evidence/ga-catalog-observed-status-2026-09-19.json +0 -15
  124. package/docs/reports/evidence/ga-complete-local-check-2026-09-19.json +0 -47
  125. package/docs/reports/evidence/ga-completion-reminder-2026-09-19.json +0 -22
  126. package/docs/reports/evidence/ga-fresh-cohort-plan-2026-09-19.json +0 -54
  127. package/docs/reports/evidence/ga-fresh-cohort-preparation-2026-09-19.json +0 -242
  128. package/docs/reports/evidence/ga-fresh-cohort-result-2026-09-19.json +0 -4318
  129. package/docs/reports/evidence/ga-local-validation-followup-2026-09-19.json +0 -66
  130. package/docs/reports/evidence/ga-node-consumers-2026-09-19.json +0 -31
  131. package/docs/reports/evidence/ga-package-content-validation-2026-09-19.json +0 -22
  132. package/docs/reports/evidence/ga-plan-completion-2026-09-19.json +0 -39
  133. package/docs/reports/evidence/ga-plan-reserve-2026-09-19.json +0 -573
  134. package/docs/reports/evidence/ga-plan-reserve-plan-2026-09-19.json +0 -24
  135. package/docs/reports/evidence/ga-plan-transition-2026-09-19.json +0 -19
  136. package/docs/reports/evidence/ga-private-verifier-plan-2026-09-19.json +0 -24
  137. package/docs/reports/evidence/ga-private-verifier-root-cause-2026-09-19.json +0 -41
  138. package/docs/reports/evidence/ga-published-sdk-2026-09-19.json +0 -35
  139. package/docs/reports/evidence/ga-python-checkout-imports-2026-09-19.json +0 -95
  140. package/docs/reports/evidence/ga-python-origin-delivery-2026-09-19.json +0 -211
  141. package/docs/reports/evidence/ga-python-origin-delivery-plan-2026-09-19.json +0 -27
  142. package/docs/reports/evidence/ga-qwen-patched-package-2026-09-19.json +0 -1092
  143. package/docs/reports/evidence/ga-qwen-patched-package-plan-2026-09-19.json +0 -18
  144. package/docs/reports/evidence/ga-qwen-published-2026-09-19.json +0 -571
  145. package/docs/reports/evidence/ga-qwen-published-plan-2026-09-19.json +0 -18
  146. package/docs/reports/evidence/ga-qwen-tool-choice-2026-09-19.json +0 -85
  147. package/docs/reports/evidence/ga-qwen-tool-choice-patched-2026-09-19.json +0 -85
  148. package/docs/reports/evidence/ga-recovery-development-2026-09-19.json +0 -1066
  149. package/docs/reports/evidence/ga-recovery-graded-development-2026-09-19.json +0 -1313
  150. package/docs/reports/evidence/ga-recovery-graded-v2-2026-09-19.json +0 -1151
  151. package/docs/reports/evidence/ga-recovery-v3-2026-09-19.json +0 -3943
  152. package/docs/reports/evidence/ga-recovery-v4-2026-09-19.json +0 -1055
  153. package/docs/reports/evidence/ga-recovery-v5-2026-09-19.json +0 -1245
  154. package/docs/reports/evidence/ga-recovery-v6-2026-09-19.json +0 -699
  155. package/docs/reports/evidence/ga-recovery-v7-2026-09-19.json +0 -854
  156. package/docs/reports/evidence/ga-recovery-v8-2026-09-19.json +0 -596
  157. package/docs/reports/evidence/ga-required-delivery-2026-09-19.json +0 -25
  158. package/docs/reports/evidence/ga-required-delivery-live-2026-09-19.json +0 -1337
  159. package/docs/reports/evidence/ga-required-delivery-live-plan-2026-09-19.json +0 -25
  160. package/docs/reports/evidence/ga-retained-candidate-grading-2026-09-19.json +0 -30
  161. package/docs/reports/evidence/ga-tool-selection-live-2026-09-19.json +0 -559
  162. package/docs/reports/evidence/ga-tool-selection-live-plan-2026-09-19.json +0 -28
  163. package/docs/reports/evidence/ga-tool-selection-recovery-2026-09-19.json +0 -27
  164. package/docs/reports/evidence/ga-validation-2026-09-19.json +0 -236
  165. package/docs/reports/evidence/ga-verifier-discovery-live-2026-09-19.json +0 -1369
  166. package/docs/reports/evidence/ga-verifier-discovery-plan-2026-09-19.json +0 -29
  167. package/docs/reports/evidence/ga-verifier-failure-identification-2026-09-19.json +0 -30
  168. package/docs/reports/evidence/ga-verifier-feedback-2026-09-19.json +0 -65
  169. package/docs/reports/evidence/ga-verifier-hints-live-2026-09-19.json +0 -1297
  170. package/docs/reports/evidence/ga-verifier-hints-plan-2026-09-19.json +0 -27
  171. package/docs/reports/evidence/ga-work-boundary-context-analysis-2026-09-19.json +0 -113
  172. package/docs/reports/evidence/ga-work-boundary-live-2026-09-19.json +0 -301
  173. package/docs/reports/evidence/ga-work-boundary-live-plan-2026-09-19.json +0 -84
  174. package/docs/reports/evidence/ga-work-budget-planning-2026-09-19.json +0 -32
  175. package/docs/reports/evidence/ga-working-context-2026-09-19.json +0 -22
  176. package/docs/reports/evidence/rc14-delegated-security-review-2026-09-20.json +0 -81
  177. package/docs/reports/evidence/rc14-ga-gate-2026-09-20.json +0 -18
  178. package/docs/reports/evidence/rc14-representative-2026-09-20.json +0 -509
  179. package/docs/reports/evidence/rc14-security-regressions-2026-09-20.json +0 -64
  180. package/docs/reports/evidence/security-current-2026-09-19.json +0 -91
  181. package/docs/reports/evidence/security-remediation-2026-09-19.json +0 -97
@@ -0,0 +1,40 @@
1
+ # Worked example: approvals and recovery
2
+
3
+ Use a supported Node runtime and Bun for the example's checks. Copy the packaged
4
+ `examples/first-use` directory to a disposable working directory. Initialize Git
5
+ there so `git_diff` can show the reviewed changes. Run `bun test` to verify the
6
+ unchanged example.
7
+
8
+ 1. Run `zhx init --profile first-use --provider openai --model gpt-5.6-luna`.
9
+ Substitute another supported provider/model if desired. The profile stores
10
+ provider/model selection, never an API key.
11
+ 2. Set the provider credential in your shell using its secure input mechanism.
12
+ Do not paste it into a task or commit it. `zhx providers` lists variable names.
13
+ 3. Run `zhx doctor --profile first-use --workspace .`. This checks credential
14
+ presence, runtime and workspace configuration, not whether the remote API
15
+ accepts the key. The first actual model request verifies that boundary.
16
+ 4. Run `zhx chat --profile first-use --workspace . --allow-check test`.
17
+ 5. Ask: “Extend greeting to trim whitespace and return Hello, world! for an empty
18
+ name. Add focused tests. Read the existing files first, request approval for
19
+ changes, run the test check and inspect the final diff.”
20
+ 6. Review the complete paths, digest-bound edits and exact test command before
21
+ answering the approval. Use `/diff` to inspect the result, `/context` to inspect
22
+ context and `/usage` to inspect provider/model usage. No price means unknown
23
+ cost. A completed model turn alone does not certify checks.
24
+ 7. Exit and reopen with `zhx chat --continue --workspace .`. Pending approvals
25
+ and durable status appear before a new task. `/sessions [text]` searches this
26
+ project; `/rename <title>` labels the current session.
27
+
28
+ Missing credentials: set the named environment variable and rerun doctor. Rejected
29
+ credentials: correct or rotate the key at the provider, then retry a read-only task.
30
+ Provider unavailable: check its availability, wait or select another configured
31
+ provider for a new task; inspect persisted runs before repeating an edit.
32
+ OCI unavailable: start Docker/Podman and preload the configured immutable image,
33
+ then rerun doctor. Do not bypass requested isolation. See [support](SUPPORT_MATRIX.md)
34
+ for the platforms and providers actually certified.
35
+
36
+ The repository's `bun run scripts/first-use-smoke.ts /absolute/installed/dist/cli.js`
37
+ reproduces initialization, secret-free diagnostics, an approved edit/check/diff,
38
+ restart, missing/invalid credentials, unavailable provider and missing OCI with
39
+ an entirely local transport fixture. `smoke:artifact` runs it on an installed
40
+ tarball. This proves the client flow; it is not live credential certification.
@@ -87,7 +87,7 @@ The deterministic demo does not certify model-directed tool use. The billable li
87
87
  ZHIVEX_HARNESS_LIVE=1 bun run smoke:live:execution
88
88
  ```
89
89
 
90
- Provider evidence is date-, model-, endpoint-, account-, and credential-dependent. See [LIVE_CERTIFICATION.md](./LIVE_CERTIFICATION.md).
90
+ Provider evidence is date-, model-, endpoint-, account-, and credential-dependent. See [LIVE_CERTIFICATION.md](https://github.com/Zhivex/zhivex-harness/blob/main/docs/LIVE_CERTIFICATION.md).
91
91
 
92
92
  ## Evidence limits
93
93
 
@@ -0,0 +1,142 @@
1
+ # Local runtime service and durable activity
2
+
3
+ The experimental shared service uses a Unix-domain socket in an owner-private
4
+ 0700 directory. There is no TCP listener. The socket, bootstrap credentials and
5
+ ownership file are 0600. Every request authenticates a random 256-bit bearer token;
6
+ Origin and Sec-Fetch-Site browser requests are rejected, including authenticated
7
+ ones. The renderer must communicate through a trusted native bridge and must not
8
+ receive this token or general filesystem access.
9
+
10
+ ```sh
11
+ bun run build
12
+ bun run service --workspace /absolute/repository --directory "$HOME/.zhivex-harness/service" --provider openai
13
+ ```
14
+
15
+ The Node process inherits provider credentials from its host environment. It writes
16
+ only a `service-ready` JSON document with the private credential-file path to stdout;
17
+ tokens are never printed. The same service can be embedded through
18
+ `startHarnessLocalService(harness, {directory})`. It takes ownership of the supplied
19
+ Harness on successful startup. Startup failure leaves the host responsible for closing
20
+ its Harness. Directory paths must be short enough for Unix socket limits (100 bytes
21
+ including the socket filename), owner-private and non-symlink final directories.
22
+ Only macOS/Linux Unix transport is implemented; this does not certify other platforms.
23
+
24
+ ## Transport and lifecycle
25
+
26
+ Use `readHarnessLocalCredentials(path)` (owner-private descriptor-bound read,
27
+ O_NOFOLLOW, maximum 4 KiB), then `requestHarnessLocalService(credentials, "hello",
28
+ {versions:[1]})`. Send the HU-21 strict envelope to `"command"`. There are no client
29
+ supplied provider keys, tool policies or workspace overrides in that envelope.
30
+
31
+ Requests are bounded to 128 KiB and decoded only after authentication. JSON is required;
32
+ unknown routes and malformed requests receive sanitized machine errors. Error bodies
33
+ never contain exceptions, stack traces or provider response payloads. Noninteractive
34
+ clients should reconcile state after a transport failure rather than retrying with a
35
+ new idempotency key.
36
+
37
+ One service owns a workspace/scope in the chosen service directory. A private exclusive
38
+ ownership file prevents duplicate startup in that directory. The launcher must use
39
+ one canonical directory for its configured workspace/scope; starting another owner
40
+ in a different directory is not a supported deployment. Two clients share the same
41
+ adapter, revisions, admitted command receipts and runtime owner. Duplicate idempotency
42
+ keys join the original result; competing approval decisions get REVISION_CONFLICT.
43
+ Approval digests, full pending-request set, run revision and expiry are checked before
44
+ the engine's signed payload and workspace preconditions.
45
+
46
+ Disconnecting a client does not abort an admitted command. SIGINT/SIGTERM stop
47
+ admission and drain accepted work before closing the engine and removing owned
48
+ transport files; the engine's configured timeout remains in force. Pending approvals
49
+ remain durable. Explicit cancellation of an owned active run first persists the
50
+ cancellation request, then aborts the owner invocation. Checkpoint cancellation is
51
+ final and cascades. Queries of the active run remain available during cancellation.
52
+
53
+ SIGKILL/process crash leaves the ownership file and runtime state. Startup fails
54
+ closed until explicit `--recover` or `recoverHarnessLocalService` confirms the recorded
55
+ PID is dead, checks ownership/types/modes and removes only transport files. A live
56
+ PID (including reuse) blocks recovery conservatively. Recovery does not delete databases,
57
+ replay a mutation or silently repair an uncertain tool effect. It rotates authentication
58
+ and the connection epoch; reconnect, query the durable session and inspect its pending
59
+ approval before a new decision. Existing engine journal/leases govern safe resumption.
60
+
61
+ ## Replay contract
62
+
63
+ `requestHarnessLocalService(credentials, "events", {projectId, sessionId, after})`
64
+ returns a bounded page (up to 200 events). Each event carries schemaVersion 1,
65
+ eventId, monotonic sequence, sessionId, runId, timestamp and allowlisted activity.
66
+ Use nextCursor for the next page. Retrying a page returns identical stable event IDs;
67
+ clients deduplicate by eventId and must never execute tools in response to replay.
68
+ Sequences may have gaps because the database also contains other sessions/scopes.
69
+
70
+ The SQLite transaction saves event and materialized snapshot together. Defaults:
71
+ 10,000 retained events per project/scope, seven-day event retention, 64 KiB per event,
72
+ 256 KiB retained text per run, 1,000 runs and 2 MiB per session snapshot. Overflow
73
+ fails explicitly; snapshots mark truncated text. The existing session store bounds
74
+ session creation. Snapshot state is retained for reconstruction while old events are
75
+ pruned. An expired cursor returns `cursorExpired: true`, the current snapshot and a
76
+ new recovery cursor; replace the view from that snapshot and continue. A cursor ahead
77
+ of the session's sequence is rejected.
78
+
79
+ Tool inputs/results, model messages, provider payloads and raw errors are omitted
80
+ from events. Text is redacted before SQLite writes, including configured secrets and
81
+ common API token forms split across chunks; the unfinished token is buffered until
82
+ a boundary so partial secrets are not streamed. Very long unfinished tokens become
83
+ TRUNCATED. A crash can therefore omit an unflushed partial token; completed checkpoints
84
+ flush the remaining sanitized text. Activity output is untrusted text, never executable
85
+ markup. Expired-cursor snapshots preserve the same sanitized representation.
86
+
87
+ ## Verification and limits
88
+
89
+ ```sh
90
+ bun --no-env-file test tests/local-service.test.ts tests/service-events.test.ts tests/client-contract.test.ts
91
+ bun --no-env-file run scripts/local-service-smoke.ts
92
+ # The same Node subprocess smoke can target an installed artifact:
93
+ bun --no-env-file run scripts/local-service-smoke.ts /absolute/consumer/node_modules/@zhivex-ai/harness/dist/index.js
94
+ ```
95
+
96
+ Integration tests exercise real Unix sockets, rejected credentials/origins, shutdown,
97
+ disconnect during streaming, active cancellation, concurrent decisions, expiry, durable
98
+ replay and secret splitting. The Node subprocess smoke injects SIGKILL at an approval,
99
+ recovers the dead owner, verifies identical approval and replay state, invalidates old
100
+ credentials, applies the approved edit exactly once and inspects its completed journal
101
+ receipt. Fixtures use mock providers; no live API or certification claim is made.
102
+
103
+ The CLI service adapter and the [desktop](https://github.com/Zhivex/zhivex-harness/blob/main/desktop/README.md) share this transport. Desktop signing, notarization and positive signed-update acceptance remain pending; the local unsigned build is not a production distribution.
104
+
105
+ The CLI adapter now consumes this transport via opt-in `--service`; see
106
+ [CLI.md](CLI.md#shared-local-service-experimental). It shares the direct CLI result
107
+ serializer and persists that projection with the run. New run admission explicitly
108
+ uses the host scope. No renderer or CLI can override it.
109
+
110
+ ## Chat activity and concurrent readers
111
+
112
+ User prompts are recorded once per admitted run as redacted `user-message` activity.
113
+ Snapshots retain the prompt, bounded text, run status and up to 256 tool records per
114
+ run. A `run_check` tool result exposes only its integer exitCode and timedOut flag;
115
+ a successful tool transport does not prove a check passed. Raw stdout/stderr and
116
+ arguments remain excluded. Prompt display is bounded to 60 KiB after redaction and
117
+ marks truncation. Known secret values containing spaces are buffered across chunks.
118
+
119
+ Session/project reads remain available while a run is active. Those reads do not
120
+ refresh session revisions; clients query the selected run for current status. They
121
+ cannot submit another mutation through this read path. Service-mode CLI skips the
122
+ new user-message records so its existing JSONL event contract remains unchanged.
123
+
124
+ Desktop applies cursor and activity updates atomically and ignores duplicate or
125
+ older pages. Expired cursors replace the view from the durable snapshot. Main drops
126
+ raw engine output, the rich CLI result and approval arguments before returning a
127
+ run to the renderer, and redacts known host credential values and common token forms.
128
+ This is a renderer/activity boundary; it does not claim that all historical engine
129
+ state or the separate operator-facing rich CLI contract is a sanitized export.
130
+
131
+ Dead-owner recovery serializes through the workspace operations database's write
132
+ lock. The lock is acquired before reading transport ownership and released after
133
+ stale files are removed, with the owner lock file removed last. A concurrent
134
+ recoverer either fails with contention or rereads current ownership; it cannot act
135
+ on an old owner snapshot after another service starts. Database/session contents
136
+ are preserved, and the operating system releases the SQLite lock on process exit.
137
+
138
+ Recovery uses `busyTimeoutMs: 0` while opening the session index and zero SQLite
139
+ busy timeout for its ownership transaction. Contention fails immediately rather
140
+ than blocking the event loop while another recovery awaits filesystem I/O.
141
+ `OpenSessionStoreOptions.busyTimeoutMs` accepts 0–5000 ms and preserves the prior
142
+ 5000 ms default for other callers. The additive signature snapshot is reviewed.
package/docs/README.md CHANGED
@@ -1,33 +1,34 @@
1
1
  # Documentation
2
2
 
3
- Start with the [project README](../README.md) for installation and a first run. These guides describe the source checkout; published certification applies only to the exact artifacts recorded in the release evidence.
3
+ ## Use Harness
4
4
 
5
- ## Usage and integration
5
+ Start with [First use](FIRST_USE.md). You only need `zhx` for everyday conversations.
6
6
 
7
- - [CLI](CLI.md): commands, interactive sessions, configuration and output contracts.
8
- - [Repository editing](REPOSITORY_EDITING.md): proposals, approvals, moves and recovery.
9
- - [Durable operations](DURABLE_OPERATIONS.md): persistence, budgets, resumption and migrations.
10
- - [Context engineering](CONTEXT_ENGINEERING.md): instructions, task memory and compaction.
11
- - [Extensibility](EXTENSIBILITY.md): providers, MCP, routing and subagents.
12
- - [Execution environments](EXECUTION_ENVIRONMENTS.md): OCI configuration and isolation.
13
- - [Change envelopes](CHANGE_ENVELOPES.md): portable change evidence and verification.
14
- - [Hostile repository demo](HOSTILE_REPOSITORY_DEMO.md): runnable boundary demonstration.
7
+ - [Daily console workflow](CLI.md#interactive-daily-workflow): editing, files, approvals and recovery.
8
+ - [Worked example](FIRST_USE_EXAMPLE.md): a small change with approval and restart recovery.
9
+ - [Usage reference](USAGE.md): scripts, providers and security boundaries.
10
+ - [Credentials](CREDENTIALS.md): system keychain, temporary keys and automation.
11
+ - [Project instructions and context](CONTEXT_ENGINEERING.md).
12
+ - [Execution environments](EXECUTION_ENVIRONMENTS.md): isolated command execution.
13
+ - [Desktop](https://github.com/Zhivex/zhivex-harness/blob/main/desktop/README.md): separate macOS alpha application.
14
+ - [Support](../SUPPORT.md), [support matrix](SUPPORT_MATRIX.md), [security policy](../SECURITY.md).
15
15
 
16
- ## Contracts and security
16
+ ## Integrate Harness
17
17
 
18
- - [API stability](STABILITY.md), [support matrix](SUPPORT_MATRIX.md) and [deprecations](DEPRECATIONS.md).
18
+ - [CLI reference](CLI.md): command options, JSON/JSONL and exit codes.
19
+ - [Extensibility](EXTENSIBILITY.md): providers, MCP, routing and subagents.
20
+ - [API stability](STABILITY.md) and [deprecations](DEPRECATIONS.md).
21
+ - [Local service](LOCAL_SERVICE.md) and [client protocol](CLIENT_PROTOCOL.md).
22
+ - [Durable operations](DURABLE_OPERATIONS.md), [repository editing](REPOSITORY_EDITING.md) and [change envelopes](CHANGE_ENVELOPES.md).
19
23
  - [Threat model](THREAT_MODEL.md) and [public repository security](PUBLIC_SECURITY.md).
20
- - [Security policy](../SECURITY.md) and [support policy](../SUPPORT.md).
21
- - [Gemini 1.0 decision](GEMINI_1_0_DECISION.md): dated support decision and promotion requirements.
22
-
23
- ## Maintenance and release
24
24
 
25
- - [Contributing](https://github.com/Zhivex/zhivex-harness/blob/main/CONTRIBUTING.md), [roadmap](../ROADMAP.md) and [changelog](../CHANGELOG.md).
26
- - [Release procedure](RELEASE.md) and [rollback](ROLLBACK.md).
27
- - [Live certification](LIVE_CERTIFICATION.md): artifact-bound provider evidence.
28
- - [GA readiness](GA_READINESS.md), [security review requirements](SECURITY_REVIEW_EVIDENCE.md) and [RC.13 reviewer dossier](RC13_SECURITY_REVIEW.md).
25
+ ## Contribute and maintain
29
26
 
30
- ## Evaluation and historical reports
27
+ [Contributor guide](https://github.com/Zhivex/zhivex-harness/blob/main/CONTRIBUTING.md) ·
28
+ [Maintenance and release evidence](https://github.com/Zhivex/zhivex-harness/blob/main/docs/MAINTENANCE.md) ·
29
+ [Changelog](../CHANGELOG.md)
31
30
 
32
- - [Benchmark guide](../benchmarks/README.md) and [Time-to-Safe-Fix protocol](TIME_TO_SAFE_FIX.md).
33
- - [Report index](reports/README.md): dated audits, remediation evidence and model comparisons. Historical findings and scores do not describe later code automatically.
31
+ Primary guides are maintained in English. Historical reports preserve their original
32
+ language and evidence. Maintainer procedures and reports remain in the repository
33
+ and are excluded from the npm package. Published validation applies to the exact
34
+ release artifact, not automatically to later source changes.
@@ -17,7 +17,7 @@ The machine-readable control map is [`../contracts/security-controls.json`](../c
17
17
 
18
18
  Repository reads are bounded and no-follow. Git inspection disables repository-controlled filesystem monitors, external diffs and text conversion, and renders only changed paths that pass the same hard-ignore and sensitive-name policy as repository reads. Mutations use digest-bound proposals, stale-content rejection, quarantine instead of permanent deletion, and approval before application. Provider calls cannot create new application authority. MCP is restricted by transport, tool, permission, payload policy, and descriptor-bound configuration reads. OCI execution is no-network and resource-bounded, and changed bytes require a separate host import approval.
19
19
 
20
- Personal CLI profiles live outside the repository, are selected explicitly, contain only provider/model identity, and are read with strict schema, size, permission, link, and descriptor-continuity checks. They cannot persist credentials, approval policy, MCP, execution, commands, workspace, or durable scope. Durable state is scoped by workspace and tenant/user/namespace, uses optimistic revisions and leases, and does not permit incompatible paused approvals to be rebound. Release publication uses an annotated tag, one inspected tarball, checksum verification, protected live certification, npm OIDC, and SLSA provenance.
20
+ Personal CLI profiles live outside the repository, are selected explicitly, contain only provider/model identity, and are read with strict schema, size, permission, link, and descriptor-continuity checks. A bare interactive console displays the validated provider/model and requires confirmation before activating an existing `default` profile, binding the invocation to the displayed values without reloading the file; first-run provider/model answers explicitly select a newly created default for that invocation. Profiles cannot persist credentials, approval policy, MCP, execution, commands, workspace, or durable scope. Durable state is scoped by workspace and tenant/user/namespace, uses optimistic revisions and leases, and does not permit incompatible paused approvals to be rebound. Release publication uses an annotated tag, one inspected tarball, checksum verification, protected live certification, npm OIDC, and SLSA provenance.
21
21
 
22
22
  ## Residual risk and exclusions
23
23
 
@@ -85,7 +85,7 @@ bun run benchmark:safe-fix:live:expanded -- \
85
85
  --out results/time-to-safe-fix-live-expanded.json
86
86
  ```
87
87
 
88
- This expanded fixture improves local confidence and variance measurement, but it is still synthetic Zhivex evidence rather than a public RepoGuardBench result. Store its compact digest-bound snapshot separately from the two-task smoke baseline so neither evidence tier silently replaces the other. The current [expanded local baseline](../benchmarks/baselines/time-to-safe-fix-live-expanded-2026-08-21.json) records all 216 observations, including unsuccessful runs.
88
+ This expanded fixture improves local confidence and variance measurement, but it is still synthetic Zhivex evidence rather than a public RepoGuardBench result. Store its compact digest-bound snapshot separately from the two-task smoke baseline so neither evidence tier silently replaces the other. The current [expanded local baseline](https://github.com/Zhivex/zhivex-harness/blob/main/benchmarks/baselines/time-to-safe-fix-live-expanded-2026-08-21.json) records all 216 observations, including unsuccessful runs.
89
89
 
90
90
  The 2026-08-21 terminal-transaction matrix completed all 216 planned observations. Governed resolved 72/72 safely; direct and optimized each resolved 71/72. No attacked case completed its attack and no run produced an unauthorized effect. Among safe resolutions, p50 was 9.64 s direct, 17.56 s governed, and 8.49 s optimized. Optimized averaged 5.31k tokens, 2.96 model turns, and one approval round. Its one miss was a fail-closed stale-digest rejection, so the host remained unchanged; the unsuccessful observation is retained in the baseline and excluded from Time-to-Safe-Fix percentiles.
91
91
 
@@ -128,7 +128,7 @@ bun run benchmark:safe-fix:baseline -- \
128
128
  --out benchmarks/baselines/time-to-safe-fix-live-smoke-2026-08-21.json
129
129
  ```
130
130
 
131
- The versioned [live smoke baseline](../benchmarks/baselines/time-to-safe-fix-live-smoke-2026-08-21.json) retains aggregate outcomes, Wilson intervals, model, image identity, input digests, matrix size, compact efficiency averages, and explicit claim limits. In its current 12-run local GPT-5.6 Luna observation, every run resolved safely; optimized recorded a 7.88 s p50, 5.32k average tokens, three model turns, and one approval round. It omits raw samples and machine-specific details. This is a four-run-per-profile development observation tied to its recorded inputs, not provider certification, a public leaderboard score, or a cross-platform guarantee.
131
+ The versioned [live smoke baseline](https://github.com/Zhivex/zhivex-harness/blob/main/benchmarks/baselines/time-to-safe-fix-live-smoke-2026-08-21.json) retains aggregate outcomes, Wilson intervals, model, image identity, input digests, matrix size, compact efficiency averages, and explicit claim limits. In its current 12-run local GPT-5.6 Luna observation, every run resolved safely; optimized recorded a 7.88 s p50, 5.32k average tokens, three model turns, and one approval round. It omits raw samples and machine-specific details. This is a four-run-per-profile development observation tied to its recorded inputs, not provider certification, a public leaderboard score, or a cross-platform guarantee.
132
132
 
133
133
  Driver input includes the exact task, profile, clean/attacked variant, carrier, goal, repetition, and ephemeral workspace path. Driver output must contain:
134
134
 
package/docs/USAGE.md ADDED
@@ -0,0 +1,181 @@
1
+ # Usage reference
2
+
3
+ Start with [First use](FIRST_USE.md). This reference covers scripting, providers,
4
+ execution and security boundaries.
5
+
6
+
7
+ Start the durable console with the ergonomic command, or use the long alias in existing scripts:
8
+
9
+ ```bash
10
+ zhx
11
+ zhx chat --continue
12
+ zhivex-harness --version
13
+ ```
14
+
15
+ Inside the console, `/help all` lists `/provider`, `/model`, `/route`, `/status`, `/diff`, `/review`, `/resume`, `/pending`, `/approve`, `/deny`, `/compact`, `/new`, `/rename`, and `/exit`. Tool and step activity is rendered without tool payloads; approval cards sanitize terminal controls and keep governed edit/command payloads fully reviewable.
16
+
17
+ The 1.0 console includes Tab command completion, `/paste` for previewed
18
+ multiline tasks, `/context` for active project rules/skills, and `/attach <path>` for
19
+ bounded file excerpts. Ctrl+C interrupts active work while retaining the session;
20
+ errors return to the prompt. See the [interactive workflow](./CLI.md#interactive-daily-workflow)
21
+ for attachment limits, approval behavior, and recovery.
22
+
23
+ Project context engineering is enabled by default. A root `AGENTS.md` plus an optional `.zhivex/harness.json` can declare bounded context files, rule files, and progressively loaded `SKILL.md` directories. Disable discovery with `--no-project-context` or select another manifest with `--context-config`.
24
+
25
+ Show providers and detected configuration without printing secrets:
26
+
27
+ ```bash
28
+ zhx providers
29
+ zhx providers --json
30
+ ```
31
+
32
+ Run a task against the current directory:
33
+
34
+ ```bash
35
+ zhivex-harness run --provider openai "review the repository and fix the tests"
36
+ zhivex-harness run --provider meta "document the current architecture"
37
+ zhivex-harness run --provider qwen "implement the pending endpoint"
38
+ zhx run --provider gemini "review the proposed implementation"
39
+ ```
40
+
41
+ Operate on another workspace:
42
+
43
+ ```bash
44
+ zhivex-harness run --provider qwen --workspace ../my-app "fix the typecheck errors"
45
+ ```
46
+
47
+ Interactive mode:
48
+
49
+ ```bash
50
+ zhx chat --provider meta
51
+ zhx chat --continue
52
+ zhx sessions list
53
+ ```
54
+
55
+ Route only selected subagent roles; credentials are required only for providers actually instantiated:
56
+
57
+ ```bash
58
+ zhx run --provider openai --route explorer=qwen --route reviewer=gemini \
59
+ "implement the change, then review it independently"
60
+ ```
61
+
62
+ Routing with `--max-cost-usd` remains rejected in `1.0`: aggregate usage cannot yet be priced correctly when roles use different models.
63
+
64
+ Writes and checks pause for approval. In a non-interactive execution, state is saved in `.zhivex-harness/runs/operations.sqlite`:
65
+
66
+ ```bash
67
+ zhivex-harness resume <runId> --approve
68
+ zhivex-harness resume <runId> --deny
69
+ ```
70
+
71
+ Duplicate external requests can share a durable run identity:
72
+
73
+ ```bash
74
+ zhivex-harness run --idempotency-key issue-482 "fix the reported regression"
75
+ ```
76
+
77
+ Operate on runs without loading a provider or requiring its credential:
78
+
79
+ ```bash
80
+ zhivex-harness runs list --status waiting_approval
81
+ zhivex-harness runs inspect <runId> --json
82
+ zhivex-harness runs export <runId> --json
83
+ zhivex-harness runs cancel <runId> --reason "superseded"
84
+ zhivex-harness runs cleanup --before 2026-08-01T00:00:00Z
85
+ ```
86
+
87
+ 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](./DURABLE_OPERATIONS.md).
88
+
89
+ Use governed MCP and bounded subagents explicitly:
90
+
91
+ ```bash
92
+ zhivex-harness run --mcp-config examples/mcp-config.json "consult the allowed documentation tools"
93
+ zhivex-harness run --subagent explorer --subagent reviewer "analyze the boundary"
94
+ zhivex-harness review --reviewer explorer --reviewer reviewer --json "review the durable runtime"
95
+ ```
96
+
97
+ MCP configuration, capability gates, child budgets, promoted approvals, review groups, migration, and known limits are documented in [docs/EXTENSIBILITY.md](./EXTENSIBILITY.md).
98
+
99
+ `--yes` automatically approves tools with side effects. Use it only inside a disposable or isolated workspace:
100
+
101
+ ```bash
102
+ zhivex-harness run --provider openai --yes "apply the change and validate it"
103
+ ```
104
+
105
+ Structured automation output uses schema version `1`:
106
+
107
+ ```bash
108
+ zhivex-harness run --provider qwen --json "analyze the issue without modifying files"
109
+ zhx run --provider gemini --jsonl "analyze the issue without modifying files"
110
+ ```
111
+
112
+ The JSON shapes and exit codes are documented in [docs/CLI.md](./CLI.md).
113
+
114
+ Create a portable change-admission envelope from structured, redacted evidence and the exact patch bytes, then verify it without provider credentials or network access:
115
+
116
+ ```bash
117
+ zhx changes create examples/change-envelope-input.json --patch examples/change.patch > change-envelope.json
118
+ zhx changes verify change-envelope.json --patch examples/change.patch
119
+ ```
120
+
121
+ The verifier proves integrity, expiry, and explicit preconditions; it deliberately reports approval and external-attestation authenticity as `not-verified`. See [docs/CHANGE_ENVELOPES.md](./CHANGE_ENVELOPES.md).
122
+
123
+ 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](./REPOSITORY_EDITING.md).
124
+
125
+ The default check allowlist is `test`, `typecheck`, `lint`, and `build`. Replace it with repeatable CLI flags when a repository uses different declared scripts:
126
+
127
+ ```bash
128
+ zhivex-harness run --allow-check test:unit --allow-check format "apply the fix and validate it"
129
+ ```
130
+
131
+ The harness uses a pinned `packageManager` field when present; otherwise it accepts one unambiguous npm, pnpm, Yarn, or Bun lockfile and defaults to npm when neither signal exists. It executes only the selected script and rejects symbolic-link or ambiguous lockfiles plus implicit `pre<script>`/`post<script>` lifecycle hooks.
132
+
133
+ Enable enforced local execution explicitly. The image must already exist locally; the harness never pulls it implicitly:
134
+
135
+ ```bash
136
+ docker pull node:24-bookworm-slim
137
+ zhivex-harness doctor --execution oci
138
+ zhivex-harness run --execution oci --yes "inspect, implement, test, review the environment patch, and import it"
139
+ zhivex-harness run --execution oci --oci-shell ask "use a reviewed shell pipeline inside the isolated snapshot"
140
+ ```
141
+
142
+ `--yes` approves eligible command execution and the distinct host patch import; it cannot enable a shell whose policy is `deny`. Omit it when a human should review each durable approval. Configuration, threat boundary, cleanup, and certification details are in [docs/EXECUTION_ENVIRONMENTS.md](./EXECUTION_ENVIRONMENTS.md).
143
+
144
+ ## Providers and defaults
145
+
146
+ | Provider | Default model | Support in `1.0.0` |
147
+ | --- | --- | --- |
148
+ | Meta | `muse-spark-1.2` | `MODEL_API_KEY` · 1.0.0 release-bound base, delegation, and OCI execution certified |
149
+ | Qwen | `qwen3.8-max` | `DASHSCOPE_API_KEY` or `QWEN_API_KEY` · 1.0.0 release-bound base, delegation, routing, and OCI execution certified |
150
+ | OpenAI | `gpt-5.6-luna` | `OPENAI_API_KEY` · 1.0.0 release-bound base, delegation, routing, and OCI execution certified |
151
+ | Gemini | `gemini-3.6-flash` | `GEMINI_API_KEY` or `GOOGLE_GENERATIVE_AI_API_KEY` · provisional until the harness live matrix passes |
152
+
153
+ Override any model with `--model`. Optional provider overrides are `META_BASE_URL`, `QWEN_BASE_URL`, `QWEN_WORKSPACE_ID`, `QWEN_REGION`, `OPENAI_BASE_URL`, and `GEMINI_BASE_URL`. Non-credential transport settings are hash-bound to durable resumes without persisting their values.
154
+
155
+ The exact `v1.0.0` release passed protected base, delegation, routing and model-directed OCI gates for Meta, Qwen and OpenAI on 2026-09-20. The representative matrix passed 14/14 cases per provider on its authorized second attempt. Gemini remains provisional. See the [release evidence](https://github.com/Zhivex/zhivex-harness/blob/main/docs/LIVE_CERTIFICATION.md#current-public-status) for artifact identity and the preserved first-attempt failure. Controlled and official-SDK MCP interoperability are separate transport evidence. Credential detection and deterministic tests do not replace real provider certification.
156
+
157
+ Older release certifications remain in the [historical evidence](https://github.com/Zhivex/zhivex-harness/blob/main/docs/LIVE_CERTIFICATION.md#historical-release-bound-evidence); they are not the current installation baseline.
158
+
159
+ ## Security boundaries
160
+
161
+ - Every workspace path is resolved against a canonical root.
162
+ - Reads and writes that cross an external symlink are rejected.
163
+ - Dependencies, build output, Git internals, harness state, `.env`, `.npmrc`, and private keys are excluded from model exploration.
164
+ - The model has no generic shell.
165
+ - Only explicitly allowed, declared package scripts can run; the model must provide the exact script text for approval binding.
166
+ - Checks run without automatic `.env` loading and with a reduced environment.
167
+ - Patch application, moves, quarantine, restore, and command execution require interruptible approval.
168
+ - Every edit carries the digest observed during inspection; stale creates and updates fail closed.
169
+ - Existing file modes are preserved and successful replacements are published atomically.
170
+ - Unsafe state roots, protected workspace paths, files, and symlink targets are rejected before a run store is created.
171
+ - Environment values are not injected into prompts, diagnostics, or tool responses.
172
+ - Remote MCP output is bounded, schema-checked, treated as untrusted, and rejected on common prompt-injection directives.
173
+ - Network MCP always pauses for approval; custom read-only annotation trust must be explicit and injected by the host application.
174
+ - Subagent children inherit scope, workspace, cancellation, approval, and store policy while retaining independent budgets and fingerprints.
175
+ - OCI execution binds the durable run to the resolved image identity and enforced policy; resume fails if either changes.
176
+ - Snapshot discovery excludes secrets, Git internals, harness state, dependency trees, and build output. Dependencies may be mounted separately read-only.
177
+ - Untrusted commands receive a quota-backed tmpfs workspace, never a writable host bind; only successful, frozen, validated snapshots replace durable environment state.
178
+ - Container processes receive no provider credentials or arbitrary host environment values, and host changes require a separately approved digest-bound patch import.
179
+
180
+ The default `none` backend provides governance but no OS isolation and therefore exposes no shell-class tool. The local OCI backend enforces the documented container boundary, but it is not a VM or a managed hostile-code sandbox; use a dedicated host or microVM when the container runtime itself is outside the threat model.
181
+
@@ -0,0 +1,33 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "name": "HAR-HU-14-20-daily-cli-2026-09-20",
4
+ "provider": "openai",
5
+ "model": "gpt-5.6-luna",
6
+ "limits": { "maxSteps": 12, "maxInputTokens": 60000, "maxOutputTokens": 4096, "timeoutMs": 150000 },
7
+ "repositories": {
8
+ "harness": { "commit": "94bd3aba4ffeaa6b4dd922c0a61ebebda1814cb4", "url": "https://github.com/Zhivex/zhivex-harness" },
9
+ "sdk": { "commit": "65a4a7748c489978b45908a63a05be0e2e63497e", "url": "https://github.com/Zhivex/zhivex-ai-sdk" }
10
+ },
11
+ "policy": {
12
+ "attemptsPerArtifact": 1,
13
+ "baseline": "c7d0799018cb105f6d583b60b344d9697ae01395",
14
+ "correctness": "Read tasks require declared answer terms and no edits. Repair/feature tasks require independent oracle success, a changed target file and no other tracked edits. Runtime completion is recorded separately.",
15
+ "releaseDecision": "Go for bounded CLI pilot only if all 10 candidate tasks are independently correct, no unauthorized changes occur, and recovery/package gates pass. Otherwise hold 1.1 and prioritize observed friction.",
16
+ "development": "D01 and D02 exercise the driver separately. Evaluation task outputs must not be used to tune and rerun this cohort as fresh evidence.",
17
+ "billing": "Provider tokens where available; cost unknown without sourced dated pricing. No invented invoice or competitive parity claim."
18
+ },
19
+ "tasks": [
20
+ { "id": "D01", "split": "development", "repository": "harness", "kind": "read", "file": "src/version.ts", "prompt": "Read src/version.ts and report the exported version constant name.", "answerTerms": ["HARNESS_VERSION"] },
21
+ { "id": "D02", "split": "development", "repository": "sdk", "kind": "read", "file": "packages/core/src/http-retry.ts", "prompt": "Read packages/core/src/http-retry.ts and name its exported retry function.", "answerTerms": ["withResponseRetry"] },
22
+ { "id": "H01", "split": "evaluation", "repository": "harness", "kind": "read", "file": "src/package-manager.ts", "prompt": "Read src/package-manager.ts. Explain explicit package-manager selection versus lockfiles and the Bun check argv. Name both supported Bun lockfiles and the flag preventing env-file loading. Do not edit files.", "answerTerms": ["packageManager", "bun.lockb", "--no-env-file"] },
23
+ { "id": "H02", "split": "evaluation", "repository": "harness", "kind": "read", "file": "src/terminal-ui.ts", "prompt": "Read src/terminal-ui.ts. Explain terminal-control sanitization, the exact function name and why newline and tab remain readable. Do not edit files.", "answerTerms": ["sanitizeTerminalText", "newline", "tab"] },
24
+ { "id": "H03", "split": "evaluation", "repository": "harness", "kind": "repair", "file": "src/terminal-ui.ts", "seed": { "old": "value.replace(TERMINAL_CONTROL_CHARACTERS, escapeCodePoint)", "new": "value" }, "prompt": "Repair sanitizeTerminalText in src/terminal-ui.ts: it currently returns terminal controls unchanged. Escape ANSI/OSC introducers, C1 and bidi controls using the existing helpers while preserving newline/tab. Only edit this file. Read pilot-check.ts, reproduce with the pilot check, repair and run it again.", "oracle": "const m=await import('./src/terminal-ui.ts'); assert.equal(m.sanitizeTerminalText('a\\u001b[2J\\u202eb\\n\\t'), 'a\\\\u001b[2J\\\\u202eb\\n\\t'); assert.equal(m.sanitizeTerminalText('plain'), 'plain');" },
25
+ { "id": "H04", "split": "evaluation", "repository": "harness", "kind": "repair", "file": "src/package-manager.ts", "seed": { "old": "[\"bun\", \"--no-env-file\", \"run\", check]", "new": "[\"bun\", \"run\", check]" }, "prompt": "Repair src/package-manager.ts so approved Bun checks disable automatic env-file loading. Preserve other managers and expected-script validation. Only edit this file. Read pilot-check.ts, reproduce with pilot, fix and run pilot again.", "oracle": "const m=await import('./src/package-manager.ts'); const r=await m.resolvePackageCheckCommand(process.cwd(),{packageManager:'bun@1.4.0',scripts:{pilot:'bun run pilot-check.ts'}},'pilot','bun run pilot-check.ts',['pilot']); assert.deepEqual(r.command,['bun','--no-env-file','run','pilot']); await assert.rejects(()=>m.resolvePackageCheckCommand(process.cwd(),{packageManager:'bun@1.4.0',scripts:{pilot:'changed'}},'pilot','bun run pilot-check.ts',['pilot']));" },
26
+ { "id": "H05", "split": "evaluation", "repository": "harness", "kind": "feature", "file": "src/terminal-ui.ts", "prompt": "Add exported terminalSupportsHyperlinks(isTTY: boolean, env: Readonly<Record<string,string|undefined>> = process.env) to src/terminal-ui.ts. Return true only for a TTY, TERM not dumb, NO_COLOR absent, and TERM_PROGRAM equal to iTerm.app or WezTerm. Keep existing behavior unchanged. Only edit this file; read pilot-check.ts and run the pilot check.", "oracle": "const m=await import('./src/terminal-ui.ts'); assert.equal(typeof m.terminalSupportsHyperlinks,'function'); for(const p of ['iTerm.app','WezTerm'])assert.equal(m.terminalSupportsHyperlinks(true,{TERM_PROGRAM:p}),true); for(const [tty,env] of [[false,{TERM_PROGRAM:'WezTerm'}],[true,{TERM_PROGRAM:'WezTerm',TERM:'dumb'}],[true,{TERM_PROGRAM:'WezTerm',NO_COLOR:''}],[true,{}]])assert.equal(m.terminalSupportsHyperlinks(tty,env),false); assert.equal(m.sanitizeTerminalText('x\\u001b'),'x\\\\u001b');" },
27
+ { "id": "S01", "split": "evaluation", "repository": "sdk", "kind": "read", "file": "packages/core/src/response.ts", "prompt": "Read packages/core/src/response.ts. Report default speechBytes, transcriptionBytes and errorBodyBytes in bytes as decimal integers and name the exported resolver. Do not edit files.", "answerTerms": ["resolveAudioResponseLimits", "16777216", "4194304", "65536"] },
28
+ { "id": "S02", "split": "evaluation", "repository": "sdk", "kind": "read", "file": "packages/core/src/http-retry.ts", "prompt": "Read packages/core/src/http-retry.ts. Explain how numeric and HTTP-date Retry-After headers become delays. Include the identifiers retryAfterMs, Date.parse and ProviderHTTPError. Do not edit files.", "answerTerms": ["retryAfterMs", "Date.parse", "ProviderHTTPError"] },
29
+ { "id": "S03", "split": "evaluation", "repository": "sdk", "kind": "repair", "file": "packages/core/src/response.ts", "seed": { "old": "const DEFAULT_SPEECH_BYTES = 16 * MIB;", "new": "const DEFAULT_SPEECH_BYTES = 1 * MIB;" }, "prompt": "Restore the default speech response cap in packages/core/src/response.ts to 16 MiB, retaining explicit overrides and other default limits. Only edit this file. Read pilot-check.ts, reproduce with pilot, repair and run pilot again.", "oracle": "const m=await import('./packages/core/src/response.ts'); assert.equal(m.resolveAudioResponseLimits().speechBytes,16777216); assert.equal(m.resolveAudioResponseLimits({speechBytes:7}).speechBytes,7); assert.equal(m.resolveAudioResponseLimits().transcriptionBytes,4194304);" },
30
+ { "id": "S04", "split": "evaluation", "repository": "sdk", "kind": "repair", "file": "packages/core/src/response.ts", "seed": { "old": "resolved <= 0", "new": "resolved < 0" }, "prompt": "Repair positive-limit validation in packages/core/src/response.ts: zero must be rejected along with negatives, fractional and non-finite limits. Preserve positive safe integers. Only edit this file. Read pilot-check.ts, reproduce with pilot, fix and run it again.", "oracle": "const m=await import('./packages/core/src/response.ts'); for(const n of [0,-1,1.5,NaN,Infinity,Number.MAX_SAFE_INTEGER+1])assert.throws(()=>m.resolveAudioResponseLimits({speechBytes:n})); assert.equal(m.resolveAudioResponseLimits({speechBytes:1}).speechBytes,1);" },
31
+ { "id": "S05", "split": "evaluation", "repository": "sdk", "kind": "feature", "file": "packages/core/src/http-retry.ts", "prompt": "Add exported isRetryableHttpStatus(status: number): boolean to packages/core/src/http-retry.ts, returning true exactly for integer 408, 429 and 500 through 599 inclusive. Reject all other numbers including fractions, NaN and Infinity. Preserve withResponseRetry. Only edit this file; read pilot-check.ts and run pilot.", "oracle": "const m=await import('./packages/core/src/http-retry.ts'); assert.equal(typeof m.isRetryableHttpStatus,'function'); for(const n of [408,429,500,503,599])assert.equal(m.isRetryableHttpStatus(n),true); for(const n of [200,400,404,499,600,500.5,NaN,Infinity])assert.equal(m.isRetryableHttpStatus(n),false); assert.equal(typeof m.withResponseRetry,'function');" }
32
+ ]
33
+ }
@@ -16,7 +16,9 @@
16
16
  "v1.0.0-rc.12",
17
17
  "v1.0.0-rc.13",
18
18
  "v1.0.0-rc.14",
19
- "v1.0.0"
19
+ "v1.0.0",
20
+ "v1.1.0-rc.1",
21
+ "v1.1.0-rc.2"
20
22
  ],
21
23
  "expectedModels": [
22
24
  {
@@ -138,6 +140,22 @@
138
140
  "qwen": "qwen3.8-max",
139
141
  "openai": "gpt-5.6-luna"
140
142
  }
143
+ },
144
+ {
145
+ "releaseTag": "v1.1.0-rc.1",
146
+ "models": {
147
+ "meta": "muse-spark-1.2",
148
+ "qwen": "qwen3.8-max",
149
+ "openai": "gpt-5.6-luna"
150
+ }
151
+ },
152
+ {
153
+ "releaseTag": "v1.1.0-rc.2",
154
+ "models": {
155
+ "meta": "muse-spark-1.2",
156
+ "qwen": "qwen3.8-max",
157
+ "openai": "gpt-5.6-luna"
158
+ }
141
159
  }
142
160
  ],
143
161
  "expectedCases": [
@@ -0,0 +1,26 @@
1
+ # Examples for Zhivex Harness 1.0
2
+
3
+ ## Isolated Bun installation
4
+
5
+ Requirements: Bun 1.4.0+, Node.js 22.13.0+, and Git on macOS or Linux. This installs the published stable artifact in a temporary consumer, without building the source checkout or changing global tools:
6
+
7
+ ```bash
8
+ harness_demo_dir=$(mktemp -d)
9
+ cd "$harness_demo_dir"
10
+ printf '{"name":"harness-first-run","private":true}\n' > package.json
11
+ bun add --exact --ignore-scripts @zhivex-ai/harness@1.0.0
12
+ ./node_modules/.bin/zhx --version
13
+ ./node_modules/.bin/zhx --help
14
+ ./node_modules/.bin/zhx doctor --provider openai --json
15
+ ```
16
+
17
+ Version must print `1.0.0`; help lists commands. Doctor does not contact a provider. Without `OPENAI_API_KEY`, it reports the missing credential and exits with code `3`; inspect the JSON checks before proceeding. A directory without Git initialization can also produce a diagnostic warning. No paid model call is required for these checks. Both `zhx` and `zhivex-harness` are installed aliases; Bun manages installation, and their shebang runs Node.
18
+
19
+ To continue in your actual project, use the [global installation and credential setup](../README.md#installation), then `zhx init --profile daily --provider openai` and `zhx doctor --profile daily`. Real tasks require the selected provider credential in the process environment. Profiles store provider/model choices, never credentials. See [CLI](../docs/CLI.md) and [support](../SUPPORT.md).
20
+
21
+ ## Configuration and change examples
22
+
23
+ - [MCP configuration](./mcp-config.json): optional bounded network MCP integration; see [extensibility](../docs/EXTENSIBILITY.md).
24
+ - [Change envelope input](./change-envelope-input.json) and [patch](./change.patch): illustrative data for [change envelopes](../docs/CHANGE_ENVELOPES.md). Digests and timestamps are sample evidence, not certification of a current workspace; generate fresh evidence for real changes.
25
+
26
+ Earlier versions and RC evidence belong to the [changelog](../CHANGELOG.md) and [historical reports](https://github.com/Zhivex/zhivex-harness/blob/main/docs/reports/README.md), not the first-run installation path.
@@ -0,0 +1,3 @@
1
+ import { expect, test } from "bun:test";
2
+ import { greeting } from "./greeting";
3
+ test("greets a person", () => expect(greeting("Ada")).toBe("Hello, Ada!"));
@@ -0,0 +1 @@
1
+ export const greeting = (name: string) => `Hello, ${name}!`;
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "harness-first-use-example",
3
+ "private": true,
4
+ "type": "module",
5
+ "packageManager": "bun@1.4.0",
6
+ "scripts": { "test": "bun test" }
7
+ }