recon_gen.cli.audit

recon-gen audit — PDF reconciliation report.

Three operations:

apply — emit Markdown source for the report (default), or

--execute to write a PDF via reportlab.

clean — list the report file that would be removed (default), or

--execute to delete it.

test — pytest the audit module + pyright.

The report is a regulator-ready PDF generated directly from the database, querying the per-prefix L1 invariant matviews + base tables. Same emit-vs-execute pattern as the other artifact groups — no --execute means the integrator can review the rendered Markdown / page outline before committing to a real PDF write.

Phase U.2 ships the executive summary page on top of the U.1 cover: per-period totals (transaction count, transfer count, dollar volume gross/net) + L1 invariant exception counts (drift, ledger drift, overdraft, limit breach, stuck pending, stuck unbundled, supersession). Real numbers when demo_database_url is configured; graceful “—” placeholders + a notice when it isn’t, so the layout stays previewable without a live DB.

Page footer carries a provenance-fingerprint placeholder (real fingerprint lands in U.7). Per-invariant violation tables, the per-account-day Daily Statement walk, and the sign-off block land in U.3+.

Period default: trailing:7 (a 7-day window ending yesterday). Override with --period <shape> — see --help for the full accepted-shapes list (trailing:N, today, yesterday, YYYY-MM-DD..YYYY-MM-DD, or single YYYY-MM-DD).

Classes

DailyStatementTransaction(transaction_id, ...)

One Posted-Money record on a Daily Statement walk page.

DailyStatementWalk(account_id, account_name, ...)

One per-(account, business_day) Daily Statement page.

DriftViolation(account_id, account_name, ...)

One row of the <prefix>_drift matview, audit-shaped.

ExecSummary(transactions_count, ...)

Totals rendered on the executive summary page.

LimitBreachChildGroupSummary(parent_role, ...)

Per (parent_role, rail_name) roll-up of breaching children.

LimitBreachViolation(account_id, ...)

One row of the <prefix>_limit_breach matview, audit-shaped.

MatviewEvidence(matview, row_count, sha256)

One matview's row count + SHA256 for the provenance appendix.

OverdraftChildGroupSummary(parent_role, ...)

Per parent-role roll-up of overdrawn child (template) accounts.

OverdraftViolation(account_id, account_name, ...)

One row of the <prefix>_overdraft matview, audit-shaped.

StuckPendingChildGroupSummary(parent_role, ...)

Per (parent_role, rail_name) roll-up of stuck child txns.

StuckPendingViolation(account_id, ...)

One row of the <prefix>_stuck_pending matview, audit-shaped.

StuckUnbundledChildGroupSummary(parent_role, ...)

Per (parent_role, rail_name) roll-up of unbundled child txns.

StuckUnbundledViolation(account_id, ...)

One row of the <prefix>_stuck_unbundled matview, audit-shaped.

SupersessionAggregate(base_table, ...)

Per (base_table, category) total count, all-time.

SupersessionAuditData(aggregates, ...)

All-table supersession audit data: aggregates + in-window details.

SupersessionDailyBalanceDetail(account_id, ...)

One in-window correcting entry from <prefix>_daily_balances.

SupersessionTransactionDetail(...)

One in-window correcting entry from <prefix>_transactions.

Modules

markdown

Markdown renderers for the audit report.

pdf

PDF renderers for the audit report.