Aglet

Investigate Unexpected Sort Order and Tie Behavior

Investigation should show why a concrete pair appears in the wrong order. Build fixtures for types, nulls, direction, locale, equal values, and page boundaries, then trace their values through every comparison stage. Keep a missing contract separate from a confirmed implementation mismatch.

Build a useful investigation brief

  1. Build ordering fixtures

    Create a small expected sequence containing negative and positive values, numeric-looking text, nulls, case or locale variants, equal primary values, and records at page boundaries. Label the intended order and tie-breaker before running the path. Include a record whose display text differs from its sort value.

  2. Trace comparison values

    Capture stored value, parsed type, normalized value, query expression, returned order, and rendered text for each fixture. Check implicit casts, null placement, direction reversal, locale collation, and missing secondary keys. Record code and query revisions alongside the sequence.

  3. Vary one rule

    Change one comparison condition at a time and compare the first inversion, full sequence, and page transitions. Test an explicit tie-breaker and a stable snapshot where relevant. If two sequences satisfy an undefined contract, document the policy decision still required instead of choosing one silently.

What to carry forward

Produce a replayable ordering brief with labeled fixtures, comparison values, first inversion, page effects, and tested alternatives. Recommend the smallest rule or contract change. Keep the conclusion limited when the source is mutable or the intended locale, null policy, or tie-breaker is not established.

Keep the decision with the work.

Use a Work Item in Aglet to record the problem, the evidence you have, and the next decision. Add an owner and priority, then keep updates in the discussion so the next person can follow the reasoning.

Create an account See the product workflow