Commit 290dfc5
committed
fix(objectql): the value-shape detail prescribes the key rename, not the missing-pair type error
A value-shape rejection was read positionally (`parsed.error.issues[0]`) at both
sites that produce the operator-facing detail: the write path's warn-first /
strict branch, and the exported `valueShapeViolation` the `os migrate
value-shapes` scan imports. zod reports per-member issues before the
object-level `unrecognized_keys` one, so on a value whose keys were RENAMED the
actionable message sorts last and was discarded — a `location` stored as
`{latitude, longitude}` reported `expected number, received undefined` while
`LocationValueSchema`'s curated `aliases` map had already built the rename
prescription that edit distance cannot reach.
Both readers now share one helper that prefers the undeclared-key issue when the
rejection carries one. Scoped by a sweep of every class the two readers cover:
only `location` and `address` are backed by a key-closed object schema, so only
they can emit `unrecognized_keys` at all and the preference is a no-op for the
other fourteen types. The sweep also refuted the reason `address` looked immune
— all-optional members rule out a missing-member type error, not a wrong-typed
declared one — so a pin now covers that class too.
No verdict moves: the same values are flagged and the same writes rejected.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ARYe3yQTQCUFm5qPYNgKaJ1 parent c463d03 commit 290dfc5
4 files changed
Lines changed: 112 additions & 5 deletions
File tree
- .changeset
- packages/objectql/src/validation
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
490 | 531 | | |
491 | 532 | | |
492 | 533 | | |
| |||
792 | 833 | | |
793 | 834 | | |
794 | 835 | | |
795 | | - | |
| 836 | + | |
796 | 837 | | |
797 | 838 | | |
798 | 839 | | |
| |||
931 | 972 | | |
932 | 973 | | |
933 | 974 | | |
934 | | - | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
935 | 978 | | |
936 | 979 | | |
937 | 980 | | |
| |||
943 | 986 | | |
944 | 987 | | |
945 | 988 | | |
946 | | - | |
| 989 | + | |
947 | 990 | | |
948 | 991 | | |
949 | 992 | | |
| |||
1009 | 1052 | | |
1010 | 1053 | | |
1011 | 1054 | | |
1012 | | - | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
1013 | 1060 | | |
1014 | 1061 | | |
1015 | 1062 | | |
| |||
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
179 | 200 | | |
180 | 201 | | |
181 | 202 | | |
| |||
186 | 207 | | |
187 | 208 | | |
188 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
189 | 229 | | |
190 | 230 | | |
191 | 231 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
52 | 59 | | |
53 | 60 | | |
54 | 61 | | |
| |||
0 commit comments