marchwarden/tests
Jeff Smith 6fdf0e338a M2.5.3: marchwarden costs CLI command (#26)
Adds operator-facing `marchwarden costs` subcommand that reads the
JSONL ledger from M2.5.2 and pretty-prints a rich summary:

- Cost Summary panel: total calls, total spend, total tokens (input/
  output split), Tavily search count, warning for any calls with
  unknown model prices
- Per-Day table sorted by date
- Per-Model table sorted by model id
- Highest-Cost Call panel with trace_id and question

Flags:
  --since   ISO date or relative shorthand (7d, 24h, 2w, 1m)
  --until   same
  --model   filter to a specific model_id
  --json    emit raw filtered ledger entries instead of the table
  --ledger  override default path (mostly for tests)

Also fixes a Dockerfile gap: the obs/ package added in M2.5.1 was
not being COPYed into the image, so the installed `marchwarden`
entry point couldn't import it. Tests had been passing because
they mounted /app over the install. Adding `COPY obs ./obs`
restores parity.

Tests cover summary rendering, model filter, since-date filter,
JSON output, and the empty-ledger friendly path. 110/110 passing.
End-to-end verified against the real cost ledger.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 15:57:39 -06:00
..
__init__.py M0.3: Implement contract v1 Pydantic models with tests 2026-04-08 14:00:45 -06:00
test_agent.py Add OpenQuestion to research contract 2026-04-08 14:37:30 -06:00
test_cli.py M2.5.3: marchwarden costs CLI command (#26) 2026-04-08 15:57:39 -06:00
test_costs.py M2.5.2: Cost ledger with price table (#25) 2026-04-08 15:52:25 -06:00
test_models.py Add OpenQuestion to research contract 2026-04-08 14:37:30 -06:00
test_obs.py M2.5.1: Structured application logger via structlog (#24) 2026-04-08 15:46:51 -06:00
test_server.py M1.4: MCP server wrapping web researcher 2026-04-08 14:41:13 -06:00
test_tools.py M1.1: Search and fetch tools with tests 2026-04-08 14:17:18 -06:00
test_trace.py M1.2: Trace logger with tests 2026-04-08 14:21:10 -06:00