symfonic.diagnostics¶
diagnostics ¶
symfonic doctor -- adopter-config audit package (v7.16, item 5).
Public API:
- :func:
audit_hms-- async core; returns an :class:~symfonic.diagnostics.result.AuditReportfor a constructed :class:~symfonic.agent.engine.SymfonicAgent. - :func:
audit_hms_sync-- sync wrapper around :func:audit_hms; what the CLI subcommand and most adopter scripts will call.
Re-exports the data types so adopters can from symfonic.diagnostics
import AuditReport, CheckResult, Severity without traversing the
internal package layout.
The audit closes the silent-fail traps Jarvio's innocent_nightingale incident + nurse-navigator's first-hour friction surfaced:
- Stub embedder (
EMBEDDING_PROVIDERempty) - OpenAI-base-URL trap (chat proxy routed through
OPENAI_API_BASE) - Hardcoded
tenant_id="default"in the consolidate beat schedule agent.get_chat_model('action')returningNonelazy_tooling=Trueorphan when prerequisites are missing- EPISODIC / SEMANTIC layers omitted from
enabled_layers - Unreachable
POSTGRES_DSN
AuditReport
dataclass
¶
Aggregate of every :class:CheckResult produced by one run.
The runner builds this object after invoking every check function;
the CLI consumes it to render either human-readable text or
--json output.
counts ¶
Return per-severity counts plus ok (= no findings).
Source code in src/symfonic/diagnostics/result.py
exit_code ¶
Compute the CLI exit code.
Semantics (mypy-style):
- No findings, or only
INFO->0. WARNpresent,ERRORabsent ->0(or2ifstrict=True).ERRORpresent ->1.
Source code in src/symfonic/diagnostics/result.py
to_json_dict ¶
Serialise to the documented --json shape.
Source code in src/symfonic/diagnostics/result.py
worst_severity ¶
Return the highest severity present, or None if clean.
AuditRunner ¶
Invoke every registered check against an agent and aggregate results.
The runner is constructed with the audit configuration (currently
just no_network). run() is the async entry point;
:func:audit_hms and :func:audit_hms_sync in the package
__init__ are the public wrappers.
Source code in src/symfonic/diagnostics/runner.py
run
async
¶
Invoke every check; return an :class:AuditReport.
Source code in src/symfonic/diagnostics/runner.py
CheckResult
dataclass
¶
Single audit finding emitted by a check function.
Attributes¶
name:
Stable short identifier (e.g. "embedding_provider.stub").
Used in the JSON output and in human-readable headers.
severity:
:class:Severity of the finding.
message:
One-line human-readable summary. Rendered as the headline of
the human output line.
fix_hint:
Optional remediation hint. Rendered on the line after the
message, and surfaced in the JSON payload.
Severity ¶
Bases: StrEnum
Audit-check severity.
Inherits from str (via :class:enum.StrEnum) so the JSON output
(--json mode) emits the short uppercase label without a custom
encoder.
rank
property
¶
Numeric rank for comparison.
Higher means more severe. Used by
:meth:AuditReport.worst_severity and the runner's exit-code
calculator without exposing the internal ordering to call sites.
audit_hms
async
¶
Run the v7.16 audit suite against agent and return an :class:AuditReport.
Parameters¶
agent:
The constructed :class:~symfonic.agent.engine.SymfonicAgent
to audit. The runner inspects agent._config,
agent._orchestrator, and process-level environment
variables (EMBEDDING_PROVIDER, POSTGRES_DSN, ...).
no_network:
When True, skip the POSTGRES_DSN reachability probe and
emit an INFO instead. When None (the default), defers
to :func:resolve_no_network which honours CI=true in the
environment.
Source code in src/symfonic/diagnostics/__init__.py
audit_hms_sync ¶
Sync wrapper around :func:audit_hms.
Wraps the async coroutine in :func:asyncio.run. This is what the
symfonic doctor Typer command calls; most adopter scripts will
prefer this entry point over the async core because the audit is
invoked from a CLI or a one-shot validation helper, not inside a
running event loop.
Adopters who already hold an event loop should call
:func:audit_hms directly instead.