# v2.0.4 — 2026-06-12

## Overview

v2.0.4 is a production-safety and documentation-quality patch. It keeps the public API backward compatible while adding explicit Model index rollout controls, updating the schema validation dependency, and refining user-facing documentation language.

---

## Runtime Fixes

- Added production-safe Model index controls:
  - runtime-level and model-level `autoIndex` options.
  - explicit `ModelInstance.ensureIndexes()` and `MonSQLize.ensureModelIndexes()` APIs.
  - dry-run index preflight with `existing`, `missing`, `conflicts`, and `failed` classification.
  - missing-index creation without dropping, renaming, or rebuilding conflicting indexes.
  - `model-index-error` events for observable automatic-index creation failures.
- Kept automatic Model indexing enabled by default for backward compatibility.
- Moved runtime Model index aggregation into the Model runtime helper layer so the strict source-size gate remains clean.

## Dependencies

- Updated `schema-dsl` from `2.0.8` to npm `latest` `2.0.9`.
- Confirmed `schema-dsl@2.0.9` keeps the required `dsl()` and `validate()` runtime paths compatible with monSQLize.
- Confirmed the `schema-dsl` transitive `cache-hub` dependency now resolves to `2.2.4`, matching the root direct dependency.

## Documentation

- Documented the recommended production index rollout flow:
  - set `autoIndex: false` in production services.
  - run `ensureIndexes({ dryRun: true })` / `ensureModelIndexes({ dryRun: true })`.
  - create only missing indexes during a low-traffic maintenance window.
  - monitor TTL and index-build behavior.
- Corrected create-index documentation to distinguish local `INVALID_ARGUMENT` validation from raw MongoDB driver/server index conflicts.
- Reworded capability-index and verification-entry documentation to use user-facing availability and verification language instead of internal migration status terms.
- Refined the documentation home experience with the VextJS-style footer, aligned hero/feature layout, and updated hero data-flow visual.

---

## Compatibility

- SemVer: patch release.
- Breaking changes: none.
- Existing v2 imports remain under `dist/cjs`, `dist/esm`, and `dist/types`.
- Existing default automatic Model indexing behavior remains enabled unless users opt into the new production-safe controls.

---

## Validation

- `npm run lint`
- `npm run check:docs-examples`
- `npm run type-check`
- targeted Model/index unit and integration tests
- `npm run test:examples`
- `npm --prefix website run build`
- `npm run verify:fast`
- `npm run test:server-matrix`
- `npm run test:audit`
- `git diff --check`

Full release validation is handled by `npm run release:preflight`, `npm pack --dry-run`, `npm publish --dry-run`, and pack install smoke before publishing.
