watchfor 0.17.2 → 0.19.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54149ca58938489d3ce42a98e390e9a966d608b78760c41e28102b39109bc5ee
4
- data.tar.gz: 165e61c5247b3ad06d6d20c92e698b91e17bf1a047fe0f189d7a2c4b0ab94788
3
+ metadata.gz: fc1faa20028f063042d18c2621241144cd8c9c28f26907632cacee441702c95a
4
+ data.tar.gz: 3ccf549203097fbf7dd6fa0ce396f5c6e5965ca9d2af22727e21ebc7bf5b5bcc
5
5
  SHA512:
6
- metadata.gz: 5b3a10eef3ea3b0bac1c0f238828fb8e7ae37e7c3b7c7b258c7e7cac387a30a81c0896a666c0668fdbc39f33ba63eb2078ef239f3cb465afc06a17262cf4b677
7
- data.tar.gz: ee8ee1ae3c9f4ab35988f826a7608149d503ffdfa5e1f5d6d62660523436fd12fad9a2db96da21801f82cdd737f0ecd470845937334a3527745024161a1705f7
6
+ metadata.gz: f555e343c3003ddc98d1e5178c8e93c7d1e6879116141ffaa4da13f5f2ff70a55ba2f7813c66de3ae5e951148442c8c529f5e8889457c964b4322ef9d612c2d1
7
+ data.tar.gz: f513483d3b7dfe0827d09ed87f67d5fe58ec7d33733fc027ac2cdde563a4e252c27c446ce0b291b81f643354f8350e508b7c25092a585709b316a656b0f840c6
data/README.md CHANGED
@@ -49,6 +49,11 @@ wf.monitors.reset(mon["id"])
49
49
  # Page integrity: after a deploy, check the pages and accept what that check saw
50
50
  wf.monitors.accept_baseline(integrity_monitor_id, fresh: true)
51
51
 
52
+ # MCP servers: before a release, keep tool drift quiet for 30 minutes (downtime still pages);
53
+ # a drift incident the user confirms was theirs is accepted as an expected change
54
+ wf.monitors.set_expected_change_window(mcp_monitor_id, window: 30, note: "v2.4 release")
55
+ wf.incidents.accept_expected_change(19352, note: "New search tool shipped in v2.4")
56
+
52
57
  # Browser checks: try a Playwright script once (nothing saved), then read the result
53
58
  run = wf.playwright.test_run(script: script, target: "https://shop.example.com")
54
59
  wf.playwright.get_test_run(run["id"]) # status: queued | running | done | error
@@ -82,7 +87,7 @@ wf.status_pages.update_announcement("<page-id>", notice["id"], { body: "Fixed.",
82
87
 
83
88
  ### Live diagnostics
84
89
 
85
- Run any of 24 checks from WatchFor's probe fleet against **any public
90
+ Run any of 26 checks from WatchFor's probe fleet against **any public
86
91
  target**, monitored or not — this measures right now, rather than reading
87
92
  what WatchFor recorded:
88
93
 
@@ -99,7 +104,8 @@ puts "finding: #{dns['error']}" unless dns["success"]
99
104
  puts "runs left this hour: #{dns['remaining']}"
100
105
 
101
106
  # Graded checks (tls-grade, http-headers, cwv-check, mcp-check, email-health,
102
- # mail-server-check, cdn-check, smart-audit, dns-health) also return the
107
+ # mail-server-check, cdn-check, smart-audit, dns-health, php-version-checker,
108
+ # software-exposure-checker) also return the
103
109
  # dashboard's WatchFor Grade: letter, rubric id and what holds it down
104
110
  headers = wf.diagnostics.run("http-headers", "https://example.com")
105
111
  grade = headers["grade"] || {}
@@ -272,6 +272,18 @@ module Watchfor
272
272
  @c.request("POST", "/monitors/#{id}/baseline",
273
273
  body: body, idempotency_key: idempotency_key)
274
274
  end
275
+ # MCP monitors: release marker - call it from a deploy pipeline before
276
+ # the rollout. For `window:` minutes (1-60, default 15) the monitor's
277
+ # drift rules (Tool Inventory Changed) are silenced - only those,
278
+ # downtime still pages - and drift incidents opened inside the window
279
+ # resolve within a minute. Markers stack; 12 per hour per monitor (429).
280
+ # Page integrity monitors -> 400 (use accept_baseline(id, fresh: true)
281
+ # after the deploy); no enabled drift rule -> 409.
282
+ def set_expected_change_window(id, window: nil, note: nil, idempotency_key: nil)
283
+ @c.request("POST", "/monitors/#{id}/expected-change",
284
+ query: { window: window }, body: note.nil? ? {} : { note: note },
285
+ idempotency_key: idempotency_key)
286
+ end
275
287
  end
276
288
 
277
289
  # Browser checks: run a Playwright script once without saving it.
@@ -328,6 +340,17 @@ module Watchfor
328
340
  def mark_maintenance(id, idempotency_key: nil)
329
341
  @c.request("POST", "/incidents/#{id}/mark-maintenance", idempotency_key: idempotency_key)
330
342
  end
343
+ # Drift incidents only (an MCP monitor's Tool Inventory Changed; others
344
+ # -> 400): mark the change as intended. An open incident is resolved
345
+ # asynchronously ("resolve_requested"; poll #get) and the accept is
346
+ # recorded on the incident and drift timelines and in the Activity log.
347
+ # Accepting again returns the first accept with "already_accepted".
348
+ # `note:` (up to 500 characters) says why. Only call it when the user
349
+ # confirms the change was theirs.
350
+ def accept_expected_change(id, note: nil, idempotency_key: nil)
351
+ @c.request("POST", "/incidents/#{id}/expected-change",
352
+ body: note.nil? ? {} : { note: note }, idempotency_key: idempotency_key)
353
+ end
331
354
  # The incident's post-mortem (404 when it has none yet - #update_postmortem creates it).
332
355
  def get_postmortem(id) = @c.request("GET", "/incidents/#{id}/postmortem")
333
356
  # Create the post-mortem draft on first use, then apply only what is given:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Watchfor
4
- VERSION = "0.17.2"
4
+ VERSION = "0.19.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watchfor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.2
4
+ version: 0.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - WatchFor