Skip to content

Add a negative-control scenario: healthy heartbeat cadence #175

Description

@sepehr-safari

Good First Issue

Add a scenario heartbeat-healthy. It is a negative control for the two heartbeat
rules at once: a station that heartbeats exactly on the negotiated interval must
produce no failures.

TIMEOUT_NO_HEARTBEAT and HEARTBEAT_INTERVAL_VIOLATION both derive their
thresholds from the interval in the BootNotification response. The corpus covers
both firing (heartbeat-timeout and heartbeat-irregular) and neither staying
quiet, so a change to either threshold could start reporting healthy stations
without failing anything.

What to do

  1. Create packages/toolkit/src/scenarios/__scenarios__/heartbeat-healthy.ts
  2. Build a synthetic trace of a station heartbeating on time:
    • BootNotification at 2026-02-01T12:00:00.000Z, and its CallResult with
      interval: 300
    • Heartbeat at 12:05:00.000Z, 12:10:00.000Z and 12:15:00.000Z, each with
      its own CallResult carrying currentTime
  3. Set expectedFailures: []
  4. Add { type: 'no_failures', params: {} } as the assertion
  5. Register, update counts, run the checks and add a patch changeset, exactly as
    in the steps above

Why those timestamps

Each heartbeat sits exactly 300 seconds after the last, which is the negotiated
interval, so the deviation the interval rule measures is zero. The first heartbeat
also lands inside twice the interval after the boot, which is what keeps
TIMEOUT_NO_HEARTBEAT quiet. This trace was run against the detection engine and
reports no failures.

Files to modify

Same seven as Issue 1, with the new file named heartbeat-healthy.ts.

Guidelines

  • Reserves station ID CS-SYNTHETIC-024.
  • Everything else as in Issue 1.

How to claim

Comment "I'd like to work on this" and it will be assigned to you.

Please hold one open claim at a time. Once the pull request for it is merged, say
which issue you want next and it will be assigned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions