Files
FabledSteward/steward/mcp/tools/__init__.py
T
bvandeusenandClaude Opus 5.5 5569f9934e
CI / lint (push) Successful in 2s
CI / integration (push) Failing after 1m24s
CI / unit (push) Successful in 1m37s
CI / publish (push) Skipped
feat(anomalies): a metric out of its normal is an anomaly to review (#5740)
#5740 "A metric that departs from its normal is recorded as an anomaly to
review, and is findable after it ends", milestone 513.

- Every minute each learned key's last 15 minutes is judged against its
  hour's normal: above the usual hold x1.25 and by the metric's floor opens
  an occurrence, which ends when the level comes back.
- metric_anomalies holds one row per item to review; a repeat while it
  still waits joins it as an occurrence (metric_anomaly_spans).
- An ended row nobody reviews within anomalies.review_days (14, Settings ->
  Thresholds) lapses; an ongoing one never does.
- Learning skips every hour an occurrence covers unless its anomaly was
  marked normal: no normal is learned without review.
- Alerts -> Anomalies lists those to review first, then the reviewed and
  lapsed under day dividers; marking is operator/admin and audited.
- The Overview widget and get_overview warn of open ones and count those
  to review; the host page shows its own; the weekly report lists the
  week's and the lapsed; MCP list_anomalies and review_anomaly.
- Reviewed and lapsed rows are pruned at data.retention_days, and kept
  in backups like alert history.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 13:41:57 -04:00

23 lines
944 B
Python

"""Core MCP tool modules.
Each module defines plain `async def` tools at module level (tests call them
directly) and a `register(register_tool)` that lists them with their minimum
role. `register_tool(fn, role=..., read_only=...)` takes both as required
keywords: a tool with no declared role is unreachable, and there is no default
read_only for a mutating tool to inherit by forgetting.
A tool's docstring IS its contract with the agent — it ships as the tool's
description. Say what it is for, when to reach for it over its siblings, what
each argument's empty value means, and what comes back.
"""
from __future__ import annotations
from . import alerts, anomalies, audit, automation, hosts, metrics, monitors, overview, session
_MODULES = (session, overview, hosts, monitors, alerts, anomalies, metrics, audit, automation)
def register_all(register_tool) -> None:
for module in _MODULES:
module.register(register_tool)