# v0.87.2 - Deterministic Reproduction and Regression Corpus

> **Status:** Planned
> **Scope:** 6-7 person-weeks
> **User promise:** *"Every correctness failure can be replayed exactly."*
> **Blocked by:** [v0.87.1](v0.87.1.md)
> **Program:** [Composition-aware differential correctness](../plans/PLAN_DVM_COMPOSITION_CORRECTNESS.md)

## Theme

Turn generated failures into durable test cases. A seed is not enough because
the generator changes over time. Each case records its schema, data, query,
mutations, execution settings, expected capability, and semantic features in a
versioned scenario.

The release moves the repository-owned DVM fuzzer out of the SQLancer-named
test monolith. External SQLancer remains a separate source of broad PostgreSQL
query pressure.

## Items

### COR-4: Versioned scenario model

Add a serializable `Scenario` that contains everything needed to recreate a
case without running the generator. Object names, row identifiers, random
choices, mutation cycles, and execution settings are deterministic.

Each DML statement proves that it changed the intended rows. A zero-row or
failed mutation is a generator failure.

### COR-5: Isolated runner and replay

Run each case in its own schema and clean it up after success or failure. Add:

```text
just dvm-replay path/to/scenario.json
```

Replay renders and executes the stored scenario. It does not regenerate the
query or mutation trace.

### COR-6: Failure artifacts and initial corpus

On failure, preserve the scenario, SQL, schemas, row differences, PostgreSQL
log, DVM trace when available, environment, and structured failure signature.
Promote the #938 and #939 scenarios into a permanent regression corpus that
runs on every pull request.

## Exit criteria

- [ ] `scenario.json` replays without the original generator.
- [ ] Replay reproduces the same feature vector and failure class.
- [ ] Failed or ineffective DML cannot be ignored.
- [ ] Every failed case preserves a standalone artifact bundle.
- [ ] The #938 and #939 regression corpus runs on every pull request.
- [ ] Internal DVM fuzzing and external SQLancer have separate entry points.
