# AIVA Throttling Dry-Run Reporting Enhancements

This PRD focuses on enhancing the reporting capabilities of AIVA's throttling dry-run mode, providing more granular insights into the simulated throttling behavior.

### GPM-066: Implement Basic Dry-Run Report Generation
**Goal:** Generate a basic report summarizing the dry-run results.
**Acceptance Criteria:**
- A report file (e.g., JSON, CSV) is generated after a dry-run is completed.
- The report includes the total number of emails processed during the dry-run.
- The report includes the total number of emails that *would have been* throttled (dropped or queued) based on the configured throttling strategy.
**Files:** `aiva/throttling/dry_run_reporter.py`, `aiva/reporting/dry_run_report.json`
**Spawns:** Add granularity to the basic report, including breakdown by throttling rule.

### GPM-067: Rule-Based Throttling Breakdown in Dry-Run Report
**Goal:** Extend the dry-run report to provide a breakdown of throttled emails per throttling rule.
**Acceptance Criteria:**
- The report includes a section detailing each active throttling rule during the dry-run.
- For each rule, the report shows the number of emails that would have been throttled by that specific rule.
- The report format is updated to accommodate this new information (e.g., nested JSON structure).
**Files:** `aiva/throttling/dry_run_reporter.py`, `aiva/reporting/dry_run_report.json`
**Spawns:** Include timestamps of when throttling events would have occurred.

### GPM-068: Timestamp Logging for Simulated Throttling Events
**Goal:** Log the timestamps when emails would have been throttled during the dry-run.
**Acceptance Criteria:**
- The dry-run report includes a list of timestamps for each throttling rule, indicating when emails would have been throttled.
- Timestamps are recorded with millisecond precision.
- The report format is updated to store the timestamps for each rule.
**Files:** `aiva/throttling/dry_run_reporter.py`, `aiva/reporting/dry_run_report.json`
**Spawns:** Allow filtering the report by date range.

### GPM-069: Date Range Filtering for Dry-Run Reports
**Goal:** Implement filtering options for dry-run reports to analyze specific time periods.
**Acceptance Criteria:**
- A command-line argument (or API endpoint) is added to specify a start and end date for filtering the report.
- The report generation process filters the simulated throttling events based on the specified date range.
- The report only includes events that fall within the specified date range.
**Files:** `aiva/cli.py`, `aiva/api.py`, `aiva/throttling/dry_run_reporter.py`
**Spawns:** Add exporting functionality for the report in different formats.

### GPM-070: Export Dry-Run Reports in Multiple Formats
**Goal:** Support exporting dry-run reports in different formats (e.g., CSV, JSON, HTML).
**Acceptance Criteria:**
- A command-line argument (or API endpoint) is added to specify the desired export format.
- The report is generated in the selected format.
- The following formats are supported: CSV, JSON, HTML.
**Files:** `aiva/cli.py`, `aiva/api.py`, `aiva/reporting/dry_run_report.py`, `aiva/reporting/csv_exporter.py`, `aiva/reporting/html_exporter.py`
**Spawns:** Implement a UI for viewing the dry-run reports.

### GPM-071: Add Configuration option for Report Location
**Goal:** Allow users to configure the location where the dry-run reports are saved.
**Acceptance Criteria:**
- A configuration setting is added to specify the directory where dry-run reports are stored.
- The default location is a sensible default (e.g., `aiva/reports/dry_run`).
- The report generation process respects the configured report location.
**Files:** `aiva/config.py`, `aiva/throttling/dry_run_reporter.py`
**Spawns:** Add reporting on the resource usage (CPU, Memory) during the dry run.
