Commit f112a74
test(cli): mask comments in the nightly-tier readers of this package's own source, and derive the pins that bound a spelling (#18924)
Fixes #18520
Clause-②: no
The nightly-tier test files under `packages/cli/test/` that read this
package's own source
TEXT now read it through the shared mask
(`scripts/js-comment-mask.mjs`), and the pins that
bound a byte-exact SPELLING now bind a property derived from the source
instead. Every file
was judged on its own; the table below gives the rung and the reason per
file.
## The population, re-derived — no number inherited
**Predicate, stated:** a file under `packages/cli/test/` whose NAME puts
it in a nightly tier
(`scripts/nightly-tiers.mjs` — `*.e2e.test.*` / `*.live.test.*`, and
nothing else selects a
tier), which READS this package's own source text at test time, directly
or through a helper
under `test/helpers/` it imports. Evaluated over each file's local
import closure, on MASKED
text, so a read one module away still counts and a path named only in
prose does not.
| predicate | count | measured at |
|:--|--:|:--|
| card's: `test/*.e2e.test.ts` containing `readFileSync` | **26** |
reproduces exactly |
| card's: of those, importing the shared mask | **3** | reproduces
exactly — `serve-port-readback`, `published-entry-stderr-nonblocking`,
`run-dev-stderr-nonblocking` |
| claim's: `grep -rl readFileSync test/*.e2e.test.ts \| xargs grep -l
'src/'` | **20** | reproduces exactly |
| **mine** (above) — nightly-tier readers of this package's own source |
**15** | 12 raw, 3 already masked |
⭐ **20 and 15 are not a contradiction — they are two predicates, and the
delta is readable
both ways.** Eight files are in the claim's 20 and not in mine, three
are in mine and not in
its 20:
- **prose only** — `lint-eval-generator-load-envelope` matches `src/` in
a docblock sentence
and reads `/definitely/not/here.json`. This is the false positive the
dispatch predicted.
- **a temp fixture's `src/`, not ours** — `build-docs-step-count`,
`build-multi-package-artifact`,
`generate-skill`, `serve-publishes-bound-port` create `src/docs` or
`src/skills` inside a
scratch project and read `dist/objectstack.json` back.
- **another package's source** — `scaffold-emission-policy` reads
`packages/create-objectstack`'s
template `package.json`. JSON carries no comments, so no rung applies.
- **own source, but `bin/` not `src/`** —
`published-entry-stderr-nonblocking` (already masked)
and `run-dev-unbuilt-workspace` (raw). Both read a hand-written
published entry; the second is
in this PR, the first was already correct.
- **missed by the claim's grep, found by mine** —
`config-miss-stdout-purity` reads
`src/commands` through `test/helpers/config-miss-family.ts` and never
spells `src/` itself;
`invocation-loudness` and `serve-host-fallback-base` DO spell
`../src/...` but never read it
as text — they `symlink`/`execFile` it, so they are readers of a module,
not of prose.
## Rung per file
| file | reads | rung | what changed, and why that rung |
|:--|:--|:--|:--|
| `build-json-failure-conversions.e2e.test.ts` |
`src/commands/compile.ts` | **3 only** | Masked. Its `indexOf` ORDER
block (`declAt` / `tryAt` / `loadAt` / `normalizeAt`) is the #17633
shape verbatim — raw positions over a file whose docblocks name `await
loadConfig(`. ⛔ The six frozen integers are card #18894's and are
untouched here. |
| `build-json-failure-warnings.e2e.test.ts` | `src/commands/compile.ts`
| **3 only** | Masked, same fence — integers untouched. |
| `cloud-login-json-ndjson.e2e.test.ts` | `src/commands/cloud/login.ts`
| **3 + 2** | Masked; and the pin that subtracted ONE byte-exact line
from the `emitJson(` hits now partitions the call sites against
`emitRecord`'s own brace-matched body: outside must be empty, inside
must not be. |
| `login-json-ndjson.e2e.test.ts` | `src/commands/login.ts` | **3 + 2**
| Same conversion, same reason. |
| `login-json-noninteractive.e2e.test.ts` | `src/commands/login.ts` |
**3** | Masked only. Its `rl.question(` filter already binds a SHAPE
(does the line carry the abort signal), not a spelling — rung 2 has
nothing to convert. |
| `json-stdout-purity.e2e.test.ts` | `src/commands/**` | **3 + 2** |
Masked; and `toHaveLength(10)` demoted to a floor. The line above it
already binds the SET against the map a sibling nightly file drives, so
the integer was a second frozen copy of one fact. It stays as a floor
because it is the only guard on the vacuum both sides share. |
| `config-miss-stdout-purity.e2e.test.ts` | `src/commands/**` via helper
| **3** | ⭐ No edit in this file — its reader lives in
`test/helpers/config-miss-family.ts`, which this PR masks once for both
consumers. |
| `test/helpers/config-miss-family.ts` | `src/commands/**` | **3** |
Masked. Both discovery halves are regexes over command source and both
are satisfiable by prose: a docblock naming `json: Flags.boolean(`
beside a `utils/config.js` import invents a direct member; a
commented-out `export default class X extends Y` invents an alias. |
| `diff-usage-error-stream.e2e.test.ts` | `src/commands/**` | **3** |
Masked. This scan decides by LINE POSITION — writers above the first
`flags.json` read — which is the print-ORDER failure that opened this
card. Its `toBeGreaterThan(10)` population control was already a floor.
|
| `run-dev-unbuilt-workspace.e2e.test.ts` | `bin/run-dev.js` | **3** |
Masked. `exec` takes the FIRST match, so a docblock recording the old
`STDERR_DRAIN_STALL_MS` would be read as the shim's bound. Its sibling
over the other published entry already masks; this makes the pair
consistent. |
| `serve-app-anchored-optional-import.e2e.test.ts` |
`src/commands/serve.ts` | **1 + 2 + 3** | See below — five byte-exact
statement pins, rewritten. |
| `validate-json-failure-conversions.e2e.test.ts` |
`src/commands/validate.ts` | **3** | Masked, and the paragraph that
recorded the opposite decision is corrected rather than left false. |
| `validate-json-failure-warnings.e2e.test.ts` |
`src/commands/validate.ts` | **3** | Same. |
| `serve-port-readback` · `published-entry-stderr-nonblocking` ·
`run-dev-stderr-nonblocking` | own source | — | Already masked.
Untouched. |
### Rung 1 — where it applied, and where it did NOT
Rung 1 permits DELETING a nightly assertion when a per-PR sibling
already binds the same
thing. I searched for a sibling for every byte-exact subject in this
population and **opened**
the one I found:
- ✅ **Applied once.** `serve-app-anchored-optional-import` bound
`function importFromHost(specifier: string, hostRoot: string =
servedAppRootOrCwd())` — an
argument LIST, the #17725 shape exactly.
`src/commands/serve-cluster-host-resolution.test.ts`
is queue-tier (its name carries no `.e2e`, so `nightly-tiers.mjs` leaves
it in the per-PR run)
and binds that function's EXISTENCE, its module scope and its
uniqueness. So this PR does not
re-pin any of that here; what it keeps, because the sibling does not
bind it, is the DEFAULT —
read off the paren-matched parameter list.
- ⛔ **Did not apply anywhere else, and this is a measurement.**
`anchorServedApp` and
`servedAppRootOrCwd` appear in no other test in the package. The login
emitter contract
(`emitRecord`) appears in no queue-tier test at all. For
`warningsSoFar`, the queue-tier
`test/truncation-remainder-notices.test.ts` binds `'warnings:
warningsSoFar(),'` in
`compile.ts` — the CALL SITE, not the declaration and not the spread
ORDER these files pin,
and for `validate.ts` it binds different payload keys entirely. Not the
same thing, so
nothing was deleted on its account.
### `serve-app-anchored-optional-import` in detail
Five `toContain`/`toMatch` pins over whole statements of `serve.ts`, in
a file only the nightly
tier collects. Each now binds what it was written for:
| was | is |
|:--|:--|
| `toContain('const { configPath: absolutePath, configExists } =
anchorServedApp(args.config!);')` | exactly ONE `anchorServedApp(` call
site (the declaration excluded by the same `function` lookbehind the
per-PR sibling uses), and its ARGUMENT is `args.config!`. The
destructured local names are deliberately no longer bound. |
| `not.toMatch(/const absolutePath = path\.resolve\(process\.cwd\(\),
args\.config!\)/)` | the same negative as a SHAPE:
`path.resolve(process.cwd(), args.config` with whitespace tolerated. A
negative pin on one exact spelling passes for every respelling of the
defect. |
| `toContain('function importFromHost(specifier: string, hostRoot:
string = servedAppRootOrCwd())')` | the `hostRoot` parameter's DEFAULT,
read off the paren-matched parameter list. A third parameter or a
renamed `specifier` no longer reddens it. |
| `toContain('const hostRoot = servedAppRootOrCwd();')` and
`toContain('const root = hostRoot ?? servedAppRootOrCwd();')` | a
partition over every `const`/`let` host-root binding: at least two
exist, and none may be bound without resolving through
`servedAppRootOrCwd()`. |
| `toMatch(/^function servedAppRootOrCwd\(\): string \{$/m)` | exactly
one MODULE-SCOPE `function servedAppRootOrCwd(`, never indented, never a
`const`/`let`/`var`. The return-type annotation and the brace are not
the defect. |
## What the mask changed TODAY: nothing — and that is the measurement
Every converted reader was evaluated raw and masked over the same tree,
and every verdict is
identical. Masking is therefore behaviour-preserving now and protective
later — it did not
launder a stale pin green:
```
SAME json-stdout-purity/discoverFamily (the same command ids)
SAME config-miss-family/discover (the same 10 ids)
SAME diff-usage/offenders = []
SAME diff-usage/withJson count = 28
SAME emitJson call sites — login.ts = 1 cloud/login.ts = 1
SAME rl.question without signal — login.ts = []
SAME payloadLiterals — validate.ts = 7 compile.ts = 11
SAME order indexes — validate.ts / compile.ts (declAt/tryAt/loadAt/normalizeAt)
SAME serve.ts anchorServedApp / servedAppRootOrCwd sites
SAME run-dev STDERR_DRAIN_STALL_MS = "15_000"
```
⛔ `scripts/check-comment-mask-adoption.mjs` is green before and after
and its ledger is
unchanged at 14 rows — because none of these twelve files ever carried a
private stripper.
They carried NO masking at all, which is the blind spot the card names
and the gate documents.
This PR adds no private stripper; every file imports the shared module.
## Ablations
Each is a script with `trap` restore on `EXIT INT TERM`, absolute paths,
an on-disk occurrence
count proving the mutation landed, exit codes captured BEFORE any pipe,
and a restore proven by
`git hash-object` against the HEAD blob plus a clean `git status` for
both paths.
1 parent 54145cc commit f112a74
12 files changed
Lines changed: 352 additions & 51 deletions
File tree
- packages/cli/test
- helpers
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
407 | 408 | | |
408 | 409 | | |
409 | 410 | | |
410 | | - | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
411 | 419 | | |
412 | 420 | | |
413 | 421 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| |||
482 | 483 | | |
483 | 484 | | |
484 | 485 | | |
485 | | - | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
486 | 494 | | |
487 | 495 | | |
488 | 496 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
440 | 441 | | |
441 | 442 | | |
442 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
443 | 474 | | |
444 | | - | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
445 | 480 | | |
446 | 481 | | |
447 | 482 | | |
448 | 483 | | |
449 | 484 | | |
450 | 485 | | |
451 | 486 | | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
457 | 511 | | |
458 | | - | |
| 512 | + | |
459 | 513 | | |
460 | 514 | | |
461 | | - | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
462 | 519 | | |
463 | 520 | | |
464 | 521 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
227 | 228 | | |
228 | 229 | | |
229 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
230 | 238 | | |
231 | 239 | | |
232 | 240 | | |
233 | | - | |
| 241 | + | |
234 | 242 | | |
235 | 243 | | |
236 | 244 | | |
| |||
250 | 258 | | |
251 | 259 | | |
252 | 260 | | |
253 | | - | |
| 261 | + | |
254 | 262 | | |
255 | 263 | | |
256 | 264 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
138 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
139 | 146 | | |
140 | 147 | | |
141 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
140 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
141 | 147 | | |
142 | 148 | | |
143 | 149 | | |
| |||
233 | 239 | | |
234 | 240 | | |
235 | 241 | | |
236 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
237 | 257 | | |
238 | 258 | | |
239 | 259 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
388 | 389 | | |
389 | 390 | | |
390 | 391 | | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
391 | 422 | | |
392 | | - | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
393 | 428 | | |
394 | 429 | | |
395 | 430 | | |
396 | 431 | | |
397 | 432 | | |
398 | 433 | | |
399 | 434 | | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
405 | 459 | | |
406 | | - | |
| 460 | + | |
407 | 461 | | |
408 | 462 | | |
409 | | - | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
410 | 467 | | |
411 | 468 | | |
412 | 469 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
316 | 317 | | |
317 | 318 | | |
318 | 319 | | |
319 | | - | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
320 | 326 | | |
321 | 327 | | |
322 | 328 | | |
| |||
0 commit comments