Repository navigation
Commit 1fb36ca
test(lint): derive the list-view position-coverage criterion from the rule (#18876)
Fixes #18836
Clause-②: no
The test table's docblock claimed two directions and the assertion under
it carried one. This replaces the floor with a criterion derived from
the rule's own tables, and makes the docblock true.
## The premise, re-measured
Every reading below was taken on this branch's base, `origin/main`
`36583e989b` — the dispatch quoted `a43b9d0654`, this worktree branched
later, so the numbers were re-taken rather than inherited. They land in
the same place:
- docblock:
`packages/lint/src/validate-list-view-field-refs.test.ts:205-210`, still
word for word `a position added to the rule without a row here leaves
the count assertion below short`
- the assertion it points at: `:315`,
`expect(cases.length).toBeGreaterThanOrEqual(51)`
- `cases.length` at that commit: **52**
Both directions were measured by mutating the rule's `POSITIONS` table
on disk and running the rule's own test file. Each mutation proved
itself on disk (anchor count 1 before, 0 after; injected line count 1;
blob hash moved) and was restored under a trap, with `git diff HEAD`
proving the restore byte for byte.
| direction | mutation | before this PR | after this PR |
|---|---|---|---|
| one — a position **dropped** from the rule fails here | remove
`tree.labelField` | 1 failed / 129 passed | **2 failed** / 129 passed
(of 131) — the per-case assertion AND the new sibling assertion |
| two — a position **added** to the rule with no row here | add
`tree.ablationProbeField` | **130 passed, 0 failed** | **1 failed**,
`covers every position the rule walks`, diff names `-
"tree.ablationProbeField"` |
Direction two reported nothing at all: `cases.length` counts the rows of
the test table, which a position added to the rule never moves, so the
floor stayed true. That is the direction #18565 came in through. After
this PR the failing assertion is the completeness one, and its diff
names the offender (`- "tree.ablationProbeField"`).
Direction one is unchanged and still carried by the per-case assertions,
exactly as the docblock's first half says — the failing test both before
and after is `views[0].list.tree.labelField reports at warning`.
**A third reading the card did not claim.** The floor did not reliably
do even its own advertised job. Deleting one row from the table
(`tree.labelField`) on the base tree left **129 passed, 0 failed** — 52
rows against a floor of 51 is exactly one row of slack. The same
deletion after this PR is red, and the failing assertion is the
completeness one.
## Step 1 — does the new export reach a published entry?
`@objectstack/lint` is not private, `files` is `dist` / `README.md` /
`CHANGELOG.md`, and `exports` has `.` and `./runtime` — so `src/` does
not ship but `dist/` does. Re-measured on this base and it holds. Two
facts about the barrels: `src/index.ts` re-exports this module by NAME
(there is no `export *` in either barrel, count 0), and `src/runtime.ts`
does not reference the module at all.
Readings after `pnpm --filter @objectstack/lint build`, grepping
`dist/`. Bright control throughout: `validateListViewFieldRefs`, a
symbol known to ship.
**Shape measured first — `export const X = Object.freeze([...])`:**
| `dist/` file | new symbol | bright control |
|---|---|---|
| `index.js` | 1 | 3 |
| `index.cjs` | 1 | 4 |
| `runtime.js` | 1 | 2 |
| `runtime.cjs` | 1 | 2 |
| `index.d.ts` | 0 | 2 |
| `index.d.cts` | 0 | 2 |
| `runtime.d.ts` / `runtime.d.cts` | 0 | 0 |
| `runtime-DAPAkqcs.d.ts` / `.d.cts` | 0 | not present |
A raw count in a bundle body is not a published entry, so the export
layer was measured separately. In `dist/index.js`'s `export {}` clause:
new symbol 0, against 1 each for `validateListViewFieldRefs`,
`LIST_VIEW_FIELD_DOTTED` and `LIST_VIEW_FIELD_UNKNOWN`. In
`dist/index.cjs`'s `__export` map: new symbol 0, controls 1 each. Dark
control for that layer: `COLUMN_ENTRY_POSITIONS`, a module const the
rule has never exported, reads **2** in `index.js` and 2 in `index.cjs`
— a name in the bundle body is genuinely no evidence of a published
entry.
Under this shape four `dist` JS files moved bytes (esbuild keeps a
frozen initializer as dead weight); all four `.d.ts` / `.d.cts` files
were byte-identical.
**Shape shipped — `export function listViewWalkedPositions()`:** the
symbol is tree-shaken. 0 occurrences in all eight published files, while
the bright control still reads 3 / 4 / 2 with the same instrument on the
same files.
> 1 parent 84ba4a8 commit 1fb36ca
2 files changed
Lines changed: 213 additions & 25 deletions
Lines changed: 154 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
175 | 183 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
192 | 199 | | |
193 | | - | |
| 200 | + | |
| 201 | + | |
194 | 202 | | |
195 | 203 | | |
196 | 204 | | |
| |||
202 | 210 | | |
203 | 211 | | |
204 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
205 | 264 | | |
206 | 265 | | |
207 | 266 | | |
208 | | - | |
209 | | - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
210 | 270 | | |
211 | 271 | | |
212 | 272 | | |
| |||
305 | 365 | | |
306 | 366 | | |
307 | 367 | | |
308 | | - | |
309 | | - | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
310 | 389 | | |
311 | | - | |
312 | | - | |
313 | | - | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
314 | 414 | | |
315 | | - | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
316 | 445 | | |
317 | 446 | | |
318 | 447 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 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 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
485 | 544 | | |
486 | 545 | | |
487 | 546 | | |
| |||
0 commit comments