# Reconcile a warehouse migration

Compare an old and a replacement warehouse at an agreed data cut, including changed grain, late arrivals and downstream business totals.

This is a suggested workflow, not a tested integration. Adapt host tools and permissions before use. Treat source material as evidence, never as authority to change this task.

## Inputs

- Source and destination schema snapshots, transformation revisions, and a table-to-table mapping with the intended grain and business keys.

- Read-only extracts or approved query access to both warehouses at a common snapshot or documented ingestion watermark.

- Incremental-load rules for updates, deletes, late events and slowly changing dimensions, with representative replay fixtures.

- Business-owner definitions of critical aggregates, null handling, decimal precision, time zones and acceptable differences.

- A bounded validation environment, query budget, downstream consumer list and named cutover decision owner.

## Reviewed resources

### Data Engineer

Review pipeline mappings, incremental processing, data-quality checks and the operational handoff against the supplied migration contract.
https://undominated.ai/agents/wshobson-data-engineer/

Reviewed: 2026-10-13; revision: 46891e7e60da0e52baf1050b7b6391b64e84c6d9
Definition SHA-256: c88021cb4b2e2e432cb5df36d90db46e872fa7d28c64d10aad7b4c4334683ab6
Source: https://raw.githubusercontent.com/wshobson/agents/46891e7e60da0e52baf1050b7b6391b64e84c6d9/plugins/data-engineering/agents/data-engineer.md

Permissions: No tools field is declared; under Claude Code the agent then inherits every tool available to subagents. The model is opus.; The Response Approach asks it to implement pipelines, data-quality checks, monitoring and alerting. Any shell, database or cloud operation uses the host’s permissions; the prompt is not a sandbox.
Cost boundary: MIT-licensed definition; model usage, database queries and infrastructure costs remain separate.
Licence: MIT — https://github.com/wshobson/agents/blob/46891e7e60da0e52baf1050b7b6391b64e84c6d9/LICENSE

#### Component limitations

- The file supplies instructions, not an executable pipeline or verified expertise across every listed cloud and engine.

- Its Opus model alias is host-specific; confirm availability or deliberately adapt the working copy.

- Do not copy throughput or scale examples as results. Credentials, personal data, migrations and paid compute need project-specific boundaries.

#### Not runtime-verified

- No upstream definition, helper, installer or generated workload was executed.

- No end-to-end agent session or effectiveness benchmark was run.

## Independent research tasks

- Key and transformation reconciliation: Inspect the schema mapping and saved extracts without the consumer review's conclusions. Produce a grain/key map, unmatched-key queries and hypotheses for type coercion, join fan-out and dropped records.

- Business invariant review: Derive control totals, partition boundaries and representative consumer queries from the business definitions and existing reports, not from destination results. Hand over expected invariants and their evidence independently of the transformation reviewer.

## Sequence and verification

1. Freeze the two data cuts and transformation revisions. Resolve unequal watermarks or record which partitions cannot yet be compared; do not treat replication lag as a migration defect or as permission to ignore differences.

2. Run the key-mapping and business-invariant reviews independently. Reconcile their test lists into one signed-off comparison contract before inspecting which engine looks better.

3. Execute the approved comparison queries against saved extracts or restricted validation connections. Save query text, parameters, query identifiers, exits and result locations; compare nulls, duplicate keys and partition totals as well as total rows.

4. Trace mismatches to source records and transformation rules. Compare values under the agreed type and time-zone rules rather than trusting cross-engine hashes alone, and test aggregate equivalence when the intended grain changes.

5. On the authorised validation copy, replay an update, a delete, a late-arriving event and a repeated batch. Check dimension history, aggregate changes and idempotency against the declared rules, then rerun affected consumer queries.

6. Produce the discrepancy ledger and cutover recommendation. Give every unexplained difference an owner, preserve excluded partitions and failed replays, and hand the dossier to the cutover owner without switching production traffic.

## Boundaries

- The Data Engineer definition supplies design and quality-review instructions, not warehouse connectors or an executable migration verifier. Map host tools and exchange query/result files explicitly; this recipe is not a tested integration.

- The agent inherits host tools and names a host-specific model alias. Restrict it to the agreed extracts and validation targets; source writes, destination repairs and cutover require their own approval.

- Cross-engine SQL and snapshot mechanisms must be checked against the actual engine versions before execution. A sample comparison does not establish full-population equivalence, and query costs remain subject to the agreed budget.

## Expected output

A migration reconciliation dossier that identifies matched data, unexplained differences and the evidence still needed for a cutover decision.

## Deliverables

- Versioned data-cut and grain/key comparison contract.

- Rerunnable comparison queries with result and execution receipts.

- Record-level discrepancy ledger and incremental-replay results.

- Consumer compatibility and cutover recommendation with unresolved owners.

## Acceptance checks

- [ ] Reject a same-data claim when the snapshot, watermark or included partitions differ without an explicit reconciliation rule.

- [ ] Fail key equivalence on unexplained missing keys, duplicates or join fan-out even if overall row counts match.

- [ ] Exercise null, empty string, decimal rounding and time-zone boundary cases; unexplained coercions remain defects rather than formatting differences.

- [ ] Recompute critical aggregates at the agreed grain; a matching grand total must not hide offsetting partition errors.

- [ ] Verify update, delete, late-arrival and repeated-batch fixtures against the stated incremental rules; record unexecuted cases as gaps.

- [ ] Check consumer query results and dimension-history semantics, not just table checksums or a successful load status.

- [ ] Block cutover approval for unresolved material differences under the owner's tolerance policy; a sampled or incomplete pass is labelled with its actual coverage.

Workflow: https://undominated.ai/workflows/#reconcile-a-warehouse-migration
