Repository navigation
sdk-sync: API 2.0.0+ffb34b7 → sdk-php (minor) - #112
marketdata-sdk-sync[bot] wants to merge 1 commit into
Conversation
tests: Added unit wire tests (tests/Unit/Options/UrlConstructionTest.php) covering the three new `dte` forms the API now accepts on GET /v1/options/chain/{underlying}/: comma-separated list ("15,30,45"), closed range ("0-45"), and comparison operator (">=30" and "<45"), each asserting the exact query string sent; the existing single-integer-value test already covers the pre-existing form. Added live integration tests (tests/Integration/Options/OptionChainTest.php) for every dte form against AAPL, each tagged #[Group('ci')], asserting multiple distinct expirations are returned (impossible under the documented single-expiration default) and that returned dte values respect the stated bounds. Added the compatibility probe at build/sdk-sync-compat/SdkSyncCompatProbeTest.php covering today's `option_chain(dte: int)` call, verified green against current code.
implement: Widened `option_chain()`'s `$dte` parameter from `?int` to `int|string|null` on src/Endpoints/Options.php, so it accepts a comma-separated list, a closed range, and a comparison operator in addition to the existing single integer, matching the API's new query syntax for GET /v1/options/chain/{underlying}/.
Correctness: the type was widened purely additively; the old int form keeps its exact behaviour and error (InvalidArgumentException via validatePositiveInteger, now gated behind is_int so string forms bypass it, same as strike/delta).
Docs: updated the @PARAM block for $dte with one bullet and example per form, in the same style as the neighbouring $delta/$strike docs.
New public members: none added — only an existing parameter's type widened, so no new doc comments needed beyond the updated @PARAM.
Wire tests: phase 1 already added one unit test per new form (list, range, >=, <) plus the pre-existing single-value regression, all asserting the literal query string.
Validation: no new validation surface was added for the string forms (consistent with strike/delta, which also accept free-form strings unchecked); the existing int validation is preserved unchanged.
Coverage: no code excluded; the is_int branch is exercised by both the existing int test and the new string-form tests.
Examples/docs still correct: examples/options_chain.md's dte entry describes the response field (always int), not the request filter, so it needed no change; options-screener examples and options_chain.php pass a plain int to dte and remain valid under the widened type.
Existing parameter compatibility: $dte still accepts every value it did before (plain int, unchanged signature position/default), only widened.
Left as-is (outside scope, no dte/option_chain content found despite being listed): tests/Unit/Options/ExpirationsTest.php, LookupTest.php, StrikesTest.php, tests/Unit/Options/QuotesTest.php, tests/Integration/Options/QuotesTest.php, tests/Unit/ToStringTest.php — these reference the unrelated response-side `dte` field or other Options endpoints, not the chain filter.
Outside my limits and left wrong/out of date: CHANGELOG.md has no entry yet (pipeline writes it); the .phpdoc/ cache still reflects the old `?int $dte` signature until regenerated.
review fix 1: Added tests/Unit/Options/UrlConstructionTest.php::testOptionChain_withDteString_addsParameter, asserting dte=30 is sent for the string single value `dte: '30'` — the form the type change exists for, previously only tested with the old int type.
Fixed testOptionChain_dteCommaList_selectsMultipleExpirations: added assertLessThanOrEqual(3, count($response->option_chains)) alongside the existing lower bound, so the test now fails on a server that ignores dte and returns the whole chain, not only on one that returns the single default.
Added strike_limit: 3 to all five new dte live tests (single value, comma list, closed range, >=, <), matching the neighbouring multi-expiration tests' convention and bounding per-contract request cost; verified none of the dte/expiration-count assertions depend on the full, unbounded strike set.
Documented the dte=0 inconsistency in the @PARAM block for $dte (src/Endpoints/Options.php): a single int dte must be positive (unchanged, pre-existing validation on the existing public method, left as-is to avoid changing its error behavior), while the string forms (list, range, comparison) are passed through unvalidated and accept 0 as a bound, matching the API's documented closed-range syntax.
Left the <40 boundary question (inclusive vs exclusive) in testOptionChain_dteComparisonLt untouched, as instructed — it is a question for a person to settle with the API team, not something to resolve in code or tests.
changelog: Added changelog entry for `Options::option_chain()` parameter widening: `dte` now accepts string forms (comma-separated list, closed range, comparison operators) in addition to single integer values (API release 2.0.0); int form retains exact prior behavior.
🧾 Job log — sdk-syncsdk-auto-sync job log
Changes in the API surface1. setupGates:
What it printed: 2. testsCoder (31 turns, US$ 1.37, 5 min 35 s):
Gates:
3. implementCoder (29 turns, US$ 1.08, 3 min 14 s):
Gates:
4. review 1Reviewer (14 turns, US$ 1.74, 3 min 07 s): 3 blocking finding(s)
5. review fix 1Findings sent back to the coder:
Minor findings sent along, as optional:
Questions for a person, shown to the coder and not for it to resolve:
Coder (15 turns, US$ 0.63, 2 min 04 s):
Gates:
6. review 2Reviewer (5 turns, US$ 0.84, 1 min 14 s): approved
7. securitySecurity (1 turns, US$ 0.00, 2 s): did not finish The pipeline:
Security (6 turns, US$ 0.44, 25 s): approved
8. assessAnalyst (7 turns, US$ 0.21, 27 s) — public surface:
Computed by the pipeline: minor; changelog entry written 9. changelogCoder (11 turns, US$ 0.09, 31 s):
Gates:
Questions for a personThe internal reviewers raised these for a person to answer. They did not block the change, and the coder was not asked to resolve them.
Totals
Agent runs
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #112 +/- ##
=========================================
Coverage 99.78% 99.78%
- Complexity 971 972 +1
=========================================
Files 50 50
Lines 2829 2830 +1
=========================================
+ Hits 2823 2824 +1
Misses 6 6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Generated by sdk-auto-sync for API release 2.0.0 (commit
ffb34b7).Changes in the API surface
Snapshots
ae2b047c8f6f→c2a31e277345:What the agent did
tests: Added unit wire tests (tests/Unit/Options/UrlConstructionTest.php) covering the three new
dteforms the API now accepts on GET /v1/options/chain/{underlying}/: comma-separated list ("15,30,45"), closed range ("0-45"), and comparison operator (">=30" and "<45"), each asserting the exact query string sent; the existing single-integer-value test already covers the pre-existing form. Added live integration tests (tests/Integration/Options/OptionChainTest.php) for every dte form against AAPL, each tagged #[Group('ci')], asserting multiple distinct expirations are returned (impossible under the documented single-expiration default) and that returned dte values respect the stated bounds. Added the compatibility probe at build/sdk-sync-compat/SdkSyncCompatProbeTest.php covering today'soption_chain(dte: int)call, verified green against current code.implement: Widened
option_chain()'s$dteparameter from?inttoint|string|nullon src/Endpoints/Options.php, so it accepts a comma-separated list, a closed range, and a comparison operator in addition to the existing single integer, matching the API's new query syntax for GET /v1/options/chain/{underlying}/.Correctness: the type was widened purely additively; the old int form keeps its exact behaviour and error (InvalidArgumentException via validatePositiveInteger, now gated behind is_int so string forms bypass it, same as strike/delta).
Docs: updated the @PARAM block for $dte with one bullet and example per form, in the same style as the neighbouring $delta/$strike docs.
New public members: none added — only an existing parameter's type widened, so no new doc comments needed beyond the updated @PARAM.
Wire tests: phase 1 already added one unit test per new form (list, range, >=, <) plus the pre-existing single-value regression, all asserting the literal query string.
Validation: no new validation surface was added for the string forms (consistent with strike/delta, which also accept free-form strings unchecked); the existing int validation is preserved unchanged.
Coverage: no code excluded; the is_int branch is exercised by both the existing int test and the new string-form tests.
Examples/docs still correct: examples/options_chain.md's dte entry describes the response field (always int), not the request filter, so it needed no change; options-screener examples and options_chain.php pass a plain int to dte and remain valid under the widened type.
Existing parameter compatibility: $dte still accepts every value it did before (plain int, unchanged signature position/default), only widened.
Left as-is (outside scope, no dte/option_chain content found despite being listed): tests/Unit/Options/ExpirationsTest.php, LookupTest.php, StrikesTest.php, tests/Unit/Options/QuotesTest.php, tests/Integration/Options/QuotesTest.php, tests/Unit/ToStringTest.php — these reference the unrelated response-side
dtefield or other Options endpoints, not the chain filter.Outside my limits and left wrong/out of date: CHANGELOG.md has no entry yet (pipeline writes it); the .phpdoc/** cache still reflects the old
?int $dtesignature until regenerated.review fix 1: Added tests/Unit/Options/UrlConstructionTest.php::testOptionChain_withDteString_addsParameter, asserting dte=30 is sent for the string single value
dte: '30'— the form the type change exists for, previously only tested with the old int type.Fixed testOptionChain_dteCommaList_selectsMultipleExpirations: added assertLessThanOrEqual(3, count($response->option_chains)) alongside the existing lower bound, so the test now fails on a server that ignores dte and returns the whole chain, not only on one that returns the single default.
Added strike_limit: 3 to all five new dte live tests (single value, comma list, closed range, >=, <), matching the neighbouring multi-expiration tests' convention and bounding per-contract request cost; verified none of the dte/expiration-count assertions depend on the full, unbounded strike set.
Documented the dte=0 inconsistency in the @PARAM block for $dte (src/Endpoints/Options.php): a single int dte must be positive (unchanged, pre-existing validation on the existing public method, left as-is to avoid changing its error behavior), while the string forms (list, range, comparison) are passed through unvalidated and accept 0 as a bound, matching the API's documented closed-range syntax.
Left the <40 boundary question (inclusive vs exclusive) in testOptionChain_dteComparisonLt untouched, as instructed — it is a question for a person to settle with the API team, not something to resolve in code or tests.
changelog: Added changelog entry for
Options::option_chain()parameter widening:dtenow accepts string forms (comma-separated list, closed range, comparison operators) in addition to single integer values (API release 2.0.0); int form retains exact prior behavior.Questions for a person
The internal reviewers raised these for a person to answer. They did not block the change, and the coder was not asked to resolve them.
tests/Integration/Options/OptionChainTest.php:452— testOptionChain_dteComparisonLt assertsassertLessThan(40, $quote->dte), i.e. that<40excludes dte exactly 40, while the API text says comparison operators are "inclusive" (and also says the syntax matches strike and delta, which would make<exclusive). The two readings differ only on days when an expiration sits at exactly dte 40, so the single passing live run does not settle it: please confirm with the API team whether<Nexcludes N before this assertion is relied on.Files
CHANGELOG.mdsrc/Endpoints/Options.phptests/Integration/Options/OptionChainTest.phptests/Unit/Options/UrlConstructionTest.phpVersion
Public-surface change computed by the pipeline: minor
Options::option_chain($dte)— ?int widened to int|string|null; dte: 30 still type-checks and validates exactly as before, while dte: '15,30,45', dte: '0-45', dte: '>=30' and dte: '<45' are new accepted forms.Live-API suite
tests/Integration/Options/OptionChainTest.phpFiles of this suite changed by this pull request. The pipeline ran the ones the change added or modified against the live API before the pull request, and they passed; this pull request's CI runs the whole suite.
Job log
The full record of this job — every phase, test and build result, review findings and how they were resolved, and each fix round after the PR was opened — is in the job log comment.
4 coder run(s) · 4 review(s) · 119 turns · 11,764,442 tokens · US$ 6.39 · item
ac9f3c82-f79b-4c28-a080-fae6a871d90bAgent runs