Commit 48a3549
test(service-settings): scan every carrier extension in the shared-predicate ratchet (#18269)
Fixes #15610
Clause-②: no
The shared-predicate ratchet walked `.ts` files only, so a membership
table carried in a
`.json` file was never opened. This admits every carrier extension the
toolchain follows
and adds the scope half the shape scans never had.
## The green-while-broken state, reproduced first
The card's specimen, rebuilt and measured on this branch's base before
anything was
changed: 249 ISO 3166-1 alpha-2 codes as a JSON array at
`packages/services/service-settings/src/zz-alpha2.json`, imported by the
door's CALLER
(`import ALPHA2 from './zz-alpha2.json' with { type: 'json' }` in
`settings-service.ts`)
and judging `iso_3166_alpha2` itself at the `validatePatch` refusal,
falling through to
`firstRejectedDomainMember` for the other two domains.
| instrument | reading with the specimen in the tree |
|---|---|
| `value-domains.shared-predicate.pin.test.ts` | **7 passed (7)** |
| `settings-service.test.ts` | **139 passed (139)** |
| `tsc --noEmit` | exit **0** |
| `tsup` build | exit **0** |
It was live code, not decoration: deleting `CH` from the JSON turned
exactly **2 of 139**
behavioural cases red — the two that write an accepted country through
the save path — so
the second definition really was deciding the `value_domain` FieldError.
## What the strengthened ratchet does to it
Same specimen, same command, on this PR's commit:
```
AssertionError: zz-alpha2.json carries an array-literal alpha-2 code list: expected true to be false
Tests 1 failed | 7 passed (8)
```
Nothing but the file's extension was missing — the existing `ARRAY`
shape catches a JSON
array of quoted codes on its current spelling once the walk opens the
file.
## Each admitted carrier measured separately
One carrier on disk at a time, because a single run with several aborts
at the first
assertion and names only one file:
| carrier placed in `src/` | ratchet | file named in the failure |
|---|---|---|
| `zz-alpha2.mts` | exit 1 — 1 failed / 7 passed | yes |
| `zz-alpha2.cts` | exit 1 — 1 failed / 7 passed | yes |
| `zz-alpha2.js` | exit 1 — 1 failed / 7 passed | yes |
| `zz-alpha2.mjs` | exit 1 — 1 failed / 7 passed | yes |
| `zz-alpha2.cjs` | exit 1 — 1 failed / 7 passed | yes |
| `zz-alpha2.json` | exit 1 — 1 failed / 7 passed | yes |
| `zz-alpha2.md` (control — not a carrier) | exit 0 — 8 passed | n/a |
| `zz-alpha2.test.ts` (control — evidence, not enforcement) | exit 0 — 8
passed | n/a |
`.mts` and `.cts` are the two the card records as never separately
measured. They are
measured here, and so are the three JS spellings: the argument is about
what the bundler
opens, not about which language the table is typed in. The two controls
are what keep the
admission list a LIST — a walk that reported on prose or on test
evidence would be a
different and worse instrument.
## Which of the three blind spots this closes, and which it does not
1. **`runtimeSources()` reading `*.ts` only — CLOSED.** The walk admits
`.ts .mts .cts .js
.mjs .cjs .json`, and the test exclusion is spelled per stem so it
covers each. Six
separate red measurements above.
2. **The import-surface pin reading the door only — PARTIALLY CLOSED,
and deliberately
not in the door's shape.** No caller-side whitelist is possible:
`settings-service.ts`
legitimately imports dozens of modules, so there is no one-specifier
assertion to make
against it. What is closable is the SCOPE of the scans that do cover
callers, and that
is the eighth assertion this PR adds — no runtime source may relatively
name a module
the walk does not open, so a carrier one directory above `src/` cannot
hide the way the
`.json` carrier hid behind an extension. A table reached by a BARE
package specifier
stays outside both pins, for the door and the caller alike; it was
already in the
NOT-covered list and stays there.
3. **The caller carrying no dense two-letter run because its table lives
in the `.json` —
CLOSED for a carrier inside this package, which is the measured
specimen; NOT a general
close.** The density scan still sees only what the walk opens, so the
table is now found
where it LIVES rather than where it is consulted. A caller consulting a
table that lives
outside this package remains uncovered, and a table in a shape no scan
knows — the
object-key map, now including its JSON spelling `{ "AD": 1, … }` — is
still the
documented three-character-separator class. The header says both.
1 parent e909148 commit 48a3549
1 file changed
Lines changed: 106 additions & 8 deletions
File tree
- packages/services/service-settings/src
Lines changed: 106 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
| |||
48 | 53 | | |
49 | 54 | | |
50 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
51 | 67 | | |
52 | 68 | | |
53 | 69 | | |
| |||
88 | 104 | | |
89 | 105 | | |
90 | 106 | | |
91 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
92 | 115 | | |
93 | 116 | | |
94 | 117 | | |
| |||
99 | 122 | | |
100 | 123 | | |
101 | 124 | | |
102 | | - | |
| 125 | + | |
103 | 126 | | |
104 | 127 | | |
105 | 128 | | |
| |||
117 | 140 | | |
118 | 141 | | |
119 | 142 | | |
120 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
121 | 176 | | |
122 | 177 | | |
123 | 178 | | |
124 | 179 | | |
125 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
126 | 185 | | |
127 | 186 | | |
128 | 187 | | |
129 | 188 | | |
130 | 189 | | |
131 | 190 | | |
132 | 191 | | |
133 | | - | |
134 | | - | |
| 192 | + | |
135 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
136 | 198 | | |
137 | 199 | | |
138 | 200 | | |
| |||
218 | 280 | | |
219 | 281 | | |
220 | 282 | | |
221 | | - | |
222 | | - | |
223 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
224 | 292 | | |
225 | 293 | | |
226 | 294 | | |
| |||
248 | 316 | | |
249 | 317 | | |
250 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
251 | 349 | | |
0 commit comments