Skip to content

Test Suite 4 — Commands

mchristegh edited this page Jul 10, 2026 · 1 revision
Harness function suite4() in test-scripts/test-harness.js
Checks 22 (the # column below reconciles)
Kind Synchronous

Proves the synchronous command paths: the disable/enable suppression cycle, remove, reset semantics (roster and override survival), setstale validation, the Emit aggregate on change only checkbox in both positions, and one documented envelope-ordering nuance.

Baseline config (applies unless a scenario says otherwise): plain numeric node — mean aggregation, Above-mode, trigger 60 / release 55, Emit aggregate on change only checked, heartbeat off, persistence off; quorum per scenario.

Traceability convention: the Check column is the harness's literal PASS/FAIL string — a failing line in the test output can be searched in this document verbatim. This document moves with the harness: a new, renamed, or removed check lands here in the same change.


4.1 Disable / enable suppression cycle

Config: quorum 2. Two sources establish an untriggered baseline; a reading that warrants a Trigger arrives while disabled.

# Check Protects
1 disable (case-insensitive) emits disabled Commands are case-insensitive (DISABLE sent)
2 redundant disable is ignored:true Redundant commands are observable, never silent
3 warranted trigger while disabled is suppressed to output 4 (ignored:true) Disable suppresses decisions: the would-be Trigger appears only on Events, tagged
4 reading still accepted while disabled (data keeps flowing) …but not data: readings, freshness, and the aggregate continue
5 enable re-evaluates: genuine trigger fires on outputs 1+4 Enable immediately re-evaluates; the suppressed transition fires genuinely
6 genuine post-enable trigger is externally sourced The enable command is the live trigger of that transition (source: "external")
7 redundant enable is ignored:true Same observability rule as redundant disable

4.2 Remove

# Check Protects
8 remove unknown topic is ignored:true with attempted topic Rejections carry the attempted value (removedTopic)
9 remove known topic emits sourceremoved then quorumlost Removal recomputes and re-evaluates — here dropping below quorum 2, in causal order

4.3 Reset: roster and override survival

Config: Expected Sources e1,e2, no-hysteresis thresholds (60/60). A settrigger 70 override is applied before the reset.

# Check Protects
10 expected sources pre-registered (sourceCount 2) Expected sources appear in every snapshot from deploy
11 expected source visible as never-seen seen: false makes "sensor never came up" visible instead of silent
12 first reading from an expected source is sourceadded Expected-but-unseen sources still announce their first reading
13 reset emits reset in post-reset waiting state The reset event's envelope reflects the post-reset world (waiting)
14 reset keeps expected roster Reset clears learned data; the configured roster survives (as never-seen)
15 reset clears aggregate Values and the aggregate are wiped
16 settrigger override SURVIVES reset (65 vs override 70 must not trigger) Reset clears data, not configuration — a discriminating value between config 60 and override 70 proves which threshold is live
17 ...and 71 vs override 70 triggers The surviving override is fully functional, not merely present

4.4 setstale validation and units

Config: quorum 2, two fresh sources.

# Check Protects
18 negative setstale is ignored:true Invalid values are rejected observably with the attempted value (staleSet)
19 setstale units conversion (1 second -> 1000ms) msg.setstaleunits converts before applying; staleSet reports the applied milliseconds

4.5 Emit aggregate on change only

An unchanged-aggregate reading (same value re-sent) under each checkbox position.

# Check Protects
20 unchanged-aggregate reading suppressed when emitonchange checked The default-checked box suppresses no-change reading events
21 unchanged-aggregate reading emitted when emitonchange unchecked Unchecking restores per-reading emission

4.6 Documented envelope-ordering nuance

Config: quorum 2; the second source's arrival satisfies quorum and enables the first-ever evaluation.

# Check Protects
22 documented nuance: quorumregained enabling first evaluation reports waiting Envelopes reflect the instant of dispatch: the quorum event fires before the silent waiting → untriggered bookkeeping (see the design doc's envelope section)

Clone this wiki locally