Commit bda6da7
committed
fix: frame JSONL index reads on LF, not str.splitlines()
Four readers of the per-Goal run index frame it with `str.splitlines()`
(`history.py::repair_index_duplicates`, `run_index_rebuild.py::read_index_rows`,
`pending_intent.py::_actual_work_window`,
`monitor_poll.py::_find_monitor_poll_turn`). The index is written with
`json.dumps(..., ensure_ascii=False)`, which keeps U+0085, U+2028 and U+2029
inside a value verbatim — and `str.splitlines()` treats all three as line
breaks. A record holding one in a text field arrives as two fragments, both
fail `json.loads`, and the row is silently dropped.
Frame on LF instead. A trailing `\r` from a CRLF file stays harmless because
JSON treats it as whitespace.
Reproduced before the change: one record containing U+0085 yields zero parsed
rows; after it yields the record intact. The new test fails on
`read_index_rows` when only that function is reverted to `splitlines()` and
passes with the fix.
Validation: `pytest -q tests/control_plane/test_run_index_jsonl_framing.py` ->
2 passed; `ruff check` on the five files reports `All checks passed!`.
Signed-off-by: kokokoXUY <13682395396@163.com>
Rebased onto current main.
Rebased onto current main.
Rebased edit-on-current-main: the previous head copied whole files from an older
base and reverted upstream changes in them; this head applies only our edit to
current main.1 parent b9a34c3 commit bda6da7
5 files changed
Lines changed: 44 additions & 4 deletions
File tree
- loopx
- capabilities/periodic_report
- control_plane
- quota
- runtime
- tests/control_plane
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
760 | 760 | | |
761 | 761 | | |
762 | 762 | | |
763 | | - | |
| 763 | + | |
764 | 764 | | |
765 | 765 | | |
766 | 766 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
390 | | - | |
| 390 | + | |
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
725 | 725 | | |
726 | 726 | | |
727 | 727 | | |
728 | | - | |
| 728 | + | |
729 | 729 | | |
730 | 730 | | |
731 | 731 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
0 commit comments