# DS4 Context Engine 0.3.0-beta.2

Status: published on 2026-09-03 under the npm `beta` dist-tag.

This coordinated beta carries forward beta.1 without changing canonical records, SQLite schema, runtime contracts, retention limits, privacy policy, compaction validation, or fallback semantics. It incorporates the operational evidence from a successful maintenance of the live derived SQLite projection and documents how to retain an interactive confirmation when recording a maintenance transcript.

## Changed since beta.1

- Recorded successful offline maintenance of a live schema-15 database after all Pi holders closed and the exact local `COMPACT` confirmation was entered.
- Clarified that `compact` and `recover` require both stdin and stdout to be local TTYs. Directly piping a mutating command through `tee` fails safely before maintenance; transcript capture must allocate a pseudo-TTY and must not bypass confirmation.
- Updated the beta dogfooding target and coordinated package versions to `0.3.0-beta.2`.

There are no functional storage-format or provider-path changes relative to beta.1.

## Live maintenance evidence

The authorized beta.1 maintenance run completed backup, working-copy transformation, candidate validation, recoverable swap, and post-swap inspection:

- database size: 2.42 GiB before, 377 MiB immediately after compaction;
- Context Manifests: 1,630 before, 128 after;
- manifest payload: 1.02 GiB before, 13.5 MiB after;
- 1,502 manifests pruned, 123 retained manifests rewritten as bounded excluded rollups, and no irreducible oversize skipped;
- schema 15, `quick_check=ok`, and zero foreign-key violations;
- no working, candidate, retired, lock, or maintenance-state artifact remained;
- after Pi reopened, the database returned to WAL mode with 128 manifests, no pending prune, and no maintenance recommendation;
- the fixed standalone backup remains retained with private file permissions during the observation period.

The first transcript-capturing launcher redirected stdout through `tee`, so the CLI rejected it with `interactive-confirmation-required` at `stage=confirmation`. The confirmation precedes `compactStorage()`, and no backup or staging artifact was created by that failed attempt. The successful retry used a pseudo-TTY and preserved the exact local confirmation requirement.

## Safety and compatibility

Pi JSONL remains canonical and append-only. SQLite remains disposable and rebuildable. Physical maintenance remains explicit, offline, local-TTY-only, and unavailable to model-callable tools. Every `context_persistence` write still requires a fresh positive local UI decision; destructive Pin and Memory operations still require an exact target and current revision; canonical mutations still append through Pi before SQLite reconciliation.

Strict exact-value grounding, bounded repair, privacy filtering, atomic tool exchanges, overflow-safe hierarchical compaction, transport-only retries, and Pi fallback behavior are unchanged. Rejected exact values, provider payloads, SQL, bound values, and raw SQLite messages remain absent from diagnostics.

Compatibility remains unchanged:

- SQLite schema: `15`;
- configuration: `ds4-context-config-v1`;
- runtime adapter: `runtime-adapter-v1`;
- persistence tool: `ds4-context-persistence-tool-v1`;
- persistence result: `ds4-context-persistence-result-v1`;
- Pi: `0.84.3`;
- Node.js: `>=22.19.0`.

Historical excluded-inventory rendering remains unsupported after downgrade once bounded `excluded-rollup` rows have been written, because earlier readers may present sampled excluded details as complete.

## Package/version policy

The coordinated version is `0.3.0-beta.2` for:

```text
ds4-context-core
ds4-context-reference-adapter
ds4-context-engine
```

Both adapters depend exactly on `ds4-context-core@0.3.0-beta.2`. Publication used the explicit npm `beta` dist-tag for all three packages. npm `latest` remains stable `0.2.0`, and GitHub Actions remains validation-only with OIDC and package-write permissions denied.

## Candidate validation

Local candidate verification on Node.js `26.5.1`:

- `npm run check`: 69 files and 341 tests passed.
- Three consecutive focused multi-process SQLite concurrency runs passed.
- `npm run quality:compare`: candidate quality `0.9875` versus baseline `0.808156`.
- `npm run schema:context-persistence`: 1,266 bytes and 317 estimated tokens; below the 1,500 absolute and 320 relative limits.
- Three feature-disabled latency comparisons against exact `ds4-context-core@0.1.2` passed with ratios `1.075625`, `0.899241`, and `1.008488`, each at or below `1.10`, using 200 samples and 50 calls per sample.
- `npm run pack:check`: verified core (223 files), reference adapter (7 files), and Pi adapter (68 files) in a clean consumer.
- `npm pack --dry-run --json` for all three packages passed with the same inventories and no forbidden local/session/storage files.
- `git diff --check` passed; the only pre-existing untracked path is `.serena/`, which is excluded from commits and package inventories.
- Version, exact core dependencies, package-lock entries, extension constant, and reference-adapter constant are synchronized to `0.3.0-beta.2`.

Validation-only CI run [`33762010502`](https://github.com/Alucard24/ds4-context-engine/actions/runs/33762010502) passed on Node.js `22.19.0` and `24.x` for candidate commit `e1dab370ea290da601c817aa358e9c384d4b068c`.

## Registry evidence

Exact post-publication verification passed for all three `0.3.0-beta.2` packages. The clean registry consumer verified exact adapter/core dependencies, public core exports, compiled reference-adapter conformance, packaged quality corpus, packaged Pi extension startup, and the installed `ds4-context-storage` CLI declaration, shim, and usage probe.

Published package shasums:

```text
ds4-context-core:              d9cc4d10756b984aa8a9078fcad05675b09b327e
ds4-context-reference-adapter: 6a9a829cf072ed613a5eec0756f967da81f481b4
ds4-context-engine:            965f65d8d350f712a0bcb0a416d1eebef46f82cd
```

For all three packages, npm `beta` resolves to `0.3.0-beta.2`, `alpha` remains `0.3.0-alpha.5`, `rc` remains `0.2.0-rc.1`, and `latest` remains `0.2.0`.

npm emitted a publish-time auto-correction warning for the root `bin` entry. The exact registry smoke independently confirmed that the published manifest still declares `ds4-context-storage`, a fresh install creates its shim, and the installed command returns the expected bounded usage response. The warning did not remove the CLI from the published artifact.

Annotated tag `v0.3.0-beta.2` targets verified registry-evidence commit `8323fb74fca286c512ea04efab54aa6065c8d315`. The GitHub prerelease is published at <https://github.com/Alucard24/ds4-context-engine/releases/tag/v0.3.0-beta.2>.

## Documentation

- [`../DOGFOODING_0.3.0_BETA.md`](../DOGFOODING_0.3.0_BETA.md)
- [`../STORAGE_MAINTENANCE.md`](../STORAGE_MAINTENANCE.md)
- [`../STORAGE.md`](../STORAGE.md)
- [`../CONTEXT_MANIFEST.md`](../CONTEXT_MANIFEST.md)
- [`../COMPACTION.md`](../COMPACTION.md)
- [`../RELEASING.md`](../RELEASING.md)
- [`0.3.0-beta.1.md`](0.3.0-beta.1.md)
