Skip to content

feat(install): recommend cli surface + update --surface mcp↔cli migration#389

Merged
HumanBean17 merged 2 commits into
masterfrom
feat/install-cli-default-update-surface-switch
Jul 6, 2026
Merged

feat(install): recommend cli surface + update --surface mcp↔cli migration#389
HumanBean17 merged 2 commits into
masterfrom
feat/install-cli-default-update-surface-switch

Conversation

@HumanBean17

Copy link
Copy Markdown
Owner

Two setup-wizard fixes building on the recently-shipped jrag CLI.

1. update can now switch surfaces (mcp ↔ cli)

  • New update --surface {mcp,cli} flag. On a TTY with no flag it prompts (cursor on the current surface, so Enter keeps it); non-interactive update without --surface refreshes each host on its own recorded surface and migrates nothing.
  • A switch migrates each affected host: tears down the old surface's artifacts (_remove_mcp_entry pops only the java-codebase-rag server, preserving siblings; old skill/agent files removed), deploys the new surface's, and rewrites the .java-codebase-rag.hosts marker so it persists.
  • Fails fast (exit 1) if the target binary is missing; dry-run safe.

2. Install recommends the cli surface

  • select_surface lists cli (Recommended) first and defaults to cli everywhere (interactive cursor + non-interactive default).
  • Fixed prompt() so questionary.select(default=...) actually positions the cursor: questionary validates default only against Choice.value, so dict choices are now normalized to Choice before the call.

⚠️ Breaking change

Non-interactive install/update without --surface now yields cli (previously mcp). CI that relied on the implicit MCP default must add --surface mcp.

Review-driven correction

Code review caught that the non-TTY no-flag update path returned the first host's surface as the global target, so a mixed-surface marker would get normalized. Fixed: that path now refreshes each host on its own surface and migrates nothing. Covered by test_update_no_flag_non_tty_mixed_marker_does_not_migrate and test_update_surface_normalizes_mixed_marker.

Verification

  • tests/test_installer_surface.py — 31 passed (incl. new migration/mixed-surface/user-scope/prompt-spy cases)
  • tests/test_installer.py — 85 passed; tests/test_java_codebase_rag_cli.py update-flag tests pass
  • Real pty smoke tests: fresh install renders » cli (Recommended) first → Enter picks cli; update renders cli (Recommended) first with cursor on the current surface → Enter keeps it
  • Full suite: 1092 passed / 15 skipped / 1 environmental failure (test_cli_lifecycle_stdout_invariant_erase_quiet.venv/bin not on PATH in the sandbox subprocess; passes with the venv on PATH, unrelated to this change)

🤖 Generated with Claude Code

HumanBean17 and others added 2 commits July 6, 2026 14:21
…ration

Two setup-wizard fixes following the jrag CLI ship:

1. `update` can now switch surfaces. New `update --surface {mcp,cli}` flag;
   on a TTY with no flag it prompts (cursor on the current surface). A switch
   migrates each affected host — tears down the old surface's artifacts
   (`_remove_mcp_entry` pops only our server, preserving siblings; skill/agent
   files removed), deploys the new surface's, and rewrites the install marker
   so it persists. Fails fast (exit 1) if the target binary is missing; dry-run
   safe. Non-interactive `update` without `--surface` refreshes each host on
   its own recorded surface and migrates nothing (a mixed-surface marker is
   left untouched, not normalized to the first host's surface).

2. Install recommends `cli`. `select_surface` now lists `cli (Recommended)`
   first and defaults to `cli` everywhere (interactive cursor + non-interactive
   default). Fixed `prompt()` so `questionary.select(default=...)` positions the
   cursor: it validates `default` only against `Choice.value`, so dict choices
   are normalized to `Choice` before the call.

Note: non-interactive `install`/`update` without `--surface` now yields `cli`
(previously `mcp`) — a breaking change for CI that relied on the implicit MCP
default.

Co-Authored-By: Claude <noreply@anthropic.com>
…lt flip

The two JAVA_CODEBASE_RAG_RUN_HEAVY-gated integration tests invoke
`install --non-interactive` via subprocess (no --surface) and assert the MCP
artifacts (.mcp.json, explore-codebase skill, explorer-rag-enhanced agent).
They broke when the non-interactive default flipped to cli — but they were
skipped locally (no heavy env var) so the miss only surfaced in CI. Add
`--surface mcp` to preserve their intent (testing the MCP install path).

Co-Authored-By: Claude <noreply@anthropic.com>
@HumanBean17 HumanBean17 merged commit 20262ae into master Jul 6, 2026
3 checks passed
@HumanBean17 HumanBean17 deleted the feat/install-cli-default-update-surface-switch branch July 6, 2026 13:24
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