Skip to content

[FIX] Dictionary↔model drift test for the FIX message set (analogous to REST TestRequestBodyDrift) #437

Description

@TexasCoding

Context

The REST SDK has hard-failing contract/drift tests (TestRequestParamDrift / TestRequestBodyDrift) that diff SDK models against the OpenAPI spec, parametrized over METHOD_ENDPOINT_MAP (per the "Drift tests hard-fail" convention in CLAUDE.md).

The FIX message layer (kalshi/fix/messages/*) has no analogous automated diff against the authoritative Kalshi FIX dictionary. Field tag/type/order faithfulness for the 8 message flows (session, order entry, drop copy, market data, order groups, RFQ, settlement) is currently guarded only by hand-written golden-wire + round-trip tests. A future dictionary revision (renamed tag, changed type) would silently pass until someone updates a test by hand.

Surfaced by the pre-PR adversarial review of #429 (settlement). Not a defect in any shipped flow — a coverage/infra gap for a money-bearing, hand-rolled codec.

Proposal

  • Check the Kalshi FIX dictionary XML into the repo (e.g. specs/kalshi-fix-dictionary.xml), mirroring specs/openapi.yaml.
  • Add a drift test that, for each registered FIX message model, diffs its declared fields (tag, FIX type, required-vs-optional) against the dictionary message/component definition — hard-failing on drift, with an EXCLUSIONS-style escape hatch (with reason) for the documented Kalshi-dialect deviations (e.g. NewOrderSingle omitting TransactTime, AllocAccount as INT, market-data messages absent from the stale v1.03 dictionary and derived from the docs instead).

Notes

  • The bundled dictionary is v1.03 and stale — it predates market data (V/W/X/Y/e/f and their fields are absent), so the MD models were derived from the docs. The drift test must account for this (either a newer dictionary or doc-derived exclusions for MD).

Part of #402.

Metadata

Metadata

Assignees

No one assigned

    Labels

    infraInfrastructure/toolingspec-driftUpstream OpenAPI/AsyncAPI spec changed since last synctestingTest coverage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions