Problem
Constructing ESEARCH results freezes arrays supplied by the caller. Reusing or appending to those arrays later raises FrozenError, even though the result only needs an immutable snapshot.
Prepared atomic commit 1b7b62dff2cbb5bb9cf111cce7b6e7f786665724 duplicates array inputs before freezing them, preserving result immutability without taking ownership of caller state. Dual-Ruby suites and focused mutable/frozen/reused-input models pass; package and Rails checks pass. No repository tests were modified.
Problem
Constructing ESEARCH results freezes arrays supplied by the caller. Reusing or appending to those arrays later raises
FrozenError, even though the result only needs an immutable snapshot.Prepared atomic commit
1b7b62dff2cbb5bb9cf111cce7b6e7f786665724duplicates array inputs before freezing them, preserving result immutability without taking ownership of caller state. Dual-Ruby suites and focused mutable/frozen/reused-input models pass; package and Rails checks pass. No repository tests were modified.