Results
results
Result models for Agent-friendly JSON output.
AuditResult
Bases: BaseModel
Aggregated result of a project audit.
Contains all individual check results and computed summary.
quality_score and grade may be passed explicitly (e.g. in
tests); otherwise they are computed from checks automatically.
Source code in packages/axm-audit/src/axm_audit/models/results.py
| Python | |
|---|---|
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 | |
crashed_rules
property
rule_ids whose check raised, in encounter order.
Crashed rules contribute score=0 to their scored category (they
are never silently dropped); this field makes a degraded audit
traceable rather than silent.
failed
property
Number of failed checks.
grade
property
Letter grade derived from quality_score.
A >= 90, B >= 80, C >= 70, D >= 60, F < 60. Returns None if quality_score is None.
quality_score
property
Weighted average across 9 code-quality categories.
Categories and weights
Linting (15%), Type Safety (15%), Complexity (15%), Testing (10%), Test Quality (10%), Security (10%), Dependencies (10%), Architecture (10%), Practices (5%).
Structure and tooling emit findings but are NOT scored (structure is handled by axm-init; tooling is informational). Returns None if no scored checks are present.
success
property
True if all checks passed.
total
property
Total number of checks.
CheckResult
Bases: BaseModel
Result of a single compliance check.
Designed for machine parsing by AI Agents.
Source code in packages/axm-audit/src/axm_audit/models/results.py
Severity
Bases: StrEnum
Severity level for check results.
Source code in packages/axm-audit/src/axm_audit/models/results.py
collect_category_scores(checks)
Group valid scores by category, filtering out unusable checks.
Reads the typed CheckResult.score field. When a check belongs to a
scored category but exposes score is None, a warning is emitted naming
the rule_id so that silently-dropped scores remain observable.
Source code in packages/axm-audit/src/axm_audit/models/results.py
crash_check_result(rule_id, category, message, *, details=None)
Build the canonical CheckResult for a rule whose check raised.
A crash in a scored category must penalize that category, not vanish
from the composite. The crash is encoded explicitly as score=0 plus a
crash marker in metadata (the discriminant is crash-vs-absent, not
None-vs-not-None), so quality_score averages the 0 in and
AuditResult.crashed_rules can surface the rule for traceability.
Source code in packages/axm-audit/src/axm_audit/models/results.py
format_categories_help()
Return a multi-line bullet list of categories with one-line summaries.
Source of truth for both the AuditTool MCP description and the
CLI --category help text.