ds4-context-engine 0.2.0-beta.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,7 +16,7 @@ bounded active context with provenance
16
16
  Pi provider
17
17
  ```
18
18
 
19
- > **Project status:** M0–M20 are implemented on `main`. Prerelease `0.2.0-beta.2` includes M14–M20: quality measurement, structural/hybrid retrieval, cross-session project memory, learned-ranking shadow evaluation, the runtime adapter kit, and opt-in local KV reuse. Stable `0.1.2` remains available; all lines target Pi `0.84.3`.
19
+ > **Project status:** Stable `0.2.0` includes M0–M20 and release hardening: quality measurement, structural/hybrid retrieval, cross-session project memory, learned-ranking shadow evaluation, the runtime adapter kit, opt-in local KV reuse, schema-10 upgrades, long-session gates, and frozen 0.2 contracts. The maintenance line targets Pi `0.84.3`.
20
20
 
21
21
  ## Why DS4
22
22
 
@@ -86,13 +86,7 @@ Install the latest stable public npm package with:
86
86
  pi install npm:ds4-context-engine
87
87
  ```
88
88
 
89
- Install the opt-in 0.2 prerelease from the `beta` dist-tag with:
90
-
91
- ```bash
92
- pi install npm:ds4-context-engine@beta
93
- ```
94
-
95
- All prerelease packages (`ds4-context-engine`, `ds4-context-core`, and `ds4-context-reference-adapter`) use the same exact version.
89
+ The stable `0.2.0` packages (`ds4-context-engine`, `ds4-context-core`, and `ds4-context-reference-adapter`) use the same exact version. Both adapters require the matching core version.
96
90
 
97
91
  ### Local checkout
98
92
 
@@ -340,7 +334,7 @@ The following example shows the main configuration groups. Omitted values use th
340
334
  }
341
335
  ```
342
336
 
343
- Invalid or unknown values are ignored with a warning. Model overrides merge deterministically from `*` to `provider/*` to an exact `provider/model` profile.
337
+ Invalid or unknown values are ignored with a warning. Model overrides merge deterministically from `*` to `provider/*` to an exact `provider/model` profile. Routine session open/close, database, rebuild, and project-index summaries are emitted only at `debug`, so the default `info` level keeps session changes quiet while preserving actionable warnings. The 0.2 release line freezes this additive surface as `ds4-context-config-v1`; existing keys, validation, and defaults are pinned by the compatibility golden.
344
338
 
345
339
  ## Privacy and provider storage
346
340
 
@@ -397,6 +391,8 @@ npm test
397
391
  npm run check
398
392
  npm run quality:compare
399
393
  npm run pack:check
394
+ # Post-publication, with an exact version rather than a dist-tag:
395
+ npm run registry:check -- 0.2.0
400
396
  npm pack --dry-run
401
397
  npm pack --dry-run --workspace ds4-context-core
402
398
  npm pack --dry-run --workspace ds4-context-reference-adapter
@@ -443,6 +439,9 @@ scripts package and release-readiness checks
443
439
  - [Storage](docs/STORAGE.md)
444
440
  - [Roadmap 0.2.0](docs/ROADMAP_0.2.0.md)
445
441
  - [Release process](docs/RELEASING.md)
442
+ - [0.2.0 release readiness](docs/RELEASE_READINESS_0.2.0.md)
443
+ - [0.2.0 release notes](docs/releases/0.2.0.md)
444
+ - [0.2.0-rc.1 release notes](docs/releases/0.2.0-rc.1.md)
446
445
  - [Architecture decisions](docs/ADR/README.md)
447
446
  - [Original development plan](DS4_Context_Engine_Extension_Piano_Sviluppo.md)
448
447
 
@@ -450,7 +449,7 @@ scripts package and release-readiness checks
450
449
 
451
450
  The original M0–M13 roadmap is complete. `ds4-context-core` contains the compiled runtime-neutral implementation. M14 context-quality metrics, M15 rich symbol indexing, M16 hybrid semantic retrieval, M17 cross-session project memory, M18 learned-ranking shadow evaluation, M19's runtime adapter/conformance kit, and M20 opt-in local KV eligibility/replay are implemented on `main`. Learned active ranking remains promotion-gated, Pi reports local KV as unsupported, and static ranking/native completion stay authoritative on every failure.
452
451
 
453
- The [0.2.0 roadmap](docs/ROADMAP_0.2.0.md) now proceeds to release-candidate hardening. Sensitive or transport-specific behavior remains opt-in, and the 0.1 lexical planner stays available as the deterministic fallback.
452
+ The [0.2.0 roadmap](docs/ROADMAP_0.2.0.md) is complete. The [readiness record](docs/RELEASE_READINESS_0.2.0.md) maps every release gate to tests and operator commands. Sensitive or transport-specific behavior remains opt-in, and the 0.1 lexical planner stays available as the deterministic fallback.
454
453
 
455
454
  ## Contributing
456
455
 
@@ -0,0 +1,122 @@
1
+ # DS4 0.2.0 Release Readiness
2
+
3
+ This document is the completed hardening record for the stable 0.2 line. The `0.2.0-rc.1` candidate passed the commands below on a clean commit, and the stable release requires the same gates plus exact verification of the published `0.2.0` registry artifacts.
4
+
5
+ ## Frozen compatibility surface
6
+
7
+ The 0.2 release line freezes three additive contracts:
8
+
9
+ | Surface | Frozen value | Change rule |
10
+ |---|---|---|
11
+ | configuration | `ds4-context-config-v1` | Existing keys, types, validation, and defaults do not change within 0.2. Additive work requires an explicit review and remains opt-in. An incompatible shape requires a new schema version. |
12
+ | SQLite projection | schema `15` | Migrations 1–15 are immutable. New projection changes append a migration; existing SQL/checksums are never rewritten. |
13
+ | runtime adapter | `runtime-adapter-v1` / `runtime-history-v1` | The four capability IDs and v1 behavior are fixed. Incompatible adapter or history changes require a new contract version. |
14
+
15
+ `tests/golden/compatibility-0.2.0.json` pins the full default configuration, every migration name/checksum, adapter/history/conformance versions, capability IDs, and local-KV contract versions. The golden test is intentionally strict: an intentional post-0.2 contract must create a new fixture rather than silently updating this one.
16
+
17
+ ## Upgrade and rebuild
18
+
19
+ A 0.1.0/0.1.2 derived database ends at schema 10. Opening it with 0.2 applies migrations 11–15 in order. `tests/integration/upgrade-rebuild.test.ts` creates an exact schema-v10 database with recorded historical checksums and legacy session/project rows, upgrades it, and verifies that the original projections are unchanged while new tables remain empty.
20
+
21
+ A 0.1 configuration remains valid. Newly introduced behavior retains safe defaults:
22
+
23
+ - semantic retrieval: disabled;
24
+ - cross-session memory: disabled;
25
+ - context-quality recording: disabled;
26
+ - learned ranking: `off`;
27
+ - local KV reuse: disabled;
28
+ - embedding defaults: local only.
29
+
30
+ Complete deletion of `context.db`, `context.db-wal`, and `context.db-shm` loses only projections. Rebuild coverage is distributed by canonical source:
31
+
32
+ - session entries and FTS: `tests/integration/session-indexer.test.ts`;
33
+ - memory/pins and supersession: `tests/integration/memory-extension.test.ts`;
34
+ - cross-session project mutations, corruption, and source exclusion: `tests/integration/cross-session-memory.test.ts`;
35
+ - project files/snippets and semantic vectors: `tests/integration/project-knowledge.test.ts` and `tests/unit/semantic-index.test.ts`;
36
+ - artifact references/objects: `tests/integration/artifact-extension.test.ts`;
37
+ - quality aggregates from the versioned local corpus: `tests/integration/context-quality-repository.test.ts`;
38
+ - reference-adapter snapshots: `tests/integration/reference-adapter.test.ts`.
39
+
40
+ Pi JSONL, reference-adapter JSONL, and live project files are never deleted by a rebuild.
41
+
42
+ ## Long-session and provider-switch hardening
43
+
44
+ `tests/integration/long-session.test.ts` replays a 1,201-message session through 24 managed planning cycles. It verifies:
45
+
46
+ - the current request remains byte-for-byte present;
47
+ - selected input remains below the model hard input limit without planner fallback;
48
+ - the canonical JSONL file is unchanged;
49
+ - the session index contains one row per canonical entry with no duplicate growth;
50
+ - bounded quality retention remains at its configured maximum;
51
+ - disabled manifests, embeddings, memory, and pins create no rows.
52
+
53
+ `tests/integration/model-awareness-extension.test.ts` switches 32k, 128k, and 200k local/remote profiles. It verifies exact-model calibration isolation, cold/reused profile state, adaptive budgets, override precedence, and privacy re-enforcement on every destination change. Native continuation and local-KV tests independently reject stale state after model/runtime changes and fall back to full replay.
54
+
55
+ ## Release-gate matrix
56
+
57
+ | Gate | Evidence |
58
+ |---|---|
59
+ | 0.1 regressions and package boundaries | `npm run check`, `npm run pack:check` |
60
+ | disposable projection rebuild | rebuild tests listed above |
61
+ | lexical-only operation | default config plus retrieval/runtime fallback tests |
62
+ | local and explicitly remote embedding privacy | `tests/integration/privacy-extension.test.ts`, `tests/unit/semantic-index.test.ts` |
63
+ | cross-session branch/supersession/corruption/isolation | `tests/integration/cross-session-memory.test.ts` |
64
+ | learned-ranking promotion or shadow-only fallback | `tests/unit/learned-ranker.test.ts`, `tests/unit/ranking-adapter.test.ts` |
65
+ | Pi/reference adapter conformance | `tests/unit/pi-runtime-contract.test.ts`, `tests/integration/reference-adapter.test.ts` |
66
+ | feature-disabled p95 ≤ 110% of 0.1 | `npm run latency:check -- <0.1.2-core-root>` |
67
+ | long-session integrity and bounded growth | `tests/integration/long-session.test.ts` |
68
+ | matching package versions and clean consumers | `npm run pack:check`; after publish, `npm run registry:check -- <exact-version>` |
69
+ | minimum Node and current LTS | CI matrix: Node `22.19.0` and `24.x` |
70
+ | migration/privacy/limitations/rollback docs | this document, `STORAGE.md`, `PRIVACY.md`, adapter/KV documentation |
71
+
72
+ The latency check loads exact `ds4-context-core@0.1.2` and the local 0.2 build in one process, runs the same deterministic feature-disabled 401-message fixture, alternates samples to reduce host drift, and rejects a p95 ratio above `1.10`. The comparison contains only timings and package versions.
73
+
74
+ ## Candidate validation
75
+
76
+ Install the exact stable baseline into an isolated temporary project, then run:
77
+
78
+ ```bash
79
+ BASELINE_DIR="$(mktemp -d)"
80
+ printf '{"private":true}' > "$BASELINE_DIR/package.json"
81
+ npm install --prefix "$BASELINE_DIR" --ignore-scripts --no-audit --no-fund \
82
+ --package-lock=false ds4-context-core@0.1.2
83
+
84
+ npm ci
85
+ npm run check
86
+ npm run pack:check
87
+ npm run latency:check -- "$BASELINE_DIR/node_modules/ds4-context-core"
88
+ git diff --check
89
+ git status --short
90
+ rm -rf "$BASELINE_DIR"
91
+ ```
92
+
93
+ After publishing all three packages in dependency order, verify registry bytes rather than local tarballs:
94
+
95
+ ```bash
96
+ npm run registry:check -- 0.2.0
97
+ ```
98
+
99
+ The registry check accepts an exact version, never a mutable dist-tag. It installs all three public packages plus the supported Pi SDK into a fresh project, validates matching exact core dependencies, imports core and local-KV exports, runs compiled reference conformance, runs the packaged quality corpus, and starts the published Pi extension through isolated offline RPC state.
100
+
101
+ ## Rollback
102
+
103
+ SQLite is forward-only. A 0.1 binary correctly refuses to open schema 15; do not edit `schema_migrations`, checksums, or `PRAGMA user_version` to force a downgrade.
104
+
105
+ To roll back the Pi adapter:
106
+
107
+ 1. stop every Pi process using the shared database;
108
+ 2. retain all Pi session JSONL and project files;
109
+ 3. remove or archive only `context.db`, `context.db-wal`, `context.db-shm`, disposable artifacts/embeddings, and the learned-ranking model;
110
+ 4. install the desired 0.1 package and let it create a fresh derived database, or point it at a new `storage.databasePath`;
111
+ 5. leave reference-adapter canonical JSONL untouched if that adapter was used.
112
+
113
+ New 0.2 configuration keys are ignored by 0.1 with warnings, but removing them reduces operator ambiguity. Disabling semantic retrieval, cross-session memory, ranking, quality, continuation, and local KV before rollback is optional because none of those states is canonical.
114
+
115
+ ## Known limitations
116
+
117
+ - Active learned ranking still requires explicit promotion metadata; otherwise static ordering remains authoritative.
118
+ - Pi exposes no local KV handles and reports that capability as unsupported.
119
+ - The reference adapter is an inspectable callback/JSONL implementation, not a production streaming runtime.
120
+ - Remote embeddings require exact provider/model consent and enabled privacy filtering.
121
+ - Runtime quality samples are unlabeled for evidence recall; the versioned replay corpus supplies deterministic labels.
122
+ - Derived manifest/calibration history grows with completed provider turns when persistence is enabled; it contains metadata only and can be discarded with the database.
package/docs/RELEASING.md CHANGED
@@ -16,7 +16,7 @@ Both adapters have an exact dependency on the matching core version, so core mus
16
16
  - verify that both adapters depend exactly on that version of `ds4-context-core`;
17
17
  - do not include session data, `.pi` state, databases, credentials, or provider payloads.
18
18
 
19
- The automated package check enforces matching versions, exact core dependencies, runtime-SDK isolation, bounded tarball inventories, clean consumer installation, core ESM exports, compiled reference-adapter conformance, and packaged Pi extension startup through isolated RPC state.
19
+ The automated package check enforces matching versions, exact core dependencies, runtime-SDK isolation, bounded tarball inventories, clean consumer installation, core ESM exports, compiled reference-adapter conformance, and packaged Pi extension startup through isolated RPC state. For the 0.2 line, also confirm the frozen `ds4-context-config-v1`, SQLite schema 15 migration checksums, and `runtime-adapter-v1` compatibility golden.
20
20
 
21
21
  ## Validate
22
22
 
@@ -28,6 +28,19 @@ git diff --check
28
28
  git status --short
29
29
  ```
30
30
 
31
+ For a 0.2 release candidate, compare feature-disabled planning against exact stable `ds4-context-core@0.1.2` on the same host:
32
+
33
+ ```bash
34
+ BASELINE_DIR="$(mktemp -d)"
35
+ printf '{"private":true}' > "$BASELINE_DIR/package.json"
36
+ npm install --prefix "$BASELINE_DIR" --ignore-scripts --no-audit --no-fund \
37
+ --package-lock=false ds4-context-core@0.1.2
38
+ npm run latency:check -- "$BASELINE_DIR/node_modules/ds4-context-core"
39
+ rm -rf "$BASELINE_DIR"
40
+ ```
41
+
42
+ The check rejects a candidate p95 above 110% of the exact 0.1.2 baseline. See [`RELEASE_READINESS_0.2.0.md`](RELEASE_READINESS_0.2.0.md) for the complete gate matrix and rollback procedure.
43
+
31
44
  CI runs the same checks on the minimum supported Node.js version and the current Node.js LTS line. `npm run pack:check` uses a temporary directory and removes it when complete. Set `DS4_KEEP_PACK_TMP=1` only when diagnosing a failed package check.
32
45
 
33
46
  Review all public tarballs before publishing:
@@ -56,7 +69,9 @@ Review `package.json`, both workspace package manifests, and `package-lock.json`
56
69
 
57
70
  ## Publish
58
71
 
59
- Authenticate with npm, verify the active account, and publish in dependency order:
72
+ Publishing is manual-only. GitHub Actions workflows must remain validation-only: do not add npm credentials, `NODE_AUTH_TOKEN`, `NPM_TOKEN`, `id-token: write`, `packages: write`, or an `npm publish` step. The CI workflow explicitly denies OIDC and package-write permissions.
73
+
74
+ Authenticate with npm using an interactive OTP or a granular publish token with bypass 2FA, verify the active account, and publish in dependency order:
60
75
 
61
76
  ```bash
62
77
  npm whoami
@@ -69,7 +84,13 @@ If core succeeds but an adapter publication fails, fix that adapter release and
69
84
 
70
85
  After all registry packages are available:
71
86
 
72
- 1. install them in a fresh temporary project and rerun the package smoke check if registry propagation was delayed;
87
+ 1. verify the exact registry artifacts (never a mutable dist-tag):
88
+
89
+ ```bash
90
+ npm run registry:check -- "$VERSION"
91
+ ```
92
+
93
+ This installs all three packages in a fresh temporary project, checks exact adapter/core dependencies, imports public core/KV exports, runs compiled reference conformance and the packaged quality corpus, and starts the published Pi extension through isolated offline RPC state.
73
94
  2. create and push the signed or annotated `v$VERSION` tag;
74
95
  3. create the GitHub Release from that tag;
75
96
  4. update installation documentation if registry names or requirements changed.
@@ -1,6 +1,6 @@
1
1
  # DS4 0.2.0 Roadmap
2
2
 
3
- Status: **planned**. No release date is committed.
3
+ Status: **complete**. Stable `0.2.0` is released with all compatibility and release gates satisfied.
4
4
 
5
5
  Version 0.2.0 focuses on evidence quality, safe project-wide reuse and runtime portability. It extends the released 0.1.0 architecture without changing its canonical-state or failure guarantees.
6
6
 
@@ -241,14 +241,24 @@ SQLite schema changes use forward migrations plus complete rebuild tests from ca
241
241
 
242
242
  ### `0.2.0-rc.1`
243
243
 
244
+ Status: **implemented and released in `0.2.0-rc.1`**. See [`RELEASE_READINESS_0.2.0.md`](RELEASE_READINESS_0.2.0.md) and the [release notes](releases/0.2.0-rc.1.md).
245
+
244
246
  - Upgrade/rebuild testing from 0.1.0 state.
245
247
  - Long-session dogfooding and provider-switch tests.
246
248
  - Registry package smoke tests, documentation and release notes.
247
249
  - Freeze config, database and adapter-contract schemas for 0.2.0.
248
250
 
251
+ ### `0.2.0`
252
+
253
+ Status: **stable release completed**. See the [release notes](releases/0.2.0.md) and the final [`RELEASE_READINESS_0.2.0.md`](RELEASE_READINESS_0.2.0.md) evidence record.
254
+
255
+ - Promotes the validated release candidate without changing frozen 0.2 contracts or default behavior.
256
+ - Publishes matching stable versions of the core, reference adapter and Pi adapter.
257
+ - Verifies exact registry artifacts in a clean consumer after publication.
258
+
249
259
  ## Release gates
250
260
 
251
- Version 0.2.0 is ready only when:
261
+ Version 0.2.0 is ready only when (the live evidence matrix is maintained in [`RELEASE_READINESS_0.2.0.md`](RELEASE_READINESS_0.2.0.md)):
252
262
 
253
263
  1. all 0.1 tests and package-boundary checks still pass;
254
264
  2. new projections rebuild from canonical sources after complete SQLite deletion;
@@ -49,7 +49,7 @@ M20-capable adapters may additionally expose `localKvPort` and aggregate `localK
49
49
 
50
50
  ## Capability negotiation
51
51
 
52
- The v1 registry is fixed and additive contracts must use a later contract version:
52
+ The v1 registry is frozen for the 0.2 release line. Incompatible contract/history changes require a later version; capability additions require explicit additive-version review:
53
53
 
54
54
  - `compaction`;
55
55
  - `provider-continuation`;
@@ -99,7 +99,7 @@ The seven checks cover:
99
99
  6. safe transport failure with native fallback still available;
100
100
  7. idempotent shutdown and closed-state behavior.
101
101
 
102
- Reports contain case IDs, booleans, and fixed failure codes only. The private marker and credential probes never appear in a report. Package smoke tests install core, Pi, and reference tarballs in a clean consumer and rerun reference conformance from compiled exports.
102
+ Reports contain case IDs, booleans, and fixed failure codes only. The private marker and credential probes never appear in a report. Package smoke tests install core, Pi, and reference tarballs in a clean consumer and rerun reference conformance from compiled exports. The 0.2 compatibility golden pins `runtime-adapter-v1`, `runtime-history-v1`, the conformance and local-KV versions, and all capability IDs; post-publication `npm run registry:check -- <exact-version>` reruns the boundary against registry bytes.
103
103
 
104
104
  ## Reference-adapter compatibility spike
105
105
 
package/docs/STORAGE.md CHANGED
@@ -125,6 +125,14 @@ Schema-v2 `CompactionEntry.details.ds4ContextEngine` records the active/segment
125
125
 
126
126
  `SummaryRepository.saveGraph()` inserts a complete node batch transactionally, rejects missing/cross-session children, enforces increasing graph levels, and refuses ID collisions that would change immutable content or provenance. `summary_sources` keeps foreign keys to indexed raw entries; deleting a session cascades through the entire derived graph.
127
127
 
128
+ ## 0.2 schema freeze, upgrade, and rollback
129
+
130
+ The 0.2 projection contract is frozen at schema 15. Migrations 1–10 are the exact 0.1 history; 11–15 add quality samples, structural symbols, derived embeddings, cross-process leases, and cross-session project-memory checkpoints. `tests/golden/compatibility-0.2.0.json` pins every migration name and SHA-256 checksum so an existing migration cannot be silently rewritten.
131
+
132
+ Opening a schema-10 database applies only forward migrations and preserves legacy rows. No migration edits Pi JSONL, reference-adapter JSONL, project files, or runtime KV state. Complete database deletion remains the recovery path because all tables are projections; versioned local quality inputs rebuild quality aggregates separately.
133
+
134
+ Rollback is also projection-based. A 0.1 binary refuses schema 15 by design. Stop all processes sharing the database, retain canonical JSONL/project files, then remove or archive `context.db`, its WAL/SHM files, and other disposable local artifacts before allowing 0.1 to create a fresh database or use another `storage.databasePath`. Never alter `schema_migrations`, stored checksums, or `PRAGMA user_version` to force a downgrade. See [`RELEASE_READINESS_0.2.0.md`](RELEASE_READINESS_0.2.0.md).
135
+
128
136
  ## Transactions
129
137
 
130
138
  A full rebuild does not blindly delete unchanged entries. It upserts all observed entries, marks them in a temporary seen-set, and removes only stale rows. This preserves foreign-key provenance for unchanged source entries. FTS rows and checkpoint state update in the same transaction.
@@ -0,0 +1,43 @@
1
+ # DS4 Context Engine 0.2.0-rc.1
2
+
3
+ Status: **released under the npm `rc` dist-tag**.
4
+
5
+ This release candidate freezes and hardens the 0.2 feature set delivered across the alpha and beta builds. It adds no new default-on provider behavior.
6
+
7
+ ## Included since 0.1.2
8
+
9
+ - deterministic metadata-only context-quality metrics and comparison corpus;
10
+ - structural project chunks and richer symbol relations;
11
+ - opt-in local or explicitly consented remote hybrid semantic retrieval;
12
+ - opt-in cross-session project memory replay from canonical Pi JSONL;
13
+ - learned ranking with `off`, shadow, promotion-gated active, and static fallback modes;
14
+ - `runtime-adapter-v1`, a reusable conformance kit, and the callback/JSONL reference adapter;
15
+ - opt-in exact local prefix/KV reuse for adapters with a host-owned volatile runtime port;
16
+ - shared-SQLite WAL/write coordination and renewable fenced project-index leases.
17
+
18
+ ## RC hardening
19
+
20
+ - exact schema-v10 (0.1) to schema-v15 upgrade coverage;
21
+ - full 0.2 configuration/database/adapter compatibility golden;
22
+ - 1,201-message repeated-planning coverage for hard limits, canonical integrity, and bounded derived retention;
23
+ - local/remote provider-switch, calibration, privacy, continuation, and cache invalidation coverage;
24
+ - same-host feature-disabled p95 comparison against exact `ds4-context-core@0.1.2`;
25
+ - exact-version registry-consumer verification for all three published packages;
26
+ - documented release gates, limitations, and forward-only database rollback.
27
+
28
+ ## Compatibility
29
+
30
+ - Node.js `>=22.19.0`;
31
+ - Pi `0.84.3`;
32
+ - package versions and adapter-to-core dependencies must match exactly;
33
+ - configuration contract `ds4-context-config-v1`;
34
+ - SQLite projection schema `15`;
35
+ - runtime adapter contract `runtime-adapter-v1`.
36
+
37
+ Existing 0.1 configuration remains valid. Semantic retrieval, cross-session memory, quality sampling, learned ranking, and local KV reuse remain disabled by default. Pi JSONL and live project files remain canonical; SQLite, embeddings, ranking models, artifacts, and runtime KV state remain local/disposable.
38
+
39
+ ## Upgrade and rollback
40
+
41
+ Opening a 0.1 database applies forward migrations 11–15. No canonical history is rewritten. A 0.1 binary cannot open the newer derived schema; rollback requires stopping all users of the shared database, retaining canonical JSONL/project files, and letting 0.1 create a fresh database or use a different `storage.databasePath`. Never alter migration checksums or delete reference-adapter canonical JSONL.
42
+
43
+ See [`../RELEASE_READINESS_0.2.0.md`](../RELEASE_READINESS_0.2.0.md) for the gate matrix and exact validation commands.
@@ -0,0 +1,43 @@
1
+ # DS4 Context Engine 0.2.0
2
+
3
+ Status: **stable release under the npm `latest` dist-tag**.
4
+
5
+ DS4 Context Engine 0.2.0 promotes the validated `0.2.0-rc.1` candidate without changing its frozen contracts, safe defaults, or canonical-state guarantees.
6
+
7
+ ## Highlights since 0.1.2
8
+
9
+ - deterministic metadata-only context-quality metrics and comparison corpus;
10
+ - structural project chunks and richer symbol relations;
11
+ - opt-in local or explicitly consented remote hybrid semantic retrieval;
12
+ - opt-in cross-session project memory replay from canonical Pi JSONL;
13
+ - learned ranking with `off`, shadow, promotion-gated active, and static fallback modes;
14
+ - `runtime-adapter-v1`, a reusable conformance kit, and the callback/JSONL reference adapter;
15
+ - opt-in exact local prefix/KV reuse for adapters with a host-owned volatile runtime port;
16
+ - shared-SQLite WAL/write coordination and renewable fenced project-index leases.
17
+
18
+ ## Stable-release evidence
19
+
20
+ - exact schema-v10 (0.1) to schema-v15 upgrade coverage;
21
+ - complete rebuild coverage from canonical session, adapter, and project sources;
22
+ - full configuration, migration, adapter, capability, and local-KV compatibility golden;
23
+ - 1,201-message repeated-planning coverage for hard limits, canonical integrity, and bounded derived retention;
24
+ - local/remote provider-switch, privacy, continuation, and cache-invalidation coverage;
25
+ - feature-disabled p95 comparison against exact `ds4-context-core@0.1.2` within the 10% release threshold;
26
+ - clean package-consumer validation and exact-version post-publication registry verification for all three packages.
27
+
28
+ ## Compatibility and defaults
29
+
30
+ - Node.js `>=22.19.0`;
31
+ - Pi `0.84.3`;
32
+ - configuration contract `ds4-context-config-v1`;
33
+ - SQLite projection schema `15`;
34
+ - runtime adapter contract `runtime-adapter-v1`;
35
+ - matching `0.2.0` versions are required for adapters and `ds4-context-core`.
36
+
37
+ Existing 0.1 configuration remains valid. Semantic retrieval, cross-session memory, context-quality recording, learned ranking, and local KV reuse remain disabled by default. Pi JSONL, reference-adapter JSONL, and live project files remain canonical; SQLite, embeddings, ranking models, artifacts, and runtime KV state remain local and disposable.
38
+
39
+ ## Upgrade and rollback
40
+
41
+ Opening a 0.1 database applies forward migrations 11–15 without rewriting canonical history. A 0.1 binary cannot open schema 15. To roll back, stop every process using the shared database, retain canonical JSONL and project files, and let 0.1 create a fresh derived database or use a different `storage.databasePath`. Never alter migration checksums or delete reference-adapter canonical JSONL.
42
+
43
+ See [`../RELEASE_READINESS_0.2.0.md`](../RELEASE_READINESS_0.2.0.md) for the complete gate matrix, limitations, and rollback procedure.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ds4-context-engine",
3
- "version": "0.2.0-beta.2",
3
+ "version": "0.2.0",
4
4
  "description": "Non-destructive, provider-independent context management for Pi.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -46,7 +46,9 @@
46
46
  "test:watch": "npm run build:core && npm run build:adapters && vitest",
47
47
  "check": "npm run build:core && npm run build:adapters && tsc --noEmit && vitest run",
48
48
  "quality:compare": "node scripts/compare-context-quality.mjs",
49
+ "latency:check": "npm run build:core && node scripts/compare-disabled-planning-latency.mjs",
49
50
  "pack:check": "node scripts/verify-packages.mjs",
51
+ "registry:check": "node scripts/verify-registry-packages.mjs",
50
52
  "prepare": "npm run build:core && npm run build:adapters"
51
53
  },
52
54
  "pi": {
@@ -55,7 +57,7 @@
55
57
  ]
56
58
  },
57
59
  "dependencies": {
58
- "ds4-context-core": "0.2.0-beta.2"
60
+ "ds4-context-core": "0.2.0"
59
61
  },
60
62
  "peerDependencies": {
61
63
  "@earendil-works/pi-ai": "0.84.3",
@@ -567,7 +567,7 @@ export class Ds4ContextRuntime {
567
567
 
568
568
  this.phase = this.config.context.mode;
569
569
  this.setStatus(ctx, `DS4 ctx: ${this.config.context.mode}`);
570
- this.logger.info("session.opened", {
570
+ this.logger.debug("session.opened", {
571
571
  sessionId: this.session.sessionId,
572
572
  persisted: Boolean(this.session.sessionFile),
573
573
  projectPath: this.session.projectPath,
@@ -2162,7 +2162,7 @@ export class Ds4ContextRuntime {
2162
2162
  projectPath: resolve(ctx.cwd),
2163
2163
  fallbackReason: "Project indexing is skipped for filesystem roots and the user home directory",
2164
2164
  };
2165
- this.logger.warn("project_index.skipped", {
2165
+ this.logger.debug("project_index.skipped", {
2166
2166
  reason: "broad-root",
2167
2167
  projectPath: resolve(ctx.cwd),
2168
2168
  });
@@ -2194,7 +2194,7 @@ export class Ds4ContextRuntime {
2194
2194
  return;
2195
2195
  }
2196
2196
  this.lastProject = this.projectKnowledge.diagnostics();
2197
- this.logger.info("project_index.opened", {
2197
+ this.logger.debug("project_index.opened", {
2198
2198
  files: sync.discoveredFiles,
2199
2199
  indexedFiles: sync.indexedFiles,
2200
2200
  currentSnippets: sync.currentSnippets,
@@ -2587,7 +2587,7 @@ export class Ds4ContextRuntime {
2587
2587
  this.closeDatabase();
2588
2588
  if (ctx) this.setStatus(ctx, undefined);
2589
2589
  this.phase = "closed";
2590
- this.logger.info("runtime.closed", { sessionId: this.session?.sessionId });
2590
+ this.logger.debug("runtime.closed", { sessionId: this.session?.sessionId });
2591
2591
  }
2592
2592
 
2593
2593
  private getCompactionDiagnostics(ctx: ExtensionContext): CompactionDiagnostics {
@@ -229,7 +229,7 @@ export class PiSessionIndexer {
229
229
  read.malformedLines,
230
230
  started,
231
231
  );
232
- this.logger.info("session_index.rebuilt", { sessionId: session.sessionId, ...result });
232
+ this.logger.debug("session_index.rebuilt", { sessionId: session.sessionId, ...result });
233
233
  return result;
234
234
  }
235
235
 
@@ -1,4 +1,4 @@
1
- export const EXTENSION_VERSION = "0.2.0-beta.2";
1
+ export const EXTENSION_VERSION = "0.2.0";
2
2
  export const SUPPORTED_PI_VERSION = "0.84.3";
3
3
  export const OBSERVER_PLANNER_VERSION = "observer-model-aware-v1";
4
4
  export const PLANNER_VERSION = "managed-learned-ranking-v1";