"""Small worked implementation: account for every dry-run source row."""
from collections import Counter

def summarize(rows):
    allowed={'create_proposal','skip','reject'}
    counts=Counter(row['action'] for row in rows)
    if set(counts)-allowed:
        raise ValueError('Unknown row action cannot be omitted from reconciliation')
    return {'input_rows':len(rows),'create_proposal':counts['create_proposal'],'skip':counts['skip'],'reject':counts['reject'],'erp_writes':0,'reconciled':len(rows)==sum(counts.values()),'mode':'dry_run'}
