---
phase: 01-installer-and-setup-architecture-simplification
plan: 01
type: execute
wave: 1
depends_on: []
files_modified:
  - src/reddit_mcp/cli.py
  - src/reddit_mcp/server.py
  - src/reddit_mcp/config.py
  - src/reddit_mcp/uninstall.py
  - tests/test_release_readiness.py
autonomous: true
requirements:
  - INST-01
  - INST-02
  - INST-03
  - SETUP-01
  - SETUP-02
  - SETUP-03
must_haves:
  truths:
    - "`reddit-mcp setup` becomes the only setup orchestrator, with explicit install/auth/cookies/register/verify phase semantics and non-zero failure behavior."
    - "`reddit-mcp serve` is the only canonical runtime command exposed by CLI help, MCP guidance, and manual recovery output."
    - "CLI-level user guidance no longer treats `uvx`, `python3`, `launcher.py`, or `bootstrap` as formal long-term runtime paths."
  artifacts:
    - path: "src/reddit_mcp/cli.py"
      provides: "Canonical setup orchestration contract and user-facing command/help surface"
    - path: "src/reddit_mcp/server.py"
      provides: "MCP-side setup guidance aligned to the canonical runtime contract"
    - path: "src/reddit_mcp/config.py"
      provides: "Config path contract after launcher exits the supported runtime path"
  key_links:
    - from: "src/reddit_mcp/cli.py"
      to: "src/reddit_mcp/server.py"
      via: "setup guidance and runtime command text"
      pattern: "reddit-mcp serve|setup|register|verify"
    - from: "src/reddit_mcp/cli.py"
      to: "src/reddit_mcp/config.py"
      via: "config path usage"
      pattern: "CONFIG_DIR|META_PATH|COOKIES_PATH"
---

<objective>
Replace the current reddit-mcp CLI contract with a single setup orchestrator and a single runtime truth before touching shared registration or installer wrappers.

Purpose: Lock the command semantics that every downstream layer will consume. Installer templates and shared registration should not move until the CLI clearly defines the setup phases, exit behavior, and user-facing guidance.
Output: A rewritten CLI/setup contract, aligned MCP guidance, reduced launcher/bootstrap coupling in config/help text, and updated release-readiness assertions.
</objective>

<execution_context>
@/Users/yimingwang/.codex/get-shit-done/workflows/execute-plan.md
@/Users/yimingwang/.codex/get-shit-done/templates/summary.md
</execution_context>

<context>
@.planning/PROJECT.md
@.planning/REQUIREMENTS.md
@.planning/ROADMAP.md
@.planning/STATE.md
@.planning/phases/01-installer-and-setup-architecture-simplification/01-CONTEXT.md
@src/reddit_mcp/cli.py
@src/reddit_mcp/server.py
@src/reddit_mcp/config.py
@tests/test_release_readiness.py
</context>

<tasks>

<task type="auto">
  <name>Task 1: Replace the CLI contract with explicit setup phase orchestration</name>
  <read_first>.planning/phases/01-installer-and-setup-architecture-simplification/01-CONTEXT.md, src/reddit_mcp/cli.py, src/reddit_mcp/cookie_manager.py, src/reddit_mcp/config.py, tests/test_release_readiness.py</read_first>
  <files>src/reddit_mcp/cli.py, src/reddit_mcp/config.py</files>
  <action>Refactor `src/reddit_mcp/cli.py` so `reddit-mcp setup` owns the explicit `install`, `auth`, `cookies`, `register`, and `verify` phases instead of mixing setup completion with launcher/bootstrap side effects. Keep `reddit-mcp serve` as the only canonical runtime command in help text, manual recovery text, and emitted config snippets. Remove `bootstrap` and launcher-centric guidance from the supported CLI surface, and stop persisting or printing `python3` + `launcher.py` runtime snippets as the formal path. Update `src/reddit_mcp/config.py` to stop treating `launcher.py` as a first-class config artifact while preserving cookie/meta/browser-profile storage and any required legacy path migration helpers that are still needed for config data only.</action>
  <verify>
    <automated>py -3 -m pytest tests/test_release_readiness.py -q</automated>
  </verify>
  <acceptance_criteria>
    - `src/reddit_mcp/cli.py` contains one setup orchestration path that references the exact phases `install`, `auth`, `cookies`, `register`, and `verify`.
    - `src/reddit_mcp/cli.py` help or manual config output contains `reddit-mcp serve` and does not contain the exact strings `uvx --from 5mghost-rover reddit-mcp serve` or `"command": "python3"`.
    - `src/reddit_mcp/cli.py` no longer exposes `bootstrap` in its main help output as a supported user command.
    - `src/reddit_mcp/config.py` does not define `LAUNCHER_PATH` or `LEGACY_LAUNCHER_PATH`.
    - `py -3 -m pytest tests/test_release_readiness.py -q` exits 0.
  </acceptance_criteria>
  <done>The CLI now defines a single setup contract that downstream registration and installer code can implement against without guessing runtime paths.</done>
</task>

<task type="auto">
  <name>Task 2: Align MCP setup guidance and uninstall/update messaging to the new contract</name>
  <read_first>.planning/phases/01-installer-and-setup-architecture-simplification/01-CONTEXT.md, src/reddit_mcp/server.py, src/reddit_mcp/cli.py, src/reddit_mcp/uninstall.py, tests/test_release_readiness.py</read_first>
  <files>src/reddit_mcp/server.py, src/reddit_mcp/uninstall.py, src/reddit_mcp/cli.py, tests/test_release_readiness.py</files>
  <action>Rewrite `src/reddit_mcp/server.py` setup-required and cookie-required guidance so MCP clients are instructed in terms of the canonical command path and setup subcommands, not `uvx` or launcher indirection. Update uninstall/update/help messaging in `src/reddit_mcp/cli.py` and `src/reddit_mcp/uninstall.py` so all user-facing recovery text points at the uv-based contract and no longer recommends `pip install --upgrade`, `python3 launcher.py`, or other retired runtime truths. Expand `tests/test_release_readiness.py` so it asserts the new runtime/help/setup contract and fails if launcher/bootstrap/`python3` assumptions regress into the CLI surface.</action>
  <verify>
    <automated>py -3 -m pytest tests/test_release_readiness.py -q</automated>
  </verify>
  <acceptance_criteria>
    - `src/reddit_mcp/server.py` setup guidance contains `reddit-mcp serve` or `reddit-mcp setup` and does not contain `uvx --from`.
    - `src/reddit_mcp/uninstall.py` and `src/reddit_mcp/cli.py` user-facing recovery text does not contain the exact string `pip install --upgrade 5mghost-rover`.
    - `tests/test_release_readiness.py` includes assertions that reject `python3` runtime registration and launcher-based manual config output as the supported contract.
    - `py -3 -m pytest tests/test_release_readiness.py -q` exits 0 after the messaging and assertions change.
  </acceptance_criteria>
  <done>MCP guidance, uninstall/update messaging, and release-readiness tests all reinforce the same uv-based setup/runtime contract.</done>
</task>

</tasks>

<threat_model>
## Trust Boundaries

| Boundary | Description |
|----------|-------------|
| user CLI invocation -> `src/reddit_mcp/cli.py` | Untrusted command/flag usage drives setup phase transitions |
| MCP client -> `src/reddit_mcp/server.py` guidance text | Incorrect guidance can cause clients or AIs to persist unusable runtime commands |

## STRIDE Threat Register

| Threat ID | Category | Component | Disposition | Mitigation Plan |
|-----------|----------|-----------|-------------|-----------------|
| T-01-01 | T | `src/reddit_mcp/cli.py` phase dispatch | mitigate | Use explicit phase functions and non-zero failure behavior instead of fallthrough from setup to partial success |
| T-01-02 | I | user-facing runtime guidance | mitigate | Eliminate launcher/`python3`/`uvx` guidance from supported text so clients do not persist stale commands |
| T-01-03 | D | setup failure handling | mitigate | Make required phase failure terminate setup clearly instead of emitting fake completion text |
</threat_model>

<verification>
Run `py -3 -m pytest tests/test_release_readiness.py -q` and inspect CLI help/server guidance output if needed to confirm the canonical command and setup phases are now the only supported contract.
</verification>

<success_criteria>
The repo has one CLI-level truth for setup and runtime, and downstream plans can consume it without reintroducing launcher/bootstrap/runtime drift.
</success_criteria>

<output>
After completion, create `.planning/phases/01-installer-and-setup-architecture-simplification/01-installer-and-setup-architecture-simplification-01-SUMMARY.md`
</output>
