{
  "schema_version": "1.3.0",
  "slug": "when-does-a-case-insensitive-uniqueness-constraint-hold-on-one-host-and-not-another",
  "title": "When does a case-insensitive uniqueness constraint hold on one host and not another?",
  "date_of_record": "2026 November 1",
  "scope": "Applies to uniqueness enforced on user-facing identifiers (email, username, path) where case-insensitivity is assumed but the folding rule is supplied by the host filesystem, database collation, or application code. Excludes fields explicitly declared binary or case-sensitive.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-does-a-case-insensitive-uniqueness-constraint-hold-on-one-host-and-not-another.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-does-a-case-insensitive-uniqueness-constraint-hold-on-one-host-and-not-another.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-does-a-case-insensitive-uniqueness-constraint-hold-on-one-host-and-not-another.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 888,
    "python_slice_tokens": 108,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "**Predicate.** A case-insensitive uniqueness constraint is portable if and only if the folding function is identical at every point that creates, checks, or indexes the key. The constraint holds if fold_application(x) == fold_application(y) implies x == y at exactly one store, and that store is the sole authority. **Failure.** The application folds on write ...",
    "what_was_observed": "**Signature.** Duplicate identifiers present in a replicated table that a single-host check says cannot exist. The duplicates differ in characters whose folding is host-dependent (Turkish dotted I, German sharp S, Greek final sigma, full-width forms). A restore onto a different platform fails the unique index. **Trace.** Application folds with Python lower(). PostgreSQL enforces with a locale-aware collation. A usern...",
    "condition_of_validity": "Portable case-insensitive uniqueness requires all of: 1. **Single fold.** Exactly one folding function is applied, and it is applied at the storage boundary rather than in application code. 2. **Pinned locale.** The database collation is pinned explicitly and does not inherit the host locale. 3. **Portable fold.** The fold function is locale-independent (ful...",
    "decision_boundary": "- One fold, pinned locale, portable function: constraint is portable. - Application fold plus database collation: two rules, divergence is possible. Normalize before write and store the folded form as the indexed column. - lower() used anywhere in the path: not portable. Replace with full case folding. - Case-insensitive key restored across platforms without...",
    "operational_effect": "The defect is dormant until a platform change, so it survives years of operation and surfaces during a migration when the cost is highest. Remediation is to compute the folded key once, store it in a dedicated column, and enforce uniqueness on that column. The trap is to set the database collation to case-insensitive and call it done. That moves the rule to ..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "0338026f94ddd82cf01f8d699b3f876aa4090932c29259f189b9cfa69d91f440",
    "verified_classes": [
      "CaseFoldingError",
      "CaseFoldGate"
    ],
    "verified_functions": [
      "dispatch_key_strategy",
      "verify"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CaseFoldingError"
    ],
    "sample_fail_closed_invariants": [
      "lower() is locale-sensitive and not portable",
      "collation not pinned: inherits host locale",
      "multiple folding authorities in the write path"
    ],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
