{
  "schema_version": "1.3.0",
  "slug": "when-does-a-64-bit-identifier-lose-precision-when-serialized-as-json",
  "title": "When does a 64-bit identifier lose precision when serialized as JSON?",
  "date_of_record": "2026 November 2",
  "scope": "Applies to 64-bit integer identifiers (snowflake, bigint, integer-form ULID) crossing a JSON boundary where numbers are parsed as IEEE-754 doubles. Excludes identifiers serialized as strings, and identifiers provably bounded below 2^53.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-does-a-64-bit-identifier-lose-precision-when-serialized-as-json.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-does-a-64-bit-identifier-lose-precision-when-serialized-as-json.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-does-a-64-bit-identifier-lose-precision-when-serialized-as-json.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 661,
    "python_slice_tokens": 90,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "**Predicate.** A JSON integer round-trips exactly through a double parser if and only if |n| < 2^53. At and above 2^53, adjacent integers collapse to the same double, so the parsed value differs from the original by the granularity of the representation. **Failure.** A service emits id=9007199254740993 (2^53+1). A JavaScript or Go-float64 consumer parses it ...",
    "what_was_observed": "**Signature.** Writes landing on adjacent rows. Reads returning rows that were never written. Off-by-small deltas in identifier space, stable within a session because the precision loss is deterministic for a given value. **Trace.** Snowflake ids contain 41 bits of timestamp plus 10 bits of worker, reaching 2^63. A service decodes into `float64` by default. id 7000000000000000001 parses as 7000000000000000000. Every ...",
    "condition_of_validity": "The identifier survives the JSON boundary only while at least one holds: 1. **String serialization.** The identifier is emitted and parsed as a string, and the schema marks the field as string unambiguously. 2. **Bit-width bound.** The identifier is provably below 2^53 in every deployment. 3. **Consumer posture.** The consumer parses numbers as arbitrary-pre...",
    "decision_boundary": "- String form on both sides: exact. - Integer below 2^53 on both sides: exact. - Integer crossing to a float64 consumer: loss is guaranteed above 2^53. - Integer with bigint parsing on every consumer: exact, provided none on the path parses as double.",
    "operational_effect": "The invariant lives in the consumer's number parser, often in a different repo and often set by framework default. Remediation is string serialization at the schema. The trap is to widen the type in the producer. That does not help; the lossy step is the parse."
  },
  "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": "ed516423fe185c2596f23ca9d3938f1d9285f49e691f05224698deadd9c49edc",
    "verified_classes": [
      "JsonIdentifierPrecisionError",
      "JsonIdentifierGate"
    ],
    "verified_functions": [
      "dispatch_serialization",
      "verify"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "JsonIdentifierPrecisionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
