Skip to content

refactor(runtime): extract typed reservation queries (v0.1.25.55) - #244

Merged
amavashev merged 2 commits into
mainfrom
agent/reservation-query-refactor-243
Jul 14, 2026
Merged

amavashev merged 2 commits into
mainfrom
agent/reservation-query-refactor-243

Conversation

@amavashev

@amavashev amavashev commented Jul 14, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #243

Summary

  • introduce an immutable ReservationListQuery boundary for scope, time-window, sort, cursor, and projection inputs
  • move SCAN pagination, sorted fallback, and completeness-gated created-at traversal into RedisReservationQueryRepository
  • centralize Redis hash projections, filter matching, finalized-time resolution, and detail/list hydration in ReservationHashMapper
  • retain the existing public repository methods as a thin protocol-facing facade
  • share exact scope-segment matching between reservation and balance queries
  • add a real-Redis parity matrix proving READY-index and SCAN-fallback rows, ordering, page boundaries, cursor bytes, and errors are identical
  • bump the service and Compose pins to v0.1.25.55 and record the audit/benchmark evidence

Compatibility

This is a behavior-preserving internal refactor. It changes no protocol schema, HTTP method signature, response shape, Redis key, Lua script, Redis command sequence, cursor encoding, filter hash, ordering rule, index readiness rule, or feature flag.

Validation

  • mvn -B verify -Pintegration-tests --file cycles-protocol-service/pom.xml -Dcontract.spec.url=file:///C:/Users/tmemo/AppData/Local/Temp/cycles-protocol-benchmark-spec/cycles-protocol-v0.yaml
  • 1,182 tests passed: 31 model, 562 data, 589 API; zero failures/errors/skips
  • protocol contract coverage: 11/11
  • JaCoCo line coverage: 95.22% data, 95.56% API
  • real-Redis created-at index suite: 24/24, including explicit INDEX and SCAN_DISABLED parity coverage
  • paired benchmark: three v0.1.25.54 baseline runs and three candidate runs, all 17 cases with zero errors
    • sorted 1k p50: 17.0ms → 17.0ms (0.0%)
    • sorted 10k p50: 16.9ms → 17.6ms (+4.1%)
    • classified as performance-neutral; unrelated paths moved more and concurrency runs contained host stalls

@amavashev
amavashev marked this pull request as ready for review July 14, 2026 17:37
@amavashev
amavashev merged commit bf972c5 into main Jul 14, 2026
8 checks passed
@amavashev
amavashev deleted the agent/reservation-query-refactor-243 branch July 14, 2026 17:38
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.

Refactor reservation listing into a typed query component

1 participant