-
-
Notifications
You must be signed in to change notification settings - Fork 0
Test Suite 3 — Boolean mode
| Harness function |
suite3() in test-scripts/test-harness.js
|
| Checks | 15 (the # column below reconciles) |
| Kind | Synchronous |
Proves boolean coercion (default and custom value lists), the fraction-based vote rules and their latch edges, the minority-report change-only semantics, and command precedence over coercion.
Baseline config (applies unless a scenario says otherwise): boolean node — Majority trigger rule, Same as trigger release rule, default True/False value lists, quorum and staleness disabled, Emit aggregate on change only checked, heartbeat off, persistence off.
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.
Five sources fed true, "ON", "yes", "1", 1; then three of
them flipped with "OFF", "no", 0; then an unlisted string.
| # | Check | Protects |
|---|---|---|
| 1 | default true-list coerces true/ON/yes/'1'/1 (fraction 1.0) |
Native booleans/1 and the default true-list all coerce, case-insensitively |
| 2 | default false-list coerces OFF/no/0 (fraction 2/5) |
The default false-list coerces the same way, and the aggregate is the fraction of fresh sources true |
| 3 | unlisted value rejected |
Anything matching neither list is a rejected reading (ignored:true) — never silently skews the vote |
Config: True Values open, False Values closed.
| # | Check | Protects |
|---|---|---|
| 4 | custom true value 'OPEN' accepted and triggers (any/majority of 1) |
Custom vocabularies (door contacts etc.) coerce case-insensitively |
| 5 | default 'true' rejected when custom lists replace defaults |
Custom lists replace the defaults rather than extending them |
Sources d1/d2/d3 walked through true, exact split, and minority states.
| # | Check | Protects |
|---|---|---|
| 6 | 1/1 majority triggers |
The denominator is the fresh source count — one sensor can satisfy Majority |
| 7 | exact 0.5 stays latched (majority >= 0.5) |
The Majority boundary is ≥ 0.5: an exact split holds the latch |
| 8 | exact split produces no minority report |
No consensus exists at an exact split, so no source is a "minority" |
| 9 | 1/3 releases under sameastrigger |
Same as trigger releases the moment the trigger rule stops being satisfied |
| 10 | minority report fires with [d1] |
A fresh source disagreeing with the consensus is named in msg.minorityTopics
|
| 11 | unchanged minority set does not re-report |
Reports fire on set change only — a stuck sensor produces one report, not a stream |
| 12 | minority resolution (set -> empty) reports once |
Resolution is itself a change: one final report with an empty set |
Config: trigger rule At least N with N = 2.
| # | Check | Protects |
|---|---|---|
| 13 | atleastn(2): 1 true does not trigger |
The N threshold counts true sources, not fractions |
| 14 | atleastn(2): 2 true triggers |
…and fires exactly at N |
A payload of "RESET" sent with a topic on a boolean node.
| # | Check | Protects |
|---|---|---|
| 15 | command string wins over coercion even with a topic |
A recognized command is always a command, in both type modes — command words can never function as boolean values |
Getting Started
Reference
Features
Examples
- Examples Basic Numeric Averaging
- Examples Staleness and Quorum
- Examples Boolean Voting
- Examples Runtime Commands
Test Script Coverage
- Overview
- Test Suite 1 — Output routing & envelope shape
- Test Suite 2 — Aggregation functions
- Test Suite 3 — Boolean mode
- Test Suite 4 — Commands
- Test Suite 5 — Threshold set-commands & release-follows-trigger
- Test Suite 6 — Status labels
- Test Suite 7 — Staleness, quorum policies, heartbeat
- Test Suite 8 — Persistence
Support