feat(coresync): FROST/Influx/Grafana demo + sub-tick burst-window reducer fix

Lands the end-to-end CoreSync demo (frost-influx-grafana.flow.json) along
with the supporting normalizer/identity/interpolation/reducer work, plus
a targeted fix for the under-compression bug surfaced by the FROST demo.

Under-compression fix (PointReducer):
- New burstWindowMs option (default 0, opt-in). When two samples arrive
  within burstWindowMs of each other, the second is treated as the same
  wall-clock observation: previous is replaced, slope analysis is skipped.
- Without this guard, sub-millisecond bursts (rotatingMachine emits twice
  per pressure-injection cycle, ~1 ms apart) produced near-vertical
  apparent slopes that tripped angle-change on every tick — driving
  cog/efficiency/SEC streams to ~0.6% reduction (i.e. no compression).
- With burstWindowMs: 10 in the demo flow, the same streams now compress
  at 78-93% (verified end-to-end in InfluxDB over a 3-min window).
- Editor HTML exposes the new "Burst dt" field with explanatory tooltip.

Regression test (test/basic/coresync.basic.test.js):
- New "burstWindowMs collapses sub-tick sample bursts into a single
  observation" test reproduces the exact burst pattern from the demo
  and asserts before/after behaviour.
- Existing 14 tests continue to pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
znetsixe
2026-05-22 20:27:28 +02:00
parent aefec90485
commit 21d77a8afa
10 changed files with 1355 additions and 6 deletions

View File

@@ -15,6 +15,7 @@
maxGapMs: { value: 300000, required: true, validate: RED.validators.number() },
minDeltaTimeMs: { value: 0, required: true, validate: RED.validators.number() },
minDeltaValue: { value: 0, required: true, validate: RED.validators.number() },
burstWindowMs: { value: 0, required: true, validate: RED.validators.number() },
maxQueuedObservationsPerStream: { value: 2, required: true, validate: RED.validators.number() },
diagnosticsEnabled: { value: false },
},
@@ -83,6 +84,10 @@
<label for="node-input-minDeltaValue"><i class="fa fa-filter"></i> Min dv</label>
<input type="number" id="node-input-minDeltaValue" style="width:70%;">
</div>
<div class="form-row">
<label for="node-input-burstWindowMs" title="Collapse sub-tick sample bursts: when two samples arrive within this many milliseconds, treat them as the same observation. 0 disables. Set to ~10 ms when an upstream node emits multiple telemetry rows per logical tick (e.g. rotatingMachine reacting to two simultaneous simulateMeasurement msgs)."><i class="fa fa-compress"></i> Burst dt</label>
<input type="number" id="node-input-burstWindowMs" style="width:70%;">
</div>
<div class="form-row">
<label for="node-input-maxQueuedObservationsPerStream"><i class="fa fa-list"></i> Queue</label>
<input type="number" id="node-input-maxQueuedObservationsPerStream" style="width:70%;">