﻿# Delete events without a complete before-image: preserve removal semantics in AI extracts

Delete events without a complete before-image: preserve removal semantics in AI extracts. A practical data-quality guide with failure mechanisms, validation steps, acceptance evidence and primary references.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/dq-delete-events-missing-before-image/
Language: en

An incremental extract expects every deletion to include all prior feature values. A source emits only identifying information, so the consumer fails to remove the previously materialized example.

## The mechanism that changes the example

Removal is a state transition identified by a key; it need not be a negative copy of the original row. Available before-image fields depend on source and connector configuration.



## Define the comparison boundary

Verify the source's configured replica identity and the fields actually emitted for deletion. Do not infer a full historical row from the connector envelope merely because insert events contain all feature columns.

Maintain enough keyed destination state to remove the active example. If an aggregate requires the old contribution, a deletion containing only the key cannot supply it; the consumer must retrieve retained state or rebuild the affected result under a documented rule.

Separate a source delete from a transport tombstone or an empty message. Their meaning depends on the connector and topic configuration. Test duplicate delivery, removal of an already absent key and a delayed older update after deletion. The final comparison should establish that the deleted entity stays absent at the chosen release boundary.

## A constructed test case

Remove a known example using a delete event carrying only the documented identity fields. The fixture should verify absence of its materialized output without requiring feature values that the source never supplied in that event.

## A reproducible validation procedure

Test deletes with minimal source identity and with richer before-images. Require the consumer to remove the intended key without fabricating absent fields. Reconcile derived outputs that depend on the removed example.

Include an unchanged control and a deliberately invalid case. Verify that the checker distinguishes them before testing the complete release.

Exercise the actual preparation path, including later serialization and reload. Limit retained diagnostic content to the evidence required for this comparison.

## Evidence needed for acceptance

Keep removal keys, consumer decisions and a comparison showing that deleted examples no longer materialize.

## Containment and recovery

Removing the current row does not automatically remove historical snapshots or independent exported copies.

Quarantine an invalid release candidate or use an explicit partial-release rule. Preserve the last approved artifact and record corrections without silently rewriting historical inputs.

## Interpretation and references

Implementation references: [Debezium PostgreSQL change events](https://debezium.io/documentation/reference/stable/connectors/postgresql.html); [Apache Iceberg table specification](https://iceberg.apache.org/spec/).

This is a proposed engineering validation, not an executed Retrivium benchmark. Documentation specifies interfaces; dataset acceptance needs its own evidence and must be repeated after relevant dependency changes.

## Related reading

Continue with [Dataset removal lineage: references, cached objects and versioned storage](/journal/data-guide-dataset-removal-lineage-tombstone/); [Apache Iceberg: snapshot identity and schema evolution in ML data](/journal/data-guide-iceberg-snapshot-schema-evolution/). These guides supply adjacent context; the decision in this article remains the specific example-preservation check above.
