fix(desktop): spawn the maxplayer binary, not the retired mobee name (#285) - #295
Merged
Conversation
…285) Since #262 the CLI ships as `maxplayer`, but mobee-desktop still probed a `mobee` sibling and fell back to `Command::new("mobee")` on PATH — so both resolution paths targeted a binary nothing installs. The crate is not in default-members, so a root `cargo build` stayed green while the app could never launch the CLI it exists to drive. Fix: introduce a single `const CLI_BIN = "maxplayer"` as the one source of truth for the spawned name, and route all three former `"mobee"` literals (sibling probe, PATH fallback, and the test helper) through it, so the name cannot drift across copies again. The `MOBEE_BIN` env override and other wire values are left untouched — only the spawned bin name changed. Red-prove: `resolve_cli_command` is split out of `mobee_command` so the spawned program name is assertable without depending on the real `current_exe`. The new test asserts the resolver targets `maxplayer`, with a red leg asserting the same resolver pointed at the retired `mobee` name resolves to `mobee` (positive control). Flipping `CLI_BIN` back to `"mobee"` turns the test red (left: "mobee", right: "maxplayer"); restoring it passes. Residual spawn-shaped sweep for the old name across the tree: 2 hits, both the sites fixed here (denominator emitted, not a bare "none"). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Fixes #285.
Problem
crates/mobee-desktoplaunched the CLI by the namemobee, which no longer exists. Since #262 the shipped binary ismaxplayer([[bin]]name, flakemainProgram,apps.*.program). Both resolution paths failed:dir.join(executable_name("mobee"))never foundmobeenext to the desktop executable, andCommand::new("mobee")spawned a name nothing installs.The crate is not in
default-members, so a rootcargo buildstayed green while the app could never launch the CLI it exists to drive. This is the "eighth lexical form" from the #262 sweep — the name as a process to spawn, which neither a path-shaped nor an assertion-shaped grep reaches.Fix — one constant, three sites
Introduced a single source of truth:
Routed all three former
"mobee"literals through it — the sibling probe (:587), the PATH fallback (:593), and the test helper (:843) — so the spawned name has one definition rather than three copies that can drift apart.resolve_cli_command(bin, current_exe)is split out ofmobee_commandso the spawned program name is assertable in a unit test without depending on the process' realcurrent_exe.Scope is deliberately narrow: the
MOBEE_BINenv override and all other wire values / crate names / paths are left untouched — only the spawned bin name changed. This is a plain correctness fix, not a rename preview.Red-prove (per acceptance)
New test
resolve_cli_command_spawns_the_shipped_maxplayer_binaryinvokes the resolver (not the source / not--help):maxplayer;mobeename resolves tomobee, and asserts the two differ — so the guard cannot pass while never running.Demonstrated failing → passing by flipping the one value that matters:
CLI_BIN = "mobee"→test ... FAILED—assertion `left == right` failed ... left: "mobee", right: "maxplayer"CLI_BIN = "maxplayer"(restored) →test result: ok. 5 passedResidual sweep (denominator emitted)
Spawn-shaped references to the old name across the tree (
Command::new("mobee")): 2 hits, both the sites fixed in this PR. Zero elsewhere.Verification
cargo build -p mobee-desktop(explicit — the crate is outside the default set): Finished, green.cargo test -p mobee-desktop: 5 passed; 0 failed (was 4 before this PR — the new test moved the count 4 → 5).Touches only
crates/mobee-desktop/src/main.rs(fix + test module).🤖 Generated with Claude Code