# Reconcile two data extracts

Establish row grain, cutoff and comparison rules before classifying differences between two frozen exports.

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

- Two authorised immutable exports with hashes, source row identifiers, extraction queries or filters, extraction times and snapshot/cutoff evidence.

- The intended row grain, candidate keys, units, timezone, field definitions and known differences in source coverage.

- A prepared local SQL or Python environment, applicable data-handling rules and the data owners who can decide comparison rules.

## Reviewed resources

### SQL Pro

Help review grain, key cardinality and comparison queries before the owner executes the local reconciliation.
https://undominated.ai/agents/wshobson-sql-pro/

Reviewed: 2026-10-13; revision: 46891e7e60da0e52baf1050b7b6391b64e84c6d9
Definition SHA-256: 6eb2fdb139b7971ae98b604ad7d22f6710f904ca74cf00e8961dbe81159513d7
Source: https://raw.githubusercontent.com/wshobson/agents/46891e7e60da0e52baf1050b7b6391b64e84c6d9/plugins/database-design/agents/sql-pro.md

Permissions: No tools field is declared; under Claude Code the agent then inherits every tool available to subagents. The model is inherit.; The Response Approach asks it to design schemas, write queries, implement indexing and test performance. 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

- SQL features and tuning advice are not portable across all named engines. Supply the exact engine, version, schema and workload.

- The prompt contains no database driver, benchmark harness or read-only enforcement. Generated timing estimates are not measurements.

- DDL, DML, production benchmarks and backup changes need explicit target and permission 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.

### Python Notebook Sample Builder

Optionally help assemble a new reconciliation notebook from locally executed snippets and retained outputs in a prepared Python environment.
https://undominated.ai/agents/github-python-notebook-sample-builder/

Reviewed: 2026-10-14; revision: 3a685010a7afdc0dbd4c83b7fbda6c316aa516e5
Definition SHA-256: a2dd06852ba4655565f9daecd939fb7ee87f7bb789442a555a706df3ed7e7980
Source: https://raw.githubusercontent.com/github/awesome-copilot/3a685010a7afdc0dbd4c83b7fbda6c316aa516e5/agents/python-notebook-sample-builder.agent.md

Permissions: vscode, execute, read, edit, search, web, mslearnmcp/*, Python environment tools, and Jupyter package tools.
Cost boundary: MIT. The file does not state a hosted-model price.
Licence: MIT — https://github.com/github/awesome-copilot/blob/3a685010a7afdc0dbd4c83b7fbda6c316aa516e5/LICENSE

#### Component limitations

- The prompt assumes a development container and broad package-install permissions; do not apply that assumption to an arbitrary host.

- Python, Jupyter and Microsoft Learn tool identifiers depend on installed VS Code integrations.

- Executing notebook cells can call paid APIs or change external data. Use authorized test inputs and inspect those effects before running.

- Terminal execution alone does not prove clean-kernel notebook execution order; rerun the assembled notebook from a fresh kernel.

#### Not runtime-verified

- The agent was not executed against a live repository or host.

### Study Design and Evidence Statistician

Help challenge missingness, population coverage and aggregate-equality claims in the independent evidence review.
https://undominated.ai/agents/agency-statistician/

Reviewed: 2026-10-13; revision: 4bce55aa8b97385a5ad7b37d09b44ab976b96573
Definition SHA-256: 4b023595c59becec2026cab38807f835e48e280885f9cd381bab7845cbf4280c
Source: https://raw.githubusercontent.com/msitarzewski/agency-agents/4bce55aa8b97385a5ad7b37d09b44ab976b96573/academic/academic-statistician.md

Permissions: No tool allowlist is declared, so the configured host tool set is inherited.; Access to data, statistical runtimes and output files must be bounded by the host and the study’s own handling requirements.
Cost boundary: The definition is reusable under its stated licence. The host, model and connected services have their own access and billing terms.
Licence: MIT — https://github.com/msitarzewski/agency-agents/blob/4bce55aa8b97385a5ad7b37d09b44ab976b96573/LICENSE

#### Component limitations

- The prompt does not supply data, a statistical runtime or a validated analysis package. Calculations require suitable tools and reproducible inputs.

- Its persona memory does not create persistent storage, and its templates cannot certify statistical correctness.

- For Claude Code, the hexadecimal color #8B5CF6 is not one of the eight documented color names; adjust it in a working copy. The download preserves the original.

#### Not runtime-verified

- This agent has not been executed or benchmarked.

- Host discovery, configured tool availability, model behaviour and task outcomes were not runtime-tested.

## Independent research tasks

- Grain analyst: Profile each frozen export independently in grain-profile.md: row counts, key uniqueness, duplicate multiplicities, missing keys, cutoff boundaries and source coverage. Preserve source row identities.

- Comparison-rule reviewer: Write comparison-rules.md from field definitions and source evidence. Propose unit/time conversions, null and blank treatment, numeric tolerances and exclusions with a reason for each; preserve raw values.

- Evidence challenger: Write reconciliation-cases.md from the same inputs, specifying independently checkable null, duplicate, boundary-time and offsetting-value cases. Identify where equal totals or a join could conceal row differences.

## Sequence and verification

1. Name a reconciliation owner and freeze both exports, extraction evidence and local environment versions. Confirm the permitted output directory and give the same inputs to all roles. If a source is unavailable, request its authorised redacted export through the owner and leave its evidence gap visible.

2. Review the three independent files before joining. The owner agrees a common grain, comparable cutoff/timezone and normalisation contract with the data owners. If no valid common grain exists, report that limit or define a separately traceable aggregation; do not manufacture row matches.

3. Create a derived copy with stable source row IDs and raw-to-normalised value columns. Flag missing keys, duplicates, cutoff exclusions and incomparable rows before matching. Do not pick an arbitrary duplicate or silently deduplicate. Specify and test the actual runner's null-key matching and null-value comparison behaviour.

4. Run a deterministic full comparison at the agreed grain in the existing local environment. Emit row links and mutually exclusive primary dispositions for equal, changed, left-only, right-only, duplicate/unresolved and incomparable/excluded records, with secondary reason flags. Retain queries or code, rule version, environment, exit status and output hashes.

5. Reconcile source-row accounting separately for each extract so every input row has exactly one primary disposition. Verify the independently designed edge cases and inspect source-linked examples from each nonempty category. Record aggregate totals as additional evidence, never as proof of row equality.

6. Package the executable comparison and receipts; optionally assemble a new notebook from snippets already run in the prepared environment. Route unexplained differences to their data owners. If accounting, cutoff or comparison checks fail, mark the run invalid, retain the evidence and rebuild derived outputs from the untouched exports under a new run ID.

## Boundaries

- Prefer local exports; no warehouse connection is required. Any optional source read must use the confirmed database/account and a role limited to the approved objects. The profiles do not enforce read-only access.

- SQL Pro and the Statistician target Claude Code; the notebook profile targets VS Code Copilot with Python/Jupyter integrations. Verify host tools and pass files explicitly. Use the existing runner and a plain script/report when notebook integrations are unavailable; do not inherit the notebook profile's package-install or cloud-example assumptions.

- Null, missing, blank and zero remain distinct unless a documented domain rule equates them. Different cutoffs, units or populations can make a comparison inconclusive. Tolerances are owner-set and justified before the run.

- Limit shared reports to necessary redacted evidence and source row references. Tool licences do not authorise redistribution of exports; keep tokens, connection strings and unnecessary personal data out of notebooks and logs.

- Stop if a hash changes, the target is wrong, the common grain is unresolved or rows disappear from accounting. Corrections to source systems are a separate action requiring authority for named records and a recoverable pre-change state; this workflow writes only derived local artefacts.

## Expected output

A reproducible row ledger that accounts for both extracts and separates changed values, missing counterparts, duplicates and incomparable records.

## Deliverables

- Extract manifest and comparison contract with grain, cutoffs, units and explicit normalisation rules.

- Independent grain profiles, rule review and edge-case expectations.

- Source-linked row difference ledger and per-extract accounting table.

- Reproducible local query/script or optional notebook with execution receipts.

- Unexplained-difference handoff and invalid-run recovery record.

## Acceptance checks

- [ ] Both input hashes, extraction filters, snapshot/cutoff meanings and common row grain are recorded; incompatible coverage is labelled.

- [ ] Every original row ID occurs in exactly one primary disposition for its own extract, including duplicates and exclusions.

- [ ] Duplicate-key cardinality is measured before matching; no arbitrary row selection or many-to-many expansion is hidden.

- [ ] Null-key matching, null/blank/zero comparisons, numeric tolerances and time boundaries have explicit expected and observed cases.

- [ ] Every reported changed value links raw and normalised values to source rows; equal aggregates do not suppress row differences.

- [ ] A repeat run from the same frozen inputs and rules reproduces the ledger, or the difference is retained as a failed check.

Workflow: https://undominated.ai/workflows/#reconcile-two-data-extracts
