Commit e953fa5
format: a JSON document can be minified or indented (#84)
* format: a JSON document can be minified or indented
json gains a formatting setting taking record-per-line, minified or indented,
with the layout literals held on a style so the arithmetic that hits an exact
byte count measures whichever one is in use rather than predicting it. The
default is the layout this format has always written, pinned by two new golden
values.
The measurement that shaped this is a negative one: no reader can tell the
three apart. The same records minified, one per line, indented by two and
indented by four all parse in CPython's json and in V8. So the value of the
setting is entirely outside the parser - a minified document of any size is one
line and ends without a newline, an indented one holds about a third fewer
records in the same bytes - and the structural checker has to be TOLD which
layout to expect, for the reason the CSV dialect is told.
That immediately falsified what the existing checker said about itself. It read
"the manifest states one record per line" and counted lines against it, so both
new layouts would have broken it. The sentence was not wrong - it stopped being
true the day the layout became something a person can ask for.
Each layout answers for its own floor: 216 B minified, 219 B a record per line,
318 B indented. The registry declares the default layout's, the generator
answers for the rest, and the refusal names the layout it is about because the
same size is legal in another.
The canary is the half that makes the rest mean anything: a checker handed a
file and the RIGHT layout name would pass even if it ignored the name, so the
guard hands it every wrong one instead. Six pairs, six refusals.
Six mutations, all caught - including one already in the list that this
refactor had staled, which staleness.py found rather than a reader.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix: say out loud that the window offers the JSON layout setting
The engine gained property:json.formatting and neither parity list named it, so
TestEveryEngineCapabilityIsClassifiedForBothSurfaces refused the run on all four
jobs. That is the guard doing its job: a setting reaching the engine without
anybody answering whether the window offers it is exactly the drift D1 forbids.
The bar for the reachable list is two things rather than one - a control on the
screen, and a guard that presses it and finds the value on the other side - and
both were measured before the name went in. The field is drawn from the
declaration and nothing else, the menu opens on its declared default and is
named among the twenty that do, and the path from a field to the manifest is
pinned by the guard that types a value and reads it back off the disk.
One thing was worth asking rather than assuming. The window sends every setting,
because a menu cannot be empty, so a run started there says record-per-line out
loud where the command line says nothing at all. Those two have to be one file,
and the guard that pins them already exists.
D1 parity: 114 of 125 capabilities reachable from the window, eleven still to go.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent be665f5 commit e953fa5
11 files changed
Lines changed: 538 additions & 73 deletions
File tree
- internal
- format/jsonfile
- guard
- testdata
- oracle
- web/public
- formats
- pl/formaty
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
86 | 101 | | |
87 | 102 | | |
88 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
480 | | - | |
| 480 | + | |
| 481 | + | |
481 | 482 | | |
482 | 483 | | |
483 | 484 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | 41 | | |
46 | 42 | | |
47 | 43 | | |
| |||
54 | 50 | | |
55 | 51 | | |
56 | 52 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | 53 | | |
77 | 54 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | 55 | | |
86 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
87 | 61 | | |
88 | 62 | | |
89 | 63 | | |
| |||
95 | 69 | | |
96 | 70 | | |
97 | 71 | | |
98 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
99 | 78 | | |
100 | 79 | | |
101 | 80 | | |
| |||
107 | 86 | | |
108 | 87 | | |
109 | 88 | | |
110 | | - | |
111 | | - | |
112 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
113 | 93 | | |
114 | 94 | | |
115 | 95 | | |
116 | 96 | | |
117 | 97 | | |
118 | 98 | | |
119 | 99 | | |
120 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
121 | 104 | | |
122 | 105 | | |
123 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
124 | 112 | | |
125 | 113 | | |
126 | 114 | | |
127 | 115 | | |
128 | 116 | | |
129 | | - | |
130 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
131 | 121 | | |
132 | 122 | | |
133 | 123 | | |
| |||
136 | 126 | | |
137 | 127 | | |
138 | 128 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
143 | 133 | | |
144 | 134 | | |
145 | 135 | | |
146 | 136 | | |
147 | | - | |
| 137 | + | |
148 | 138 | | |
149 | 139 | | |
150 | 140 | | |
| |||
154 | 144 | | |
155 | 145 | | |
156 | 146 | | |
157 | | - | |
| 147 | + | |
158 | 148 | | |
159 | 149 | | |
160 | 150 | | |
161 | 151 | | |
162 | | - | |
| 152 | + | |
163 | 153 | | |
164 | 154 | | |
165 | 155 | | |
166 | | - | |
167 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
168 | 162 | | |
169 | 163 | | |
170 | 164 | | |
171 | 165 | | |
172 | 166 | | |
173 | 167 | | |
174 | | - | |
| 168 | + | |
175 | 169 | | |
176 | 170 | | |
177 | 171 | | |
| |||
211 | 205 | | |
212 | 206 | | |
213 | 207 | | |
214 | | - | |
| 208 | + | |
215 | 209 | | |
216 | | - | |
| 210 | + | |
217 | 211 | | |
218 | | - | |
| 212 | + | |
219 | 213 | | |
220 | 214 | | |
221 | | - | |
| 215 | + | |
222 | 216 | | |
223 | 217 | | |
224 | 218 | | |
225 | 219 | | |
226 | 220 | | |
227 | 221 | | |
228 | | - | |
| 222 | + | |
229 | 223 | | |
230 | 224 | | |
231 | 225 | | |
232 | 226 | | |
233 | 227 | | |
234 | | - | |
235 | | - | |
| 228 | + | |
| 229 | + | |
236 | 230 | | |
237 | | - | |
| 231 | + | |
238 | 232 | | |
239 | | - | |
| 233 | + | |
240 | 234 | | |
241 | | - | |
| 235 | + | |
242 | 236 | | |
243 | | - | |
| 237 | + | |
244 | 238 | | |
245 | 239 | | |
246 | 240 | | |
247 | | - | |
| 241 | + | |
248 | 242 | | |
249 | 243 | | |
250 | 244 | | |
251 | 245 | | |
252 | | - | |
| 246 | + | |
253 | 247 | | |
254 | | - | |
| 248 | + | |
255 | 249 | | |
256 | 250 | | |
257 | 251 | | |
| |||
281 | 275 | | |
282 | 276 | | |
283 | 277 | | |
284 | | - | |
285 | | - | |
286 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
287 | 281 | | |
288 | 282 | | |
289 | 283 | | |
| |||
0 commit comments