feat(mcp): make odd_stack_reset machine-wide wipe visible - #49
Merged
Conversation
The stack is shared machine-wide, so a reset issued while observing one project silently destroyed every other project's telemetry (#35). The wipe stays global (the backends offer no per-service delete), but it is no longer silent: the tool description now states the machine-wide scope, and the reset result returns services_wiped - the service.name values stored across Tempo, Loki, and Prometheus just before the wipe - so a calling agent can warn when unexpected services are present. Refs #35 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Multi-agent review of the branch surfaced two defects that emptied the
list in the most common scenarios, plus hardening gaps:
- Tempo/Loki were queried without start/end: Tempo then only reads its
live store and Loki looks back 6h, so day-old services were wiped
without being listed. Both backends reject ranges over their caps
(168h / 30d1h) rather than clamping, so the queries now use the widest
accepted window (verified against the live stack).
- A stopped container (normal after a host reboot) answers nothing on
:3000, so the reset reported services_wiped: [] while destroying real
data. The reset now boots a stopped container first (best-effort: a
container too broken to boot must still be wipeable).
- Wrong-typed JSON fields no longer leak (string iterated char-by-char)
or raise (null field -> TypeError escaping the except tuples).
- Namespace stripping uses split("/", 1): job is one namespace segment
plus service.name, which may itself contain "/".
- Issue #35 side note now addressed: docs and tool description state
that oddyssey-mcp and otelcol-contrib are always listed and are never
another project's leftover state.
Refs #35
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…is the contract Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements option 2 of #35:
odd_stack_resetkeeps its full-wipe behavior (the backends offer no per-service delete), but the destruction is no longer silent.odd_stack_down's description gains the same shared-stack caveat.services_wipedfield: theservice.namevalues stored just before the wipe, collected best-effort as the union of Tempo tag values, Lokiservice_namelabel values, and Prometheusjobvalues (with theservice.namespace/prefix stripped). Any backend failure degrades to fewer names, never to an error that blocks the reset.Why
Reported by the first external consumer: a reset issued while observing project A silently and irreversibly destroyed every signal project B had accumulated on the same machine. Options 1 (service selector) and 3 (configurable stack) of #35 remain open — this is the quick win that removes the silent part of the data loss.
How to test
uv run --project src/mcp-server pytest -c src/mcp-server/pyproject.toml tests/mcp-servertest-stack-reset.shnow asserts the reset result names the injectedreset-proofservice inservices_wiped.stored_services()returned['oddyssey-mcp', 'otelcol-contrib'].Refs #35
🤖 Generated with Claude Code