Skip to content

feat(mcp): make odd_stack_reset machine-wide wipe visible - #49

Merged
using-system merged 4 commits into
mainfrom
feat/stack-reset-visibility
Aug 23, 2026
Merged

feat(mcp): make odd_stack_reset machine-wide wipe visible#49
using-system merged 4 commits into
mainfrom
feat/stack-reset-visibility

Conversation

@using-system

Copy link
Copy Markdown
Owner

What

Implements option 2 of #35: odd_stack_reset keeps its full-wipe behavior (the backends offer no per-service delete), but the destruction is no longer silent.

  • The tool description now states the wipe is machine-wide and irreversible — one shared stack per machine, every project's data is destroyed — and instructs the calling agent to warn the user when unexpected services are present. odd_stack_down's description gains the same shared-stack caveat.
  • The reset result gains a services_wiped field: the service.name values stored just before the wipe, collected best-effort as the union of Tempo tag values, Loki service_name label values, and Prometheus job values (with the service.namespace/ prefix stripped). Any backend failure degrades to fewer names, never to an error that blocks the reset.
  • README documents the one-stack-per-machine constraint and the new field.

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

  • Unit: uv run --project src/mcp-server pytest -c src/mcp-server/pyproject.toml tests/mcp-server
  • Integration: test-stack-reset.sh now asserts the reset result names the injected reset-proof service in services_wiped.
  • Verified read-only against a live local stack: stored_services() returned ['oddyssey-mcp', 'otelcol-contrib'].

Refs #35

🤖 Generated with Claude Code

using-system and others added 4 commits August 23, 2026 21:05
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>
@using-system
using-system merged commit a0c09d3 into main Aug 23, 2026
11 checks passed
@using-system
using-system deleted the feat/stack-reset-visibility branch August 23, 2026 19:37
@github-actions github-actions Bot mentioned this pull request Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant