Commit 9cdffbe
feat(spec,driver-sql,cli): one physical representation for the NUMERIC column family, read by all three producers (#16887)
* wip: inherited unverified draft from the predecessor session (#16318)
The container restart that killed the previous os-dev left this in the
worktree, uncommitted. Committed verbatim so it is not the only copy;
every number in it is re-measured before anything is claimed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADLdAs2pVcH17h9tZKWMBg
* feat(spec,driver-sql,cli): one per-field-type physical representation for the NUMERIC column family
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADLdAs2pVcH17h9tZKWMBg
* fix(driver-sql): the numeric read coercion runs on every dialect
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADLdAs2pVcH17h9tZKWMBg
* test(spec,driver-sql,cli): pin the numeric representation on all three producers
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADLdAs2pVcH17h9tZKWMBg
* test(cli): the multiple-JSON pin takes NOT NULL from storage.notNull (ADR-0113)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADLdAs2pVcH17h9tZKWMBg
* chore(spec): regenerate api-surface and export-origins for the numeric column table
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADLdAs2pVcH17h9tZKWMBg
* chore: changeset for the numeric column representation table
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADLdAs2pVcH17h9tZKWMBg
* fix(docs,driver-sql,spec): the numeric column's documentation, its live-dialect pins and the read-path bound
The protocol doc stated the opposite of the DDL this branch emits, and three
claims the branch makes had no instrument behind them.
- content/docs/protocol/objectql/types.mdx: `number`, `currency` and `percent`
said "a floating-point column (REAL / FLOAT)" and the type-conversion matrix
said `REAL` / `FLOAT` / `REAL` for the family and for `summary`. All of it now
states the exact-decimal column, the "new columns only" bound, and the SQLite
and per-dialect `rating` consequences, with `slider` / `progress` / `rating`
given rows the matrix never carried.
- packages/spec/src/api/sortability.zod.ts (and its generated
content/docs/references/api/sortability.mdx): the `summary` fossil said
"an engine-maintained `table.float`".
- packages/services/service-analytics/src/measure-result-type.ts: the same
fossil, as the reason `summary` needs no correction. The reason is unchanged;
only the column it names moved.
New live-dialect cell (`sql-driver-16318-numeric-representation-live-dialects.test.ts`):
`numeric_precision` / `numeric_scale` read off the server's own catalog and
compared against the spec table, the `typeof === 'number'` read that SQLite
cannot exercise, and `rating`'s fractional disposition asserted PER DIALECT —
PostgreSQL refuses, MySQL rounds. The PG half was executed against a live
PostgreSQL 16.13; the MySQL half runs in the "Temporal Conformance (live PG +
MySQL)" job.
`formatOutput`'s numeric read coercion is scoped per dialect. It reads the
authorable `NUMERIC_VALUE_TYPES` half on the server dialects and keeps the wider
`NUMERIC_SCALAR_TYPES` set on SQLite, where the legacy TEXT-affinity repair
lives. The aliases `integer` / `int` / `float` are how an external, introspected
column reaches the driver, and node-postgres hands `bigint` back as a string
precisely because it does not fit a JS double: coercing it would round above
2^53 on a table this change never created, outside the "new columns only" bound.
Changeset: `rating`'s two dialects stated separately, the residual bound
restated as "30 fractional digits are kept", the binary64 read seam named, and
the ADR-0087 disposition argued positively instead of resting on the detector
miss the gate's own docblock warns about.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018rzQyhLGC5iVs11V3TzRs5
* docs(spec): state the residual bound the changeset states, and point the ADR-0087 marker at the right bullet
F1 — `packages/spec/src/data/numeric-column-representation.ts`'s "residual
bound" section said only that magnitudes below 1e-30 round to zero, while the
shipped changeset states the column keeps 30 fractional digits, that precision
loss BEGINS around |x| < 1e-13 and is TOTAL below 1e-30, and that magnitudes at
or above 1e35 are refused. That docblock is the canonical home both
`sql-driver.ts` and `os generate migration` point readers at ("the spec module
carries the measurements, the ruling and the residual bound"), and it says of
itself that the bound is "stated here so no reader has to rediscover it" — so
it now states both ends of the bound in the changeset's own terms.
F2 — `.changeset/numeric-column-representation.md` said "Three consequences"
above four bullets, and its ADR-0087 marker claimed "bullet 3 IS a
prescription" where bullet 3 is the read-seam bullet and the prescription is
bullet 4 (the `NOT NULL` / `storage.notNull` one). The marker is the auditable
artifact the gate prints verbatim, so a wrong internal pointer defeats its
purpose. Exactly one `adr-0087:` marker, same category and same argument.
Docblock and changeset prose only: no behaviour change, no schema move, no
test edit.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Js5kTpTtxieBjPyScgxJ3
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 07150b3 commit 9cdffbe
16 files changed
Lines changed: 1421 additions & 76 deletions
File tree
- .changeset
- content/docs
- protocol/objectql
- references/api
- packages
- cli/src/commands
- drivers/driver-sql/src
- services/service-analytics/src
- spec
- api-surface
- export-origins
- src
- api
- data
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
266 | | - | |
267 | | - | |
268 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
269 | 279 | | |
270 | 280 | | |
271 | 281 | | |
| |||
309 | 319 | | |
310 | 320 | | |
311 | 321 | | |
312 | | - | |
313 | | - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
314 | 333 | | |
315 | 334 | | |
316 | 335 | | |
| |||
331 | 350 | | |
332 | 351 | | |
333 | 352 | | |
334 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
335 | 358 | | |
336 | 359 | | |
337 | 360 | | |
| |||
1174 | 1197 | | |
1175 | 1198 | | |
1176 | 1199 | | |
1177 | | - | |
| 1200 | + | |
| 1201 | + | |
1178 | 1202 | | |
1179 | 1203 | | |
1180 | 1204 | | |
1181 | 1205 | | |
1182 | 1206 | | |
1183 | 1207 | | |
1184 | 1208 | | |
1185 | | - | |
| 1209 | + | |
1186 | 1210 | | |
1187 | 1211 | | |
1188 | 1212 | | |
| |||
1209 | 1233 | | |
1210 | 1234 | | |
1211 | 1235 | | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
1212 | 1252 | | |
1213 | 1253 | | |
1214 | 1254 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
| |||
Lines changed: 23 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
219 | 233 | | |
220 | 234 | | |
221 | 235 | | |
| |||
0 commit comments