Skip to content

Make CLI, doctor, and operator documentation an executable contract #105

Description

@jmcte

Problem

Operator docs and runtime behavior disagree:

  • mpi doctor --json is documented but fails because --json is only global.
  • Runbook examples place global --db after subcommands and fail.
  • Live configuration names differ between the runbook and runtime.
  • Docs imply copying .env.example is sufficient, but runtime reads process environment and has no dotenv loader.
  • Doctor reports live access ok based only on variable presence.
  • The live-adapter example passes a nonexistent SyncBatch.next_cursor.
  • Phase status marks modules “done” even when they are contract-only or stubs.

Relevant code/docs

  • src/mailplus_intelligence/cli.py:292-400
  • src/mailplus_intelligence/doctor.py:38-153
  • src/mailplus_intelligence/live_adapter.py:33-85
  • src/mailplus_intelligence/sync.py:18-25
  • docs/quickstart.md
  • docs/ops-runbooks.md
  • docs/integration/live-mailplus-adapter.md
  • docs/live-adapter.md
  • docs/phase2-planning.md
  • docs/bootstrap/next-steps.md

Scope

  • Choose and enforce a consistent common-option model; common flags should work in documented positions or docs must use the supported canonical order.
  • Normalize live credential names across code, .env.example, doctor, and runbooks.
  • Either explicitly support dotenv loading or state that operators must export variables/process-inject them.
  • Split doctor live status into configured, reachable, authenticated, and sync-capable.
  • Correct SyncBatch examples and cursor terminology.
  • Replace binary “done” claims with fixture-complete, contract-only, integrated, and production-verified.
  • Add an executable documentation smoke test for every command block in the quickstart/runbook that is expected to run in fixture mode.

Non-goals

  • Do not implement live network access here.
  • Do not add real credentials or hostnames to fixtures.
  • Do not claim connectivity from environment-variable presence.

Acceptance criteria

  • Every fixture-mode command documented in quickstart/runbooks is executed verbatim in CI.
  • JSON and database flags behave consistently in documented positions.
  • Credential names and setup instructions agree everywhere.
  • Doctor distinguishes configuration from real capability.
  • Live adapter examples instantiate current public types correctly.
  • Phase/status docs accurately distinguish stubs from integrated behavior.
  • Stale bootstrap/release wording is removed or updated.
  • Failure messages include a concrete next step without exposing secrets.

Validation

bash scripts/ci/run-fast-checks.sh
# run the new docs/CLI smoke harness
mpi --help
mpi doctor --json

The PR should include captured output for the canonical quickstart path.

Parent

Part of #98.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:infraInfrastructure, CI, release, governance, scripts, or repo setup.bugSomething isn't workingdocumentationImprovements or additions to documentationpriority:P2Codex Connector P2; blocks execution until Athena validates.ready-for-agentIssue is approved for worker-lane execution.risk:mediumMedium-risk change; normal care required.status:ready-for-agentIssue is approved for worker-lane execution.

    Type

    No type

    Fields

    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