refactor(decode): split god-file into mdds/decode/{error,headers,transport,extract,cell,v3} + lift tdbe::time (refs #500)#505
Closed
userFRM wants to merge 1 commit into
Closed
Conversation
…sport,extract,cell,v3} + lift tdbe::time (refs #500) Wave 2 structural refactor of `crates/thetadatadx/src/decode.rs`. No public API change; existing `thetadatadx::decode::*` paths preserved via `pub use mdds::decode` at the crate root. Module split: * `mdds/decode/error.rs` -- `DecodeError` enum + `observed_name` helper * `mdds/decode/headers.rs` -- `HEADER_ALIASES` v3 <-> schema map + `find_header` * `mdds/decode/transport.rs` -- zstd `decompress_response` / `decode_data_table` * `mdds/decode/extract.rs` -- `extract_{number,text,price}_column` projections * `mdds/decode/cell.rs` -- per-cell strict decoders + generated parser surface * `mdds/decode/v3.rs` -- `parse_option_contracts_v3`, `parse_calendar_days_v3`, `parse_iso_date`, `parse_time_text`, calendar consts Eastern-time + DST primitives (`eastern_offset_ms`, `march_second_sunday_utc`, `november_first_sunday_utc`, `april_first_sunday_utc`, `october_last_sunday_utc`, `civil_to_epoch_days`, `timestamp_to_ms_of_day`, `timestamp_to_date`) lifted from `decode.rs` into the new `tdbe::time` module. `tdbe::latency` now reuses the canonical implementation, eliminating the duplicate civil-date arithmetic that previously lived alongside the latency wrapper. Generator templates updated to call `tdbe::time::timestamp_to_*` directly (`build_support/ticks/templates/parser/eod_{date,num,num64}.rs.tmpl`). Versioning: * thetadatadx: 8.0.33 -> 8.0.34 (patch; structural refactor only) * tdbe: 0.12.9 -> 0.12.10 (additive `time` module)
Owner
Author
|
Closing — refolding all 4 Wave 2 god-file splits into a single PR per workflow discipline (one wave = one PR). Will reopen as a single coordinated commit covering decode + protocol + config + conditions. |
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 2 structural refactor of
crates/thetadatadx/src/decode.rs(2177 LoC).No public-API change;
thetadatadx::decode::*paths are preserved viapub use mdds::decodeat the crate root. Eastern-time / DST primitivesbecome a canonical
tdbe::timemodule reused by mdds, fpss latency, andflatfiles.
Module surface
decode.rslinesmdds/decode/error.rsDecodeErrorenum +observed_namediagnostic helpermdds/decode/headers.rsHEADER_ALIASESv3 <-> schema map +find_headerlookupmdds/decode/transport.rsdecompress_response/decode_data_table(zstd thread-local pool)mdds/decode/extract.rsextract_{number,text,price}_columnprojectionsmdds/decode/cell.rsrow_*) + macro-generated parser surfacemdds/decode/v3.rsparse_iso_date/parse_time_text/calendar constscrates/tdbe/src/time.rstdbe::time)Lifted to
tdbe::timeeastern_offset_msmarch_second_sunday_utcnovember_first_sunday_utcapril_first_sunday_utcoctober_last_sunday_utccivil_to_epoch_daystimestamp_to_ms_of_daytimestamp_to_datetdbe::latencynow reuses these helpers, removing the duplicate civil-datearithmetic that previously lived alongside the latency wrapper. Generator
templates (
build_support/ticks/templates/parser/eod_{date,num,num64}.rs.tmpl)updated to call
tdbe::time::*directly.Public API confirmation
Zero public surface change.
thetadatadx::decode::{DecodeError, decompress_response, decode_data_table, extract_*_column, parse_*_ticks, parse_option_contracts_v3, parse_calendar_days_v3, CALENDAR_STATUS_*}all resolve through
pub use mdds::decodeat the crate root. Externalconsumers (
sdks/python/src/decode_bench.rs,crates/thetadatadx/benches/bench_decode.rs,crates/thetadatadx/tests/test_decode_captures.rs) compile unchanged.Versioning
thetadatadx: 8.0.33 -> 8.0.34 (patch; structural refactor only)tdbe: 0.12.9 -> 0.12.10 (additivetimemodule)Test plan
cargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspace(453 lib tests + 9 integration tests pass)cargo deny checkcargo run -p thetadatadx --bin generate_sdk_surfaces --features config-file -- --checkcargo check --manifest-path tools/mcp/Cargo.toml --lockedcargo clippy --manifest-path tools/mcp/Cargo.toml --all-targets -- -D warningscargo test --manifest-path tools/mcp/Cargo.toml --no-runcargo check --manifest-path tools/server/Cargo.toml --lockedcargo check --manifest-path sdks/python/Cargo.toml --lockedcargo check --manifest-path sdks/typescript/Cargo.toml --lockedpython3 scripts/check_version_sync.pyRefs #500.