Commit 8d18b40
committed
refactor(parsers): switch fixture format from JSON to YAML
Convert the 7 PARSER.batch fixture files from JSON to YAML so the
multi-line `model_text` field reads as the actual wire format
instead of a `\n`-escaped one-liner. Same data, more readable
during PR review:
- XML-style families (qwen3_coder, kimi_k2, glm47, harmony) get
proper line breaks via YAML literal block scalars (`|-`).
- DeepSeek embedded-JSON args lose the escaped-quote noise
(`{\"location\":\"NYC\"}` -> `{"location":"NYC"}`).
- Special tokens (`|` U+FF5C, `▁` U+2581) still round-trip
literally via `allow_unicode=True`.
Mechanical changes:
- `regenerate_fixtures.py`: dump via PyYAML with a custom string
presenter that picks block-scalar style for multi-line strings.
Test pass: 111 passed / 90 skipped / 9 xfailed (unchanged from
the JSON baseline). `--overwrite-if-exists` round-trip is
byte-stable.
- `test_parity_parser.py`: load via `yaml.safe_load`; glob shifts
from `*.json` to `*.yaml`.
- README: schema example reframed in YAML; mentions JSON only
where it refers to wire-format JSON (tool-call args), not the
fixture format.
- Fix a pre-existing bug in `regenerate_fixtures.py` where
`FIXTURES_ROOT = Path(__file__).parent` wrote outputs one level
above the canonical `fixtures/` tree. Now writes back to
`fixtures/`.
PyYAML is already an ambient runtime dep; no new top-level
requirement. Eventual Rust harness can use `serde_yaml` (already
present transitively via `kube-client`).
Signed-off-by: Keiven Chang <[email protected]>1 parent 55eab8e commit 8d18b40
17 files changed
Lines changed: 1112 additions & 2024 deletions
File tree
- tests/parity
- parser
- fixtures
- deepseek_v3_1
- glm47
- harmony
- kimi_k2
- minimax_m2
- nemotron_deci
- qwen3_coder
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
140 | 139 | | |
141 | 140 | | |
142 | | - | |
143 | | - | |
144 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
145 | 145 | | |
146 | | - | |
147 | | - | |
148 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
149 | 151 | | |
150 | | - | |
| 152 | + | |
151 | 153 | | |
152 | 154 | | |
153 | 155 | | |
| |||
259 | 261 | | |
260 | 262 | | |
261 | 263 | | |
262 | | - | |
| 264 | + | |
263 | 265 | | |
264 | 266 | | |
265 | 267 | | |
| |||
271 | 273 | | |
272 | 274 | | |
273 | 275 | | |
274 | | - | |
| 276 | + | |
275 | 277 | | |
276 | 278 | | |
277 | 279 | | |
| |||
281 | 283 | | |
282 | 284 | | |
283 | 285 | | |
284 | | - | |
| 286 | + | |
285 | 287 | | |
286 | 288 | | |
287 | 289 | | |
| |||
302 | 304 | | |
303 | 305 | | |
304 | 306 | | |
305 | | - | |
| 307 | + | |
306 | 308 | | |
307 | 309 | | |
308 | 310 | | |
| |||
326 | 328 | | |
327 | 329 | | |
328 | 330 | | |
329 | | - | |
| 331 | + | |
330 | 332 | | |
331 | 333 | | |
332 | 334 | | |
| |||
0 commit comments