Repository navigation
Expand fractal-doctor into full installation health check (#1) - #9
Conversation
KreutzM
left a comment
There was a problem hiding this comment.
External review: overall implementation matches Issue #1 well and CI is green across Ubuntu/Windows on Python 3.11–3.13 plus GUI smoke, pan stability, and wheel build. One MINOR finding before merge: check_ffmpeg() currently treats shutil.which("ffmpeg") as sufficient for OK. The repository already has ffmpeg_mp4.probe_ffmpeg() / resolve_ffmpeg(), which actually verifies that the executable can run and returns a valid version line. A stale/broken executable on PATH would currently be reported healthy by fractal-doctor even though MP4 export would fail. Please reuse/provide equivalent executable probing through the injectable probe layer and add a deterministic test for “ffmpeg path exists but probe fails => WARNING, exit remains 0”. No other blocking findings.
Independent Review of PR #9 — fractal-doctor health checkOverall assessmentThe PR correctly addresses Issue #1 requirements. The architecture (ProbeEnv protocol, separation of probing from presentation, reuse of gpu_info.py, per-check OK/WARNING/ERROR states, exit-code contract, stable JSON schema) is sound and well-documented. Tests are passing (11/11 in test_doctor.py) and the design is unit-testable without a GPU or FFmpeg. That said, I found 2 MAJOR, 4 MINOR, and 3 NOTE items. The most important is a diagnostic correctness gap in FFmpeg probing that the existing owner review (KreutzM) also identified. I concur with KreutzM that the FFmpeg probe issue should be addressed before merge. I escalate its severity to MAJOR because a usable-health-check that reports a stale/broken executable as OK is a false-positive diagnostic, contrary to the doctor's stated purpose. MAJOR — check_ffmpeg() only tests PATH presence, not executable healthEvidence: The repository already has proven FFmpeg probing infrastructure:
The ProbeEnv protocol makes injecting a proper probe straightforward. A Remediation:
MAJOR — format_report next() will crash on reports without a CUDA checkEvidence: cuda_check = next(c for c in report.checks if c.key == "cuda")This raises Remediation: Use cuda_check = next((c for c in report.checks if c.key == "cuda"), None)
if cuda_check and cuda_check.data:
...MINOR — PR description claims 12 new tests, only 11 existEvidence: Remediation: Update the PR description to say 11. MINOR — "\Installation vollständig gesund" output path is untestedEvidence: Additionally, Remediation: Add a test with a CUDA-available + FFmpeg-found environment (zero warnings) that asserts the "\vollständig gesund" substring is present. MINOR — "\Versionsnummer unbekannt" check_package path is untestedEvidence: When a module imports successfully but Remediation: Add a FakeEnv variant that returns a module without MINOR — check_package non-ImportError exception path is untestedEvidence: The Remediation: Add a FakeEnv mode where NOTE — CUDA-Details block always shown, even when CUDA is unavailableBoth branches of NOTE — JSON CLI test uses monkeypatch instead of the real main path
NOTE — No test with the real SystemProbeEnvAll 11 tests use ConclusionThe architecture and core implementation are solid. The FFmpeg probe gap is the only finding that would materially mislead a user and should be fixed before merge. The other issues are test-coverage gaps and minor robustness concerns that could be addressed in follow-up. |
…ort, coverage gaps (#1) - MAJOR 1: ProbeEnv gains probe_ffmpeg(); check_ffmpeg now verifies the found binary actually runs via ffmpeg_mp4.probe_ffmpeg() (ffmpeg -version). A stale/broken executable on PATH is reported WARNING with the probe error instead of a false OK; exit stays 0 (optional capability). - MAJOR 2: format_report tolerates reports without a CUDA check (next(..., None) guard, no StopIteration). - Tests: +6 cases (broken ffmpeg, ffmpeg version line, fully-healthy zero-warning path, Versionsnummer unbekannt, non-ImportError package failure, report without CUDA check); FakeEnv gained ffmpeg_probe_ok/versionless_packages/broken_imports fault switches. 17 doctor tests, 348 total pass; pan stability STABLE. - NOTE items (CUDA details always shown, monkeypatched JSON CLI test, no SystemProbeEnv test) evaluated and kept as-is; rationale in PR comment.
|
Review findings disposition — commit a49c6f6 (branch agent/1-fractal-doctor-health-check) Every finding from the review (external review COMMENTED + the independent-review PR comment) was evaluated independently against the code. All fixes are pushed; validation: pytest 348 passed (17 doctor tests), check_pan_stability STABLE, live CLI + real broken-binary smoke on Linux. MAJOR 1 — check_ffmpeg() only tests PATH presence: VALID, FIXED. MAJOR 2 — format_report next() StopIteration: VALID, FIXED. MINOR 1 — PR claims 12 tests, 11 existed: VALID, FIXED. MINOR 2 — "vollständig gesund" path untested: VALID, FIXED. MINOR 3 — "Versionsnummer unbekannt" untested: VALID, FIXED. MINOR 4 — non-ImportError package path untested: VALID, FIXED. NOTE 1 — CUDA-Details always shown: EVALUATED, KEPT AS-IS (deliberate). NOTE 2 — JSON CLI test monkeypatches run_health_check: EVALUATED, KEPT AS-IS. NOTE 3 — no test with the real SystemProbeEnv: EVALUATED, KEPT AS-IS. Docs updated with the behavior change: CHANGELOG.md (FFmpeg executable-health probe bullet) and README.md GPU-Diagnose section. Not merged, per policy; ready for re-review. |
Re-review of PR #9 — fractal-doctor health check (Round 2)Commit under review: a49c6f6 VERIFIED FIXED — 6 of 6 actionable findingsMAJOR — check_ffmpeg() PATH-only, no executable health probe — VERIFIED FIXED. MAJOR — format_report next() StopIteration on CUDA-less report — VERIFIED FIXED. MINOR — PR claimed 12 tests, 11 existed — VERIFIED FIXED. MINOR — "vollständig gesund" path untested — VERIFIED FIXED. MINOR — "Versionsnummer unbekannt" untested — VERIFIED FIXED. MINOR — non-ImportError exception path untested — VERIFIED FIXED. The 3 NOTE items (CUDA-Details always shown, JSON CLI monkeypatch, no real SystemProbeEnv test) were EVALUATED AND KEPT. I concur with the published rationale. NEW FINDINGS — 0No regressions, new defects, architecture violations, or misleading diagnostics found. Specifically verified in the review-fix delta (a49c6f6):
VERDICT: READY TO MERGEAll 6 previous findings are independently verified as correctly fixed. Zero unresolved issues. Zero new findings. Tests pass, documentation updated. The PR makes fractal-doctor a correct, robust, and testable health check. (I will not merge; approval requires explicit user authorization per policy.) |
Summary
fractal-doctorno longer fails merely because CUDA is missing. It is now a full installation health check that separates required core health from optional capabilities:OK/WARNING/ERROR; human-readable output groups core vs optional explicitly.--jsonemits a stable schema:schema_version,tool,exit_code,core_ok,summary{ok,warning,error},checks[{key,label,state,required,detail,data}].gpu_info.inspect_cuda()— no duplicated detection; the CUDA-Details block reusesCudaStatus.report().ProbeEnv.probe_ffmpeg()delegates toffmpeg_mp4.probe_ffmpeg()(ffmpeg -version). A stale/broken binary on PATH reports WARNING with the probe error instead of a false OK (review finding, addressed in a49c6f6).Issue
Closes #1
Design / Decisions
TKINTER_IS_CORE = True, documented indoctor.py): the desktop GUIfractal-studiois the primary entry point of this repository, so a missing Tkinter is a real core failure for the shipped application; the detail message states that offline rendering remains possible. The constant makes the opposite policy a one-line change if desired.run_health_check(env)) is separated from CLI presentation (main,format_report) via a smallProbeEnvprotocol, so every acceptance scenario is unit-testable on a headless box without GPU/FFmpeg/display. No new runtime dependency.run_windows.ps1,enable_cuda.ps1) keep working — they already treat a non-zero doctor exit as a CUDA warning, which remains correct under the new contract.format_reporttolerates reports without a CUDA check (next(..., None)guard) because it is a public function taking anyHealthReport.Validation
pytest -q: 348 passed (17tests/test_doctor.pyacceptance/coverage cases + existingtest_gpu_info.pycoverage), on Linux with the repo venv (Python 3.11.16, NumPy/Numba/Pillow/mpmath installed). CI additionally covers Windows 3.11–3.13.scripts/check_pan_stability.py --backend cpu: STABLE.ffmpeg -versionrun);--jsonparses with the schema above.ffmpegthat exits non-zero is reportedWARNING ... aber nicht verwendbarwith exit 0 — verifies the review fix outside the fake-env unit tests.pytestfor 3.11–3.13.Remaining / Follow-ups
Handoff
agent/1-fractal-doctor-health-check, heada49c6f6(review fixes) on top of0beb1c9(initial implementation), basemain@e1219d7.src/fractal_flight_studio/doctor.py(rewritten, probe/CLI split + FFmpeg executable probe),tests/test_doctor.py(new, 17 tests),CHANGELOG.md,README.md(GPU-Diagnose section).pytest -qif desired; merge only with explicit user approval.