Repository navigation
feat(sandbox): structured Docker diagnostics + actionable CLI pre-flight gate - #13
Merged
Merged
Conversation
…ght gate Add a frozen DockerDiagnostic dataclass carrying a probe reason plus platform-specific recovery hints, and refactor DockerBackend.diagnose() to return it for every failure mode (CLI missing on PATH, daemon unreachable, and probe timeout). is_available() now delegates to the structured diagnostic instead of a bare boolean probe. Surface the diagnostic in evalguard audit run's pre-flight gate: when an explicit '--backend docker' is requested but cannot come up, print the structured reason and color-coded hints, and point at the '--backend auto' graceful fallback instead of a bare warning. Closes. Ref.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #1
Surfaces the structured \DockerDiagnostic\ (probe reason + platform recovery hints) at the CLI pre-flight instead of a bare warning, and refactors the Docker backend so every failure mode produces actionable guidance.
Changes
**\evalguard/sandbox/backends/docker.py**: new frozen \DockerDiagnostic\ dataclass (\�vailable/
eason/\hints, \ok()\ factory, \platform_hints()\ static method returning actionable per-platform instructions); \DockerBackend.diagnose()\ now returns a structured diagnostic for every failure mode (CLI missing on PATH -> install guidance + platform hints; daemon unreachable -> decoded \docker info\ stderr tail + daemon-start hints; probe timeout -> graceful timeout path with hints); \is_available()\ delegates to the structured probe.
**\evalguard/cli/audit.py**: pre-flight gate emits the structured reason + actionable color-coded hints when an explicit backend is requested but cannot come up, and points at the --backend auto\ graceful fallback.
Ruff, mypy (67 files), and the targeted adapter/CLI test suites all pass.