feat: an alerts workload in the Weather starter, a range outside the key - #86
Merged
Merged
Conversation
Every read the starter could drive filtered on key columns, so traffic it generated gave a control plane no reason for the one physical change built in place: an added index. --workload alerts reads one station's readings at or above 95% humidity - a bounded page, a count and an exact celsius summary - in both languages, checked exactly against the generator (humidity is 30 + sequence mod 70, so five in seventy alert; before the first one the summary total is null, as for any summary of no values). The window's filtered_on names the station equality and the humidity range. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
sde-weather run --workload alertsandsde-weather-ts run --workload alerts: in every iteration,besides the write and the point read every workload makes, the run reads its station's readings at
or above 95% humidity - a bounded page, a count and an exact
celsiussummary - and compares eachwith the generator exactly.
Why
Every read the starter could drive filtered on key columns.
mixed,pointandanalyticsfixthe station, which the declared key (
station, thenat) already serves;fleetranges overatacross stations, which a key reordered to
(at, station)serves. Nothing asked a question only anadded index can answer, so a control plane measuring the starter's traffic had no evidence for the
one physical change that is built in place (
docs/in-place-index.md) - and a demonstration couldnot show one.
alertsis that question: a range onhumidity, a field outside the key, within one station. Thewindow says so in its per-shape section -
filtered_on: [{"equal": ["station"], "range": "humidity", ...}]for the range reads and the aggregates - names only, no values.Exactness
Humidity is
30 + sequence mod 70, so a reading alerts whensequence mod 70 >= 65: five in everyseventy, known from the sequence number alone.
alert_expected/alertExpectedcomputes the firstpage (one station, so key order is sequence order), the count and the exact decimal total. Before
the first alert the page is empty and the summary's total is
null, asdocs/logical-reads.mdspecifies for a summary of no values on every engine - the live runs cover that iteration too.
Tests
threshold, for four (rows, page limit) pairs including none and exactly one alert.
(equality, range, key order): a faithful engine completes; a page that ignores the range, a count
that ignores it, a total off by a cent, and a zero total for no values each refuse the run with
the check that caught it.
test_demo_starter_live.py,weather.live.test.ts): twoiterations of 40 rows - none alert in the first, five in the second - complete, and the window's
filtered_onis exactly the station equality and the humidity range.WORKLOADS/workloads, one list each).Mutations (both languages, harness in the private acceptance record): 14 applied, all killed; both
controls (comments) survived.
make checkwith both live engines: see the checks below.🤖 Generated with Claude Code