Commit 009e25d
refactor(types): burn ledger batch 1 — report/chart/query symbols stop wearing spec names (#3167)
Batch 1 of the objectstack#4115 debt ledger (objectui#3155): 11 `@object-ui/types`
collisions, triaged one by one against `@objectstack/spec` 17.0.0-rc.0. Ledger
115 -> 105; ALLOW 5 -> 6.
Six were pure name collisions — same name, different concept — so they are
renamed to local dialects. Each new name was run past the guard first
(objectui#3074's `PageComponentSchema` lesson) and is pinned absent from the
spec's export set:
ChartSeries -> ChartDataSeries (ours carries literal `data: number[]`;
ChartSeriesSchema -> ChartDataSeriesSchema spec's is a dataset-bound descriptor)
QueryAST -> SqlQueryAST (compiled SQL tree vs ObjectQL request)
QuerySchema -> DriverQueryConfig (TS config vs the spec's zod value)
DriverInterface -> SqlDriverInterface (SQL client vs runtime driver contract)
DatasourceSchema -> DatasourceRegistration (live record vs authored document)
Renames were done declaration-and-barrel first, letting tsc enumerate the break
points, never by global string replace — half these names exist on both sides.
Three are now DERIVED, converging on the `ListViewSchema` paradigm. Two carried
live defects, both of the silent-stripping kind a `z.object()` produces:
- DashboardWidgetSchema declared 10 of the spec's 22 keys, so `objectui
validate` deleted the other 12 in silence — chartConfig, colorVariant,
filter, responsive, aria, action{Url,Type,Icon}, compareTo, suppressWarnings
and the requiresObject/requiresService capability gates the renderer honours
at runtime. The TS interface declared most of them all along.
- GlobalFilterSchema took `scope` as a free-form string; it now uses the spec's
widget|dashboard vocabulary.
- AppContextSelectorSchema was a full restatement.
Every pinned divergence is one a runtime normalizer already backs, and each is
asserted in both directions so it dies the day the spec adopts it.
ListViewSchema resolves as a pair: the zod node now names the spec in its own
initializer instead of one hop away through a local const (which is why the
repo's own best-practice derivation was sitting in the ledger), and the TS twin
moves to ALLOW — the spec's `ListViewSchema` is a zod VALUE, so there is no spec
type to alias, and the objectui node intersects non-serialisable runtime props.
JoinedReportBlock is NOT burnable and stays in the ledger: the spec declares
`JoinedReportBlockSchema` as `z.ZodTypeAny`, so its exported type resolves to
`unknown` — re-exporting it would delete the block type outright. This is one
variant wider than the objectstack#4171 cases already pinned: those erase to
`any`, which `0 extends (1 & T)` detects, while this erases to `unknown`, which
that probe reports as safe. Guard header and an inverted pin now say so; it
belongs to ledger batch 8.
Verification: guard green; `--ledger` diff removes exactly these 10 and adds
nothing, other packages byte-identical; type-check 78/78 after rebuilding the
types dist; 9326 assertions across 798 files green; mutation-tested both ways
(hand-copying GlobalFilterSchema back and un-renaming SqlQueryAST each fail by
name and file, and the parity test fails alongside).
Claude-Session: https://claude.ai/code/session_015Jdef6ZFhJmiNRhNCd4DW3
Co-authored-by: Claude <noreply@anthropic.com>1 parent 10bead2 commit 009e25d
14 files changed
Lines changed: 666 additions & 209 deletions
File tree
- .changeset
- packages
- core/src/query
- __tests__
- types/src
- __tests__
- zod
- scripts
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
| 38 | + | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
| 332 | + | |
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | | - | |
| 339 | + | |
340 | 340 | | |
341 | 341 | | |
0 commit comments