refactor!: 9.0.0 cut — drop wire-internal surface, IntoOptionSpec, FpssConnectArgs, public-API discipline (closes #500)#508
Merged
Conversation
…ssConnectArgs, public-API discipline (closes #500) Wave 4 of the audit-sweep refactor. ThetaDataDx 9.0.0 cuts the public surface to what users actually need and removes wire-internal state from every binding. B1. Drop wire-internal `contract_id: i32` from public surface. - Removed: `ThetaDataDx::{contract_map, contract_lookup}`, `FpssClient::{contract_map, contract_lookup}`, every C ABI / Python / TypeScript / C++ wrapper, plus `TdxContractMapArray` / `TdxContractMapEntry` / `tdx_contract_map_array_free`. - The reader-thread cache stays internal; downstream consumers that still need an id->contract map build it from the `FpssControl::ContractAssigned { id, contract }` event stream. B2. `pub mod proto` -> `pub(crate)`. Generated protobuf payload types are surfaced via the new `thetadatadx::wire` re-export (`DataTable`, `DataValueList`, `DataValue`, `ResponseData`, `Price`, `data_value`, `CompressionAlgo`, `CompressionDescription`). B3. `pub mod fpss::{connection, framing, dispatcher, ring}` -> `pub(crate)`. `protocol` stays public; `Frame`, `read_frame`, `write_frame` are surfaced as items at `fpss::` root for bench consumers. B4. `FpssClient::connect` takes one `FpssConnectArgs` struct instead of seven loose arguments. `Default` impl + a `FpssConnectArgs::new(creds, hosts)` shortcut cover the common path. B5. `Contract::option_raw` collapsed into `Contract::option` via the new sealed `IntoOptionSpec` trait. Both `(&str, &str, &str)` (human-friendly) and `(i32, bool, i32)` (wire-format integer triple) input shapes route through the same call. Public-API discipline sweep: - `auth::{creds, nexus, session}` reduced to `pub(crate)`; user-facing types stay re-exported at `thetadatadx::auth::*`. - Dead helpers removed (`fpss::connection::connect_to`, `fpss::framing::FrameReadState::is_idle`, `fpss::ring::DEFAULT_RING_SIZE`). - Every `pub fn` / `pub struct` reachable from a public path was audited; internal helpers are now crate-private. Versions: thetadatadx 8.0.37 -> 9.0.0; tdbe 0.12.10 -> 0.13.0 (eastern-time + json_canon + conditions codegen surface expansion warrants the minor bump). All seven Cargo.tomls, four npm package.jsons, and five Cargo.lock files updated atomically. Closes #500.
TS / Python bindings hold String params and pass &String refs into Contract::option(). Add (String, String, String) and (&String, &String, &String) impls that delegate to the existing (&str, &str, &str) impl via .as_str() on each component. CI failure on Wave 4 9.0.0 cut caught the missing impl coverage.
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
Wave 4 of the audit-sweep refactor. ThetaDataDx 9.0.0 cuts the public surface to what users actually need and removes wire-internal state from every binding (Rust, C ABI, Python, TypeScript, C++).
B1 — Drop wire-internal
contract_id: i32ThetaDataDx::{contract_map, contract_lookup},FpssClient::{contract_map, contract_lookup}tdx_unified_contract_map,tdx_unified_contract_lookup,tdx_fpss_contract_map,tdx_fpss_contract_lookup,tdx_contract_map_array_free,TdxContractMapArray,TdxContractMapEntrycontract_map(),contract_lookup()contractMap(),contractLookup()FpssClient::{contract_map, contract_lookup}The reader-thread cache stays internal. Consumers that still need an id→contract map build it from the
FpssControl::ContractAssigned { id, contract }event stream — every event still carries the assignment.B2 —
pub mod proto→pub(crate)The generated protobuf module is wire-internal. Bindings that need
DataTable/DataValueList/ResponseData/Price/data_value::*consume the newthetadatadx::wirere-export, which surfaces only the types offline-decode harnesses actually use.B3 —
pub mod fpss::{connection, framing, dispatcher, ring}→pub(crate)Only
protocolremains a public submodule offpss.Frame,read_frame,write_frameare surfaced as items atthetadatadx::fpss::for benchmark consumers; everything else (TLS connect, ring-buffer wait strategies, dispatcher internals) is now crate-private.B4 —
FpssConnectArgsreplaces 9-argconnectDefaultimpl +FpssConnectArgs::new(creds, hosts)shortcut cover the common path.B5 —
Contract::optionpolymorphic viaIntoOptionSpecNew sealed trait
IntoOptionSpecaccepts either(&str, &str, &str)(human-friendly: expiration / strike / right) or(i32, bool, i32)(wire-format integer triple).Contract::option_rawis gone.Public-API discipline sweep
auth::{creds, nexus, session}reduced topub(crate); user-facing types stay re-exported atthetadatadx::auth::*and the crate root.fpss::connection::connect_to,fpss::framing::FrameReadState::is_idle,fpss::ring::DEFAULT_RING_SIZE.pub fn/pub structreachable from a public path was audited; internal helpers (parsers, decoders, format converters, TLS connect entry points) are now crate-private.Versions
All seven Cargo.tomls, four npm package.jsons, and five Cargo.lock files updated atomically.
python3 scripts/check_version_sync.pyreportsversion sync: ok.Test plan
cargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspace(every crate green)cargo deny check— advisories ok, bans ok, licenses ok, sources okcargo run -p thetadatadx --bin generate_sdk_surfaces --features config-file -- --checkcargo check --manifest-path tools/cli/Cargo.toml --lockedcargo check --manifest-path tools/server/Cargo.toml --lockedpython3 scripts/check_version_sync.pycmake -S sdks/cpp -B build/cpp && cmake --build build/cpp --target thetadatadx_cppcmake --build build/cpp --target thetadatadx_fpss_smokeCloses #500.