Reports Module¶
Report generation and templates for compliance reporting.
ReportGenerator¶
ReportGenerator ¶
Generator for compliance reports from audit data.
ReportGenerator retrieves audit entries from storage, runs compliance checks against configured frameworks, and produces comprehensive reports.
Attributes:
| Name | Type | Description |
|---|---|---|
storage |
Storage backend for retrieving audit entries. |
|
frameworks |
Dictionary mapping framework names to implementations. |
Example
from rotalabs_comply.audit.storage import MemoryStorage from rotalabs_comply.frameworks.eu_ai_act import EUAIActFramework
storage = MemoryStorage() frameworks = { ... "eu_ai_act": EUAIActFramework(), ... } generator = ReportGenerator(storage, frameworks)
Generate a report¶
report = await generator.generate( ... period_start=datetime(2026, 1, 1), ... period_end=datetime(2026, 1, 31), ... profile=profile, ... framework="eu_ai_act", ... )
Source code in src/rotalabs_comply/reports/generator.py
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 | |
__init__ ¶
__init__(
audit_logger: StorageProtocol,
frameworks: Optional[
Dict[FrameworkName, ComplianceFramework]
] = None,
) -> None
Initialize the report generator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
audit_logger
|
StorageProtocol
|
Storage backend implementing list_entries method. |
required |
frameworks
|
Optional[Dict[FrameworkName, ComplianceFramework]]
|
Optional dict mapping framework names to implementations. If not provided, compliance checks will be skipped. |
None
|
Example
generator = ReportGenerator(storage) generator = ReportGenerator(storage, {"soc2": SOC2Framework()})
Source code in src/rotalabs_comply/reports/generator.py
generate
async
¶
generate(
period_start: datetime,
period_end: datetime,
profile: ComplianceProfile,
framework: Optional[FrameworkName] = None,
format: Literal[
"markdown", "json", "html"
] = "markdown",
) -> ComplianceReport
Generate a comprehensive compliance report.
Retrieves audit entries for the specified period, runs compliance checks, and generates a full report with all standard sections.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
period_start
|
datetime
|
Start of the analysis period (inclusive). |
required |
period_end
|
datetime
|
End of the analysis period (inclusive). |
required |
profile
|
ComplianceProfile
|
ComplianceProfile defining evaluation parameters. |
required |
framework
|
Optional[FrameworkName]
|
Specific framework to report on (None = all in profile). |
None
|
format
|
Literal['markdown', 'json', 'html']
|
Output format hint (used for template selection). |
'markdown'
|
Returns:
| Type | Description |
|---|---|
ComplianceReport
|
ComplianceReport with all sections populated. |
Example
report = await generator.generate( ... period_start=datetime(2026, 1, 1), ... period_end=datetime(2026, 1, 31), ... profile=profile, ... format="markdown", ... ) print(f"Generated: {report.title}") print(f"Entries: {report.total_entries}") print(f"Score: {report.compliance_score:.2%}")
Source code in src/rotalabs_comply/reports/generator.py
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 | |
generate_executive_summary
async
¶
generate_executive_summary(
period_start: datetime,
period_end: datetime,
profile: ComplianceProfile,
) -> ComplianceReport
Generate a high-level executive summary report.
Creates a condensed report suitable for executive audiences, focusing on key metrics and critical findings without technical details.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
period_start
|
datetime
|
Start of the analysis period. |
required |
period_end
|
datetime
|
End of the analysis period. |
required |
profile
|
ComplianceProfile
|
ComplianceProfile defining evaluation parameters. |
required |
Returns:
| Type | Description |
|---|---|
ComplianceReport
|
ComplianceReport with executive-focused sections. |
Example
report = await generator.generate_executive_summary( ... period_start=datetime(2026, 1, 1), ... period_end=datetime(2026, 3, 31), ... profile=profile, ... ) print(f"Status: {report.status}") print(f"Score: {report.compliance_score:.2%}")
Source code in src/rotalabs_comply/reports/generator.py
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 | |
export_markdown ¶
Export report to Markdown format.
Creates a well-formatted Markdown document with proper headings, tables, and structure suitable for documentation or rendering.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
report
|
ComplianceReport
|
ComplianceReport to export. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Markdown formatted string. |
Example
md = generator.export_markdown(report) with open("report.md", "w") as f: ... f.write(md)
Source code in src/rotalabs_comply/reports/generator.py
export_json ¶
Export report to JSON format.
Creates a JSON document with all report data, suitable for programmatic processing or API responses.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
report
|
ComplianceReport
|
ComplianceReport to export. |
required |
Returns:
| Type | Description |
|---|---|
str
|
JSON formatted string (pretty-printed). |
Example
json_str = generator.export_json(report) data = json.loads(json_str) print(data["compliance_score"])
Source code in src/rotalabs_comply/reports/generator.py
export_html ¶
Export report to HTML format.
Creates a standalone HTML document with embedded styles, suitable for viewing in a browser or embedding in web applications.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
report
|
ComplianceReport
|
ComplianceReport to export. |
required |
Returns:
| Type | Description |
|---|---|
str
|
HTML formatted string. |
Example
html = generator.export_html(report) with open("report.html", "w") as f: ... f.write(html)
Source code in src/rotalabs_comply/reports/generator.py
665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 | |
Generator for compliance reports from audit data.
Constructor¶
ReportGenerator(
audit_logger: StorageProtocol,
frameworks: Optional[Dict[str, ComplianceFramework]] = None,
)
Parameters:
| Parameter | Type | Description |
|---|---|---|
audit_logger |
StorageProtocol |
Storage backend with list_entries method |
frameworks |
Optional[Dict] |
Framework name -> implementation mapping |
Example:
from rotalabs_comply import ReportGenerator
from rotalabs_comply.audit import MemoryStorage
from rotalabs_comply.frameworks.eu_ai_act import EUAIActFramework
from rotalabs_comply.frameworks.soc2 import SOC2Framework
storage = MemoryStorage()
generator = ReportGenerator(
audit_logger=storage,
frameworks={
"eu_ai_act": EUAIActFramework(),
"soc2": SOC2Framework(),
},
)
Methods¶
generate¶
async def generate(
period_start: datetime,
period_end: datetime,
profile: ComplianceProfile,
framework: Optional[str] = None,
format: Literal["markdown", "json", "html"] = "markdown",
) -> ComplianceReport
Generate a comprehensive compliance report.
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
period_start |
datetime |
Required | Analysis start (inclusive) |
period_end |
datetime |
Required | Analysis end (inclusive) |
profile |
ComplianceProfile |
Required | Evaluation configuration |
framework |
Optional[str] |
None |
Specific framework (None=all) |
format |
str |
"markdown" |
Output format hint |
Returns: ComplianceReport
Example:
from datetime import datetime, timedelta
end = datetime.utcnow()
start = end - timedelta(days=30)
report = await generator.generate(
period_start=start,
period_end=end,
profile=profile,
framework="eu_ai_act",
)
generate_executive_summary¶
async def generate_executive_summary(
period_start: datetime,
period_end: datetime,
profile: ComplianceProfile,
) -> ComplianceReport
Generate a condensed executive summary report.
Example:
report = await generator.generate_executive_summary(
period_start=start,
period_end=end,
profile=profile,
)
export_markdown¶
Export report to Markdown format.
Example:
export_json¶
Export report to JSON format (pretty-printed).
Example:
export_html¶
Export report to standalone HTML format.
Example:
ComplianceReport¶
ComplianceReport
dataclass
¶
A complete compliance report with all sections and metadata.
ComplianceReport contains the full results of a compliance evaluation, including all sections, summary statistics, and compliance scoring.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Unique identifier for this report. |
title |
str
|
Report title. |
framework |
Optional[FrameworkName]
|
Framework evaluated (None for multi-framework reports). |
period_start |
datetime
|
Start of the analysis period. |
period_end |
datetime
|
End of the analysis period. |
generated_at |
datetime
|
When the report was generated. |
profile |
ComplianceProfile
|
ComplianceProfile used for evaluation. |
summary |
Dict[str, Any]
|
Summary statistics dictionary. |
sections |
List[ReportSection]
|
List of report sections. |
total_entries |
int
|
Total audit entries analyzed. |
violations_count |
int
|
Number of violations found. |
compliance_score |
float
|
Overall compliance score (0.0 to 1.0). |
status |
Literal['compliant', 'non_compliant', 'needs_review']
|
Overall compliance status. |
Example
report = ComplianceReport( ... id="rpt-001", ... title="Q1 2026 Compliance Report", ... framework=None, # Multi-framework ... period_start=datetime(2026, 1, 1), ... period_end=datetime(2026, 3, 31), ... generated_at=datetime.utcnow(), ... profile=profile, ... summary={"total": 10000, "violations": 5}, ... sections=[executive_summary, risk_assessment], ... total_entries=10000, ... violations_count=5, ... compliance_score=0.9995, ... status="compliant", ... ) print(f"Compliance: {report.compliance_score:.2%}") Compliance: 99.95%
Source code in src/rotalabs_comply/reports/generator.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |
to_dict ¶
Convert report to dictionary for serialization.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Dict containing all report data. |
Example
data = report.to_dict() print(data["status"]) 'compliant'
Source code in src/rotalabs_comply/reports/generator.py
A complete compliance report with all sections and metadata.
Attributes:
| Attribute | Type | Description |
|---|---|---|
id |
str |
Unique report identifier |
title |
str |
Report title |
framework |
Optional[str] |
Framework evaluated (None=multiple) |
period_start |
datetime |
Analysis period start |
period_end |
datetime |
Analysis period end |
generated_at |
datetime |
When report was generated |
profile |
ComplianceProfile |
Profile used for evaluation |
summary |
Dict[str, Any] |
Summary statistics |
sections |
List[ReportSection] |
Report sections |
total_entries |
int |
Entries analyzed |
violations_count |
int |
Violations found |
compliance_score |
float |
Score 0.0-1.0 |
status |
str |
"compliant", "non_compliant", "needs_review" |
Methods:
| Method | Returns | Description |
|---|---|---|
to_dict() |
Dict[str, Any] |
Convert to dictionary |
Templates¶
ReportSection¶
ReportSection
dataclass
¶
A section within a compliance report.
Report sections can contain nested subsections to create hierarchical report structures. Each section has a title, content, and optional metadata for additional context.
Attributes:
| Name | Type | Description |
|---|---|---|
title |
str
|
Section heading/title. |
content |
str
|
Main content of the section (text, markdown, etc.). |
subsections |
List['ReportSection']
|
Nested sections within this section. |
metadata |
Dict[str, Any]
|
Additional data about the section (charts, tables, etc.). |
Example
section = ReportSection( ... title="Risk Assessment", ... content="This section analyzes identified compliance risks.", ... subsections=[ ... ReportSection( ... title="Critical Risks", ... content="No critical risks identified.", ... ), ... ReportSection( ... title="High Risks", ... content="2 high-risk violations require attention.", ... ), ... ], ... metadata={"risk_count": 2, "max_severity": "high"}, ... )
Access nested sections¶
for sub in section.subsections: ... print(f"- {sub.title}") - Critical Risks - High Risks
Source code in src/rotalabs_comply/reports/templates.py
to_dict ¶
Convert section to dictionary for serialization.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Dict containing all section data including nested subsections. |
Example
section = ReportSection(title="Test", content="Content") data = section.to_dict() print(data["title"]) 'Test'
Source code in src/rotalabs_comply/reports/templates.py
to_markdown ¶
Render section as markdown with appropriate heading levels.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level
|
int
|
Heading level (default 2 = ##). Subsections use level + 1. |
2
|
Returns:
| Type | Description |
|---|---|
str
|
Markdown formatted string of the section. |
Example
section = ReportSection(title="Summary", content="All good.") print(section.to_markdown())
Summary¶
Source code in src/rotalabs_comply/reports/templates.py
A section within a compliance report.
Attributes:
| Attribute | Type | Description |
|---|---|---|
title |
str |
Section heading |
content |
str |
Main content (text/markdown) |
subsections |
List[ReportSection] |
Nested sections |
metadata |
Dict[str, Any] |
Additional data |
Methods:
| Method | Returns | Description |
|---|---|---|
to_dict() |
Dict[str, Any] |
Convert to dictionary |
to_markdown(level=2) |
str |
Render as markdown |
Example:
from rotalabs_comply.reports.templates import ReportSection
section = ReportSection(
title="Risk Assessment",
content="Analysis of identified risks...",
subsections=[
ReportSection(title="Critical Risks", content="None found."),
ReportSection(title="High Risks", content="2 issues identified."),
],
metadata={"risk_count": 2},
)
print(section.to_markdown())
ReportTemplate¶
ReportTemplate
dataclass
¶
Template defining the structure and format of a compliance report.
Templates specify which framework the report covers, its title, which sections to include, and the output format.
Attributes:
| Name | Type | Description |
|---|---|---|
framework |
FrameworkType
|
The compliance framework this template is for. |
title |
str
|
Default title for reports using this template. |
sections |
List[str]
|
List of section names to include in the report. |
format |
Literal['markdown', 'json', 'html']
|
Output format for the report (markdown, json, or html). |
Example
template = ReportTemplate( ... framework="eu_ai_act", ... title="EU AI Act Compliance Report", ... sections=[ ... "executive_summary", ... "risk_assessment", ... "compliance_matrix", ... "recommendations", ... ], ... format="markdown", ... )
Check what sections will be included¶
"risk_assessment" in template.sections True
Source code in src/rotalabs_comply/reports/templates.py
to_dict ¶
Convert template to dictionary.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Dict containing template configuration. |
Source code in src/rotalabs_comply/reports/templates.py
Template defining report structure and format.
Attributes:
| Attribute | Type | Description |
|---|---|---|
framework |
str |
Target framework |
title |
str |
Default title |
sections |
List[str] |
Section names to include |
format |
str |
Output format |
Pre-defined Templates¶
EU_AI_ACT_TEMPLATE¶
EU_AI_ACT_TEMPLATE
module-attribute
¶
EU_AI_ACT_TEMPLATE = ReportTemplate(
framework="eu_ai_act",
title="EU AI Act Compliance Report",
sections=[
"executive_summary",
"risk_classification",
"risk_assessment",
"transparency_obligations",
"human_oversight",
"compliance_matrix",
"data_governance",
"technical_documentation",
"recommendations",
"audit_summary",
],
format="markdown",
)
Template for EU AI Act compliance reports.
Includes sections required for demonstrating compliance with the European Union's Artificial Intelligence Act, focusing on risk classification, transparency, and human oversight requirements.
Example
from rotalabs_comply.reports.templates import EU_AI_ACT_TEMPLATE print(EU_AI_ACT_TEMPLATE.title) 'EU AI Act Compliance Report'
Template for EU AI Act compliance reports.
Sections: - executive_summary - risk_classification - risk_assessment - transparency_obligations - human_oversight - compliance_matrix - data_governance - technical_documentation - recommendations - audit_summary
SOC2_TEMPLATE¶
SOC2_TEMPLATE
module-attribute
¶
SOC2_TEMPLATE = ReportTemplate(
framework="soc2",
title="SOC2 Type II Compliance Report",
sections=[
"executive_summary",
"system_overview",
"risk_assessment",
"security_controls",
"availability_controls",
"processing_integrity",
"confidentiality_controls",
"privacy_controls",
"compliance_matrix",
"recommendations",
"audit_summary",
],
format="markdown",
)
Template for SOC2 Type II compliance reports.
Covers the five Trust Service Criteria: Security, Availability, Processing Integrity, Confidentiality, and Privacy.
Example
from rotalabs_comply.reports.templates import SOC2_TEMPLATE "security_controls" in SOC2_TEMPLATE.sections True
Template for SOC2 Type II compliance reports.
Sections: - executive_summary - system_overview - risk_assessment - security_controls - availability_controls - processing_integrity - confidentiality_controls - privacy_controls - compliance_matrix - recommendations - audit_summary
HIPAA_TEMPLATE¶
HIPAA_TEMPLATE
module-attribute
¶
HIPAA_TEMPLATE = ReportTemplate(
framework="hipaa",
title="HIPAA Compliance Report",
sections=[
"executive_summary",
"risk_assessment",
"administrative_safeguards",
"physical_safeguards",
"technical_safeguards",
"breach_notification",
"phi_handling",
"compliance_matrix",
"recommendations",
"audit_summary",
],
format="markdown",
)
Template for HIPAA compliance reports.
Covers the Security Rule requirements including Administrative, Physical, and Technical Safeguards for Protected Health Information (PHI).
Example
from rotalabs_comply.reports.templates import HIPAA_TEMPLATE "phi_handling" in HIPAA_TEMPLATE.sections True
Template for HIPAA compliance reports.
Sections: - executive_summary - risk_assessment - administrative_safeguards - physical_safeguards - technical_safeguards - breach_notification - phi_handling - compliance_matrix - recommendations - audit_summary
EXECUTIVE_SUMMARY_TEMPLATE¶
EXECUTIVE_SUMMARY_TEMPLATE
module-attribute
¶
EXECUTIVE_SUMMARY_TEMPLATE = ReportTemplate(
framework="any",
title="Compliance Executive Summary",
sections=[
"executive_summary",
"key_metrics",
"risk_assessment",
"critical_findings",
"recommendations",
],
format="markdown",
)
Template for high-level executive summary reports.
Designed for executive audiences, focusing on key metrics, critical findings, and high-priority recommendations without technical details.
Example
from rotalabs_comply.reports.templates import EXECUTIVE_SUMMARY_TEMPLATE len(EXECUTIVE_SUMMARY_TEMPLATE.sections) 5
Template for executive summary reports.
Sections: - executive_summary - key_metrics - risk_assessment - critical_findings - recommendations
Section Generators¶
generate_executive_summary¶
Generate executive summary from statistics.
Expected stats keys:
- total_entries: int
- violations_count: int
- compliance_rate: float (0-100)
- critical_violations: int
- high_violations: int
- period_start: str
- period_end: str
- frameworks: List[str]
Example:
from rotalabs_comply.reports.templates import generate_executive_summary
stats = {
"total_entries": 10000,
"violations_count": 15,
"compliance_rate": 99.85,
"critical_violations": 0,
"high_violations": 2,
"period_start": "2026-01-01",
"period_end": "2026-01-31",
"frameworks": ["EU AI Act", "SOC2"],
}
section = generate_executive_summary(stats)
print(section.metadata["status"]) # "NEEDS REVIEW"
generate_risk_assessment¶
Generate risk assessment from violations.
Returns section with metadata:
- overall_risk: str
- severity_counts: Dict[str, int]
- category_counts: Dict[str, int]
- violation_count: int
generate_compliance_matrix¶
Generate compliance matrix from check results.
Returns section with metadata:
- frameworks: List[str]
- total_checks: int
- total_passed: int
- total_violations: int
- compliance_rate: float
generate_recommendations¶
Generate prioritized recommendations from violations.
Returns section with metadata:
- recommendation_count: int
- immediate_count: int
- short_term_count: int
- long_term_count: int
generate_metrics_summary¶
Generate metrics summary from audit entries.
Returns section with metadata:
- entry_count: int
- safety_rate: float
- avg_latency: float
- p50_latency: float
- p95_latency: float
- p99_latency: float
generate_audit_summary¶
Generate audit summary for a period.
Returns section with metadata:
- period: str
- entry_count: int
- days_active: int
- avg_daily: float
- peak_daily: int