Sensors + Wally analysis — live data in the evidence chain
Discovery experiments aren't just static notebooks — you can bind any Turtini IoT device (lab sensor, temperature probe, weather station, scale, leak sensor, …) so its readings flow directly into the experiment's evidence chain. Wally then watches the stream and helps you analyze it.
**Sensor binding:**
1. The device must already exist as a propertyDevice on your org (Property Operations module owns the device registry — Discovery just binds to it).
2. On the experiment, open the Sensors tab → Bind Device.
3. Give the binding a variable name (`tankTempC`, `ph_reservoirA`, `fieldHumidity`) and unit. Optionally set a sample rate hint.
4. Every DeviceEvent from that device gets copied into experiments/{id}/sensorEvents at ingest time, with the variable name + unit + your bound metadata. The original event still lives canonically in deviceEvents — your experiment owns a snapshot for reproduction-friendly replay.
**Anomaly watcher (Slice 3):**
If your pre-registration declared sensorThresholds (e.g. `tankTempC: { min: 18, max: 22 }`), a scheduled function compares every incoming reading against the envelope. The moment a value drifts out of bounds, Wally pings you with the time + value + how far past the threshold. You decide whether to amend the methodology (with a documented reason) or let it ride.
**Wally analysis tools (Slice 3):**
Wally exposes a few discovery-specific tools you can call from the experiment chat:
- **discovery_analyzeStream** — trend / outlier / summary stats on any sensor variable's last N hours. Returns mean, median, std, min, max, anomalies.
- **discovery_runStatTest** — t-test / ANOVA / regression / chi-square / Mann-Whitney with assumption checks (normality, equal variance) baked in.
- **discovery_summarizeSession** — pulls today's sensor data + your jotted observations and drafts a session entry. You review/edit before it appends.
- **discovery_draftResult** — looks at the full experiment (pre-reg + every session + every dataset + every sensor stream) and drafts the Result writeup. You ALWAYS review and edit before publishing — Wally never auto-publishes.
- **discovery_searchPriorWork** — searches the public registry for similar experiments and negative results. Run this BEFORE you start, so you don't accidentally re-run a known dead-end.
**Statistical honesty:**
Wally's stat-test outputs are stamped with the assumption-check results (normality, equal variance, sample size). If your data violates an assumption, the output flags it clearly rather than burying it. That's the radical-transparency principle baked into the analysis layer.
**Sensor data is part of the chain:**
Every sensor event is part of the immutable chain. Reproductions can replay exactly the slice of sensor history that informed your analysis. No "the data went missing" or "we re-collected after the freezer thawed" — the chain shows the freezer thawing.