Quality trace
quality_trace
Best-effort persistence of governance quality snapshots.
Each init_check run appends one JSON line to
~/axm/quality/{package}.jsonl capturing the score, grade and the list of
actionable failures, stamped with a UTC timestamp and the current git HEAD.
The file is an append-only history: the current state of a repo is the last
line of a given kind; a trend is obtained by filtering on sha at read
time (deduplication is a reader concern, never a writer one).
Design contract: observability must never break a check. Every failure
here (no git, unwritable disk, malformed payload) is swallowed — the caller's
ToolResult is returned unchanged regardless.
normalize_fails(data)
Extract actionable failures from an audit/init data payload.
audit emits failed: [{rule_id, message, fix_hint, ...}].
init_check emits failures: [{name, message, fix, ...}].
Both are normalized to {rule_id, message, fix_hint}.
Source code in packages/axm-init/src/axm_init/quality_trace.py
record_quality_snapshot(*, path, kind, data)
Append one quality snapshot line for path; never raise.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Path to the audited project (its directory name becomes the history file name). |
required |
kind
|
TraceKind
|
|
required |
data
|
Mapping[str, object]
|
The |
required |