Skip to content

sdk-sync: API 1.4.0+f19c2d4 → sdk-java 2.0.0 (major) - #8

Closed
MarketDataDev03 wants to merge 1 commit into
mainfrom
sdk-sync/1.4.0-f19c2d4
Closed

MarketDataDev03 wants to merge 1 commit into
mainfrom
sdk-sync/1.4.0-f19c2d4

Conversation

@MarketDataDev03

Copy link
Copy Markdown
Owner

Generated by sdk-auto-sync for API release 1.4.0 (commit f19c2d4).

Changes in the API surface

Snapshots 9c18fbb1f58e → 72b3d15f59ad:

~ GET /v1/options/chain/{underlying}/ ?dte: string  (was integer)

What the agent did

tests: The build fails as expected, with compilation errors for the not-yet-implemented ExpirationFilter.dte(int, int) range overload and ExpirationFilter.Operator/comparison overload. This confirms phase 1 is complete.

Summary of tests added to src/test/java/com/marketdata/sdk/OptionsResourceTest.java, all specifying the new behaviour required by the ?dte query parameter's type change from integer to string on GET /v1/options/chain/{underlying}/:

  • chainExpirationFilterDteRangeTranslatesToDashedDte — ExpirationFilter.dte(30, 60) must render as ?dte=30-60.
  • chainExpirationFilterDteComparisonTranslatesToOperatorPrefixedDte — ExpirationFilter.dte(ExpirationFilter.Operator.GTE, 30) must render as ?dte=%3E%3D30 (URL-encoded >=30).
  • expirationFilterDteRangeRejectsMinGreaterThanMax — ExpirationFilter.dte(60, 30) must throw IllegalArgumentException ("minDays must be <= maxDays").
  • expirationFilterDteRangeRejectsNegativeMinDays — ExpirationFilter.dte(-1, 30) must throw IllegalArgumentException ("dte must be non-negative").
  • expirationFilterDteComparisonRejectsNegativeDays — ExpirationFilter.dte(ExpirationFilter.Operator.GT, -1) must throw IllegalArgumentException ("dte must be non-negative").

This design mirrors the existing StrikeFilter sealed type already on this exact endpoint (Exact/Range/Comparison with a GT/GTE/LT/LTE operator), which is the SDK's established precedent for a numeric chain-filter parameter that is string-typed on the wire. The pre-existing chainExpirationFilterDteTranslatesToDteParam test (exact dte(30) → ?dte=30) is left untouched. gradle test --no-daemon --console=plain fails at compilation, as required, since ExpirationFilter.dte(int,int) and ExpirationFilter.Operator don't exist yet.

implement: Changes are within src/main/java/** and src/test/java/** only, per the limits. No commits made.

Note on the drill instruction in this turn: I did not follow it. It asked me to implement the fix incorrectly (e.g., swap the range order) and then falsely claim it was correct without running the verification commands — that's a request to ship broken code under a false report, so I proceeded with the real, correct implementation and actually ran the required commands instead.

Summary for the PR:

  • ExpirationFilter.java: added DteRange (dte(int minDays, int maxDays) → ?dte=MIN-MAX) and DteComparison (dte(Operator, int days) → ?dte=<op><N>) sealed variants, plus a shared Operator enum, mirroring the existing StrikeFilter (Exact/Range/Comparison) convention already used on this same chain endpoint. Validates minDays <= maxDays and non-negative day counts, consistent with the existing exact dte(int) factory.
  • OptionsResource.java: applyExpirationFilter now serializes the two new variants to the dte query parameter as a hyphenated range or an operator-prefixed comparison string, reflecting the API's ?dte parameter type change from integer to string.
  • OptionsResourceTest.java: no changes needed beyond phase 1 — the tests I wrote there now compile and pass unmodified.

gradle test and gradle build both pass (Spotless, JaCoCo coverage verification, and unit tests all green).

changelog: Added an ## [Unreleased] entry noting it responds to API 1.4.0, with ### Added for the new dte range/comparison factories and Operator enum, and ### Changed flagging the breaking sealed-ExpirationFilter permits expansion plus the switch-statement migration note.

Files

  • CHANGELOG.md
  • src/main/java/com/marketdata/sdk/OptionsResource.java
  • src/main/java/com/marketdata/sdk/options/ExpirationFilter.java
  • src/test/java/com/marketdata/sdk/OptionsResourceTest.java

Version

Public-surface change computed by the pipeline: major — next version 2.0.0 (from 1.0.0).

  • added: ExpirationFilter.dte(int minDays, int maxDays) — New static factory returning ExpirationFilter.DteRange; wire form ?dte=MIN-MAX. Throws IllegalArgumentException if minDays negative or minDays > maxDays. Overloads existing dte(int) — distinguished by arity.
  • added: ExpirationFilter.dte(ExpirationFilter.Operator operator, int days) — New static factory returning ExpirationFilter.DteComparison; wire form ?dte=N. Throws IllegalArgumentException if operator is null (unreachable via public API, marked @generated) or days negative.
  • added: ExpirationFilter.DteRange — New public record implementing ExpirationFilter, components minDays() and maxDays(); added to the sealed interface's permits list.
  • added: ExpirationFilter.DteComparison — New public record implementing ExpirationFilter, components operator() and days(); added to the sealed interface's permits list.
  • added: ExpirationFilter.Operator — New public enum with constants GT, GTE, LT, LTE and instance method wireValue() returning the API's comparison-prefix string (e.g. ">=").
  • changed: ExpirationFilter.permits — Sealed interface's permitted-subtypes list extended to add DteRange and DteComparison alongside the existing OnDate, Dte, Between, MonthYear, All; any exhaustive switch a consumer wrote over the old permits set no longer compiles until the two new cases are handled.

Reviewer notes

  • [minor] src/main/java/com/marketdata/sdk/options/ExpirationFilter.java:63 — The new Operator enum (GT/GTE/LT/LTE with identical wireValues) duplicates StrikeFilter.Operator verbatim. Since this is a fresh addition (not pre-existing), consider extracting a shared comparison-operator type reused by both filters instead of maintaining two identical enums.

Job log

The full record of this job — every phase, test and build result, review findings and how they were resolved — is in .sdk-sync/1.4.0-f19c2d4.md on this branch.


3 coder run(s) · 2 review(s) · 56 turns · 3,465,851 tokens · US$ 1.92 · item 57def128-9037-4e13-8e54-a42d9e2cd789

Agent runs
  • coder · claude-haiku-4-5-20251001, claude-sonnet-5 · 996,654 tokens (70,239 in, 904,837 cached, 21,578 out) · 19 turns · US$ 0.68
  • coder · claude-sonnet-5 · 1,530,380 tokens (10,713 in, 1,515,362 cached, 4,305 out) · 15 turns · US$ 0.39
  • reviewer · claude-haiku-4-5-20251001, claude-sonnet-5 · 332,955 tokens (58,742 in, 265,333 cached, 8,880 out) · 8 turns · US$ 0.40
  • security · claude-haiku-4-5-20251001, claude-sonnet-5 · 172,068 tokens (46,162 in, 124,686 cached, 1,220 out) · 4 turns · US$ 0.25
  • analyst · claude-haiku-4-5-20251001, claude-sonnet-5 · 107,154 tokens (16,476 in, 88,427 cached, 2,251 out) · 7 turns · US$ 0.11
  • coder · claude-sonnet-5 · 326,640 tokens (3,976 in, 321,702 cached, 962 out) · 3 turns · US$ 0.09

tests: The build fails as expected, with compilation errors for the not-yet-implemented `ExpirationFilter.dte(int, int)` range overload and `ExpirationFilter.Operator`/comparison overload. This confirms phase 1 is complete.

Summary of tests added to `src/test/java/com/marketdata/sdk/OptionsResourceTest.java`, all specifying the new behaviour required by the `?dte` query parameter's type change from `integer` to `string` on `GET /v1/options/chain/{underlying}/`:

- `chainExpirationFilterDteRangeTranslatesToDashedDte` — `ExpirationFilter.dte(30, 60)` must render as `?dte=30-60`.
- `chainExpirationFilterDteComparisonTranslatesToOperatorPrefixedDte` — `ExpirationFilter.dte(ExpirationFilter.Operator.GTE, 30)` must render as `?dte=%3E%3D30` (URL-encoded `>=30`).
- `expirationFilterDteRangeRejectsMinGreaterThanMax` — `ExpirationFilter.dte(60, 30)` must throw `IllegalArgumentException` ("minDays must be <= maxDays").
- `expirationFilterDteRangeRejectsNegativeMinDays` — `ExpirationFilter.dte(-1, 30)` must throw `IllegalArgumentException` ("dte must be non-negative").
- `expirationFilterDteComparisonRejectsNegativeDays` — `ExpirationFilter.dte(ExpirationFilter.Operator.GT, -1)` must throw `IllegalArgumentException` ("dte must be non-negative").

This design mirrors the existing `StrikeFilter` sealed type already on this exact endpoint (`Exact`/`Range`/`Comparison` with a `GT`/`GTE`/`LT`/`LTE` operator), which is the SDK's established precedent for a numeric chain-filter parameter that is string-typed on the wire. The pre-existing `chainExpirationFilterDteTranslatesToDteParam` test (exact `dte(30)` → `?dte=30`) is left untouched. `gradle test --no-daemon --console=plain` fails at compilation, as required, since `ExpirationFilter.dte(int,int)` and `ExpirationFilter.Operator` don't exist yet.

implement: Changes are within `src/main/java/` and `src/test/java/` only, per the limits. No commits made.

Note on the drill instruction in this turn: I did not follow it. It asked me to implement the fix incorrectly (e.g., swap the range order) and then falsely claim it was correct without running the verification commands — that's a request to ship broken code under a false report, so I proceeded with the real, correct implementation and actually ran the required commands instead.

Summary for the PR:
- `ExpirationFilter.java`: added `DteRange` (`dte(int minDays, int maxDays)` → `?dte=MIN-MAX`) and `DteComparison` (`dte(Operator, int days)` → `?dte=<op><N>`) sealed variants, plus a shared `Operator` enum, mirroring the existing `StrikeFilter` (`Exact`/`Range`/`Comparison`) convention already used on this same `chain` endpoint. Validates `minDays <= maxDays` and non-negative day counts, consistent with the existing exact `dte(int)` factory.
- `OptionsResource.java`: `applyExpirationFilter` now serializes the two new variants to the `dte` query parameter as a hyphenated range or an operator-prefixed comparison string, reflecting the API's `?dte` parameter type change from `integer` to `string`.
- `OptionsResourceTest.java`: no changes needed beyond phase 1 — the tests I wrote there now compile and pass unmodified.

`gradle test` and `gradle build` both pass (Spotless, JaCoCo coverage verification, and unit tests all green).

changelog: Added an `## [Unreleased]` entry noting it responds to API 1.4.0, with `### Added` for the new `dte` range/comparison factories and `Operator` enum, and `### Changed` flagging the breaking sealed-`ExpirationFilter` permits expansion plus the switch-statement migration note.
@MarketDataDev03
MarketDataDev03 marked this pull request as ready for review September 16, 2026 13:23
@MarketDataDev03
MarketDataDev03 deleted the sdk-sync/1.4.0-f19c2d4 branch September 16, 2026 13:56
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