aeat.application.provisioning module¶
Typed external-dependency probes for graceful degradation and config check.
This module is the read-only application doctor surface: each probe asks whether
one external service or optional package extra is usable on this workstation and
returns a typed DependencyStatus with the exact remediation command when
it is not. Probes do not provision, unlock, write profile state, or raise on
absence; a missing dependency is report data under the dependency-provisioning
ADR, not an exception path.
The vision read consults probe_ollama_vision() before expensive inference,
so a down server or an unpulled model becomes an instructive refusal instead of
a raw stack trace. The aeat config check command renders this module’s
statuses as
CheckDependencyPayload
rows beside the active profile’s capability posture from
resolve_active_capability(). Optional-extra
probes walk the core OPTIONAL_EXTRAS catalogue of
OptionalExtra records, so CLI diagnostics and adapter import
guards share one registry.
- class DependencyStatus(**data)[source]¶
Bases:
BaseModelAvailability result for one external dependency.
serviceis the stable row id shown byaeat config check;detailexplains the observed state;remediationis the command or action the operator can run whenavailableis false. The model is intentionally generic so Ollama, subprocess CLIs, Playwright browser binaries, andOptionalExtrapackage extras all render through the same payload shape and can be validated intoCheckDependencyPayload.- service: str¶
- available: bool¶
- detail: str¶
- remediation: str¶
- probe_ollama_vision(settings=None)[source]¶
Probe Ollama and the configured vision model, returning a
DependencyStatus.Reads
aeat_llm_ollama_chat_urlandaeat_llm_ollama_vision_modelfromSettings, then performs a short-timeoutGET /api/tags. The probe never runs inference and returns unavailable when the server is unreachable (ollama serve) or the configured model is not pulled (ollama pull <model>). Ledger evidence reading uses this result before local-vision inference soLLMClassifierErrorcan carry the exact remediation.- Return type:
- Parameters:
settings (Settings | None)
- probe_subprocess_providers()[source]¶
Probe each subprocess LLM CLI provider on
PATH.Delegates provider discovery to the ledger classification surface and adapts each availability row into the common
DependencyStatusshape. The probe resolves binaries only; it does not spawn provider processes.aeat config checkcombines these rows withServiceCapabilitydecisions to flag opted-in cloud evidence uploads that lack a provider CLI.- Return type:
- probe_playwright_browser(cache_root=None)[source]¶
Probe the Playwright Chromium browser binary, returning a
DependencyStatus.Scans the Playwright browsers cache for an installed
chromium*build using a fast filesystem check. The Playwright sync driver can hang inside the CLI process, so this probe deliberately never launches it. Missing, unreadable, or empty cache roots return unavailable with theplaywright install chromiumremediation.cache_rootis a testable override for the browser cache directory. The row complements the browser health probe inaeat.application.diagnostics; it checks workstation provisioning, not AEAT site reachability.- Return type:
- Parameters:
cache_root (Path | None)
- probe_optional_extra(extra)[source]¶
Probe whether an optional package extra is importable, never raising.
Wraps the core
optional_extra_available()spec-only check for oneOptionalExtra(no import, no side effects) in the doctor’sDependencyStatus, naming the extra’sinstall_hintas remediation when absent. The feature-boundary guard is the sibling corerequire_optional_extra(), which raises the typedMissingOptionalExtraErrorwhen a command actually requires the feature.- Return type:
- Parameters:
extra (OptionalExtra)
- probe_optional_extras()[source]¶
Probe every capability-gated
OptionalExtraintoDependencyStatusrows.The result set is keyed by the same
OPTIONAL_EXTRAScatalogue used byrequire_optional_extra(), keepingaeat config checkand runtime feature guards aligned.- Return type: