Skip to content

fix: separate external recovery health from watchdog diagnostics for short cooldown #75

Closed

Description

@abruption

Problem

The confirmed-new-incident cooldown is deployed, but valid external SSH/ping recovery can fail to earn the shorter interval because the monitor's top-level state also describes an optional watchdog.

The broker closes an outage when normalized SSH and peer ping are healthy, while sustained recovery confirmation additionally requires state == verified_running. The external observer can legitimately emit prior_boot with successful SSH, a valid probe and successful ping when the old watchdog metadata belongs to a previous boot. This leaves the confirmation streak at zero and selects the global cooldown for the next outage.

Reproduction and observed evidence

Read-only operational checks on 2026-10-30 confirmed the configured policy remained 12 claims/24h, a 3600-second global interval and a 600-second confirmed-new-incident interval. The deployed recovery core still matched the previously applied candidate; this was not a missing deployment.

KST timeline from the minimized recovery ledger:

  • Previous claim: 06:01:20; external SSH/ping recovery: 06:01:47; first explicit report: success.
  • Its confirmation record remained streak=0, confirmed_at=null.
  • Next incident: 07:00:36; eligibility retry time: 07:01:20, exactly the previous claim plus 3600 seconds, rather than plus 600 seconds.
  • Reminder: 07:01:36; subsequent claim: 07:06:40; external recovery: 07:08:02.

In the 05:50–07:15 observation window, 61 valid SSH+ping-positive samples had state=prior_boot; none had state=verified_running. The source condition explains why those samples closed incidents without accumulating confirmation. This does not imply the new incident waited a full hour: the rolling interval had only about 45 seconds left when that incident was created. Later event-processing/execution latency is separate.

Proposed behavior

  • Separate external connection health from watchdog/boot/heartbeat diagnostics. Preserve prior_boot and other watchdog evidence instead of rewriting it as verified_running.
  • Carry an explicit bounded external-health classification through the trusted observation relay and validate it at ingestion against the SSH/ping booleans, integer exit codes and error markers. Contradictory or malformed evidence must not authorize shortened recovery.
  • Keep legacy observations compatible without silently treating every arbitrary top-level state as a healthy connection.
  • Retain three distinct consecutive fresh healthy samples spanning at least 60 seconds, gaps at most 150 seconds, claim/first-success/new-incident ordering, default compatibility, rolling daily limits, single claims, unknown-result fences and bounded reminders.
  • New observations may establish evidence only for an eligible existing claim slot; do not fabricate or backfill historical proof.

Acceptance

  • Relay and broker agree on an explicit external-health contract while preserving watchdog diagnostics.
  • Regression covers successful SSH/ping plus prior_boot, sustained proof, and the subsequent 600-second eligibility boundary.
  • Negative cases cover partial/invalid/error/contradictory evidence, stale/replayed timestamps, gaps, legacy inputs, unknown first reports and daily-limit precedence.
  • Exercise the actual relay sanitizer → authenticated HTTP ingestion → recovery core path with isolated fixtures, including compatible rolling update order.
  • EN/KO operation guidance describes the contract, rollout/rollback and why cooldown alone does not identify the interval.
  • Independent Claude Code and Codex CLI review, relevant CI, and a reviewable PR before any operating deployment.

Related #61, #20, #43; integrates with #74 for v0.8.0.

Scope: source, isolated tests and documentation. No production deployment, policy-limit change, live outage injection, new claim, subscription change or ledger reset is included.

Implementation and isolated acceptance checks are complete in PR #74; this issue remains open until that reviewed PR is merged. Operating deployment remains separate.

Activity

  1. added this to the v0.8.0 milestone on Oct 29, 2026
  2. self-assigned this
    on Oct 29, 2026
  3. added
    bug
    priority: high
    on Oct 29, 2026
  4. abruption commented on Oct 29, 2026

    @abruption
    OwnerAuthor

    Implemented in PR #74, Ready for review, at edc9e2629df1751951030db080dd78827b7214f8.

    • Keep watchdog state intact; derive and independently validate the optional external-health field. Preserve legacy behavior without the field and all existing confirmation/claim/budget guards.
    • Twelve new isolated regressions exercise sanitizer → authenticated HTTP → real temporary recovery core. No operating claim, callback, startup or ledger change was made.
    • Independent Claude Code (claude-opus-5-5, actual model confirmed) and Codex CLI (isolated default, actual ID not exposed) both completed with no required product correction. Frozen input SHA-256: 695538f0df438025f7db9c8456bd5049a94e464d7cb1a373313c0cac2ea22e5b.
    • Final-head Checks passed: Python 3.11/3.13 each 541 tests; all required contexts passed. Research passed: Python 3.12/3.13 each 243 + 11 tests.
    • The isolated old/new receiver matrix confirms the required broker-first rollout. Documentation clarifies existing evidence slots, observation rejection during reversed rollout and preserving earned evidence during rollback.

    Detailed evidence and operating gates. This is a reviewed source PR, not an operating deployment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugpriority: high

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions