Accepted click events — from click detection v6
stream of (ti, pi) · 159 recordings exported · 1 364 accepted events in the headline corpus
every Stage 1–4 limitation propagates into this layer
Premises — all three verified on the corpus
P1 · clustered ✓
Fano at 300 s: stimulus 23.5 vs baseline 1.00
21/22 stimulus sessions > 2
P2 · transient ✓
19/23 sessions peak in the first 10 min
densest window holds 88 % of events
P3 · controls quiet ✓
empty room 1.35 /h · plant-only 5.58 /h
water 83 /h · mechanical 20 /h
Artefact rule declared before validation: a session with > 50 % of events at 64–70 kHz and ≥ 20 events is excluded — a narrowband tone that passes Stages 1–4 at p ≈ 0.2. It flags 9 sessions, no stimulus session. Warm-up bias measured at 2–3 %; handling controlled by the baseline group, set up identically.
Sliding-window statistic
Score(t) = Σ wi over { i : t − W < ti ≤ t } · wi = 1 (Variant A, hard count)
W = 180 s, longer than every stimulus burst (longest 166 s at τ = 30 s, p90 113 s)
Variant B (wi = pi) ranks equally at 20/23 but its threshold moves across folds — A adopted
Per-event update — O(1), no timer
Score(t) is non-increasing between events, so evaluating on arrival is exact · verified against brute force on 300 random streams
admit → evict → decide
push(ti, wi), sum += wi · then pop while front.t ≤ ti − W · queue of 32 timestamps = 128 B in firmware
Onset?
not active · sum ≥ hhigh = 7
ti − tlast ≥ R = 300 s
EMIT stress_onset
median first onset 36.5 s
alarm lasts 216 s (111–603 s)
Clear?
active · sum < hlow = ρ·hhigh
ρ = 0.5 → 3.5
EMIT stress_cleared
refractory gates onset only,
so an alarm can clear at any time
Hysteresis (dead band hlow…hhigh) suppresses chattering; the refractory period collapses one physical burst into one report. Neither binds on this corpus: R ∈ 150–1800 s and ρ ∈ 0.3–0.7 all give h = 7, 20/23, 49/53.
Threshold calibration — hhigh is measured, never derived
hhigh = min { h : A(h) / Tbase ≤ φtarget } · φtarget = 0.1 FA/h declared before validation
the complete detector replayed on 53 baseline sessions, 44.69 h → h = 7 events in 180 s
4 false alarms = 0.090 FA/h · 95 % upper bound 0.205 FA/h · all four in plant-only sessions, none in the empty room
Results — leave-one-session-out, 23 stimulus vs 53 baseline sessions
0.973
session AUC
p = 4.3 × 10⁻¹¹
≤ 0.21
false alarms / h
95 % bound
h = 7 in all 53 folds — no single baseline session sets the threshold. Median stimulus session peaks at 28 events in 180 s, median baseline at 1. On the Stage 3 out-of-sample subset: 10/11 and 35/38 at h = 10. W is not critical: across 60–900 s each variant moves by at most one session.
Four qualifications that travel with the headline
It depends on the artefact rule. Switched off, h rises to 13 and sensitivity falls to 15/23. The 66 kHz tone is the single largest threat to the result; the proper fix is upstream.
Detection is time-locked to the recording start. The stimulus delay is not logged per session, so 15 of 20 detections fire within 44 s of the start and latency cannot be measured.
All three misses are Aloe. Each produced at most 7 accepted events in the whole session — no threshold separates them from the baseline. The loss is upstream.
Indoor only. Outdoor and insect probes alarm at 1.8–2.8 onsets/h, 25–30× the target. Insects with no plant trigger every session: a burst detector cannot reject a burst.
Analysed as one number per session (the maximum of Score(t)), compared by Mann–Whitney: events inside a burst are not independent, so per-event p-values would be pseudoreplication. Rejected earlier: session-mean rate (averaging destroys the burst), analytic Poisson thresholds (F ≫ 1 breaks them), fixed bins (a burst straddling a boundary is split), bootstrap on session maxima. 23 positives · one session moves sensitivity by 4.3 points.
Operating point — frozen to click detection v6
W, R and φtarget were declared on 16-09-2026, before the corpus was analysed. hhigh is a property of the full pipeline: it is invalid for any other version of Stages 1–4.
Legend
Verified premise / result
On 76 indoor sessions under leave-one-session-out validation, the detector flagged 20 of 23 acute-stimulus sessions and stayed silent in 49 of 53 controls, at a false-alarm rate of at most 0.21 per hour (95 % upper bound, 44.7 h of baseline). It does not identify the cause, detect chronic stress, or work outdoors.