Skip to content

feat(cli): wheels doctor detects stale installed module shadowing source checkout (#2223)#2225

Merged
bpamiri merged 1 commit into
developfrom
claude/quirky-rosalind-fda2ae
Apr 22, 2026
Merged

feat(cli): wheels doctor detects stale installed module shadowing source checkout (#2223)#2225
bpamiri merged 1 commit into
developfrom
claude/quirky-rosalind-fda2ae

Conversation

@bpamiri
Copy link
Copy Markdown
Collaborator

@bpamiri bpamiri commented Apr 22, 2026

Summary

Behavior

When invoked from a wheels source checkout (projectRoot contains cli/lucli/Module.cfc + vendor/wheels/) the installed Module.cfc is inspected three ways:

State Outcome
symlink to the checkout pass: "Installed CLI module is a symlink (source changes take effect immediately)"
real file, bytes match pass: "Installed CLI module matches source checkout"
real file, bytes diverge warn + recommendation with exact rm -rf <installed> && ln -s <checkout>/cli/lucli <installed> command

Symlink detection and byte comparison go through java.nio.file.Files for cross-engine parity (Lucee / Adobe CF / BoxLang).

Scope decisions (from issue's open questions)

  • Kept the check inside Doctor.cfc rather than a new wheels install status command. Zero cost outside source checkouts, preserves the single-entry-point UX. Muddies the service slightly in exchange for discoverability.
  • Byte-compare scoped to Module.cfc per the issue's proposal. A broader tree-compare under cli/lucli/ is a reasonable follow-up if edits to service files (not Module.cfc) become a recurring footgun — deferred.
  • Auto-symlink on install (issue's other open question) not addressed here — it's an lucli module install concern, separate PR.

Files changed

  • cli/lucli/services/Doctor.cfc — new checkCliInstallFreshness() + path/NIO helpers + remediation recommendation
  • cli/lucli/Module.cfc — pass variables.moduleRoot into Doctor service factory
  • cli/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 & LuCLI

Test plan

  • CLI suite via bash tools/test-cli-local.sh: 371 pass / 0 fail / 0 error (includes 6 new specs, all passing)
  • Core framework suite via LuCLI (SQLite): 3251 pass / 0 fail / 0 error
  • Live end-to-end simulation against the exact wheels doctor: detect stale ~/.wheels/modules/wheels/ install that shadows source checkout #2223 scenario (divergent bytes between checkout's cli/lucli/Module.cfc and a separate installed dir) — warning fires with the expected text, and the recommendation contains a ready-to-paste remediation command
  • Verify full CI matrix (Lucee 5/6/7 + Adobe 2018/2021/2023/2025 + BoxLang) passes on PR

Related

…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.
@github-actions github-actions Bot added the docs label Apr 22, 2026
@bpamiri bpamiri merged commit 979b200 into develop Apr 22, 2026
4 checks passed
@bpamiri bpamiri deleted the claude/quirky-rosalind-fda2ae branch April 22, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant