Skip to content

Add warning for PATH Nu version mismatch and improve tests - #119

Merged
tonythethompson merged 6 commits into
masterfrom
doctor-nu-version-mismatch
Aug 16, 2026
Merged

tonythethompson merged 6 commits into
masterfrom
doctor-nu-version-mismatch

Conversation

@tonythethompson

@tonythethompson tonythethompson commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

PR Summary by Qodo

Warn on PATH vs managed Nu version mismatch; expand unit tests; add CI coverage job

✨ Enhancement 🧪 Tests ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Warn when PATH Nu and managed Nu are both present but report different versions.
• Add inline unit tests across list/snapshot/registry/download and Nu pin offer flows.
• Add an informational CI coverage job using cargo-llvm-cov (no fail-under threshold).
Diagram

graph TD
  U(("User")) --> D["doctor command"] --> PV["Probe PATH Nu"] --> MV["Probe managed Nu"] --> C{"Versions differ?"}
  C -->|"yes"| W[/"Warn: nu.version_mismatch"/]
  C -->|"no"| I[/"Info findings only"/]

  subgraph Legend
    direction LR
    _actor(("Actor")) ~~~ _proc["Command/step"] ~~~ _dec{"Decision"} ~~~ _out[/"Finding"/]
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Compare only Nu major/minor (semver-aware)
  • ➕ Aligns warning to the stated ABI-lock constraint (minor version)
  • ➕ Avoids noisy warnings when only patch versions differ
  • ➖ Requires robust parsing/normalization of Nu version strings
  • ➖ Adds edge cases when version output is non-semver (e.g., dev builds)
2. Report mismatch as Info with actionable remediation
  • ➕ Less disruptive for users with multiple Nus installed intentionally
  • ➕ Still surfaces the issue without elevating severity
  • ➖ May reduce visibility for a common cause of plugin load failures

Recommendation: Current Warn finding is a reasonable default because mismatches commonly break plugin loading. Consider making the comparison semver-aware and warning only on major/minor divergence (or when parsing fails, fall back to string comparison) to better match the ABI-lock rationale and reduce false positives.

Files changed (11) +488 / -14 · 3 not counted

Enhancement (1) +41 / -14
doctor.rsWarn when PATH Nu version differs from managed Nu +41/-14

Warn when PATH Nu version differs from managed Nu

• Captures the detected PATH Nu and managed Nu versions during doctor execution. Emits a new Warn-severity finding (nu.version_mismatch) when both are present and differ, with guidance about plugin ABI lock-in and remediation steps.

src/cmd/doctor.rs

Tests (5) +420 / -0
list.rsAdd unit tests for list command output paths +93/-0

Add unit tests for list command output paths

• Adds tests that exercise listing behavior with an empty lockfile, a single package, and multiple packages including an active plugin entry. Uses a temp root and minimal NuPaths/lockfile fixtures to keep tests hermetic.

src/cmd/list.rs

nu_pin_offer.rsAdd unit tests for Nu pin offer interaction flow +68/-0

Add unit tests for Nu pin offer interaction flow

• Adds tests covering accept/decline branches, invalid input handling, and non-interactive short-circuiting. Uses a deliberately malformed pin to force a deterministic local failure before any network activity.

src/cmd/nu_pin_offer.rs

registry.rsExpand registry command test coverage +133/-0

Expand registry command test coverage

• Adds tests for listing registries, adding/removing registries, duplicate-name errors, and listing packages from an on-disk registry index. Generates an ephemeral Ed25519 verifying key in base64 for trust-key persistence checks.

src/cmd/registry.rs

snapshot.rsAdd unit tests for snapshot listing/inspection helpers +96/-0

Add unit tests for snapshot listing/inspection helpers

• Adds tests for short_hash behavior, listing snapshots when empty and when committed, and inspecting snapshot details including payload-backed entries. Builds a minimal on-disk payload and lockfile to validate inspect flow.

src/cmd/snapshot.rs

download.rsAdd unit tests for local and file:// download paths +30/-0

Add unit tests for local and file:// download paths

• Adds hermetic tests ensuring download_file copies from a plain local path and from a file:// URL into the destination, creating parent directories as needed.

src/install/download.rs

Other (5) +27 / -0
ci.ymlAdd informational coverage job using cargo-llvm-cov +25/-0

Add informational coverage job using cargo-llvm-cov

• Introduces a new GitHub Actions job that installs llvm-tools and cargo-llvm-cov, then writes a coverage summary into the workflow step summary. The job is explicitly informational (no fail-under threshold).

.github/workflows/ci.yml

.gitignoreIgnore llvm-cov profraw artifacts +2/-0

Ignore llvm-cov profraw artifacts

• Adds generated .profraw coverage artifacts to .gitignore to keep llvm-cov outputs out of version control.

.gitignore

bump-contract.shNormalize script file permissions not counted

Normalize script file permissions

• Adjusts repository script metadata (e.g., executable bit) without changing script behavior.

scripts/bump-contract.sh

push-homebrew-tap.shNormalize script file permissions not counted

Normalize script file permissions

• Adjusts repository script metadata (e.g., executable bit) without changing script behavior.

scripts/push-homebrew-tap.sh

sign-sha256sums.pyNormalize script file permissions not counted

Normalize script file permissions

• Adjusts repository script metadata (e.g., executable bit) without changing script behavior.

scripts/sign-sha256sums.py

Adds a Warn-severity finding 'nu.version_mismatch' when both PATH Nu and
managed Nu are detected but report different versions. Explains that
plugins are ABI-locked and packages installed under one won't load in
the other.

30 doctor unit tests pass.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @tonythethompson, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 346c4c17-4b5a-4b88-af70-a7c47f360b74

📝 Walkthrough

Walkthrough

The doctor command retains successfully probed PATH and managed Nu versions. When both versions exist and differ, it emits a nu.version_mismatch warning with compatibility details and corrective commands.

Changes

Nu environment diagnostics

Layer / File(s) Summary
Version comparison and mismatch warning
src/cmd/doctor.rs
check_nu_environments stores PATH and managed Nu versions, then reports mismatches with plugin compatibility details and corrective command hints.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: greptile-apps

🚥 Pre-merge checks | ✅ 8
✅ Passed checks (8 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: warning about mismatched PATH and managed Nu versions, with test improvements.
Description check ✅ Passed The description directly covers the version mismatch warning, tests, coverage job, and related repository changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Pipeline Stage Enum Ordering ✅ Passed The repository and PR diff contain no SessionWorkflowStage enum, named members, or related comparisons; ordering, raw-literal, and legacy-mapping checks are not applicable.
Gpu/Cpu Runtime Boundary ✅ Passed The PR changes Rust, CI, and configuration files only; no inference/, CPU/GPU requirements, main.py, or C# files exist or changed, so this boundary check is not applicable.
Managed Host Restart Safety ✅ Passed The pull request changes Nu version checks, tests, and CI only; no target host-manager, container, lease, restart, or readiness code is present or modified.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch doctor-nu-version-mismatch
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch doctor-nu-version-mismatch

Warning

Review ran into problems

🔥 Problems

Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. Analyzed tonythethompson/QuickShell, tonythethompson/numan, tonythethompson/dependency-chain-substrate, skipped Trackdubllc/Trackdub.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds report-only detection of incompatible PATH and managed Nushell major/minor versions.

  • Records successful PATH and managed Nu version probes and emits nu.version_mismatch when their major/minor versions differ.
  • Documents the new warning, compatibility rule, and manual remediation commands.
  • Adds tests for incompatible versions and compatible patch-only differences.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the previously reported contract-script permission issue is fixed at current HEAD.

Important Files Changed

Filename Overview
src/cmd/doctor.rs Adds major/minor compatibility comparison, a report-only mismatch warning, report ordering, and focused tests; no eligible follow-up issue remains.
docs/numan-doctor.md Documents the mismatch finding, patch-version compatibility, repair policy, and manual remediation consistently with the implementation.

Reviews (6): Last reviewed commit: "Potential fix for pull request finding" | Re-trigger Greptile

@qodo-code-review

qodo-code-review Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (1) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Brittle profraw gitignore ✓ Resolved 🐞 Bug ⚙ Maintainability
Description
The PR adds two specific .profraw filenames to .gitignore, which only ignores those exact
artifacts. Other .profraw files produced by coverage runs will still show up as untracked noise
and can be accidentally committed.
Code

.gitignore[R47-48]

+default_3642496141717855874_0_856833.profraw
+default_3642496141717855874_0_856842.profraw
Relevance

●●● Strong

Trivial gitignore hygiene; repo has accepted updating .gitignore to avoid noisy artifacts.

PR-#64
PR-#3

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The ignore rules added are literal filenames with long numeric components; Git will only ignore
those exact names, not other generated .profraw artifacts.

.gitignore[44-48]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`.gitignore` currently ignores two literal `.profraw` filenames; this does not generalize to future runs that generate different `.profraw` names.

### Issue Context
The filenames include long numeric components, suggesting run-specific/generated artifacts.

### Fix Focus Areas
- .gitignore[44-48]

### Proposed fix
- Replace the two concrete entries with a wildcard pattern such as:
 - `*.profraw`
 - (or narrower) `default_*.profraw`
- Remove the two literal entries once the pattern is added.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Redundant Warn if comment 📘 Rule violation ⚙ Maintainability
Description
The new comment restates the immediately following control flow (if path_v != managed_v) rather
than focusing on non-obvious rationale. This adds noise and violates the requirement to keep
comments to non-obvious rationale.
Code

src/cmd/doctor.rs[532]

+    // Warn if both exist but differ — plugins built for one won't load in the other.
Relevance

●●● Strong

Team has accepted removing/reworking comments that restate obvious control flow per comment-style
guidance.

PR-#116
PR-#108

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2452624 requires comments to document non-obvious rationale rather than restating
behavior. The comment at src/cmd/doctor.rs:532 describes the exact behavior of the subsequent
conditional, making it redundant.

Rule 2452624: Restrict code comments to non-obvious rationale, not restating behavior
src/cmd/doctor.rs[532-532]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A newly added comment restates what the next `if` statement does (warning on mismatch) instead of focusing only on non-obvious rationale.

## Issue Context
Compliance requires comments to capture rationale/constraints, not obvious behavior already clear from adjacent code.

## Fix Focus Areas
- src/cmd/doctor.rs[532-532]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Overbroad Nu mismatch warning 🐞 Bug ≡ Correctness
Description
check_nu_environments() emits nu.version_mismatch whenever the full PATH and managed Nu version
strings differ, even though the warning text claims plugins are ABI-locked to a Nu *minor* version.
This can produce false-positive warnings for patch-only differences and mislead users into
unnecessary remediation.
Code

src/cmd/doctor.rs[R532-535]

+    // Warn if both exist but differ — plugins built for one won't load in the other.
+    if let (Some(ref path_v), Some(ref managed_v)) = (&path_version, &managed_version) {
+        if path_v != managed_v {
+            findings.push(finding(
Relevance

●● Moderate

They value accurate semver comparisons and non-misleading messaging, but changing warn threshold
(minor vs full) is behavioral.

PR-#6
PR-#116

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new logic compares the full version strings (path_v != managed_v) before warning, while the
codebase’s Nu version utilities explicitly model and match compatibility at the minor level
(including support for exact-minor constraints like =0.113.x). This makes the new warning broader
than the compatibility model it cites.

src/cmd/doctor.rs[465-548]
src/core/nu_version.rs[36-61]
src/core/nu_version.rs[76-120]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`doctor` warns when `path_v != managed_v` (full string comparison), but the warning text explicitly scopes the incompatibility to Nu *minor* version. This makes patch-only differences look like an incompatibility.

### Issue Context
The repo already has `NuVersion` parsing utilities and constraint matching that treat compatibility at the minor level.

### Fix Focus Areas
- src/cmd/doctor.rs[532-547]
- src/core/nu_version.rs[36-61]
- src/core/nu_version.rs[76-120]

### Proposed fix
- Parse `path_v` and `managed_v` via `NuVersion::parse(...)`.
- If both parse successfully: warn only when `major/minor` differ (or implement a small helper like `same_minor(&NuVersion, &NuVersion)`), and optionally adjust the message to include both full versions.
- If parsing fails for either: either skip the mismatch warning or fall back to string compare but downgrade message/severity so it doesn’t claim a minor-version ABI break without evidence.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context used
✅ Compliance rules (platform): 31 rules
✅ REVIEW.md
Review mode: ⚖️ Balanced: Downgraded extended -> standard: change is below the extended eligibility bar (hunks 10/18, lines 502/200; both must reach the floor). Router rationale: This PR spans multiple independent runtime and CI/test edit sites, including PATH/managed Nu version diagnostics and installation behavior, creating a high density of subtle defects that benefits from redundant review passes.

Grey Divider

Tip of the day
💡 Did you know, you can group findings by type and pick your Finding display, from Minimal to Full

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread src/cmd/doctor.rs Outdated
Comment thread src/cmd/doctor.rs Outdated
Comment thread .gitignore Outdated
@qodo-code-review

Copy link
Copy Markdown
Contributor

Qodo Fixer

No findings are within the configured fix scope. To change which findings are fixed, adjust the setting on your Qodo configuration page.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

https://github.com/tonythethompson/numan/blob/a7a6c3bcb337fd7a599365ca599e27cb49c74f45/scripts/bump-contract.sh#L1
P2 Badge Restore executable bits on helper scripts

On Unix, this mode-only change makes the documented direct command scripts/bump-contract.sh ... fail with permission denied (exit 126). The same regression affects push-homebrew-tap.sh and sign-sha256sums.py; restore mode 100755 on all three scripts.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cmd/doctor.rs Outdated
@tonythethompson
tonythethompson force-pushed the doctor-nu-version-mismatch branch from a7a6c3b to 8fea7a2 Compare August 10, 2026 22:24
greptile-apps[bot]
greptile-apps Bot previously approved these changes Aug 10, 2026
coderabbitai[bot]
coderabbitai Bot previously requested changes Aug 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/cmd/doctor.rs`:
- Around line 467-481: Run cargo fmt to format the changes in the doctor command
code, then verify cargo fmt --check passes without modifying the intended
behavior around find_nu_on_path and probe_nu_version.
- Around line 535-546: Add doctor tests covering Nu version mismatch detection:
verify distinct incompatible major/minor PATH and managed versions produce
exactly one Warn-severity finding with code nu.version_mismatch, and verify
versions differing only by patch do not produce that warning. Reuse the existing
doctor test setup and finding assertions.
- Around line 535-546: Update the finding-ID allowlist in print_report to
include nu.version_mismatch, ensuring normal numan doctor output displays this
warning while preserving the existing JSON and human-output behavior for other
findings.
- Around line 535-546: Document the new nu.version_mismatch warning and its
remediation guidance in the repository’s existing user-facing documentation or
command-help location, including the PATH-versus-managed Nu version mismatch and
the numan setup nu/numan activate remedies. Update AGENTS.md or the relevant
docs/help source rather than changing the diagnostic implementation in
src/cmd/doctor.rs.
- Around line 532-545: Update the version comparison in the PATH-versus-managed
Nu check to use the documented major/minor compatibility identity or existing
compatibility helper, so patch-only differences do not trigger
nu.version_mismatch. Remove or revise the nearby comment so it describes only
the non-obvious compatibility rationale, and update the mismatch guidance to
explain compatible versions while offering the documented managed-Nu pinning
flow.
🪄 Autofix

✅ Autofix completed


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 94bc8b52-5953-46ce-8395-f48f8537c81d

📥 Commits

Reviewing files that changed from the base of the PR and between 2281b87 and 8fea7a2.

📒 Files selected for processing (1)
  • src/cmd/doctor.rs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • tonythethompson/QuickShell (manual)
  • tonythethompson/numan (manual)
  • tonythethompson/dependency-chain-substrate (manual)
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: Greptile Review
  • GitHub Check: Real-Nu acceptance (windows-latest)
  • GitHub Check: Test (windows-latest)
  • GitHub Check: Format
  • GitHub Check: Analyze (rust)
🧰 Additional context used
📓 Path-based instructions (10)
**/*

📄 CodeRabbit inference engine (CLAUDE.md)

**/*: Use Serena's semantic, symbol-aware tools as the primary tools for reading and editing code; use built-in Read, Glob, Grep, and Edit only under the stated exceptions.
Before editing a code file, inspect its symbol overview, read the specific symbols being changed, and edit them with Serena's symbol-aware tools.
Understand the existing code before changing it and make the smallest change that satisfies the request; avoid unrelated cleanup, premature abstractions, unnecessary error handling, feature flags, and compatibility shims.
Prefer editing existing files over creating new ones, and never create Markdown or README files unless explicitly requested.
For exploratory questions, provide a 2–3 sentence recommendation with the main tradeoff and do not implement until the user agrees.
For UI or frontend changes that cannot be tested in a browser, explicitly state that browser testing was not performed rather than claiming success.
Address security issues when discovered, including injection, XSS, SQL injection, path traversal, and secret leaks.
Pause and obtain confirmation before destructive, hard-to-reverse, externally visible, or third-party-upload actions, including deleting files or branches, dropping tables, force-pushing, modifying CI/CD, posting externally, or uploading content.
When blocked, investigate the root cause instead of bypassing it with --no-verify, --force, or deletion; investigate unfamiliar files, branches, and configuration before deleting them.
Only commit when explicitly asked; do not proactively update git configuration or push changes.
Do not skip Git hooks unless explicitly asked; if a pre-commit hook fails, fix the issue, re-stage, and create a new commit rather than amending.
Stage files by name rather than using git add -A or git add ., to avoid accidentally including secrets or large binaries.
Use a HEREDOC for commit messages, and add co-author attribution only when the user explicitly requests the exact trailer.
Do not force-pus...

Files:

  • src/cmd/doctor.rs
**/*.{js,jsx,ts,tsx,py,java,go,rs,rb,php,c,cpp,h,hpp,cs,swift,kt,kts}

📄 CodeRabbit inference engine (CLAUDE.md)

Add comments only when the WHY is non-obvious; do not narrate what the code does, reference the current task, or reference the PR in comments.

Files:

  • src/cmd/doctor.rs
!**/.env,!**/credentials.json,!**/*.pem

📄 CodeRabbit inference engine (CLAUDE.md)

Do not commit files that appear to contain secrets, including .env, credentials.json, and PEM files; warn before doing so even if explicitly requested.

Files:

  • src/cmd/doctor.rs
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Use the Rust 2021 edition.
Use anyhow::Result with .context(...) in application code; use thiserror for library error types that callers match on.
Use clap derive macros for CLI definitions.
Use serde with serde_json or toml for serialization.
Function parameters must use &Path, not &PathBuf.
Library code must not panic; error paths should return anyhow::Result with context where appropriate.
Add or update tests for behavior changes, including relevant failure paths.
New mutating code paths must acquire the mutation lock via acquire_mutation_lock(root) and snapshot the lockfile before writes.
Lockfile, journal, and state-file JSON writes must use write_json_atomic.
numan install must write only to $NUMAN_ROOT; it must not invoke Nu or register plugins/autoloads.
Only activate and deactivate may modify Nu integration state.
Treat the lockfile as the authoritative source of truth; derived projections such as autoload state must not be authoritative.
Install payloads under versioned, content-addressed paths and never overwrite them in place.
Never overwrite foreign autoload files; respect OWNERSHIP_MARKER.
Pass plugin paths through environment variables only; do not use runtime interpolation in Nu program strings.

**/*.rs: Use &Path rather than &PathBuf in Rust function parameters.
Use anyhow::Result for application code, thiserror for library errors, and add context with .context(...) or ?.
Never panic in library code; return errors instead.
Test-first development is expected: write a failing test, implement the change, then verify it passes.
Format and lint Rust code with cargo fmt --check and cargo clippy -- -D warnings; no warnings are permitted.

**/*.rs: All CI gates must pass: cargo test, cargo clippy -- -D warnings, cargo fmt --check, MSRV cargo +1.88 check --locked --all-targets, cargo package --locked, cargo deny, and ignored real-Nu acceptance tests.
numan install must not invoke...

Files:

  • src/cmd/doctor.rs
**/*.{rs,toml}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Run and keep cargo fmt/rustfmt clean, and ensure cargo clippy -- -D warnings passes.

Files:

  • src/cmd/doctor.rs
**/*.{rs,nu}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{rs,nu}: Real-Nu acceptance tests must be marked #[ignore] and should be run when changes affect activation or nupm import; unit tests must not spawn real nu and should use injectable seams such as FakeCandidateRunner or registrars.
The nupm integration must be read-only toward NUPM_HOME, must not execute build.nu, and must not perform bidirectional synchronization.

Files:

  • src/cmd/doctor.rs
**/*.{rs,md}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Match existing naming, module layout, and documentation level in the file being edited; update AGENTS.md, docs/, or command help when structure, conventions, or user-visible behavior changes.

Files:

  • src/cmd/doctor.rs
**/*.{rs,md,toml}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use the repository's established serialization and module conventions rather than introducing unrelated refactors.

Files:

  • src/cmd/doctor.rs
src/**/*.rs

📄 CodeRabbit inference engine (AGENTS.md)

Use compile-time #[cfg(target_env)] platform detection rather than std::env::consts.

Files:

  • src/cmd/doctor.rs
src/cmd/*.rs

📄 CodeRabbit inference engine (AGENTS.md)

Create a snapshot before mutations performed by install, update, remove, activate, deactivate, nupm import, and init --refresh.

Files:

  • src/cmd/doctor.rs
🔍 Remote MCP GitHub Copilot

Review-relevant context

  • The current PR head changes only src/cmd/doctor.rs (+41/−14); the PR description’s claims about CI, tests, and other files do not match the actual diff.,
  • nu.version_mismatch is added to findings but omitted from print_report’s human-output allowlist. It will appear in JSON, but not normal numan doctor output.
  • The warning compares complete version strings, while the repository documents plugin ABI compatibility as Nu-major/minor scoped and supports exact-minor constraints. Patch-only differences may therefore trigger a misleading warning.,
  • No test currently exercises a mismatch: the test probe returns the same version for PATH and managed Nu, and code search found no nu.version_mismatch test.,
  • Current checks show Format failed; Linux/macOS tests, Clippy, Deny, and Ubuntu acceptance passed, while several checks remain in progress.

Comment thread src/cmd/doctor.rs
Comment thread src/cmd/doctor.rs Outdated
Comment thread src/cmd/doctor.rs
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Fixes Applied Successfully

Fixed 1 file(s) based on 3 unresolved review comments.

Files modified:

  • src/cmd/doctor.rs

Commit: 32f4b5ce3956a0e3d858646a390950581fecaa3b

The changes have been pushed to the doctor-nu-version-mismatch branch.

Time taken: 6m 2s

Fixed 1 file(s) based on 3 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
greptile-apps[bot]
greptile-apps Bot previously approved these changes Aug 11, 2026
greptile-apps[bot]
greptile-apps Bot previously approved these changes Aug 15, 2026
@tonythethompson
tonythethompson dismissed coderabbitai[bot]’s stale review August 15, 2026 13:30

Dismissing stale CHANGES_REQUESTED review: every finding here was confirmed addressed in-thread by CodeRabbit itself and by the PR author (commit 7d542b4). All review threads on this PR are now resolved.

@tonythethompson
tonythethompson requested a lite review from Copilot August 15, 2026 13:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances numan doctor to warn when the Nushell binary found on PATH is ABI-incompatible (major/minor mismatch) with the managed Nushell version under the Numan root, and updates the doctor spec documentation to describe the new finding and remediation guidance.

Changes:

  • Add a new nu.version_mismatch Warn finding when both PATH Nu and managed Nu are present but major/minor versions differ.
  • Introduce a versions_compatible helper (major/minor comparison; patch differences treated as compatible).
  • Document the new finding and recommended user actions in docs/numan-doctor.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/cmd/doctor.rs Adds PATH-vs-managed Nu mismatch detection and reporting, including a major/minor compatibility helper and unit tests.
docs/numan-doctor.md Documents the new nu.version_mismatch finding in both the repair policy table and check catalog.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/cmd/doctor.rs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@tonythethompson
tonythethompson enabled auto-merge (squash) August 16, 2026 01:56
@tonythethompson
tonythethompson merged commit 6831bd1 into master Aug 16, 2026
24 checks passed
@tonythethompson
tonythethompson deleted the doctor-nu-version-mismatch branch August 16, 2026 01:56
@linear-code

linear-code Bot commented Aug 16, 2026

Copy link
Copy Markdown

NUM-100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants