fix(legacy-meter): guard MCP alias metering off in tests

Alias tests monkeypatch _get/_post but _meter_legacy_mcp uses _client()
directly, so every pytest run recorded real usage and reset zero-window
retirement streaks. STATEHUB_MCP_LEGACY_METER=off skips metering; set in
tests/conftest.py. Verified meter counts flat across the alias suite.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
tegwick 2026-07-10 21:47:46 +02:00
parent a18fa13682
commit 54577cd847
3 changed files with 16 additions and 0 deletions

View file

@ -119,6 +119,16 @@ zero-window streaks accrue from 2026-07-10. Note: `mcp:list_workstreams` shows
1 verification call in the 2026-07-10 window — streak counts from the next
window. Removal remains gated on 7 consecutive zero windows.
Recheck 2026-07-10: pytest was recording real alias usage on the live meter
(tests monkeypatch `_get`/`_post` but the meter helper uses `_client()`),
which would reset streaks every run. Guarded with
`STATEHUB_MCP_LEGACY_METER=off`, set in `tests/conftest.py`; verified
before/after counts flat across the alias test suite. Stray counts from
verification + first test run (create=2, list=2, resource=1) clear at next
window rollover. **Deploy note:** the long-running dev-hub MCP process
(:8001) predates this change and must be restarted (`make mcp-http`) before
its zero windows are trustworthy — unmetered live usage would look like zero.
## Task: Internal dual-key and param alias cleanup
```task