{% for v in g.violations %}
{% set lag = lag_days(v) %}
{% set src = source_label(v) %}
{# Each violation gets its own so Alpine x-data scopes
correctly over both the data row and the explain row. #}
{{ v.loss_sale_date or "—" }}
{{ v.loss_account or "—" }} → {{ v.buy_account or "—" }}
{{ v.triggering_buy_date or "—" }}
{% if lag is not none %}{{ lag }}d{% else %}—{% endif %}
, so HTMX innerHTML swap inserts
valid table content (a
inside a
is hoisted by browsers). #}
{% endfor %}
{% endfor %}
{% endif %}
{# C4: Exempt matches — §1256 contracts that were skipped by the wash-sale detector.
Shown as a sibling section below the violations table. Gray + line-through styling
signals "detected but not penalised". #}
{% if exempt_matches %}
§1256 Exempt Matches
These pairs were detected within the 30-day window but are exempt from wash-sale rules under IRC §1256(c).
Loss date
Loss → Buy
Trigger date
Ticker
Notional disallowed
Matched qty
Confidence
Exempt reason
{% for em in exempt_matches %}
{{ em.loss_sale_date or "—" }}
{{ em.loss_account or "—" }} → {{ em.buy_account or "—" }}