# Scan Report

# Scan Report

Specular generates a public `SpecularScanReport` class alongside `SpecularProvider`. Its `GetScanResults()` method returns a `Specular.Diagnostics.ScanResults` value containing every assembly, type, and service-descriptor scan resolved during compilation.

```csharp
var results = SpecularScanReport.GetScanResults();
```

Each report includes the name of the assembly that defined the scan expression and its selector expression normalized to one line. The result collections are grouped by scan kind:

- `AssemblyScanReports` lists the selected assemblies.
- `TypeScanReports` groups selected types by every assembly that was scanned. An assembly remains in the report even when no types matched.
- `ServiceDescriptorScanReports` groups emitted service descriptors by every assembly that was scanned. Each descriptor carries its effective `ServiceLifetime`, registered service type name, and implementation type name. Empty scan results are retained.

The report is pure compile-time metadata: it does not perform reflection or add trim/AOT requirements. It is suitable for tooling such as an external Mermaid renderer.

## Opting Out

Scan reports are generated by default. Disable them with:

```xml
<PropertyGroup>
  <SpecularGenerateDiagnostics>false</SpecularGenerateDiagnostics>
</PropertyGroup>
```