Conversation
Create a new crates/doctor/ crate containing the health-check system for verifying external tool dependencies (git, gh, git-lfs, AI agents, etc.). The crate exposes: - types: CheckStatus, DoctorCheck, DoctorReport, FixType, ResolvedBinary - resolve: binary resolution via login shell and common install paths - checks: individual health-check functions for git, gh, gh-auth, git-lfs, clonefile - agents: AI agent checks (goose, claude, codex, pi, amp) and fix command lookup - run_checks(): async orchestrator that runs all checks in parallel - execute_fix(): lookup-based fix execution by check ID and fix type - execute_command(): raw command execution for backward compatibility The Staged app's doctor.rs is replaced with thin Tauri command wrappers that delegate to the crate. The existing frontend API (run_doctor_fix accepting a raw command string) is preserved via execute_command(). The new FixType/fix_type fields on DoctorCheck are additive — the frontend will simply ignore the extra camelCase JSON field until it adopts the new API.
Replace the raw command string pattern in the Staged app's doctor fix flow with the secure check-ID + fix-type pattern already used by goose2. Backend (doctor.rs): - Import and re-export FixType from the doctor crate - Change run_doctor_fix signature from (command: String) to (check_id: String, fix_type: FixType) - Delegate to doctor::execute_fix which looks up the command from static definitions server-side Frontend (commands.ts): - Add fixType field to DoctorCheck interface - Update runDoctorFix to accept (checkId, fixType) instead of a raw command string UI (DoctorCheckRow.svelte): - Fix button visibility now checks check.fixType instead of check.fixCommand - confirmFix sends check.id and check.fixType instead of check.fixCommand - fixCommand remains as a display-only field in the ConfirmDialog Crate (doctor/src/lib.rs): - Make execute_command pub(crate) since it is an internal primitive and execute_fix is the intended public API
- Narrow fixType parameter from string to 'command' | 'bridge' union for compile-time safety in commands.ts - Gate fix button on both fixType and fixCommand to prevent null message in ConfirmDialog when fixCommand is absent - Extract duplicated clonefile fix command string into a shared pub(crate) const to prevent drift between check and lookup Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
apps/staged/src-tauri/src/doctor.rs) into a standalone shared crate (crates/doctor/)types,checks,agents, andresolveTest plan
🤖 Generated with Claude Code