Skip to content

fix(turn): retain original numeric values in journal persistence - #7657

Closed
loopx-agent wants to merge 1 commit into
mainfrom
codex/turn-journal-source-json
Closed

loopx-agent wants to merge 1 commit into
mainfrom
codex/turn-journal-source-json

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Python-origin Turn journals passed through JavaScript JSON serialization before persistence. This changed 1.0 to 1, 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.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant