# DS4 Context Engine 0.2.0

Status: **stable release under the npm `latest` dist-tag**.

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.

## Highlights since 0.1.2

- deterministic metadata-only context-quality metrics and comparison corpus;
- structural project chunks and richer symbol relations;
- opt-in local or explicitly consented remote hybrid semantic retrieval;
- opt-in cross-session project memory replay from canonical Pi JSONL;
- learned ranking with `off`, shadow, promotion-gated active, and static fallback modes;
- `runtime-adapter-v1`, a reusable conformance kit, and the callback/JSONL reference adapter;
- opt-in exact local prefix/KV reuse for adapters with a host-owned volatile runtime port;
- shared-SQLite WAL/write coordination and renewable fenced project-index leases.

## Stable-release evidence

- exact schema-v10 (0.1) to schema-v15 upgrade coverage;
- complete rebuild coverage from canonical session, adapter, and project sources;
- full configuration, migration, adapter, capability, and local-KV compatibility golden;
- 1,201-message repeated-planning coverage for hard limits, canonical integrity, and bounded derived retention;
- local/remote provider-switch, privacy, continuation, and cache-invalidation coverage;
- feature-disabled p95 comparison against exact `ds4-context-core@0.1.2` within the 10% release threshold;
- clean package-consumer validation and exact-version post-publication registry verification for all three packages.

## Compatibility and defaults

- Node.js `>=22.19.0`;
- Pi `0.84.3`;
- configuration contract `ds4-context-config-v1`;
- SQLite projection schema `15`;
- runtime adapter contract `runtime-adapter-v1`;
- matching `0.2.0` versions are required for adapters and `ds4-context-core`.

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.

## Upgrade and rollback

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.

See [`../RELEASE_READINESS_0.2.0.md`](../RELEASE_READINESS_0.2.0.md) for the complete gate matrix, limitations, and rollback procedure.
