Commit 29c8d02
fix(migration-legacy): don't classify valid-JSON non-object lines as corrupt
`analyzeContextContent` documents `corrupt` as "every non-blank line
failed to parse" (disk damage / truncated write). But a line that
JSON.parse accepted yet was a scalar/array (e.g. `42`, `"hi"`, `[]`) hit
the object-shape `continue` before `hadParseableLine` was set, so a
context of all valid-JSON non-objects was misreported as `corrupt` and
surfaced as a migration failure instead of an empty/skipped session.
Mark the line as parseable as soon as JSON.parse succeeds, before the
shape check — matching the documented contract and the existing
"at least one line parses → empty" test intent. Genuinely truncated
lines still fail JSON.parse and remain `corrupt`.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 0e0baea commit 29c8d02
2 files changed
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
53 | 56 | | |
| 57 | + | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
173 | 181 | | |
0 commit comments