Skip to content

R3: First-run experience — quickstart, friendly doctor, CLI error paths #84

@jmcte

Description

@jmcte

Goal

A new operator should be able to go from git clone to running mpi search and mpi queue list against the fixture corpus in under 5 minutes, without reading the existing per-area design docs. Today the README is policy-heavy and the CLI fails opaquely if the DB or fixture corpus is missing.

This is R3 of six release milestones (R1–R6) leading to v0.1.0.

Evidence

  • README.md documents a venv install but no curated walkthrough of the operator workflow (search → queue → export).
  • src/mailplus_intelligence/cli.py:11 defaults --db to :memory:, so cold-start state isn't preserved between commands and the user can't actually approve and re-inspect anything without specifying --db <path>.
  • cli.py has no top-level try/except around DB connect, fixture load, or extractor runs — exceptions surface as raw tracebacks.
  • mpi doctor (per src/mailplus_intelligence/doctor.py) reports check status but doesn't print actionable next steps when a check is gated/failed.

Acceptance criteria

Quickstart

  • New docs/quickstart.md walks through:
    1. pip install -e . (or post-R2: pip install mailplus-intelligence)
    2. mpi doctor to confirm fixture corpus and schema
    3. mpi --db ./mpi.db sync … (or fixture-corpus seed command, see below) to populate from fixtures/mailplus_metadata
    4. mpi --db ./mpi.db search --keyword …
    5. mpi --db ./mpi.db thread <key>
    6. mpi --db ./mpi.db queue listqueue approve <id>queue inspect <id>
    7. mpi --db ./mpi.db export --output ./out (and explanation that this is dry-run only — see R4)
  • Each step shows expected output (trimmed) so a reader can verify they're on track.
  • Quickstart is linked from README.md directly under the "Recommended starting point" section.

CLI ergonomics

  • Add mpi seed --from-fixtures <dir> (or wire the existing sync_from_fixture_corpus helper into the CLI) so the quickstart doesn't require Python invocation to populate the index.
  • Wrap the CLI command dispatcher in a single try/except that catches FileNotFoundError, sqlite3.OperationalError, LiveAdapterNotConfigured, and the new LLMNotAvailable (from R2), printing a single-line actionable error and returning a non-zero exit code.
  • --db :memory: (the current default) prints a one-line warning that approvals/state will not persist; recommend a path.
  • mpi --version prints package version (sourced from importlib.metadata).

Doctor improvements

  • Each failed/gated DoctorCheck includes a next_step string surfaced in the human-readable report ("To enable LLM extraction, run pip install 'mailplus-intelligence[llm]'", "To enable live MailPlus, set MAILPLUS_HOST/USER/TOKEN", etc.).
  • mpi doctor --json schema documented in the doc page (one line per check).

Tests

  • CLI test asserting the friendly error path for a missing fixture corpus and a missing DB parent directory.
  • Test for mpi --version.
  • Test that mpi seed populates a fresh DB and mpi search returns expected fixture rows.

Definition of done

  • A teammate (or anyone) can follow docs/quickstart.md start to finish on a fresh clone with no prior context.
  • All acceptance criteria boxes checked.
  • bash scripts/ci/run-fast-checks.sh green.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions