detectkit 0.66.5__tar.gz → 0.67.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. {detectkit-0.66.5/detectkit.egg-info → detectkit-0.67.0}/PKG-INFO +1 -1
  2. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/__init__.py +1 -1
  3. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/assets/claude/rules/alerting.md +4 -0
  4. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/assets/claude/rules/cli.md +8 -4
  5. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/config/metric_config.py +41 -0
  6. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/orchestration/task_manager/_alert_step.py +2 -4
  7. detectkit-0.67.0/detectkit/ui/assets/ui.js +557 -0
  8. {detectkit-0.66.5 → detectkit-0.67.0/detectkit.egg-info}/PKG-INFO +1 -1
  9. detectkit-0.66.5/detectkit/ui/assets/ui.js +0 -551
  10. {detectkit-0.66.5 → detectkit-0.67.0}/LICENSE +0 -0
  11. {detectkit-0.66.5 → detectkit-0.67.0}/MANIFEST.in +0 -0
  12. {detectkit-0.66.5 → detectkit-0.67.0}/README.md +0 -0
  13. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/alerting/__init__.py +0 -0
  14. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/alerting/channels/__init__.py +0 -0
  15. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/alerting/channels/base.py +0 -0
  16. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/alerting/channels/branding.py +0 -0
  17. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/alerting/channels/discord.py +0 -0
  18. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/alerting/channels/email.py +0 -0
  19. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/alerting/channels/factory.py +0 -0
  20. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/alerting/channels/googlechat.py +0 -0
  21. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/alerting/channels/mattermost.py +0 -0
  22. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/alerting/channels/ntfy.py +0 -0
  23. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/alerting/channels/slack.py +0 -0
  24. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/alerting/channels/teams.py +0 -0
  25. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/alerting/channels/telegram.py +0 -0
  26. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/alerting/channels/webhook.py +0 -0
  27. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/alerting/orchestrator/__init__.py +0 -0
  28. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/alerting/orchestrator/_base.py +0 -0
  29. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/alerting/orchestrator/_cooldown.py +0 -0
  30. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/alerting/orchestrator/_decision.py +0 -0
  31. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/alerting/orchestrator/_dispatch.py +0 -0
  32. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/alerting/orchestrator/_recovery.py +0 -0
  33. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/alerting/orchestrator/_replay.py +0 -0
  34. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/alerting/orchestrator/_types.py +0 -0
  35. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/alerting/orchestrator/orchestrator.py +0 -0
  36. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/autotune/__init__.py +0 -0
  37. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/autotune/_base.py +0 -0
  38. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/autotune/_types.py +0 -0
  39. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/autotune/autotuner.py +0 -0
  40. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/autotune/axis_spec.py +0 -0
  41. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/autotune/config_emitter.py +0 -0
  42. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/autotune/crossval.py +0 -0
  43. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/autotune/detector_select.py +0 -0
  44. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/autotune/distribution.py +0 -0
  45. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/autotune/grid_search.py +0 -0
  46. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/autotune/labels.py +0 -0
  47. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/autotune/result.py +0 -0
  48. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/autotune/runner.py +0 -0
  49. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/autotune/scoring.py +0 -0
  50. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/autotune/seasonality_search.py +0 -0
  51. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/autotune/settings.py +0 -0
  52. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/autotune/window_select.py +0 -0
  53. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/__init__.py +0 -0
  54. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/_output.py +0 -0
  55. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/assets/claude/CLAUDE.section.md +0 -0
  56. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/assets/claude/rules/autotune.md +0 -0
  57. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/assets/claude/rules/detectors.md +0 -0
  58. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/assets/claude/rules/metrics.md +0 -0
  59. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/assets/claude/rules/overview.md +0 -0
  60. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/assets/claude/rules/project.md +0 -0
  61. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/assets/claude/skills/dtk-autotune/SKILL.md +0 -0
  62. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/assets/claude/skills/dtk-feedback/SKILL.md +0 -0
  63. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/assets/claude/skills/dtk-new-metric/SKILL.md +0 -0
  64. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/assets/claude/skills/dtk-setup-project/SKILL.md +0 -0
  65. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/assets/claude/skills/dtk-tune/SKILL.md +0 -0
  66. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/commands/__init__.py +0 -0
  67. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/commands/autotune.py +0 -0
  68. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/commands/clean.py +0 -0
  69. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/commands/init.py +0 -0
  70. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/commands/init_claude.py +0 -0
  71. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/commands/mcp.py +0 -0
  72. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/commands/osi.py +0 -0
  73. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/commands/run.py +0 -0
  74. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/commands/test_alert.py +0 -0
  75. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/commands/tune.py +0 -0
  76. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/commands/ui.py +0 -0
  77. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/commands/unlock.py +0 -0
  78. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/cli/main.py +0 -0
  79. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/config/__init__.py +0 -0
  80. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/config/metric_io.py +0 -0
  81. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/config/profile.py +0 -0
  82. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/config/project_config.py +0 -0
  83. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/config/validator.py +0 -0
  84. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/core/__init__.py +0 -0
  85. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/core/interval.py +0 -0
  86. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/core/models.py +0 -0
  87. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/database/__init__.py +0 -0
  88. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/database/_sql_manager.py +0 -0
  89. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/database/bigquery_manager.py +0 -0
  90. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/database/clickhouse_manager.py +0 -0
  91. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/database/duckdb_manager.py +0 -0
  92. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/database/internal_tables/__init__.py +0 -0
  93. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/database/internal_tables/_alert_states.py +0 -0
  94. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/database/internal_tables/_autotune_runs.py +0 -0
  95. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/database/internal_tables/_base.py +0 -0
  96. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/database/internal_tables/_datapoints.py +0 -0
  97. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/database/internal_tables/_detections.py +0 -0
  98. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/database/internal_tables/_maintenance.py +0 -0
  99. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/database/internal_tables/_metrics.py +0 -0
  100. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/database/internal_tables/_schema.py +0 -0
  101. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/database/internal_tables/_tasks.py +0 -0
  102. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/database/internal_tables/manager.py +0 -0
  103. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/database/manager.py +0 -0
  104. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/database/mysql_manager.py +0 -0
  105. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/database/postgres_manager.py +0 -0
  106. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/database/snowflake_manager.py +0 -0
  107. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/database/source_manager.py +0 -0
  108. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/database/tables.py +0 -0
  109. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/detectors/__init__.py +0 -0
  110. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/detectors/base.py +0 -0
  111. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/detectors/factory.py +0 -0
  112. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/detectors/seasonality.py +0 -0
  113. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/detectors/statistical/__init__.py +0 -0
  114. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/detectors/statistical/_windowed.py +0 -0
  115. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/detectors/statistical/autoreg.py +0 -0
  116. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/detectors/statistical/iqr.py +0 -0
  117. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/detectors/statistical/mad.py +0 -0
  118. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/detectors/statistical/manual_bounds.py +0 -0
  119. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/detectors/statistical/zscore.py +0 -0
  120. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/loaders/__init__.py +0 -0
  121. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/loaders/errors.py +0 -0
  122. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/loaders/metric_loader.py +0 -0
  123. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/loaders/query_template.py +0 -0
  124. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/mcp/__init__.py +0 -0
  125. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/mcp/context.py +0 -0
  126. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/mcp/errors.py +0 -0
  127. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/mcp/serialize.py +0 -0
  128. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/mcp/server.py +0 -0
  129. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/mcp/tools.py +0 -0
  130. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/orchestration/__init__.py +0 -0
  131. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/orchestration/error_dispatch.py +0 -0
  132. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/orchestration/task_manager/__init__.py +0 -0
  133. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/orchestration/task_manager/_base.py +0 -0
  134. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/orchestration/task_manager/_detect_step.py +0 -0
  135. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/orchestration/task_manager/_load_step.py +0 -0
  136. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/orchestration/task_manager/_types.py +0 -0
  137. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/orchestration/task_manager/manager.py +0 -0
  138. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/reporting/__init__.py +0 -0
  139. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/reporting/assets/report.js +0 -0
  140. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/reporting/builder.py +0 -0
  141. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/reporting/html_report.py +0 -0
  142. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/semantic/__init__.py +0 -0
  143. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/semantic/errors.py +0 -0
  144. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/semantic/exporter.py +0 -0
  145. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/semantic/importer.py +0 -0
  146. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/semantic/osi_model.py +0 -0
  147. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/semantic/query_gen.py +0 -0
  148. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/tuning/__init__.py +0 -0
  149. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/tuning/assets/tune.js +0 -0
  150. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/tuning/config_writer.py +0 -0
  151. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/tuning/html.py +0 -0
  152. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/tuning/payload.py +0 -0
  153. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/tuning/server.py +0 -0
  154. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/ui/__init__.py +0 -0
  155. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/ui/html.py +0 -0
  156. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/ui/jobs.py +0 -0
  157. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/ui/metric_files.py +0 -0
  158. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/ui/overview.py +0 -0
  159. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/ui/server.py +0 -0
  160. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/utils/__init__.py +0 -0
  161. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/utils/datetime_utils.py +0 -0
  162. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/utils/env_interpolation.py +0 -0
  163. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/utils/json_utils.py +0 -0
  164. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit/utils/stats.py +0 -0
  165. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit.egg-info/SOURCES.txt +0 -0
  166. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit.egg-info/dependency_links.txt +0 -0
  167. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit.egg-info/entry_points.txt +0 -0
  168. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit.egg-info/requires.txt +0 -0
  169. {detectkit-0.66.5 → detectkit-0.67.0}/detectkit.egg-info/top_level.txt +0 -0
  170. {detectkit-0.66.5 → detectkit-0.67.0}/pyproject.toml +0 -0
  171. {detectkit-0.66.5 → detectkit-0.67.0}/requirements.txt +0 -0
  172. {detectkit-0.66.5 → detectkit-0.67.0}/setup.cfg +0 -0
  173. {detectkit-0.66.5 → detectkit-0.67.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: detectkit
3
- Version: 0.66.5
3
+ Version: 0.67.0
4
4
  Summary: Metric monitoring with automatic anomaly detection
5
5
  Author: detectkit team
6
6
  License: MIT
@@ -4,7 +4,7 @@ detectk - Anomaly Detection for Time-Series Metrics
4
4
  A Python library for data analysts and engineers to monitor metrics with automatic anomaly detection.
5
5
  """
6
6
 
7
- __version__ = "0.66.5"
7
+ __version__ = "0.67.0"
8
8
 
9
9
  from detectkit.core.interval import Interval
10
10
  from detectkit.core.models import ColumnDefinition, TableModel
@@ -182,6 +182,10 @@ suppress_until: "2026-04-11 18:00:00" # UTC; default null
182
182
 
183
183
  Load and detect keep running; only alerting is paused until that time, then it
184
184
  auto-resumes (no second edit needed). For permanent off, use `enabled: false`.
185
+ Accepts `"YYYY-MM-DD HH:MM:SS"`, `"YYYY-MM-DD HH:MM"`, the ISO `T` form, or a
186
+ bare `"YYYY-MM-DD"` (midnight UTC) — validated when the config loads, so a
187
+ typo is refused up front instead of failing the metric at alert time. Also a
188
+ field in the `dtk ui` Builder's alerting section.
185
189
 
186
190
  ## Mentions
187
191
 
@@ -258,10 +258,13 @@ exactly as if typed into a terminal.
258
258
 
259
259
  The cockpit header has a **New metric** button, and every metric row an
260
260
  **Edit** action; both open an editor overlay with **two tabs sharing one
261
- draft**: **Builder** — a structured form over the whole config (basics,
261
+ draft**: **Builder** — a structured form over the whole config (basics —
262
+ including both `profile` and the hybrid-mode `source_profile` as pickers —,
262
263
  schedule/loading, seasonality, minimal detector rows with type + 1-2 key
263
264
  params — fine-tuning belongs in `dtk tune` —, alerting with a channel
264
- multi-select seeded from `profiles.yml` channel names, `ai_context`; SQL in
265
+ multi-select seeded from `profiles.yml` channel names, plus `suppress_until`
266
+ and (under Advanced) `timezone` / `links` / `cooldown_reset_on_recovery`,
267
+ `ai_context`; SQL in
265
268
  a syntax-highlighted pane, `query_file` paths read-only; a **From OSI**
266
269
  sub-tab compiles a pasted OSI semantic-model metric through the same code
267
270
  path as `dtk osi import`) — and **YAML**, the raw text, kept for whole-config
@@ -270,8 +273,9 @@ validates server-side first and blocks the switch on error; leaving an
270
273
  edited Builder re-emits the YAML. A debounced live-validation chip re-checks
271
274
  the draft while typing — showing the Builder's friendly checks while the
272
275
  YAML tab still mirrors the form, and a one-line `field — reason` summary of
273
- server errors otherwise. Keys the form doesn't model (`autotune:`, custom
274
- templates, unknown detector types/params, a multi-entry alerting list)
276
+ server errors otherwise. Keys the form doesn't model (`autotune:`, `tables:`,
277
+ custom `template_*` bodies, unknown detector types/params, a multi-entry
278
+ alerting list)
275
279
  round-trip verbatim, listed under "Preserved fields". Create writes
276
280
  `metrics/[<folder>/]<name>.yml`; after a create, a **next-steps strip**
277
281
  offers **Load & detect** (`dtk run --steps load,detect` for just that metric
@@ -125,6 +125,33 @@ class QueryColumnsConfig(BaseModel):
125
125
  )
126
126
 
127
127
 
128
+ #: Accepted ``suppress_until`` spellings. The date-only form means midnight UTC —
129
+ #: it is what the docs' own examples use, so it must not be a runtime crash.
130
+ _SUPPRESS_UNTIL_FORMATS = ("%Y-%m-%d %H:%M:%S", "%Y-%m-%dT%H:%M:%S", "%Y-%m-%d %H:%M", "%Y-%m-%d")
131
+
132
+
133
+ def parse_suppress_until(value: str) -> datetime:
134
+ """Parse an ``alerting.suppress_until`` value into a naive UTC datetime.
135
+
136
+ The single seam shared by :class:`AlertConfig`'s validator (fail at config
137
+ load / at a UI save) and the alert step (decide whether to skip).
138
+
139
+ :param value: The configured deadline string.
140
+ :return: The deadline as a naive UTC datetime.
141
+ :raises ValueError: If the value matches none of the accepted formats.
142
+ """
143
+ text = value.strip()
144
+ for fmt in _SUPPRESS_UNTIL_FORMATS:
145
+ try:
146
+ return datetime.strptime(text, fmt)
147
+ except ValueError:
148
+ continue
149
+ raise ValueError(
150
+ f"suppress_until must be a UTC datetime like '2026-04-11 18:00:00' "
151
+ f"or a date like '2026-04-11' (got {value!r})"
152
+ )
153
+
154
+
128
155
  class AlertConfig(BaseModel):
129
156
  """
130
157
  Alert configuration for a metric.
@@ -232,6 +259,20 @@ class AlertConfig(BaseModel):
232
259
  "dashboard_url (e.g. {'Runbook': 'https://...', 'Grafana': 'https://...'}).",
233
260
  )
234
261
 
262
+ @field_validator("suppress_until")
263
+ @classmethod
264
+ def validate_suppress_until(cls, v: str | None) -> str | None:
265
+ """The suppression deadline must parse, at config load, into a UTC datetime.
266
+
267
+ It used to be an unvalidated string that the alert step parsed with a strict
268
+ ``strptime`` — so a typo (or the date-only form the docs themselves showed)
269
+ raised mid-run and failed the metric instead of being caught at load/save.
270
+ """
271
+ if v is None:
272
+ return v
273
+ parse_suppress_until(v)
274
+ return v
275
+
235
276
  @field_validator("consecutive_anomalies")
236
277
  @classmethod
237
278
  def validate_consecutive(cls, v: int) -> int:
@@ -2,12 +2,10 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from datetime import datetime
6
-
7
5
  import click
8
6
 
9
7
  from detectkit.alerting.orchestrator import AlertConditions, AlertOrchestrator
10
- from detectkit.config.metric_config import MetricConfig
8
+ from detectkit.config.metric_config import MetricConfig, parse_suppress_until
11
9
  from detectkit.orchestration.task_manager._base import _TaskManagerBase
12
10
  from detectkit.orchestration.task_manager._types import make_alert_config_id
13
11
  from detectkit.utils.datetime_utils import now_utc_naive
@@ -48,7 +46,7 @@ class _AlertStepMixin(_TaskManagerBase):
48
46
  )
49
47
 
50
48
  if alerting_config.suppress_until:
51
- suppress_dt = datetime.strptime(alerting_config.suppress_until, "%Y-%m-%d %H:%M:%S")
49
+ suppress_dt = parse_suppress_until(alerting_config.suppress_until)
52
50
  if now_utc_naive() < suppress_dt:
53
51
  click.echo(
54
52
  f" │ Alerts suppressed until " f"{alerting_config.suppress_until} UTC"