Skip to content

The probe only inspects results[0], and it cost us a real field — min_order_amount was removed on a false negative #230

Description

@eaitbrahim

Found while preparing the #198 order test. Two linked defects, one of which is a regression we shipped.

D1 — shape_of collapses a list to its FIRST element, so field variation is invisible

scripts/robinhood_smoke.py's shape_of reduces a list to [shape_of(value[0]), "... N items"]. Every probe therefore validates one element and reports a match for the whole collection.

Measured live on trading_pairs (89 pairs):

results[0] = BILL-USD
   keys: asset_code, asset_increment, is_api_tradable, max_order_size,
         quote_code, quote_increment, status, symbol

BTC-USD keys: ...same... PLUS min_order_amount

DISTINCT key-sets across all 89 pairs: 2
    63 pairs WITH    min_order_amount   <- includes BTC-USD, ETH-USD
    26 pairs WITHOUT min_order_amount   <- includes BILL-USD, which is results[0]

The probe has reported 5/5 and 6/6 matched while blind to a field present on 71% of pairs, including every asset keel trades.

D2 — the regression: min_order_amount is real, and #218 removed it

min_order_amount exists and is populated for BTC-USD (0.1). #218 deleted it from tests/fixtures/rh_trading_pairs.json on the strength of a probe run whose results[0] happened to be one of the 26 pairs lacking it. That instruction was mine and it was wrong.

Consequences:

  • The committed fixture is now missing a field the venue sends for every asset keel trades.
  • Prerequisites before wiring Robinhood to the live execution path #198's prerequisite list records "the venue exposes no minimum-order field, so a pre-flight minimum-size check has no source." That is false and must be corrected — min_order_amount is exactly that source.
  • The README carries the same claim.

Fixes

  1. shape_of must summarise the whole list, not the first element. Union the keys across all elements and mark which are present on only some (e.g. min_order_amount: str (63/89)), so a partially-present field is visible rather than silently absent. A field present on some elements is a real and common API shape; the probe must model it.
  2. Restore min_order_amount to rh_trading_pairs.json and correct the README plus Prerequisites before wiring Robinhood to the live execution path #198's claim.
  3. Add a regression test: a two-element list where the second element carries a key the first lacks must produce a reported difference, not a match.

Why this matters beyond the one field

Every "shape matches" this probe has reported was a claim about results[0]. That is much weaker than how the results were read — including by me, in the #198 comment asserting the shapes were corroborated. The confidence needs restating once the probe actually checks what it claims to.

Related: #218 (removed the field), #198 (carries the false claim), #216 (the probe).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtoolingDev/release tooling (Docs, CI & tooling)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions