mix mimir.smoke (Mimir v0.1.0)

Copy Markdown View Source

Drives the public mimir API surface end-to-end as one repeatable command — no network, no external services. The HTTP client stage runs a real Req request against an in-process plug, so JSON encoding, response atomization, and error mapping execute production code at the transport seam. The health and turn-event stages run the real GenServers, ETS tables, and telemetry handlers.

Stages

  1. descriptor — full parse incl. agent identity + outcome hint; rejection path
  2. catalog — resolver seam keeps/drops entries
  3. oracle — placement on a healthy catalog; no-candidate on empty and on degraded-lane catalogs
  4. decision record — id format, grant echo, agent echo
  5. route log — meta building for placed and grant-failed outcomes
  6. pricing — config-table math, vendored-DB load, unknown-model zero
  7. health — telemetry-driven degradation and recovery
  8. turn events — current-request buffering, ordering, envelope shape
  9. router client — placement round-trip and http_error mapping over a real Req request (skipped unless run under MIX_ENV=test — Plug is a test-only dependency; CI's test job runs it for real)
  10. redact — provider split, truncation, payload gating

Usage

mix mimir.smoke

Exits 0 on all-pass, non-zero on any failure. run_smoke/0 is also asserted by the test suite so CI verifies the composed surface on every build.

Summary

Functions

Pure smoke flow — returns {:ok, results} or {:error, results} where results is a list of {stage_name, :pass | :fail | :skip, detail}. Does not print or halt; suitable for calling directly from tests.

Functions

run_smoke()

@spec run_smoke() ::
  {:ok, [{String.t(), :pass | :fail | :skip, String.t()}]}
  | {:error, [{String.t(), :pass | :fail | :skip, String.t()}]}

Pure smoke flow — returns {:ok, results} or {:error, results} where results is a list of {stage_name, :pass | :fail | :skip, detail}. Does not print or halt; suitable for calling directly from tests.