Skip to content

Add TS.READ, TS.NRANGE/NREVRANGE, TS.QUERYLABELS, and MRANGE/MREVRANGE EXCLUDEEMPTY support - #100

Merged
mumez merged 27 commits into
masterfrom
develop
Sep 8, 2026
Merged

mumez merged 27 commits into
masterfrom
develop

Conversation

@mumez

@mumez mumez commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Merges accumulated develop work into master: new RediStick-TimeSeries commands (TS.READ, TS.NRANGE/TS.NREVRANGE, TS.QUERYLABELS), the EXCLUDEEMPTY option for TS.MRANGE/TS.MREVRANGE, a flaky-test fix for RediSearch score parsing, and supporting documentation/plans.

Changes

  • Added RsTsReadCursor and RsTsReadOptions for TS.READ (BLOCK/MAX_COUNT options, cursor-based reads, send-time validation).
  • Added RsTsNAggregation and RsTsNRangeRow and extended RsRedisEndpoint.extension.st for TS.NRANGE/TS.NREVRANGE support.
  • Added TS.QUERYLABELS support in RsRedisEndpoint.extension.st, later refactored and renamed (tsQueryLabelValues → tsQueryLabelValuesOf).
  • Added excludeEmpty/isExcludeEmpty to RsTsMRangeOptions and wired EXCLUDEEMPTY into the shared TS.MRANGE/TS.MREVRANGE executor in RsRedisEndpoint.extension.st, with GROUPBY-mutual-exclusion validation.
  • Fixed flaky RsSearchTest FT.SEARCH score parsing (RsSearchResult.class.st, RsSearchResultSet.class.st).
  • Fixed flaky testXGroupAutoClaim timing in RediStick-Stream-Tests.
  • Added corresponding test classes/extensions: RsTsReadOptionsTest, RsTsNAggregationTest, RsTsNRangeTest, RsTsNRevRangeTest, RsTsQueryLabelsTest, RsTsMRangeOptionsTest, RsTsMRangeTest, RsTsMRevRangeTest, RsTsAggregationTest, RsTsTest.
  • Added scripting-feature docs (doc/scripting-features/feature-ts-read.scripting.md, feature-ts-nrange-nrevrange.scripting.md, feature-ts-querylabels.scripting.md, feature-ts-mrange-mrevrange-excludeempty.scripting.md) and an implementation plan (doc/plans/2026-09-07-ts-read-implementation.md, doc/plans/common-patterns.md).
  • Updated CLAUDE.md.

Commits Included

81f1094 Add validation for TimeSeries read options
ffb70d2 Merge pull request #99 from mumez/feature/ts-support_v810_4
6ae5a71 Address Hermes review feedback on TS.MRANGE/TS.MREVRANGE EXCLUDEEMPTY PR
ee6fccc Add EXCLUDEEMPTY option to TS.MRANGE / TS.MREVRANGE
79926c5 Merge pull request #98 from mumez/feature/ts-support_v810_3
f3a949e Address review feedback on TS.NRANGE/TS.NREVRANGE PR
5d097da Add TS.NRANGE / TS.NREVRANGE support
251a09e Merge pull request #96 from mumez/feature/ts-support_v810_2
29ff7d0 Merge pull request #97 from mumez/cursor/fix-flaky-search-score-test-98d3
6f62da5 Rename tsQueryLabelValues to tsQueryLabelValuesOf
9d568ae Refactor TS.QUERYLABELS command implementation
e0678c4 Fix flaky RsSearchTest score parsing for FT.SEARCH results
43e2bed Add TS.QUERYLABELS support to RediStick-TimeSeries
d48b749 Add documentation for common implementation patterns
266b8f9 Merge pull request #95 from mumez/feature/ts-support_v810
feb44de Signal error for partial BLOCK configuration in RsTsReadOptions
c30f745 Improve RsTsReadCursor validation
ee584de Refactor RsTsReadCursor for improved readability
3a2b168 Add validation to RsTsReadCursor at send-time
4ebb310 Add RsTsReadCursor for TS.READ command support
b7b7b04 Refactor TimeSeries read cursor API
81e2c56 Add TS.READ implementation plan and orchestration script
09ee944 Fix lint findings in TS.READ implementation
6dd9739 Add RsRedisEndpoint>>tsRead:cursor: for TS.READ support
78ffe40 Add RsTsReadOptions for TS.READ BLOCK/MAX_COUNT options
d7c4354 Merge pull request #94 from mumez/cursor/fix-flaky-xgroup-autoclaim-test-a836
d8fc680 Fix flaky testXGroupAutoClaim timing on CI

Files Changed

CLAUDE.md
doc/plans/2026-09-07-ts-read-implementation.md
doc/plans/common-patterns.md
doc/scripting-features/feature-ts-mrange-mrevrange-excludeempty.scripting.md
doc/scripting-features/feature-ts-nrange-nrevrange.scripting.md
doc/scripting-features/feature-ts-querylabels.scripting.md
doc/scripting-features/feature-ts-read.scripting.md
src/RediStick-Search/RsSearchResult.class.st
src/RediStick-Search/RsSearchResultSet.class.st
src/RediStick-Stream-Tests/RsRedisEndpointTest.extension.st
src/RediStick-TimeSeries-Tests/RsTsAggregationTest.class.st
src/RediStick-TimeSeries-Tests/RsTsMRangeOptionsTest.class.st
src/RediStick-TimeSeries-Tests/RsTsMRangeTest.class.st
src/RediStick-TimeSeries-Tests/RsTsMRevRangeTest.class.st
src/RediStick-TimeSeries-Tests/RsTsNAggregationTest.class.st
src/RediStick-TimeSeries-Tests/RsTsNRangeTest.class.st
src/RediStick-TimeSeries-Tests/RsTsNRevRangeTest.class.st
src/RediStick-TimeSeries-Tests/RsTsQueryLabelsTest.class.st
src/RediStick-TimeSeries-Tests/RsTsReadOptionsTest.class.st
src/RediStick-TimeSeries-Tests/RsTsTest.class.st
src/RediStick-TimeSeries/RsRedisEndpoint.extension.st
src/RediStick-TimeSeries/RsTsAggregation.class.st
src/RediStick-TimeSeries/RsTsMRangeOptions.class.st
src/RediStick-TimeSeries/RsTsNAggregation.class.st
src/RediStick-TimeSeries/RsTsNRangeRow.class.st
src/RediStick-TimeSeries/RsTsReadCursor.class.st
src/RediStick-TimeSeries/RsTsReadOptions.class.st

cursoragent and others added 27 commits September 4, 2026 14:40
Poll until XAUTOCLAIM can claim idle pending entries instead of using
a fixed 200ms delay, increase minIdleTime to 100ms, and continue the
second autoclaim from the first result's nextId cursor.

Co-authored-by: Masashi Umezawa <mumez@users.noreply.github.com>
…est-a836

Fix flaky testXGroupAutoClaim on CI
Add missing class comment to RsTsReadOptions.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Documents the design (RsTsReadOptions, tsRead:cursor:/tsRead:cursor:using:)
and the AgenticBrowser orchestration used to implement it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Introduce `RsTsReadCursor` to encapsulate cursor logic and add a fluent
`tsRead:cursorBy:using:` API to `RsRedisEndpoint` for improved usability
and type safety. Updated existing tests and added new test cases for the
new cursor builder.
Move cursor validation from construction to #asArgumentValue to allow
reassignment of timestamps before the command is sent.
- Use semantic methods (earliest, latest, newest) instead of raw values
- Fix typo in timestamp: parameter name
Add validation checks for nil values and invalid string formats in
RsTsReadCursor>>validate to ensure only valid timestamps or sentinels
are sent to Redis.
Ensure both blockMilliseconds and blockMinCount are provided when using
the BLOCK option, as required by Redis.
Create `doc/plans/common-patterns.md` to document the Parameter-Class
pattern and update `CLAUDE.md` to reference it for future development.
Adds tsQueryLabels, tsQueryLabelsFilterBy:, tsQueryLabelValues:, and
tsQueryLabelValues:filterBy: to RsRedisEndpoint, reusing the existing
RsTsFilterBuilder/RsTsFilter machinery for the optional FILTER clause.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
BM25 scores are fractional floats, but score: used asInteger which
truncated values like 0.28 to 0 and failed score > 0 assertions on CI.

Replace fixed-size chunk parsing with stream-based loading that handles
both nested and flat Redis reply layouts for WITHSCORES/WITHPAYLOADS/
WITHSORTKEYS combinations.

Co-authored-by: Masashi Umezawa <mumez@users.noreply.github.com>
Consolidate command building logic into a private helper method to
reduce
code duplication across query and label value retrieval methods.
…98d3

Fix flaky RsSearchTest score parsing for FT.SEARCH results
Add TS.QUERYLABELS support to RediStick-TimeSeries
Implements TS.NRANGE and TS.NREVRANGE (Redis 8.10+), which query an
explicit list of keys and group results by timestamp rather than by
key. Adds RsTsNAggregation (per-key AGGREGATION lists sharing one
bucketDuration) and RsTsNRangeRow, and refactors RsTsAggregation to
expose aggregatorsString for reuse. Both commands share a single
private executor in RsRedisEndpoint, mirroring the existing
TS.MRANGE/TS.MREVRANGE pattern.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Pin exact aggregated values and the missing-value NaN representation
in RsTsNRangeTest instead of only checking counts, and add a CRC-style
class comment to RsTsNAggregation documenting its per-key AGGREGATION
contract.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Add TS.NRANGE / TS.NREVRANGE support
Redis 8.10 introduces EXCLUDEEMPTY to omit series with no samples in
the queried range. Adds excludeEmpty/isExcludeEmpty to
RsTsMRangeOptions and appends EXCLUDEEMPTY as the final command token
(after FILTER/GROUPBY) via the shared MRANGE/MREVRANGE executor,
signaling an error when combined with GROUPBY as Redis itself does.
The executor is also split into smaller private helpers to keep
method length within the project's lint limits.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Rename tsValidateExcludeEmpty:notWithGroupBy: to
tsValidateExcludeEmpty:compatibleWithGroupBy: for a clearer positive
constraint name, and tighten the GROUPBY-conflict test to assert
RsError specifically instead of the broader Error.

Kept EXCLUDEEMPTY positioned before FILTER, not after as originally
suggested: verified empirically against a live Redis 8.10 server that
FILTER swallows a trailing EXCLUDEEMPTY as an unterminated filter
expression ("ERR TSDB: failed parsing labels"). Redis's own syntax_fmt
metadata disagrees with its own worked example and with actual server
behavior here; the doc's worked example and the server are the source
of truth. Added a comment documenting this so it isn't "fixed" again
based on the misleading metadata field. Full RediStick-TimeSeries-Tests
suite still green (212/212).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Add EXCLUDEEMPTY option to TS.MRANGE / TS.MREVRANGE
Ensure `blockMinCount` does not exceed `maxCount` when both are set in
`RsTsReadOptions`.
@mumez
mumez merged commit 93147be into master Sep 8, 2026
3 checks passed
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.

2 participants