Botanical light reports finalize too early when one observation station gets ahead
Level 3 · node · Data · Incorrect merge of event-time progress frontiers across inputs
Scenario
A fictional botanical lighting exhibit sums light response counts from north and south observation stations into ten-unit observation-time windows. Each station separately announces how far its records have been delivered. Reports are correct when both stations progress together, but when one gets ahead, valid records from the other station are lost. Trace the observation entry point, progress frontier management, and the aggregation store's finalization condition together.
Requirements
createExhibit() exposes observe(source, time, count), progress(source, time), and reports(). source is north or south; time and count are nonnegative integers. Each station's frontier starts at zero and cannot decrease. A frontier means no more records earlier than that time will arrive from that station. observe rejects records earlier than their station's frontier and invalid inputs, returning whether it succeeded. progress also returns success. Windows are [0,10), [10,20), and so on. Finalize a nonempty window only when both stations have reached its end. reports returns finalized { start, end, count } rows in window order, without publishing a window twice. Records exactly at the input frontier are allowed. Preserve the public interface.
Acceptance criteria
- When both stations progress together, each window sum is finalized correctly exactly once.
- When one station gets ahead, valid records from the other are still accepted and windows are not finalized prematurely.
- When the two stations progress differently across multiple windows, report only eligible windows in order.
- Reject backward progress and records before the frontier, but allow records exactly at it. Do not report empty windows.