Doctor
doctor
Provenance reporting for resolved config keys (read-only).
:func:config_doctor_data answers "where would this key resolve from?" for
every key visible in a namespace, following the resolver's own
env > file > default precedence. It is a diagnostic surface: it probes the
layers and reports the winning one per key, it never reads a value into a
consumer and never mutates any layer.
The set of reported keys is the union of the namespace's section in
~/.axm/config.toml and any environment variables matching the resolver's
AXM_<NS>_* naming. For an absent namespace both sources are empty, so the
report is {}.
config_doctor_data(namespace=None)
Report the resolution layer of every visible key, read-only.
For namespace, the reported keys are the union of the namespace's
config.toml section keys and its AXM_<NS>_* environment keys. When
namespace is None, every namespace present in config.toml (or a
not-yet-folded legacy file) is reported.
Keys are formatted "<ns>.<key>"; each maps to
{"layer": env|file|default, "present": bool}. Nothing is mutated.
Source code in packages/axm-config/src/axm_config/doctor.py
render_doctor_report(report)
Render a doctor report as one <dotted_key>: <layer> line per key.
Shared by the CLI doctor command and :class:ConfigDoctorTool so the
two provenance renderings cannot drift. Keys are emitted in the report's
own (already sorted) order; an empty report renders the empty string.