Xero trial balance integrity evaluation

Result: of 3 fictional CSV fixtures, the balanced file exports and the movement and year-to-date failures stop with nothing written. Reproduce the offline integrity gate below, then inspect the human review boundary.

Published 26 August 2026. Last reviewed 30 September 2026. Newer releases exist; the Xero trial balance export page names the current one.

Problem
An automated trial balance export can look tidy while one balance pair is wrong.
Control
Check movement and year-to-date debits against credits before any CSV write.
Evidence
Three fictional fixtures isolate a passing file, a movement failure and a YTD failure.
Result
One run exits 0. Two runs exit 1 and report that nothing was written.
Limit
Balance does not prove completeness, classification or approval.

Accounting problem

Xero’s Trial Balance endpoint returns current month movement and year-to-date values. Before any CSV write, the exporter independently checks both debit and credit pairs, so an imbalance in either pair stops the export.

The production tool reads trial balance data directly from Xero’s Accounting API Reports endpoint.

Intended reviewer

This pack is for a reviewer who wants to reproduce the offline integrity gate without connecting to Xero or handling client data.

Fictional inputs

The 3 CSV files are fictional output-shape fixtures. They are not Xero API responses or client records, and no OAuth flow runs in this evaluation. No Xero tenant credentials or tenant data are used.

Reproduce

Needs Git and Python 3.10 or newer with pip; the commands are the same on Windows, macOS and Linux. Clone the Accounting Review Pipeline at tag xero-trial-balance-export/v0.1.6 (commit 3ae854911bf36f00bd3cc3eeafd1855848896629) and run these commands from packages/xero-trial-balance-export. Dependency installation may download the hash-locked packages. Once dependencies are installed, the 3 evaluation runner commands are fully offline, make no network request and write no output file.

git clone --branch xero-trial-balance-export/v0.1.6 --depth 1 https://github.com/ryanduguid/accounting-review-pipeline.git
cd accounting-review-pipeline/packages/xero-trial-balance-export
python -m pip install --require-hashes -r requirements.lock
python -B -m unittest tests.test_evaluation_pack -v
python -B -m unittest discover -s tests -v
python evaluation/xero_tb_integrity/run.py ../../contracts/xero-trial-balance-v1/fixtures/passing.csv
python evaluation/xero_tb_integrity/run.py ../../contracts/xero-trial-balance-v1/fixtures/failing_movement.csv
python evaluation/xero_tb_integrity/run.py ../../contracts/xero-trial-balance-v1/fixtures/failing_ytd.csv

Expected result

Fictional fixture Expected result
passing.csv passing.csv exits 0 and reports that movement and YTD balance.
failing_movement.csv failing_movement.csv exits 1, identifies the movement pair and reports Nothing written.
failing_ytd.csv failing_ytd.csv exits 1, identifies the YTD pair and reports Nothing written.

Controls triggered

  • failing_movement.csv breaks only the current month Debit/Credit pair.
  • failing_ytd.csv breaks only the YTDDebit/YTDCredit pair.
  • The evaluation runner calls the production check_balanced gate before any CSV write.

Primary sources

Versions

Product release v0.1.6; fixture version 1; source reviewed 2026-08-26.

xero-trial-balance-export/v0.1.6 is the first monorepo release to contain this evaluation and the shared contract it exercises. The export behaviour is unchanged from v0.1.4, and the evaluation artefacts are fixed to that release’s commit.

Human decision

A balanced export passes this integrity control only; a human still decides completeness, classification, accounting treatment and fitness for review.

The integrity result does not approve the export or replace professional review.

Limitations

This control does not prove completeness, classification, accounting treatment or client approval. It does not assess source data accuracy, reporting period suitability or fitness for a particular client review. See Evidence and Assurance for the common assurance record and boundaries.