# AI Trace Compliance Report

> Generated by [AI Trace Auditor](https://github.com/BipinRimal314/ai-trace-auditor) v{{ version }}
> This report is an automated assessment, not legal advice. Consult qualified counsel for compliance decisions.

**Generated:** {{ report.generated_at.strftime('%Y-%m-%d %H:%M:%S UTC') }}
**Trace source:** {{ report.trace_source }}
**Traces analyzed:** {{ report.trace_count }} | **Spans:** {{ report.span_count }}
**Regulations checked:** {{ report.regulations_checked | join(', ') }}

---

## Overall Compliance Score: {{ (report.overall_score * 100) | round(1) }}%

| Status | Count |
|--------|-------|
| Satisfied | {{ report.summary.satisfied }} |
| Partial | {{ report.summary.partial }} |
| Missing | {{ report.summary.missing }} |
| N/A | {{ report.summary.not_applicable }} |

{% if report.summary.top_gaps %}
## Top Gaps

{% for gap in report.summary.top_gaps %}
{{ loop.index }}. {{ gap }}
{% endfor %}
{% endif %}

---

## Requirement Details

{% for result in report.requirement_results %}
### {{ result.requirement.id }}: {{ result.requirement.title }}

| | |
|---|---|
| **Status** | {{ result.status | upper }} ({{ (result.coverage_score * 100) | round(1) }}%) |
| **Regulation** | {{ result.requirement.regulation }} {{ result.requirement.article }} |
| **Severity** | {{ result.requirement.severity }} |

{{ result.requirement.description }}

{% if result.evidence %}
**Evidence found:**

| Field | Coverage | Sample |
|-------|----------|--------|
{% for e in result.evidence %}
| `{{ e.field_path }}` | {{ e.present_count }}/{{ e.population }} ({{ (e.coverage_pct * 100) | round(1) }}%) | {{ e.sample_values[:2] | join(', ') if e.sample_values else '-' }} |
{% endfor %}
{% endif %}

{% if result.gaps %}
**Gaps:**

{% for g in result.gaps %}
- **{{ g.description }}**
  - *Impact:* {{ g.impact }}
  - *Recommendation:* {{ g.recommendation }}

{% endfor %}
{% endif %}

---

{% endfor %}

## Methodology

This report was generated by analyzing {{ report.span_count }} LLM operation spans against {{ report.requirement_results | length }} regulatory requirements. Each requirement maps to specific trace data fields. Coverage is calculated as the percentage of spans containing the required field data.

- **Satisfied** (>= 95% coverage): All required data is present
- **Partial** (25-94% coverage): Some data is missing
- **Missing** (< 25% coverage): Critical data not being logged
