{
  "schema_version": "1.3.0",
  "slug": "when-does-locale-dependent-string-sort-produce-different-orders-across-hosts",
  "title": "When does locale-dependent string sort produce different orders across hosts?",
  "date_of_record": "2026 November 2",
  "scope": "Applies to string comparisons and sorts that use locale-dependent collation (ICU default, `strcoll`, database default collation) across hosts that may differ in locale, ICU version, or collation table. Excludes binary/byte-wise comparison and sorts pinned to a named, versioned collation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-does-locale-dependent-string-sort-produce-different-orders-across-hosts.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-does-locale-dependent-string-sort-produce-different-orders-across-hosts.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-does-locale-dependent-string-sort-produce-different-orders-across-hosts.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 757,
    "python_slice_tokens": 110,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "**Predicate.** Two string sorts produce the same order if and only if they use the same collation identifier *and* the same version of the collation table. Locale name alone is insufficient; ICU and glibc produce different orders for the same locale name across versions. **Failure.** A search index is sorted on one host with ICU 70 and queried on another wit...",
    "what_was_observed": "**Signature.** Pagination or range scans returning different rows on different replicas. Search results ordered differently across regions. Rows appearing in one host's results and not another's for the same range query. **Trace.** A `BETWEEN 'a' AND 'm'` query relies on collation order. Under ICU 70, \"æ\" sorts after \"a\"; under ICU 72, it sorts after \"z\". A row whose name begins with \"æ\" is included on one replica an...",
    "condition_of_validity": "Cross-host sort consistency holds only while at least one applies: 1. **Binary collation.** Comparison is byte-wise, so order is a function of the encoding only. 2. **Pinned collation with version.** A named, versioned collation is used and its version is fixed across hosts and upgrades. 3. **Client-side sort.** Sort happens at a single layer after all data ...",
    "decision_boundary": "- Binary collation on both hosts: identical order. - Versioned pinned collation: identical as long as upgrades are coordinated. - Locale name only, no version: divergence is possible on any library upgrade. - Client-side single-collation sort: identical by construction, at the cost of data movement.",
    "operational_effect": "The defect grows slowly as libraries upgrade on independent schedules, then appears all at once when two hosts are compared. Remediation is binary collation for keys used in filters, or version-pinned collation with coordinated upgrades. The trap is to declare a locale like \"en_US\" and assume it is stable. It is not; it is a name that maps to a changing impl..."
  },
  "matched_failure_symptoms": [
    "DST_SHIFT_OR_CLOCK_SKEW"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "88d5aa48166c2613568bcaf713831c69446def6363b753e5f2c775d3b6dd17c2",
    "verified_classes": [
      "LocaleSortError",
      "CollationGate"
    ],
    "verified_functions": [
      "dispatch_collation",
      "verify"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "LocaleSortError"
    ],
    "sample_fail_closed_invariants": [
      "locale-name collation without pinned version: order varies across library upgrades"
    ],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
