@zhivex-ai/harness 1.3.0 → 1.4.0-rc.1

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 (56) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +11 -8
  3. package/SECURITY.md +1 -1
  4. package/SUPPORT.md +2 -2
  5. package/contracts/engine-api.json +50 -0
  6. package/contracts/public-api.json +162 -0
  7. package/contracts/stable-api-signatures.json +9 -9
  8. package/dist/acp-cli.js +36 -10
  9. package/dist/cli/arguments.d.ts +5 -1
  10. package/dist/cli/memory.d.ts +2 -0
  11. package/dist/{cli-entry-1gfg3brj.js → cli-entry-0c8vd42w.js} +725 -388
  12. package/dist/{cli-entry-bx3vjw7h.js → cli-entry-645q3vwx.js} +29 -3
  13. package/dist/{cli-etsmtst3.js → cli-mejgq79m.js} +94 -6
  14. package/dist/cli.js +2 -2
  15. package/dist/compat/cli-options.d.ts +12 -1
  16. package/dist/compat/code-support.js +2 -2
  17. package/dist/context/project-memory-context.d.ts +6 -0
  18. package/dist/engine/acp.js +6 -6
  19. package/dist/engine/client.js +5 -5
  20. package/dist/engine/desktop-state-v1.js +3 -3
  21. package/dist/engine/index.d.ts +4 -0
  22. package/dist/engine/index.js +85 -8
  23. package/dist/engine/mcp-stdio-v1.js +2 -2
  24. package/dist/engine/service.js +6 -6
  25. package/dist/hostile-repository-demo.js +1019 -696
  26. package/dist/{index-hnaxfpb5.js → index-4nf70nq1.js} +53 -6
  27. package/dist/{index-h0mqx2ed.js → index-aqe7236b.js} +279 -2
  28. package/dist/{index-42gp2hy8.js → index-ds5e9x3a.js} +1 -1
  29. package/dist/{index-azmwjp95.js → index-fm6ahk8m.js} +3 -2
  30. package/dist/{index-8zzhggxv.js → index-g0wfcb65.js} +1 -1
  31. package/dist/{index-a97bezbz.js → index-hwff3qx5.js} +10 -4
  32. package/dist/{index-6m08wvab.js → index-ma9a5re7.js} +1 -1
  33. package/dist/{index-w2sj0wkw.js → index-n86069yc.js} +2 -2
  34. package/dist/{index-2jrdcj6b.js → index-wq2tax80.js} +15 -1
  35. package/dist/index.js +8 -8
  36. package/dist/persistence/project-memory-command.d.ts +11 -0
  37. package/dist/persistence/project-memory.d.ts +109 -0
  38. package/dist/persistence/sessions.d.ts +4 -0
  39. package/dist/runtime/harness.d.ts +4 -0
  40. package/dist/service-cli.js +6 -6
  41. package/dist/{service-client-cli-3365rfav.js → service-client-cli-2ye331s3.js} +2 -2
  42. package/dist/verify-historical-migrations.js +716 -392
  43. package/dist/zhx.js +2 -2
  44. package/docs/CLI.md +4 -0
  45. package/docs/CODE_RELEASE.md +57 -17
  46. package/docs/CONTEXT_ENGINEERING.md +2 -0
  47. package/docs/DURABLE_OPERATIONS.md +2 -0
  48. package/docs/ENGINE_API.md +11 -7
  49. package/docs/FIRST_USE.md +6 -6
  50. package/docs/PROJECT_MEMORY.md +157 -0
  51. package/docs/README.md +2 -0
  52. package/docs/STABILITY.md +1 -1
  53. package/docs/WORKSPACE_CHECKPOINTS.md +11 -1
  54. package/evaluations/representative-assembly-matrix.json +10 -1
  55. package/examples/README.md +4 -4
  56. package/package.json +3 -2
package/dist/zhx.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  HARNESS_VERSION,
4
4
  shortCliHelp
5
- } from "./cli-entry-bx3vjw7h.js";
5
+ } from "./cli-entry-645q3vwx.js";
6
6
  import {
7
7
  __require
8
8
  } from "./cli-entry-1bx83sw4.js";
@@ -16,6 +16,6 @@ if (argv.length === 1 && ["--version", "-v", "version"].includes(argv[0])) {
16
16
  process.stdout.write(`${shortCliHelp(HARNESS_VERSION)}
17
17
  `);
18
18
  } else {
19
- const { runCli } = await import("./cli-etsmtst3.js");
19
+ const { runCli } = await import("./cli-mejgq79m.js");
20
20
  await runCli(argv);
21
21
  }
package/docs/CLI.md CHANGED
@@ -795,3 +795,7 @@ An envelope link matches the recorded patch identifier; envelope integrity and
795
795
  expiry are checked separately. Patch bytes and producer authenticity remain
796
796
  unverified. No envelope v1 fields are added. Concurrent source changes and hard
797
797
  capacity limits reject export; bounded tree/history truncation is reported.
798
+
799
+ ## Experimental project memory (unreleased)
800
+
801
+ `zhx memory` supports `remember`, `list`, `read`, `update`, `forget`, `suggest`, `accept`, `context`, `clear`, `enable` and `disable`. Content is one quoted argument. Updates, acceptance and forgetting require the current revision. `--source` supplies a provenance label; `--no-memory` disables curated retrieval and SDK memory loading/capture for a local run/chat/resume invocation. Existing workspace/tenant/user/namespace flags select scope. See [Project memory](PROJECT_MEMORY.md) for bounds, review, deletion semantics and next-release pairing.
@@ -1,47 +1,87 @@
1
1
  # Code release procedure
2
2
 
3
- Code is released independently of Harness. The prepared stable release is
3
+ ## Current RC preparation: 2026-10-04
4
+
5
+ This checkout prepares Harness `1.4.0-rc.1` and Code `0.3.0-rc.1`, both on
6
+ `next`, with Code pinned exactly to the Harness candidate. npm currently reports
7
+ Harness `1.3.0` and Code `0.2.0` on `latest`; those stable tags must not move.
8
+ The candidates are not published. Review and integrate the preparation PR, then
9
+ require the latest successful `ci.yml`, `codeql.yml`, `code-journey.yml` and
10
+ `web.yml` main-push runs for the exact release SHA, including the separate CodeQL
11
+ security result. Run Harness's existing preparation and protected release workflow
12
+ for annotated `v1.4.0-rc.1` with `channel=next`. Its exact-artifact, OCI, live and
13
+ representative gates remain mandatory. Paid certification requires separate
14
+ campaign approval. After Harness registry integrity and provenance verification,
15
+ run Code's protected OIDC workflow at annotated `code-v0.3.0-rc.1` on the same SHA,
16
+ with `channel=next`, `mode=oidc` and publication confirmation. Code must resolve
17
+ the real published engine without overrides and pass retained-artifact terminal
18
+ and web acceptance, four-manager checks and provenance verification. Keep stable
19
+ `latest` unchanged. The older publication records below are historical.
20
+
21
+
22
+ Code is released independently of Harness. The verified stable release is
4
23
  `@zhivex-ai/code@0.1.0`, with the sole binary `zhivex-code`, npm tag `latest`,
5
- and the exact dependency `@zhivex-ai/harness@1.3.0`. Harness must first be
6
- published and verified through its protected release workflow. Code RC2 is
7
- already published on `next` and RC1 is still on `latest`; trusted
8
- publishing succeeded in [run 36902929707](https://github.com/Zhivex/zhivex-harness/actions/runs/36902929707).
9
- The stable release uses that existing OIDC path; no new credentials or publisher
10
- configuration are part of preparation. This document records preparation, not
11
- successful stable publication.
24
+ and the exact dependency `@zhivex-ai/harness@1.3.0`. Harness was published and
25
+ verified first in [run 37031040747](https://github.com/Zhivex/zhivex-harness/actions/runs/37031040747). Code passed real registry
26
+ resolution, four-manager installed acceptance and source-bound provenance in
27
+ [run 37036369187](https://github.com/Zhivex/zhivex-harness/actions/runs/37036369187) at `aa86de8d700f893253559b00c1f7191e7dab48b9`.
28
+ Attempt 1 accepted publication but failed while registry metadata still reported
29
+ the version absent. Attempt 2 recovered only the failed publish job using the
30
+ retained artifact; identical bytes skipped npm publication and verification passed.
31
+ Code RC2 remains on `next`; RC1 is historical. The existing OIDC publisher and
32
+ protected environment were preserved. See [publication evidence](https://github.com/Zhivex/zhivex-harness/blob/main/docs/reports/evidence/stable-publication-2026-10-02.json).
33
+
34
+ ## Code 0.2.0 candidate
35
+
36
+ This checkout prepares `@zhivex-ai/code@0.2.0` with the same exact published
37
+ Harness `1.3.0` dependency. Code `0.1.0` remains the verified npm `latest` release
38
+ until a separately approved publication succeeds. The candidate adds guided
39
+ approval diffs, reviewed checkpoints, per-run estimated budgets and the offline
40
+ first-use tutorial. See the [candidate changelog](https://github.com/Zhivex/zhivex-harness/blob/main/packages/code/CHANGELOG.md)
41
+ and [release readiness](https://github.com/Zhivex/zhivex-harness/blob/main/docs/reports/CODE_0_2_0_READINESS_2026-10-03.md).
42
+
43
+ This is a Code-only release: no Harness version change or new paid six-provider
44
+ certification campaign is required. Engine API tiers and provisional provider
45
+ support remain unchanged; estimated budgets are not guaranteed financial caps.
12
46
 
13
47
  ## Release preparation
14
48
 
15
49
  1. Merge the Code release PR after required review and successful checks.
16
- 2. Wait for the latest `ci.yml` and `codeql.yml` **push runs on main** to succeed
50
+ 2. Wait for the latest `ci.yml`, `codeql.yml` and `code-journey.yml` **push runs on main** to succeed
17
51
  for the exact commit. Keep the Code manifest, version and engine pin unchanged
18
52
  after selecting that commit.
19
53
  3. Wait for Harness `1.3.0` publication and successful registry/provenance
20
54
  verification as ordered in [the Harness release procedure](https://github.com/Zhivex/zhivex-harness/blob/main/docs/RELEASE.md).
21
55
  From a clean checkout of that main commit, create an annotated
22
- `code-v0.1.0` tag and push it. Never move or overwrite release tags.
56
+ `code-v0.2.0` tag and push it. Never move or overwrite release tags.
23
57
  4. Dispatch `release-code.yml` **at that tag**, with input `tag` matching it and
24
58
  `channel=latest`, `mode=oidc`, and `confirm_publication=true`. Dispatching
25
59
  main while supplying a different tag is rejected.
26
60
 
27
61
  ```sh
28
- gh workflow run release-code.yml --ref code-v0.1.0 \
29
- -f tag=code-v0.1.0 -f channel=latest -f mode=oidc -f confirm_publication=true
62
+ gh workflow run release-code.yml --ref code-v0.2.0 \
63
+ -f tag=code-v0.2.0 -f channel=latest -f mode=oidc -f confirm_publication=true
30
64
  ```
31
65
 
32
- The workflow validates tag identity, main ancestry, exact CI/CodeQL, Code source
66
+ The workflow validates tag identity, main ancestry, exact CI/CodeQL/installed journeys, Code source
33
67
  and package boundaries. It downloads the pinned Harness version from npm and
34
68
  verifies its integrity and SLSA artifact/workflow/tag/source binding; missing
35
69
  publication or provenance stops the release.
36
- It builds Code once, inspects package contents, installs it against the actual
70
+ It builds Code once, admits only metadata, flat built JavaScript and the two
71
+ named tutorial modules, and installs it against the actual
37
72
  registry dependency without overrides, and tests the retained Code and Harness
38
73
  artifacts with npm, pnpm, Yarn and Bun. The paired matrix uses explicit engine
39
74
  artifact overrides; the separate standalone installation proves npm resolution.
40
- This does not claim every future engine version or installation order is certified.
75
+ The retained Code tarball also passes offline installed PTY journeys without
76
+ repacking. The separate `code-journey.yml` workflow runs on every PR and main
77
+ push on Linux/macOS with Node 22.13.0/24, retaining the tested tarball, digest,
78
+ report and transcript. Removing path filters ensures each selected main SHA can
79
+ produce its own journey evidence. This does not claim every future engine
80
+ version or installation order is certified.
41
81
 
42
82
  The workflow generates genuine npm/Sigstore provenance using pinned npm 11.6.1
43
83
  inside the GitHub-hosted build job. It retains `code.tgz`, `code.sigstore.json`,
44
- `SHA512SUMS`, and installed acceptance in `code-release-<full-source-sha>`.
84
+ `SHA512SUMS`, installed acceptance, and the offline PTY report/transcript in `code-release-<full-source-sha>`.
45
85
  Bootstrap mode **does not publish**. No npm token is copied into GitHub.
46
86
 
47
87
  ## Historical first publication / future package bootstrap
@@ -64,7 +104,7 @@ commit SHA. Install npm 11.6.1 into an isolated tools directory and set
64
104
  ```sh
65
105
  (cd release-code-artifacts && shasum -a 512 -c SHA512SUMS)
66
106
  bun run scripts/code-release.ts inspect release-code-artifacts/code.tgz
67
- CODE_EXPECTED_SHA="$(git rev-list -n 1 code-v0.1.0)" \
107
+ CODE_EXPECTED_SHA="$(git rev-list -n 1 code-v0.2.0)" \
68
108
  node scripts/code-bootstrap-provenance.cjs verify \
69
109
  release-code-artifacts/code.tgz release-code-artifacts/code.sigstore.json
70
110
  node "$CODE_PROVENANCE_NPM_ROOT/bin/npm-cli.js" publish \
@@ -426,3 +426,5 @@ that `endLine` is an absolute line number, not a count. The runtime does not
426
426
  execute, rename or silently repair malformed calls. Durable error receipts stay
427
427
  unchanged; the model must issue a corrected request, and edits still require
428
428
  current read evidence and approval.
429
+
430
+ Project memory is a separate kind of explicit operator context in the existing durable memory table. It is projected per request as untrusted data, with revision-based review and hard byte/entry budgets. It does not become project instructions or skills. See [Project memory](PROJECT_MEMORY.md).
@@ -218,3 +218,5 @@ To disable cumulative token ceilings explicitly, use `--no-token-budget` (librar
218
218
  through resume. Token accounting and compaction continue; cost, time, steps, tools,
219
219
  approvals, and provider per-request limits remain enforced. Stored numeric token
220
220
  ceilings are inactive until `unlimitedTokens` is set back to `false`.
221
+
222
+ Next-version [project memory](PROJECT_MEMORY.md) reuses the existing SDK memory table and state export records. Historical state is not harvested into curated memory. Forget/clear remove current memory content, while backups, run histories and SQLite WAL retention remain separate. Older importers reject the new reserved memory key safely.
@@ -1,9 +1,9 @@
1
1
  # Engine API and Code integration
2
2
 
3
3
  This checkout adds terminal-independent package entrypoints for
4
- Harness 1.3.0 (prepared for `latest`). They are not present in the previously published Harness 1.2.0.
5
- Stable 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
4
+ Harness 1.3.0 (published and verified on `latest`). They are not present in the previously published Harness 1.2.0.
5
+ The protected workflow validated the exact stable tarball, live gates and
6
+ registry integrity/provenance; local candidate smoke remains contributor evidence. Do not install registry 1.2.0 and
7
7
  expect the new entrypoints to exist.
8
8
 
9
9
  ## Entry points
@@ -68,9 +68,9 @@ switching presentation does not migrate state or authorize new effects.
68
68
  ## Terminal product
69
69
 
70
70
  `packages/code` is the independently built terminal product. Its current version
71
- is `0.1.0`, prepared for independent publication to `latest` with the exact
72
- engine dependency `@zhivex-ai/harness@1.3.0`. Publication remains gated by
73
- reviewed main, CI and registry evidence in the [Code release procedure](CODE_RELEASE.md).
71
+ is `0.1.0`, independently published and verified on `latest` with the exact
72
+ engine dependency `@zhivex-ai/harness@1.3.0`. Reviewed main, CI and registry
73
+ evidence are recorded in the [Code release procedure](CODE_RELEASE.md).
74
74
  Code imports declared package APIs, never Harness source paths. Its build leaves
75
75
  Harness external.
76
76
 
@@ -115,7 +115,7 @@ The new subpaths were introduced after RC3 and are published in RC7. Stable
115
115
  1.3.0 retains their declared tiers.
116
116
  Desktop migration and packaged acceptance are documented in
117
117
  the repository-only report `docs/reports/HAR_HU_39_2026-09-29.md`. Its dependency is pinned to the
118
- exact prepared engine version and checked for required contracts/artifact identity; this does
118
+ exact engine version and checked for required contracts/artifact identity; this does
119
119
  not claim compatibility with the earlier published RC3 bytes or a broader range.
120
120
 
121
121
  ```sh
@@ -318,3 +318,7 @@ input/output/cache tokens and terminal completion for the current invocation.
318
318
  It retains at most 128 requests plus an omitted count and contains no prompt or
319
319
  result text. Missing usage is null, including an interrupted paid request; these
320
320
  measurements do not claim invoice accuracy or provider tokenizer equivalence.
321
+
322
+ ## Experimental project memory
323
+
324
+ The `/engine` surface exports `openHarnessProjectMemory`, `executeHarnessMemoryCommand`, `HARNESS_MEMORY_COMMANDS`, `HARNESS_PROJECT_MEMORY_SCHEMA_VERSION`, `HARNESS_PROJECT_MEMORY_LIMITS` and their memory types. `createHarness` accepts the experimental `projectMemory: true` host opt-in option. These additions use existing local persistence; no client protocol change is required. See [Project memory](PROJECT_MEMORY.md) for contracts and release implications.
package/docs/FIRST_USE.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # First use
2
2
 
3
- This guide targets the prepared stable `1.3.0` release. These exact-version commands become available after protected publication to npm `latest`; currently latest resolves to 1.2.0.
3
+ This guide targets candidate `1.4.0-rc.1`, pending publication to npm `next`. The versioned install commands below become available only after protected publication. npm `latest` remains stable 1.3.0.
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.3.0
10
+ npm install -g @zhivex-ai/harness@1.4.0-rc.1
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.3.0
85
+ bun add --global @zhivex-ai/harness@1.4.0-rc.1
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.3.0 --version
93
- bunx @zhivex-ai/harness@1.3.0 --help
94
- bunx @zhivex-ai/harness@1.3.0 doctor
92
+ bunx @zhivex-ai/harness@1.4.0-rc.1 --version
93
+ bunx @zhivex-ai/harness@1.4.0-rc.1 --help
94
+ bunx @zhivex-ai/harness@1.4.0-rc.1 doctor
95
95
  ```
96
96
 
97
97
  For source development, use the [contributor guide](https://github.com/Zhivex/zhivex-harness/blob/main/CONTRIBUTING.md).
@@ -0,0 +1,157 @@
1
+ # Project memory (experimental, RC candidate)
2
+
3
+ Project memory keeps explicit operator notes across separate sessions. It is
4
+ local, inspectable and correctable. No provider calls, external database,
5
+ credentials or integrations are needed to manage it. Suggestions are never
6
+ generated automatically; hosts may submit a suggestion for operator review.
7
+
8
+ ## CLI
9
+
10
+ Use `zhx` or `zhivex-code` with Harness 1.4.0-rc.1 (Code 0.3.0-rc.1), pending publication. Commands
11
+ print bounded JSON, including the selected workspace/scope hashes. Quote content
12
+ as one argument. Memory commands do not start a model or read credentials.
13
+
14
+ ```sh
15
+ zhx memory remember "Database migrations use SQLite" --source "Operator decision"
16
+ zhx memory list
17
+ zhx memory read <id>
18
+ zhx memory update <id> <revision> "Database migrations need explicit review"
19
+ zhx memory forget <id> <revision>
20
+ zhx memory suggest "Candidate database convention" --source "Model suggestion, reviewed separately"
21
+ zhx memory read <suggestion-id>
22
+ zhx memory accept <suggestion-id> <reviewed-revision>
23
+ zhx memory context "database migrations"
24
+ zhx memory disable
25
+ zhx memory enable
26
+ zhx memory clear
27
+ zhx run --no-memory "Inspect database migrations"
28
+ ```
29
+
30
+ `remember` and `update` are explicit operator writes. `suggest` creates a pending
31
+ record; editing it leaves it pending. `accept` requires the exact revision that
32
+ the operator reviewed. No model tool can remember, update, accept or forget a
33
+ record. Host applications must keep these write operations behind their own
34
+ operator interface; an API call is not proof of human consent. `--source` is a
35
+ user-supplied provenance label, not a verified citation or execution receipt.
36
+ Records retain origin, creation/update/review timestamps and revision. API writes
37
+ can specify `expiresAt`; expired entries remain inspectable but are not retrieved.
38
+
39
+ `disable` persists opt-out for this project and scope and blocks writes/acceptance.
40
+ Read, list, forget and clear remain available. `clear` removes all pending and
41
+ accepted entries while preserving the opt-out setting. `--no-memory` disables
42
+ curated retrieval and SDK memory loading/capture for one local run/chat/resume
43
+ invocation. It does not remove messages already in a resumed run's history.
44
+ Service mode does not accept this flag: the service host owns runtime configuration.
45
+
46
+ ## Scope and bounds
47
+
48
+ Scope always includes the canonical workspace directory and the existing
49
+ tenant/user/namespace fields. Existing `--workspace`, `--state-dir`, `--tenant`,
50
+ `--user` and `--namespace` flags select it explicitly. The default namespace is
51
+ already workspace-derived. Even with a shared state directory and the same
52
+ explicit namespace, separate workspace directories remain isolated. A renamed
53
+ or copied project gets a different binding; there is no automatic merge, global
54
+ scope, Git-remote identity inference or cross-user permission inference. Directory
55
+ symlink aliases of the same canonical workspace use the same project. These
56
+ scope labels are host-owned selectors, not authentication: users with access to
57
+ the same OS-owned database can edit it directly.
58
+
59
+ | Bound | Limit |
60
+ | --- | --- |
61
+ | Accepted and pending entries together | 128 |
62
+ | Entry content | 4,096 UTF-8 bytes |
63
+ | Provenance label | 512 UTF-8 bytes |
64
+ | Current document | 256 KiB |
65
+ | Retrieved entries per model request | 3 |
66
+ | Complete rendered context, including metadata | 6,000 UTF-8 bytes |
67
+ | Freshness review interval | 30 days |
68
+
69
+ Retrieval ranks literal, case-insensitive query terms against content; ties use
70
+ update time and ID. It has no embeddings or semantic recall guarantee. Short
71
+ terms and a small English stop list are ignored. Only matching accepted entries
72
+ are selected. Entire entries that exceed the remaining budget are skipped.
73
+ `memory context "query"` exposes exactly that projection and its byte count.
74
+ Stale entries are labelled; expiry excludes them. Updating a reviewed entry
75
+ refreshes its review time. Byte limits are hard bounds, not exact model token
76
+ counts; the existing overall runtime token budget still applies. Empty memory
77
+ adds no model context.
78
+
79
+ ## Engine API and trust boundary
80
+
81
+ ```ts
82
+ import { openHarnessProjectMemory } from "@zhivex-ai/harness/engine";
83
+ const memory = await openHarnessProjectMemory({ workspace, stateDirectory, scope });
84
+ try {
85
+ const note = memory.remember({ content: "Use reviewed migrations", source: "Operator" });
86
+ memory.update(note.id, note.revision, { content: "Review SQLite migrations", source: "Operator correction" });
87
+ console.log(memory.list(), memory.retrieve("SQLite migrations"));
88
+ } finally { memory.close(); }
89
+ ```
90
+
91
+ `openHarnessProjectMemory`, its types, constants and the host command dispatcher
92
+ are experimental `/engine` additions. No client protocol commands or remote
93
+ service endpoints are added. Local CLI hosts explicitly enable curated project memory and project relevant
94
+ notes on every model request, including resumed runs. Engine hosts opt in with
95
+ `createHarness({ projectMemory: true, ... })`. Omitting the option preserves the
96
+ historical SDK memory integration and opens no curated store. Explicit `false`
97
+ disables both curated and SDK memory, including caller-supplied `memory`.
98
+ These rules also apply to caller-supplied run stores. With `true` or omission,
99
+ caller-supplied SDK `memory` remains an explicit host integration.
100
+
101
+ Memory reaches the model in a labelled user-context message before the current
102
+ user request, never as system instructions. The projection is ephemeral and is
103
+ not appended to durable run messages. It cannot grant approvals, change execution
104
+ or filesystem permissions, bypass tool policy, certify checks, or create skills.
105
+ Runtime approval checks still apply even when a remembered note claims authority.
106
+ This is an enforced separation of permission state; a model can still be influenced
107
+ by malicious text and must not be assumed immune to prompt injection.
108
+
109
+ Only explicit content is persisted. Tool output, repository files, conversation
110
+ summaries and model responses are not silently converted into curated memory.
111
+ Known secret patterns are rejected and the existing host secret guard still
112
+ applies. Pattern checks are best effort: they can miss secrets or reject innocent
113
+ text. Do not store credentials or private material you do not want retained.
114
+
115
+ ## Storage, deletion and compatibility
116
+
117
+ Memory reuses `operations.sqlite` and the SDK's existing `zhivex_agent_memory`
118
+ table with a fully project/scope-bound key outside the SDK's scoped run/agent key
119
+ namespace. Its leading colon cannot match a nonempty URI-encoded SDK namespace,
120
+ regardless of the run or agent ID. A versioned envelope in the existing row format
121
+ holds current records and the enabled setting. There is no
122
+ second memory database or vector store. File-backed run hosts use the same SQLite
123
+ state index that already serves sessions. Writes use SQLite transactions and
124
+ expected revisions so concurrent edits cannot silently replace newer records.
125
+
126
+ Forget and clear remove content from the active row; earlier revisions and
127
+ deleted-content tombstones are not retained by this feature. SQLite secure-delete
128
+ is enabled for writes, but WAL pages, filesystem snapshots and previous backups
129
+ can still retain bytes. This is not forensic erasure. Existing run histories,
130
+ legacy SDK memory rows, exported state, host logs and model/provider transcripts
131
+ have separate retention. If a model quotes a memory in its response, that quote
132
+ may enter run history. Deleting a memory does not rewrite those histories.
133
+ Explicitly importing an older backup can restore a previously forgotten note.
134
+
135
+ New state exports include the bound project document using the existing memory
136
+ record shape. Imports validate the envelope/binding, preserve opt-out, and reject
137
+ different destination content; identical imports remain idempotent. Historical
138
+ v1 backups without project memory still import. Older importers reject a backup
139
+ with the new reserved record because it is not a run-bound SDK memory record;
140
+ use the next-version engine to restore such backups. Whole-database host snapshots
141
+ already include the row. There is no configuration or SQL table schema migration.
142
+
143
+ Legacy automatic last-assistant SDK records are not promoted into curated memory.
144
+ The stable engine default preserves its historical SDK memory integration.
145
+ Explicit curated mode, including local CLI hosts, stops automatic last-assistant
146
+ capture; caller-provided SDK memory remains supported unless memory is explicitly
147
+ disabled. The API additions can ship in a future Harness minor release with a
148
+ matched next Code release and
149
+ updated exact engine dependency. Any broader removal of the stable SDK memory
150
+ default would require a major release under [API stability](STABILITY.md). Candidate package versions remain Harness
151
+ 1.3.0 / Code 0.2.0 for development only: they are not publishable replacements for
152
+ the already released artifacts. Release preparation must select new versions,
153
+ update the Code pin and rerun the release gates. Nothing in this change publishes
154
+ a version.
155
+
156
+ No terminal layout, menu or visual design changes are included. A future `/memory`
157
+ console flow needs coordination with the separate TUI audit/proposals task.
package/docs/README.md CHANGED
@@ -40,3 +40,5 @@ Primary guides are maintained in English. Historical reports preserve their orig
40
40
  language and evidence. Maintainer procedures and reports remain in the repository
41
41
  and are excluded from the npm package. Published validation applies to the exact
42
42
  release artifact, not automatically to later source changes.
43
+
44
+ - [Project memory](PROJECT_MEMORY.md): experimental explicit notes, review, retrieval budgets and deletion semantics.
package/docs/STABILITY.md CHANGED
@@ -4,7 +4,7 @@ The additive [engine entrypoints](ENGINE_API.md) are enumerated in
4
4
  [`../contracts/engine-api.json`](../contracts/engine-api.json). Aliases preserve
5
5
  their existing root tiers; newly exposed helpers have explicit tiers. The root
6
6
  compatibility surface remains unchanged. These entrypoints are source changes
7
- for the prepared 1.3.0 release and are available in the published RC7; they are absent from registry 1.2.0. Stable package numbering does not upgrade any export tier.
7
+ for the published 1.3.0 release and were available in the published RC7; they are absent from registry 1.2.0. Stable package numbering does not upgrade any export tier.
8
8
 
9
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.
10
10
 
@@ -24,4 +24,14 @@ After interruption in `applying`, retry checks every captured file. If all have
24
24
 
25
25
  There is no single transaction spanning SQLite and filesystem updates. Journaling exposes that boundary and makes recovery conservative. An interrupted partial filesystem update is detected, not automatically rolled back.
26
26
 
27
- Snapshot storage is bounded to 100 records per workspace/scope (captures and restores combined), 2 MiB per record. There is currently no automatic eviction or checkpoint deletion API. Portable state export/import preserves captures and completed restore records with workspace/scope and conversation lineage validation. Unfinished restore operations block export and import because their filesystem recovery state and reviewed authorization are local to the original database. Older bundles without checkpoint records remain readable. Close the checkpoint store before state maintenance or update operations.
27
+ ## Reviewed retention
28
+
29
+ Snapshot storage is bounded to 100 records per workspace/scope (captures and restores combined), 2 MiB per record. There is no automatic eviction. The existing host API supports explicit reviewed removal of stored checkpoint records and completed restore records:
30
+
31
+ 1. Call `prepareRetention({ checkpointIds, completedRestoreIds })` with the exact selected record IDs. It returns the normalized `selection`, affected `records`, record counts, serialized bytes removed and a `planId` bound to the complete scoped inventory.
32
+ 2. Present that plan to the operator and enforce explicit review in the integrating host. Possession of the plan ID does not itself grant authorization.
33
+ 3. Call `applyRetention(plan.selection, plan.planId)` to revalidate the inventory and remove the reviewed records in one SQLite transaction under the workspace mutation lock.
34
+
35
+ Pending or unknown restore evidence cannot be removed. A checkpoint referenced by a retained restore operation cannot be removed; completed referencing operations must be included in the reviewed selection or removed first. Inventory changes invalidate the plan, and a failure rolls back the entire selected database removal. Retention changes neither workspace files nor conversation sessions. It does not provide general filesystem deletion or repository rollback.
36
+
37
+ Portable state export/import preserves captures and completed restore records with workspace/scope and conversation lineage validation. Unfinished restore operations block export and import because their filesystem recovery state and reviewed authorization are local to the original database. Older bundles without checkpoint records remain readable. Close the checkpoint store before state maintenance or update operations.
@@ -53,7 +53,8 @@
53
53
  "v1.3.0-rc.5",
54
54
  "v1.3.0-rc.6",
55
55
  "v1.3.0-rc.7",
56
- "v1.3.0"
56
+ "v1.3.0",
57
+ "v1.4.0-rc.1"
57
58
  ],
58
59
  "expectedModels": [
59
60
  {
@@ -471,6 +472,14 @@
471
472
  "qwen": "qwen3.8-flash",
472
473
  "openai": "gpt-6-luna"
473
474
  }
475
+ },
476
+ {
477
+ "releaseTag": "v1.4.0-rc.1",
478
+ "models": {
479
+ "meta": "muse-spark-1.3-contributor",
480
+ "qwen": "qwen3.8-flash",
481
+ "openai": "gpt-6-luna"
482
+ }
474
483
  }
475
484
  ],
476
485
  "expectedCases": [
@@ -1,20 +1,20 @@
1
- # Examples for Zhivex Harness 1.2
1
+ # Examples for Zhivex Harness 1.3
2
2
 
3
3
  ## Isolated Bun installation
4
4
 
5
- Requirements: Bun 1.4.0+, Node.js 22.13.0+, and Git on macOS or Linux. After protected 1.3.0 publication, this installs the stable artifact in a temporary consumer, without building the source checkout or changing global tools:
5
+ Requirements: Bun 1.4.0+, Node.js 22.13.0+, and Git on macOS or Linux. After protected RC publication, this installs the 1.4.0-rc.1 candidate artifact in a temporary consumer, without building the source checkout or changing global tools:
6
6
 
7
7
  ```bash
8
8
  harness_demo_dir=$(mktemp -d)
9
9
  cd "$harness_demo_dir"
10
10
  printf '{"name":"harness-first-run","private":true}\n' > package.json
11
- bun add --exact --ignore-scripts @zhivex-ai/harness@1.3.0
11
+ bun add --exact --ignore-scripts @zhivex-ai/harness@1.4.0-rc.1
12
12
  ./node_modules/.bin/zhx --version
13
13
  ./node_modules/.bin/zhx --help
14
14
  ./node_modules/.bin/zhx doctor --provider openai --json
15
15
  ```
16
16
 
17
- Version must print `1.3.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.
17
+ Version must print `1.4.0-rc.1`; 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
18
 
19
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
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhivex-ai/harness",
3
- "version": "1.3.0",
3
+ "version": "1.4.0-rc.1",
4
4
  "description": "Governed, provider-portable runtime for coding agents with durable approvals and isolated repository execution.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -135,7 +135,8 @@
135
135
  "docs/adr/0002-isolated-mcp-stdio.md",
136
136
  "docs/VERTEX.md",
137
137
  "docs/TOOL_POLICY.md",
138
- "docs/fixtures/mcp-stdio-contract-v1.json"
138
+ "docs/fixtures/mcp-stdio-contract-v1.json",
139
+ "docs/PROJECT_MEMORY.md"
139
140
  ],
140
141
  "scripts": {
141
142
  "models:check": "bun run scripts/validate-model-catalog.ts",