Preserve opaque product identifiers as identities, not approximate quantities. A small numeric change that is tolerable in a rounded measurement can refer to a different resource when the value is an ID. A lossy conversion can also merge two distinct resources into one apparent identity.
Build a source-to-transform identity map and a collision fixture. Verify the actual transformation where evidence exists; do not assume an AI system or extraction tool internally uses the runtime demonstrated here. The artifact proves one concrete failure mode without inventing how an external answer was produced.
Establish which fields carry identity
Record the field's documented type, namespace, exact lexeme and intended comparison. An account ID, document ID or product code is not necessarily a number just because it contains digits. Leading zeros and exact characters may be meaningful.
Keep quantities separate. Two storage measurements can be compared approximately under a declared rounding convention; two opaque IDs should not be treated as approximately the same resource. The numeric trace checks quantity transformations, while this review checks whether identity survives at all.
Use synthetic tokens in public examples. The values below do not identify real accounts, credentials or customer records. Their purpose is to expose a representation boundary.
Read the numeric representation's actual limit
MDN's MAX_SAFE_INTEGER reference explains the range in which JavaScript Number can represent and compare integers safely. It demonstrates that distinct mathematical integer expressions beyond that range can compare equal.
RFC 8259's JSON specification separately discusses numeric interoperability and implementation precision limits. A valid numeric JSON token does not establish that every consumer preserves arbitrarily large integer identity.
Neither source means every integer beyond the safe range is unrepresentable. The relevant fact is that not every neighboring integer remains distinguishable through the demonstrated numeric representation. Test the actual tokens and transformation rather than applying a vague large-number warning.
Freeze a complete collision fixture
Assume a fictional product exposes two distinct IDs as strings: "9007199254740992" and "9007199254740993". Their source contract treats them as opaque exact identities. There are no aliases or equivalence rules that intentionally merge them.
| Source String | JavaScript Number Conversion | Identity Consequence |
|---|---|---|
| 9007199254740992 | 9007199254740992 | One numeric value |
| 9007199254740993 | 9007199254740992 | Collides with the first value |
The source has two distinct string tokens. The transformed set has one distinct Number value. Converting that numeric value back to text cannot determine which original resource was intended, because both inputs already collapsed to the same representation.
That is an identity loss, not merely a less precise display of the same quantity. A later correct-looking string serializer cannot reconstruct information the earlier conversion discarded.
Inspect the complete harmless public example
The following JavaScript uses only invented local values and standard language operations. It performs no network access, file change or account operation. Its expected result is two original identities, one converted numeric identity and an unchanged two-string round trip.
const ids = ["9007199254740992", "9007199254740993"];
const converted = ids.map(Number);
console.log(JSON.stringify({
originalDistinct: new Set(ids).size,
convertedDistinct: new Set(converted).size,
converted,
leadingZeroConverted: Number("00142"),
stringRoundTrip: JSON.parse(JSON.stringify(ids))
}));The numeric conversion produces two equal entries, both 9007199254740992. The original string round trip preserves the two different IDs. The leading-zero example becomes the number 142, showing a separate loss when the source's exact token was "00142".
These observations establish this code's transformation behavior. They do not prove a captured answer used JavaScript, or that every product with long IDs suffers this defect. Preserve that causal boundary in the finding.
Keep identity typing through each boundary
Trace the source field, parser representation, intermediate data structure, export and final answer. A field can begin as a string and become numeric during spreadsheet import, validation, aggregation or formatting. The final text alone may not reveal where the loss happened.
Record exact inspected values at the boundaries you can observe. If one transformation is unavailable, mark its cause unresolved. Do not invent a runtime explanation merely because the final answer resembles the fixture's result.
The source worksheet should preserve the documented identity contract and the actual inspected path. A plausible reconstruction is different from evidence that the same conversion occurred.
Distinguish a namespace collision from a precision collision
Two systems can legitimately use the same exact local ID for different resources. Preserving digits is necessary but insufficient when the namespace differs. Retain product, tenant or other documented scope alongside the identifier where required.
The compound-identity guide demonstrates why identifier scope matters in analytics. That grouping problem differs from the numeric collision here: the latter merges two distinct tokens even within one already-correct namespace.
Conversely, adding a namespace cannot repair a conversion that erased the difference between two IDs inside that namespace. Preserve both the scope and the exact representation.
Avoid unsupported normalization rules
Do not lowercase, strip punctuation, remove leading zeros or reinterpret a version-like identifier as a decimal unless the source defines that normalization. A human-friendly display can be paired with the exact underlying identity, but the relationship must remain inspectable.
For an actual product, obtain the relevant field contract before deciding that a variation is an error. Some systems intentionally define aliases or case-insensitive comparison. The teaching fixture assumes exact strings precisely to avoid inventing those rules.
Keep display truncation separate from stored identity. Showing a shortened label can be acceptable when the actual action still targets the correct documented resource and the user has enough context. The audit should test the consequential binding, not merely demand long strings everywhere.
Build meaningful negative and positive checks
Include two distinct source IDs that collide under the suspected conversion and a string-preserving control path. Verify both distinct counts and exact returned tokens. A test checking only array length would miss two entries that now identify the same numeric value.
Also retain the leading-zero case and a namespace example when relevant. Those checks target different boundaries and should not be averaged into one generic accuracy score.
The fixture contract helps keep these synthetic inputs stable. Do not claim that a convenient ordinary ID demonstrates safe handling for every supported identity.
Release an exact identity result
Save source lexemes, namespace, field type, inspected transformations, collision output and the approved correction. Where you own the pipeline, preserve the documented identity representation through the actual consumer path and verify the final binding.
A faithful answer keeps distinct resources distinct. It does not excuse an entity collision as harmless rounding or claim to know an external system's internal conversion without evidence.
