Pit Tax Reporter
Overview
Build reporter changes safely by preserving tax semantics and verifying full outputs. Use this workflow for IB, IB Flex Query, Schwab, Revolut, Coinbase, Raw, and shared tax models.
Workflow
- •Confirm target behavior before editing:
- •Expected output is
TaxReportandTaxRecordvalues by year. - •Required CLI/report table behavior if app flow is touched.
- •Normalize inputs deterministically:
- •Parse dates, currencies, and numeric values explicitly.
- •Handle malformed rows by dropping/raising consistently.
- •Keep financial semantics explicit:
- •Preserve FIFO matching and per-year aggregation rules.
- •Keep exchange-rate lookups and cache behavior consistent.
- •Prefer focused refactors:
- •Reduce duplication without changing external behavior.
- •Keep reporter responsibilities clear and testable.
- •Test with full-output assertions:
- •Compare full dataframes/tax reports, not selected fields.
- •Mock cross-module dependencies when unit-testing a module.
- •Run quality gates:
- •
uv run pytest -q - •
pre-commit run --all-files
Output Standard
Provide:
- •Behavior summary.
- •Exact files changed.
- •Test evidence (
pytest+pre-commitresults). - •Any assumptions or unresolved data-contract questions.
References
Use references/reporter-checklist.md for implementation and testing checks.