PAY-PER-CALL RECONCILIATION EXERCISE — FICTIONAL, 2026-11-06

Save reconcile.py and both fictional input CSVs into one directory. They are
teaching records, not VICIdial import files or an invoice. Python3 standard
library only. No database credentials or network access are used.

Run:
python3 -B reconcile.py

The command creates a new results/ directory. It refuses to overwrite an
existing directory. To retain several runs, pass --output results-run2.
Inspect decisions.csv, candidate-billable.csv and summary.json, then compare
with the provided expected files. Do not treat only the printed total as proof.

Fictional contract, version TRAINING-1:
- Include started_utc >=2026-11-06T00:00:00Z and <2026-11-07T00:00:00Z.
- Exactly one reviewed source attribution must match a unique call_id.
- connected_seconds >=60, qualified=Y, duplicate=N, consent_reviewed=Y.
- SOURCE_A pays USD12.50 and SOURCE_B USD18.00 per qualifying call.
These are invented prices and business predicates. The consent_reviewed flag
is an input to this example, not a finding about any law or actual consent.
Real buyer acceptance, fraud rules, geographic restrictions and dispute rules
must be added if the signed contract requires them; this is not a universal rule.

The connected_seconds input is fictional verified media duration. It is NOT
automatically vicidial_closer_log.length_in_sec. CALLER/AGENT term_reason values
are termination categories, not proof that a person answered or qualified.
An unknown duration/review/identity must be investigated, never filled with an
optimistic default to make a row billable.

Expected population:
9 raw calls; C009 falls exactly on the excluded end boundary.
8 in-window calls =6 unique attributions +1 ambiguous(C004) +1 unmatched(C005).
C002 is too short; C003 is not qualified; C006 is a duplicate; C007 lacks review.
C001 and C008 satisfy every example predicate:2 candidates, USD30.50 total.
The candidate export uses the SAME predicate result as the summary; it is not
an unfiltered call-log export with a billable label.

For your own contract, first write and approve the predicate specification,
verify raw-call uniqueness and join cardinality, and trace each duration/status
field to its source. Keep raw evidence, contract version, scope/timezone and
decision reasons. Reconcile differences by identity with the buyer before
issuing a bill. Do not delete disputed records to force totals to agree.
