refactor!: rename Contract.root/exp_date to symbol/expiration (closes #467)#484
Merged
Conversation
5 tasks
6e4b596 to
4725257
Compare
Closes #467. Rename the public-API fields on the SDK to match the v3 vendor surface documented in the v2 → v3 migration guide: Contract.root -> Contract.symbol Contract.exp_date -> Contract.expiration OptionContract.root -> OptionContract.symbol FlatFileRow.root -> FlatFileRow.symbol IndexEntry.root -> IndexEntry.symbol IndexEntry.exp -> IndexEntry.expiration Plus the matching constructor + parameter renames (Contract::stock(symbol), Contract::option(symbol, expiration, ...), Contract::option_raw(...), FlatFileRow::from_decoded(symbol, expiration, ...)) and the cross-language bindings regenerated from the SSOT (Python, TypeScript, Go, C++, C ABI). The wire format is unchanged. Contract::to_bytes / Contract::from_bytes still serialize the field as `root` per Contract.java parity, and the FLATFILES decoder still resolves both v2 (`root`) and v3 (`symbol`) response columns through the existing decode::HEADER_ALIASES alias table. Workspace 8.0.26 -> 8.0.27, tdbe 0.12.7 -> 0.12.8. CHANGELOG and docs-site/docs/changelog.md kept byte-identical. Local CI gate: cargo fmt --all -- --check # clean cargo clippy --workspace --all-targets -- -D warnings # clean cargo test --workspace # 0 failures cargo deny check # advisories+bans+licenses+sources ok generate_sdk_surfaces --check # no drift cargo check/clippy/test --manifest-path tools/mcp/Cargo.toml cargo check/clippy/test --manifest-path tools/server/Cargo.toml
4725257 to
e1e8a82
Compare
This was referenced May 7, 2026
userFRM
added a commit
that referenced
this pull request
May 7, 2026
) Post-#484 (8.0.28) follow-up. The Rust SDK rename Contract.root -> Contract.symbol and Contract.exp_date -> Contract.expiration was not propagated to the doc tree. Sweep brings the docs into alignment with the SDK surface; wire codecs (FPSS binary frames, MDDS gRPC) are unchanged. Touched: - docs/api-reference.md - Rust struct definitions and prose - docs/macro-guide.md - parsed_endpoint! example query block - docs/architecture.md - clarifies that the FPSS binary diagram labels are wire-format names, not SDK struct names - docs/java-parity-checklist.md - top-of-file vocabulary note plus Rust-side rewrites; Java-side root/expDate references kept verbatim - docs-site/docs/api-reference.md - field tables and prose - docs-site/docs/streaming/{connection,events}.md - inline comments - docs-site/docs/historical/option/list/roots.md - prose only; URL slug preserved for inbound-link stability - docs-site/docs/historical/option/list/contracts.md - JSON sample, response table, and Go example (t.Root -> t.Symbol) - docs-site/public/thetadatadx.yaml - OpenAPI schema for Contract - sdks/cpp/README.md - OptionContract surface row Version bump 8.0.33 -> 8.0.35 across all manifests; sub-Cargo.lock files updated (8.0.34 placeholder is reserved for Wave 2A's parallel work-stream). CHANGELOG entry added under [8.0.35] in both CHANGELOG.md and the docs-site mirror. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Closes #467.
Rename the public-API fields on the SDK to match the v3 vendor surface
documented in the v2 → v3 migration guide:
Contract.root -> Contract.symbol
Contract.exp_date -> Contract.expiration
OptionContract.root -> OptionContract.symbol
FlatFileRow.root -> FlatFileRow.symbol
IndexEntry.root -> IndexEntry.symbol
IndexEntry.exp -> IndexEntry.expiration
Plus the matching constructor + parameter renames (
Contract::stock(symbol),Contract::option(symbol, expiration, ...),Contract::option_raw(...),FlatFileRow::from_decoded(symbol, expiration, ...)).Bumps the workspace 8.0.26 → 8.0.27 and tdbe 0.12.7 → 0.12.8 (the latter
because
crates/tdbe/src/types/tick_generated.rs::OptionContract.symbolis regenerated from the schema rename).
The wire format is unchanged.
Contract::to_bytes/Contract::from_bytesstill serialize the field as
rootperContract.javaparity, and theFLATFILES decoder still resolves both v2 (
root) and v3 (symbol)response columns through the existing
decode::HEADER_ALIASESalias.Per-language renames
Rust
thetadatadx::fpss::protocol::Contract:.root→.symbol,.exp_date→.expirationContract::stock(root)→Contract::stock(symbol)Contract::index(root)→Contract::index(symbol)Contract::rate(root)→Contract::rate(symbol)Contract::option(root, exp_date, …)→Contract::option(symbol, expiration, …)Contract::option_raw(root, exp_date, …)→Contract::option_raw(symbol, expiration, …)tdbe::types::tick::OptionContract.root→OptionContract.symbolthetadatadx::flatfiles::FlatFileRow.root→FlatFileRow.symbolPython (
thetadatadx)contract.root/contract.exp_date→contract.symbol/contract.expirationOptionContract(root=…)constructor keyword →OptionContract(symbol=…)TypeScript (
@thetadatadx/napi)contract.root/contract.expDate→contract.symbol/contract.expirationOptionContract.root→OptionContract.symbolGo (
thetadatadx)c.Root/c.ExpDate→c.Symbol/c.ExpirationOptionContract.Root→OptionContract.SymbolC++ (
tdx::OptionContract,TdxContract,TdxOptionContract)c.root/c.exp_date/c.has_exp_date→c.symbol/c.expiration/c.has_expirationOptionContract.root→OptionContract.symbolC ABI
TdxContract.root→TdxContract.symbolTdxContract.exp_date→TdxContract.expirationTdxContract.has_exp_date→TdxContract.has_expirationTdxOptionContract.root→TdxOptionContract.symbolFLATFILES (CSV / JSONL)
root,expiration,strike,right,…→symbol,expiration,strike,right,…root,…→symbol,…"symbol"instead of"root").REST / WebSocket / MCP outputs
tools/serverREST + WS JSON outputs emit"symbol"and"expiration"keys on every contract payload.tools/mcpoption_list_contractsrows emit"symbol"instead of"root".{"contract": {"symbol": "…"}}and falls back to legacy{"root": "…"}for backwards compatibility.SSOT touch points
crates/thetadatadx/tick_schema.toml:OptionContractcolumn field renamedroot → symbol.crates/thetadatadx/build_support/fpss_events/{python,typescript,go_structs,ffi_rust,ffi_c}.rs: emitContract.symbol/Contract.expirationon every binding plus the regenerated FFI converter stages acontract_symbol_cstring.crates/thetadatadx/build_support/ticks/go.rs: updates theOptionContractsource-expression dispatch.crates/thetadatadx/build_support/ticks/rust_frames.rs+crates/thetadatadx/build_support/ticks/cli_headers.rs: Arrow / Polars / CLI raw-header column names trackcolumn.fieldinstead ofcolumn.name, so the divergence between wirerootand publicsymbolflows through automatically.crates/thetadatadx/build_support/sdk_surface/templates/go/next_event_body.go.tmpl: readsc.symbol/c.expirationoff the C ABI struct and assignsSymbol/Expirationon the Go-side*Contract.crates/thetadatadx/build_support/endpoints/render/templates/cpp/option_contracts_convert.cpp.tmpl: assignsc.symbolon the C++OptionContractvalue type.Hand-written touch points
crates/thetadatadx/src/fpss/protocol.rs—Contract.symbol,Contract.expiration; constructor + method param renames; the byte-level decoder keeps the wire-spec local names (root,exp_date) so the file still diffs cleanly against the upstream binary protocol, but the struct construction now binds to the v3 names.crates/thetadatadx/src/decode.rs—parse_option_contracts_v3constructsOptionContract { symbol, … }; the alias("root", "symbol")continues to map v3 wire columns onto thefind_header("root")lookup.crates/thetadatadx/src/flatfiles/{decoded.rs,decoded_row.rs,index.rs,writer.rs}— symbol/expiration field renames + CSV / JSONL header rename.crates/thetadatadx/src/{fpss,unified}.rs— everycontract.root/contract.exp_dateaccess updated.ffi/src/{streaming.rs,types.rs}—TdxOptionContract.symbol,Contract::symbolaccessors.tools/{cli,mcp,server}— option-contract rendering reads.symbol, REST + MCP + WS JSON outputs emit"symbol"/"expiration"keys on every contract payload.sdks/cpp/include/{thetadx.h,thetadx.hpp}—TdxOptionContract.symbol,OptionContract.symbol.sdks/go/tick_ffi_mirrors.go—cOptionContract.Symbol.sdks/typescript/index.d.ts—Contract.symbol/Contract.expiration,OptionContract.symbol.Regenerated bindings
ffi/src/{fpss_event_structs,fpss_event_converter}.rssdks/python/src/{fpss_event_classes,tick_classes,tick_arrow}.rssdks/typescript/src/{fpss_event_classes,tick_classes}.rssdks/go/{fpss_event_structs,fpss_event_structs.h.inc,fpss_methods,tick_converters,tick_structs}.gosdks/cpp/include/fpss_event_structs.h.inc,sdks/cpp/src/historical.cpp.inccrates/thetadatadx/src/frames_generated.rstools/cli/src/raw_headers_generated.rsCHANGELOG / docs
CHANGELOG.mdanddocs-site/docs/changelog.mdget a[8.0.27] - 2026-05-06entry under### Breakingwith the per-language rename matrix and a### Changedbullet noting thetdbebump.docs-site/docs/{getting-started,streaming,historical/option/list}/*.mdexamples updated to usecontract.symbol/contract.expiration.Test plan
Local CI gate (all green on the final push):
cargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspacecargo deny checkcargo run -p thetadatadx --bin generate_sdk_surfaces --features config-file -- --checkcargo check / clippy / test --manifest-path tools/server/Cargo.tomlcargo check / clippy / test --manifest-path tools/mcp/Cargo.tomlcargo check --manifest-path sdks/python/Cargo.tomlcargo check --manifest-path sdks/typescript/Cargo.tomlCloses #467