Skip to content

fix: preserve error sources and align cross-binding strike and park-interval widths#818

Merged
userFRM merged 2 commits into
mainfrom
fix/audit-low-info-cleanup
Jun 16, 2026
Merged

fix: preserve error sources and align cross-binding strike and park-interval widths#818
userFRM merged 2 commits into
mainfrom
fix/audit-low-info-cleanup

Conversation

@userFRM

@userFRM userFRM commented Jun 16, 2026

Copy link
Copy Markdown
Owner

A batch of small correctness and consistency fixes across the error surface, contract docs, the flat-file byte-match test, and the TypeScript binding.

Error cause-chain preservation

The bridges from the data-format encoding layer and the per-cell decoder into the public Error previously flattened the typed cause to a string, so std::error::Error::source() returned None for the Config and Decode families — inconsistent with the Io / Http / Tls variants that carry their cause via #[from]. The Config and Decode variants now hold an optional #[source] boxed error that the From conversions populate with the typed cause, so chain walkers reach the original error without parsing Display. The credentials-file read carries its underlying io::Error the same way. Display output is unchanged: kind and message render exactly as before, verified by the existing kind-carried tests. The gRPC status conversion already preserves the numeric code, message, and retry hint structurally, so it gains a clarifying comment rather than a redundant source link.

Contract::from_str rustdoc

The bare-root doc claimed 1..=6 ASCII uppercase, but validate_root accepts 1..=MAX_ROOT_LEN (16). Corrected to match the code.

Flat-file byte-match comparison

The opt-in live byte-match compared the SDK CSV against the vendor reference as one byte block. The SDK emits option strikes in dollars on every client-facing surface while the vendor file renders the raw scaled-integer wire value (1000 wire units per dollar), so the strike column can never byte-match. The comparison is now column-for-column: the strike cell is compared on a common scale, and every other byte must still match exactly. The test stays behind its live-tests feature gate and the fixtures env var.

TypeScript wait_park_us width

The napi binding typed wait_park_us as u32 while the core field, and the Python, C, and C++ bindings, are all u64. Widened the binding to a BigInt, mirroring the other microsecond and second streaming and reconnect knobs, so all four bindings match the core width.

Verification

  • cargo fmt --all -- --check clean (core and TypeScript crate)
  • cargo test -p thetadatadx --lib — 808 passed, including the two new error::tests::*_bridge_preserves_source tests
  • cargo clippy -p thetadatadx --lib -- -D warnings clean
  • cargo check -p thetadatadx --test flatfiles_byte_match --features live-tests compiles
  • cargo build on the TypeScript binding crate succeeds

🤖 Generated with Claude Code

…nterval widths

Bridge the data-format and per-cell decode errors into the public Error with the typed cause carried as a thiserror source instead of flattening it to a string, so std::error::Error::source() walks the chain for the Config and Decode families the way it already does for the IO, HTTP, and TLS variants. The credentials-file read also carries its underlying io::Error as the source. Display output is unchanged: the kind and message fields still render exactly as before, and the gRPC status conversion already preserves the code, message, and retry hint structurally so it needs no source link.

Correct the Contract::from_str bare-root rustdoc to state the real length bound: validate_root accepts 1..=16 ASCII uppercase characters (MAX_ROOT_LEN), not 1..=6.

Compare the flat-file CSV against the vendor reference column-for-column rather than as a raw byte block. The SDK emits option strikes in dollars on every client-facing surface while the vendor file renders the raw scaled-integer wire value, so the strike column is compared on a common scale and every other byte must still match exactly.

Widen the TypeScript wait_park_us binding to a BigInt so the microsecond park interval marshals as the u64 it is in the core, matching the Python, C, and C++ bindings and the other microsecond and second streaming and reconnect knobs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@userFRM userFRM enabled auto-merge (squash) June 16, 2026 13:16
…setter

The committed type stub carried a stale tsdoc block for `setWaitParkUs` / `waitParkUs` after the park interval widened to a 64-bit microsecond value. Regenerate the stub from the native build so the published types match the doc comments the binding actually emits, restoring parity between the committed `.d.ts` and the generator output.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@userFRM userFRM merged commit 97ad526 into main Jun 16, 2026
42 of 43 checks passed
@userFRM userFRM deleted the fix/audit-low-info-cleanup branch June 16, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants