Commit b110578
* fix(metadata): collapse four isoFromValidDate call sites onto the shared canonical-ISO spelling (#16422)
WIP checkpoint before the verification lap.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XTBcV7zZHmokdyQgXjbyEU
* fix(metadata): collapse four isoFromValidDate call sites onto the shared canonical-ISO spelling (#16422)
The per-site `isoFromValidDate` helper rewrote exactly one shape (a valid JS
`Date` becomes ISO text) and handed every other input back untouched, so four
adapter boundaries fed a `null`, a `number`, an opaque column and an Invalid
`Date` into fields declared `z.string()` / `z.string().datetime()`, each behind
an `as string` cast asserting the opposite. Measured over the seven inputs that
distinguish the two helpers, the declared schemas refused 21 of 35 values.
Those four sites now read `canonicalIsoInstant`, whose return type IS
`string | undefined`, so all four casts are deleted rather than restated, and
both sibling definitions of the retired helper are gone. The terminal value is
chosen per site from that site's declared schema: `undefined` for the two
`.optional()` fields on `MetadataRecord`, and the epoch (`recordedAtFallback`)
for the REQUIRED `MetadataHistoryRecord.recordedAt`, which had no legal answer
at all before this change. Refusals over the same inputs: 21 -> 8.
`listCommits` in metadata-protocol keeps its copy on purpose — it promises
callers the RAW value back, and the shared spelling would erase an Invalid
`Date` from the response and reorder the commit timeline. That site is
byte-identical on all seven inputs. `SqlDriver`'s same-named helper takes
`Date`, not `unknown`, and is the producer-side fold ADR-0053 D-F3 governs; it
is not part of this family and is untouched.
The three neutrality pins are dispositioned individually: two rewritten as
ruled pins, the `listCommits` one kept verbatim because its behaviour did not
move. A fourth section the card did not name (`database-loader-14078`'s
composition pin) is rewritten too, and records the one composed behaviour that
changed: `stat()`'s `updatedAt ?? createdAt` now falls through for an
unreadable `updated_at`, publishing a stored `created_at` instead of a
fabricated `new Date()`.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XTBcV7zZHmokdyQgXjbyEU
* chore(changeset): regrade @objectstack/metadata to minor for the stat() answer change (#16422)
Seat ruling on the delivery: the `patch` argument holds for the four repaired
sites — those change only values `MetadataRecordSchema` /
`MetadataHistoryRecordSchema` already refused, so nothing a consumer
legitimately received has moved. It does not cover `DatabaseLoader.stat()`.
A row with an unreadable `updated_at` and a good `created_at` previously
published `new Date().toISOString()` as its `mtime`, and that answer was LEGAL —
it satisfies `MetadataStats.mtime`'s `z.string().datetime()`, and the
pre-existing pin asserted exactly that. So that site is not the repair of a
violation; it is one legal published answer replaced by a different legal
published answer on a published read verb, which the ladder puts at `minor`.
The level is per package, so the four repaired sites ride along.
`@objectstack/metadata-protocol` stays `patch`: `rowToEvent` only stops emitting
values `MetadataEventSchema` refused, and `listCommits` is byte-identical on all
seven probe inputs.
Front-matter and prose are moved together — the body now states which site
carries the level, why the old answer was legal, and why the sibling package
does not take it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XTBcV7zZHmokdyQgXjbyEU
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 0f38ab0 commit b110578
9 files changed
Lines changed: 493 additions & 212 deletions
File tree
- .changeset
- packages
- metadata-protocol/src
- metadata/src/loaders
| 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 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
Lines changed: 19 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
59 | 68 | | |
60 | 69 | | |
61 | 70 | | |
| |||
180 | 189 | | |
181 | 190 | | |
182 | 191 | | |
183 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
184 | 198 | | |
185 | 199 | | |
186 | 200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1811 | 1811 | | |
1812 | 1812 | | |
1813 | 1813 | | |
1814 | | - | |
1815 | | - | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
1816 | 1817 | | |
1817 | 1818 | | |
1818 | 1819 | | |
1819 | 1820 | | |
1820 | 1821 | | |
1821 | | - | |
1822 | | - | |
1823 | | - | |
1824 | | - | |
1825 | | - | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
1826 | 1841 | | |
1827 | 1842 | | |
1828 | 1843 | | |
| |||
1837 | 1852 | | |
1838 | 1853 | | |
1839 | 1854 | | |
1840 | | - | |
1841 | | - | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
1842 | 1858 | | |
1843 | 1859 | | |
1844 | 1860 | | |
| |||
Lines changed: 56 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
64 | 70 | | |
65 | 71 | | |
66 | 72 | | |
| |||
250 | 256 | | |
251 | 257 | | |
252 | 258 | | |
253 | | - | |
| 259 | + | |
254 | 260 | | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
262 | 279 | | |
263 | | - | |
| 280 | + | |
264 | 281 | | |
265 | 282 | | |
266 | | - | |
| 283 | + | |
267 | 284 | | |
268 | 285 | | |
269 | 286 | | |
270 | 287 | | |
271 | 288 | | |
272 | 289 | | |
273 | | - | |
274 | | - | |
275 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
276 | 310 | | |
277 | 311 | | |
278 | 312 | | |
0 commit comments