- Add GET /metrics/summary endpoint with global coverage counts and percentage - Add GET /metrics/by-tactic endpoint with per-tactic coverage breakdown - Handle multi-tactic techniques (comma-separated) counting in each tactic - Add CoverageSummary and TacticCoverage Pydantic schemas - Update README with metrics endpoints and project structure
28 lines
609 B
Python
28 lines
609 B
Python
"""Pydantic schemas for coverage-metrics endpoints."""
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class CoverageSummary(BaseModel):
|
|
"""Global coverage summary across all MITRE ATT&CK techniques."""
|
|
|
|
total_techniques: int
|
|
validated: int
|
|
partial: int
|
|
not_covered: int
|
|
in_progress: int
|
|
not_evaluated: int
|
|
coverage_percentage: float # (validated + partial) / total * 100
|
|
|
|
|
|
class TacticCoverage(BaseModel):
|
|
"""Coverage breakdown for a single tactic."""
|
|
|
|
tactic: str
|
|
total: int
|
|
validated: int
|
|
partial: int
|
|
not_covered: int
|
|
not_evaluated: int
|
|
in_progress: int
|