Repository navigation
fix(turn): retain original numeric values in journal persistence - #7657
Closed
loopx-agent wants to merge 1 commit into
Closed
loopx-agent wants to merge 1 commit into
loopx-agent wants to merge 1 commit into
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
This was referenced Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Python-origin Turn journals passed through JavaScript JSON serialization before persistence. This changed
1.0to1, lost negative zero, and rounded large integers in captured evidence. The writer now carries the original JSON text through the same TypeScript transition, lifetime, effect and lock checks, then atomically publishes that validated text. Existing object callers keep their encoding; historical journals are not rewritten.Validation: four numeric cases fail on unchanged main; the repaired real Python→TypeScript→filesystem/replay cases pass. The affected Python journal/executor/recovery cohort passes 178 tests; 53 TypeScript journal/effect/query checks, typecheck, Ruff, public-boundary scan and standard local premerge pass. An additional 106 production native CLI capture/recovery checks pass locally with synthetic hosts. No live host installation or model run is involved.
Cost boundary: one RPC remains one RPC. In matched synthetic request parameters with an 8 KiB quoted/newline body, bytes grow from 9,837 to 11,002; at 64 KiB they grow from 71,708 to 80,418. Compact on-disk JSON is smaller, but escaping increases transport/memory cost and leaves less headroom under the unchanged 2 MiB request limit. This repairs source fidelity; it does not establish a latency or long-horizon cost benefit. A future compact numeric transport can be assessed separately without rewriting historical receipts or weakening validation.
This is an independently usable prerequisite for unified-contract recovery. It does not change canonical hash semantics or qualify controller/session cutover. Merge is left to a maintainer.