# Prod Reconcile Gap Backfill - 2026-05-25 21:28:01 CST

## Purpose

This directory records the production data gap backfill effort initiated after
the `Salesforce Prod Reconcile` report found mismatches between live
Salesforce data and the current TiDB production dataset.

The current goal is:

1. use the reconcile report as the authoritative gap inventory
2. derive a concrete backfill dataset from the missing-source IDs
3. load the approved dataset into the production system
4. keep a durable audit trail for what was identified, generated, and applied

Important implementation note:

- the GitHub reconcile artifact only preserves sampled mismatch IDs
- the full missing-ID set must be recomputed live from Salesforce and TiDB when
  generating the actual backfill dataset

## Source Report

- Workflow: `Salesforce Prod Reconcile`
- Run: `26401749356`
- Job: `77715460855`
- Commit: `eda66ffeb56aad6b7d9bc64da7e9c46d8e963c0a`
- Report URL: `https://github.com/pingcap-inc/nexuscrm-pingcap-pack/actions/runs/26401749356`
- Source mode: `live_salesforce`
- Source org: `https://pingcap.my.salesforce.com`

## What This Directory Must Contain

- the reconcile mismatch summary used as the backfill input
- a written scope split between:
  - objects that are safe to backfill from missing source IDs
  - objects that also have unexpected extra target IDs and therefore need
    cleanup or manual review before any blind import
- the generated backfill dataset or dataset manifests
- execution notes for any production import that is actually applied

## Current Decision Boundary

This reconcile result is not a blanket signal to run a single full repair.

We have three classes of mismatch:

1. missing-only objects
   - candidate for targeted export + targeted import
2. extra-only objects
   - not a backfill problem; requires cleanup or allowlist review
3. both missing and extra
   - not safe for blind backfill; must be analyzed as mixed drift

Only class `missing-only` should be considered for the first fast backfill
dataset.

## Proposed Deliverables

1. `reconcile-mismatch-summary.json`
   - machine-readable summary extracted from the GitHub artifact
2. `backfill-scope.md`
   - human-readable triage of which objects are safe for direct backfill
3. generated object-level datasets
   - one file or manifest per approved object batch
4. import execution notes
   - exact command, operator, timestamp, and verification result

## Dataset Generation Rule

The generated dataset must not trust sampled IDs from the GitHub artifact as a
complete source of truth.

The export program must:

1. re-fetch live Salesforce IDs for the approved object
2. re-fetch current TiDB IDs for the target table
3. recompute the full missing-ID set
4. export the exact missing records by `Id IN (...)`

## Recommended Additions

The following additions should be preserved in this folder as the work
continues:

1. a final approved object list for the first production import batch
2. the exact export command used to fetch missing records from Salesforce
3. the exact load command used to import the dataset into TiDB
4. post-import reconcile evidence proving the gap was closed
5. explicit exclusions for objects intentionally not repaired in the first pass
