FIELD NOTES · ACCEPTANCE EXERCISES

Catalogue sorting needs a tie-break rule

A product finder can place Pack10 before Pack2 with ordinary string sorting. A locale-aware numeric comparison helps, but equivalent labels still need stable IDs for a predictable order. Commission the exact ordering contract rather than a vague “alphabetical” option.

Primary evidence and claim boundaries

Intl.Collator supports language-sensitive comparison and a numeric option. Comparison returns a negative, zero or positive number; implementations do not promise only−1 or 1. Primary reference · Read 18 October 2026.

Filled acceptance example

Original synthetic teaching scenario, not a client case, provider integration test or business result. The example policy needs the actual owner’s approval; scroll the table on narrow screens.

Input and stateDeclared checkExpected output and decision
Pack10(idC), Pack2(idB), Pack1(idA)en-AU; numeric=truePack1, Pack2, Pack10
Pack2(idB), Pack02(idA)Numeric labels may compare equalUse explicit stableID tie-break; A before B in this policy
Same product list arrives in reverse orderSame locale/options/ID ruleFinal order must remain identical
Supplier relies on default runtime localeLocale not recordedDo not approve cross-environment parity

Practical handover procedure

  1. Choose locale, numeric handling, case/accent sensitivity and a stable tie-break key. Sorting and search matching are independent policies.
  2. Run the supplied list in normal and reversed input order. Compare exact ordered IDs, not only visible labels or the sign magnitude of a comparator.
  3. Record runtime/ICU versions and repeat on supported environments with actual bilingual catalogue labels. Locale rules may differ; do not promise one culturally neutral global order.

Interpret the outcome

The first row fixes the2/10 defect. The second addresses an additional problem that numeric comparison alone does not solve: two labels can compare equal. A stable ID makes input arrival order irrelevant under this declared policy.

Acceptance decision

Require the exact agreed ID sequence under both input orders and documented runtime settings. No unexplained resorting after pagination or refresh.

Limits and unverified work

Synthetic English SKU labels, not a claim about every Chinese collation rule or a live search index. This does not change existing site search.

Download the filled bilingual acceptance record — Contains the inputs, steps, expectations and limits. This is a teaching record, not an executable production integration.