Repository navigation
sdk-sync: API 1.4.0+f19c2d4 → sdk-java 2.0.0 (major) - #8
Closed
MarketDataDev03 wants to merge 1 commit into
Closed
MarketDataDev03 wants to merge 1 commit into
MarketDataDev03 wants to merge 1 commit into
Conversation
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.
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.
Generated by sdk-auto-sync for API release 1.4.0 (commit
f19c2d4).Changes in the API surface
Snapshots
9c18fbb1f58e→72b3d15f59ad:What the agent did
tests: The build fails as expected, with compilation errors for the not-yet-implemented
ExpirationFilter.dte(int, int)range overload andExpirationFilter.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?dtequery parameter's type change fromintegertostringonGET /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 throwIllegalArgumentException("minDays must be <= maxDays").expirationFilterDteRangeRejectsNegativeMinDays—ExpirationFilter.dte(-1, 30)must throwIllegalArgumentException("dte must be non-negative").expirationFilterDteComparisonRejectsNegativeDays—ExpirationFilter.dte(ExpirationFilter.Operator.GT, -1)must throwIllegalArgumentException("dte must be non-negative").This design mirrors the existing
StrikeFiltersealed type already on this exact endpoint (Exact/Range/Comparisonwith aGT/GTE/LT/LTEoperator), which is the SDK's established precedent for a numeric chain-filter parameter that is string-typed on the wire. The pre-existingchainExpirationFilterDteTranslatesToDteParamtest (exactdte(30)→?dte=30) is left untouched.gradle test --no-daemon --console=plainfails at compilation, as required, sinceExpirationFilter.dte(int,int)andExpirationFilter.Operatordon't exist yet.implement: Changes are within
src/main/java/**andsrc/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: addedDteRange(dte(int minDays, int maxDays)→?dte=MIN-MAX) andDteComparison(dte(Operator, int days)→?dte=<op><N>) sealed variants, plus a sharedOperatorenum, mirroring the existingStrikeFilter(Exact/Range/Comparison) convention already used on this samechainendpoint. ValidatesminDays <= maxDaysand non-negative day counts, consistent with the existing exactdte(int)factory.OptionsResource.java:applyExpirationFilternow serializes the two new variants to thedtequery parameter as a hyphenated range or an operator-prefixed comparison string, reflecting the API's?dteparameter type change fromintegertostring.OptionsResourceTest.java: no changes needed beyond phase 1 — the tests I wrote there now compile and pass unmodified.gradle testandgradle buildboth pass (Spotless, JaCoCo coverage verification, and unit tests all green).changelog: Added an
## [Unreleased]entry noting it responds to API 1.4.0, with### Addedfor the newdterange/comparison factories andOperatorenum, and### Changedflagging the breaking sealed-ExpirationFilterpermits expansion plus the switch-statement migration note.Files
CHANGELOG.mdsrc/main/java/com/marketdata/sdk/OptionsResource.javasrc/main/java/com/marketdata/sdk/options/ExpirationFilter.javasrc/test/java/com/marketdata/sdk/OptionsResourceTest.javaVersion
Public-surface change computed by the pipeline: major — next version 2.0.0 (from 1.0.0).
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.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.ExpirationFilter.DteRange— New public record implementing ExpirationFilter, components minDays() and maxDays(); added to the sealed interface's permits list.ExpirationFilter.DteComparison— New public record implementing ExpirationFilter, components operator() and days(); added to the sealed interface's permits list.ExpirationFilter.Operator— New public enum with constants GT, GTE, LT, LTE and instance method wireValue() returning the API's comparison-prefix string (e.g. ">=").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
Operatorenum (GT/GTE/LT/LTE with identical wireValues) duplicatesStrikeFilter.Operatorverbatim. 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.mdon this branch.3 coder run(s) · 2 review(s) · 56 turns · 3,465,851 tokens · US$ 1.92 · item
57def128-9037-4e13-8e54-a42d9e2cd789Agent runs