Repository navigation
Commit dda71aa
authored
Make export reports byte-deterministic (#701)
## Summary
- serialize component export reports as explicit UTF-8 bytes with LF
endings
- reuse the byte serializer for GGUF reuse package metadata
- simulate Windows text newline translation in a platform-independent
regression
## Root cause
`ComponentExportReport.write_json()` used `Path.write_text()`. Windows
text mode translated the serializer's LF characters to CRLF, so
persisted `export_report.json` bytes differed from the deterministic
serializer and package hashes varied by platform.
## Tests
- `python -m pytest src/mobius/_model_package_test.py -q --tb=short` (90
passed)
- `lintrunner f --output oneline src/mobius/_export_report.py
src/mobius/_model_package.py src/mobius/_model_package_test.py`
- `git diff --check`
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Copilot-Session: 43bb31ac-c136-44bc-8cdf-70cbcedd4a421 parent dcf8bab commit dda71aa
3 files changed
Lines changed: 26 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
309 | 313 | | |
310 | | - | |
311 | | - | |
| 314 | + | |
| 315 | + | |
312 | 316 | | |
313 | 317 | | |
314 | 318 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
650 | 650 | | |
651 | 651 | | |
652 | 652 | | |
653 | | - | |
654 | | - | |
655 | | - | |
| 653 | + | |
656 | 654 | | |
657 | 655 | | |
658 | 656 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
274 | 275 | | |
275 | 276 | | |
276 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
277 | 296 | | |
278 | 297 | | |
279 | 298 | | |
| |||
0 commit comments