Skip to content

fix(doctor): honor --home and resolve harnesses the way boot does (#216, #217, #265) - #296

Merged
orveth merged 1 commit into
devfrom
fix/doctor-home-and-registry-216-217-265
Jul 30, 2026
Merged

fix(doctor): honor --home and resolve harnesses the way boot does (#216, #217, #265)#296
orveth merged 1 commit into
devfrom
fix/doctor-home-and-registry-216-217-265

Conversation

@orveth

@orveth orveth commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

All three fixes are in one file, crates/mobee/src/doctor.rs.

#216 — doctor silently ignored --home (and every other flag)

doctor::run took _args and never read it; run_doctor always called default_home_dir(), so maxplayer doctor --home <seat> produced a confident PASS/FAIL report about ~/.mobee instead.

  • run now parses --home <dir> (mirroring the sell.rs:660 pattern) via parse_doctor_args, and REFUSES any unknown flag rather than silently dropping it (a dropped flag yields an authoritative-looking answer to a question nobody asked — worse than an error).
  • The resolved home is threaded through resolve_doctor_homebootstrapbuild_checks.
  • The seller-key check now names the key file of the resolved home (<home>/key present) instead of the hardcoded literal ~/.mobee/key present.

#217 — doctor vs boot resolved harnesses differently

doctor resolved the [seller] agent preset through agent_presets::resolve_agent_preset (PATH-based), while SellerNodeRunner::boot calls seller_agents::resolvefallback_registry, which takes agent_command verbatim. A seat could be doctor-red / boot-fine, or the dangerous inverse.

  • doctor's agent check now calls seller_agents::resolve(&seller, &presets) — the exact call boot makes — and reports ITS verdict: full resolve ⇒ PASS, partial (still boots, serves the remainder) ⇒ WARN with boot's degrade line, RegistryError ⇒ FAIL with boot's refusal reason.
  • This check lives in the shared build_checks, so maxplayer doctor and the sell_readiness_gate auto-doctor converge on boot's verdict by construction: a green doctor now means "this seat boots with these harnesses".

#265 — startup auto-doctor "vacuous pass": did NOT reproduce on dev

Reproduced against dev by reading the path: the auto-doctor key check is key_file_present(home) (home-aware), and sell resolves its home from --home/MOBEE_HOME (sell.rs:95) before passing it to sell_readiness_gate. So the check reads the seat's configured home, not a hardcoded path — no logic bug. The only residual was the cosmetic hardcoded message string, which is fixed under #216 above.

Red-prove evidence (each behavioral fix goes red on revert)

#216 — revert: resolve_doctor_home ignores its --home override and uses default_home_dir():

test doctor::tests::doctor_honors_home_override_and_inspects_that_home ... FAILED
assertion `left == right` failed: doctor must bootstrap the --home dir, not the default
  left: "/home/gudnuf/.mobee"
 right: "/tmp/mobee-doctor-home-216-198254-1785398676685225342"

Restored → PASS.

#217 — revert: agent check uses the old resolve_agent_preset + argv0_resolvable (PATH) path:

test doctor::tests::doctor_agent_check_matches_boot_verdict_on_verbatim_command ... FAILED
assertion `left == right` failed: doctor must converge on boot's registry verdict, not a PATH-based preset probe:
  FAIL agent preset — agent 'myabsent' not found (argv0=mobee-doctor-absent-adapter-x7q) (fix: x)
  left: Fail
 right: Pass

Restored → PASS.

Tests

Targeted doctor suite (debug): 11 passed, 0 failed (was 6 before this change — count moved, confirming the new tests actually ran, not a feature-gated no-op). Full maxplayer bin unit suite: 33 passed, 0 failed.

New tests added inside doctor.rs:

🤖 Generated with Claude Code

…, #217, #265)

#216 — `maxplayer doctor` now parses `--home <dir>` (mirroring `sell`) and threads
the resolved home through bootstrap/build_checks; unknown flags are REFUSED rather
than silently dropped, so an operator is never handed a confident report about a
home they did not ask about. The seller-key check now names the key file of the
resolved home instead of a hardcoded `~/.mobee/key`.

#217 — doctor's agent check now builds the harness registry exactly the way
`SellerNodeRunner::boot` does (`seller_agents::resolve` on the same config) and
reports ITS verdict, instead of re-deriving resolution through the PATH-based preset
resolver. Because this lives in the shared `build_checks`, `doctor` and
`sell_readiness_gate` converge on boot's verdict by construction: a green doctor now
means "this seat boots with these harnesses".

#265 — the startup auto-doctor's key check does NOT reproduce as a logic bug on dev:
it already uses the home-aware `key_file_present(home)` and `sell` resolves the home
from `--home`/`MOBEE_HOME`. The only residual was the cosmetic hardcoded message,
fixed under #216.

Red-proven: dropping the --home threading turns the override test red (resolves the
default home instead of the tmp dir); reverting to the preset/PATH agent check turns
the boot-convergence test red (doctor FAIL vs boot PASS on an absolute agent_command).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mobee Ready Ready Preview Jul 30, 2026 8:07am

Request Review

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.

1 participant