Skip to content

feat: an alerts workload in the Weather starter, a range outside the key - #86

Merged
krzysztof-smartdataengines merged 1 commit into
mainfrom
feat/starter-alerts-workload
Sep 24, 2026
Merged

krzysztof-smartdataengines merged 1 commit into
mainfrom
feat/starter-alerts-workload

Conversation

@krzysztof-smartdataengines

Copy link
Copy Markdown
Contributor

What

sde-weather run --workload alerts and sde-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 celsius summary - and compares each
with the generator exactly.

Why

Every read the starter could drive filtered on key columns. mixed, point and analytics fix
the station, which the declared key (station, then at) already serves; fleet ranges over at
across stations, which a key reordered to (at, station) serves. Nothing asked a question only an
added 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 could
not show one.

alerts is that question: a range on humidity, a field outside the key, within one station. The
window 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 when sequence mod 70 >= 65: five in every
seventy, known from the sequence number alone. alert_expected / alertExpected computes the first
page (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, as docs/logical-reads.md
specifies for a summary of no values on every engine - the live runs cover that iteration too.

Tests

  • Brute force in both languages: the expectation against every generated row filtered by the
    threshold, for four (rows, page limit) pairs including none and exactly one alert.
  • The run loop in both languages against an in-memory session that answers reads as an engine does
    (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.
  • Live, both engines, both languages (test_demo_starter_live.py, weather.live.test.ts): two
    iterations of 40 rows - none alert in the first, five in the second - complete, and the window's
    filtered_on is exactly the station equality and the humidity range.
  • The CLI offers every workload the runtime runs (WORKLOADS / workloads, one list each).

Mutations (both languages, harness in the private acceptance record): 14 applied, all killed; both
controls (comments) survived.

make check with both live engines: see the checks below.

🤖 Generated with Claude Code

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>
@krzysztof-smartdataengines
krzysztof-smartdataengines merged commit 31b199e into main Sep 24, 2026
11 checks passed
@krzysztof-smartdataengines
krzysztof-smartdataengines deleted the feat/starter-alerts-workload branch September 24, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant