feat(cli): wheels doctor detects stale installed module shadowing source checkout (#2223)#2225
Merged
Merged
Conversation
…rce checkout (#2223) When invoked as `wheels`, LuCLI loads modules from ~/.wheels/modules/wheels/. If that path is a real directory holding a pre-install copy of Module.cfc, edits a contributor makes under cli/lucli/ in a source checkout silently do not take effect — surfaced during #2222, where the merged #2216 fix kept exit-0'ing locally because the installed module was a pre-fix copy. `wheels doctor` now detects this when run from a wheels source checkout (projectRoot contains cli/lucli/Module.cfc + vendor/wheels/). The installed Module.cfc is inspected three ways: - symlink to the checkout → pass - real file, bytes match → pass (stale but harmless this moment) - real file, bytes diverge → warn, with a `rm -rf && ln -s` remediation command in the recommendations section The check is a no-op outside source checkouts and when the installed path is the checkout's own cli/lucli/ (dev-symlinked install). Symlink detection and byte comparison go through java.nio.file.Files for cross-engine parity. Closes #2223.
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
wheels doctornow detects when~/.wheels/modules/wheels/Module.cfcdiverges from the source checkout undercli/lucli/and warns with a ready-to-pasterm -rf && ln -sremediation.~/.wheels/modules/wheels/install that shadows source checkout #2223 footgun discovered while debugging fix(cli): hard-fail invalid WHEELS_FRAMEWORK_PATH instead of silent fallback (#2215) #2222: a merged fix could appear not to take effect locally because the installed CLI module was a pre-fix copy.cli/lucli/(dev-symlinked install), so normal users see no new output.Behavior
When invoked from a wheels source checkout (projectRoot contains
cli/lucli/Module.cfc+vendor/wheels/) the installedModule.cfcis inspected three ways:rm -rf <installed> && ln -s <checkout>/cli/lucli <installed>commandSymlink detection and byte comparison go through
java.nio.file.Filesfor cross-engine parity (Lucee / Adobe CF / BoxLang).Scope decisions (from issue's open questions)
Doctor.cfcrather than a newwheels install statuscommand. Zero cost outside source checkouts, preserves the single-entry-point UX. Muddies the service slightly in exchange for discoverability.Module.cfcper the issue's proposal. A broader tree-compare undercli/lucli/is a reasonable follow-up if edits to service files (not Module.cfc) become a recurring footgun — deferred.lucli module installconcern, separate PR.Files changed
cli/lucli/services/Doctor.cfc— newcheckCliInstallFreshness()+ path/NIO helpers + remediation recommendationcli/lucli/Module.cfc— passvariables.moduleRootintoDoctorservice factorycli/lucli/tests/specs/services/DoctorSpec.cfc— 6 new specs covering: no-context silent, not-a-checkout silent, divergent warns, bytes-match passes, self-install skips, symlink passes (with graceful skip if FS rejects symlink creation)CHANGELOG.md— entry under[Unreleased] → Added → CLI & LuCLITest plan
bash tools/test-cli-local.sh: 371 pass / 0 fail / 0 error (includes 6 new specs, all passing)~/.wheels/modules/wheels/install that shadows source checkout #2223 scenario (divergent bytes between checkout'scli/lucli/Module.cfcand a separate installed dir) — warning fires with the expected text, and the recommendation contains a ready-to-paste remediation commandRelated