Repository navigation
Commit 32e03d2
test(spec): six retirement walks skip generated json-schema, unmatched pattern runs and a repeated corpus walk (#23575)
Part of #23180
Clause-②: no
This round's claim (`6181109416`) covers seven `src/` retirement rows.
Six of them spent most of their time in one tree walk over `packages`,
`examples`, `skills`, `content` and `scripts`. This PR cuts that work
inside the walk. Every assertion is unchanged and no verdict changes.
Each of the six now takes about 1.0 to 1.8 s locally, down from 2.2 to
3.8 s. The seventh row, `compliance-families-retirement.test.ts`, is
left as it was: its floor is one case that imports the `system` barrel.
The diff is test files only: 6 files, +54 / -15. It adds or changes no
`expect(`, `it(` or `describe(` line (counted: 0). No production source
changes.
## Rows
All readings are local, taken through `scripts/pm/os-verify-lock.sh` on
a shared box, so they are shared-box seconds. The spec package was
built, so `packages/spec/json-schema/` was on disk, as it is in CI's
`Test Core`, which builds before it tests.
Command: `env -u AI_AGENT -u CLAUDECODE -u CLAUDE_CODE -u CURSOR_AGENT
NODE_OPTIONS=--max-old-space-size=4096 pnpm --filter @objectstack/spec
exec vitest run --project repo --maxWorkers=2 FILE --reporter=default
--reporter=json --outputFile.json=OUT`.
Each figure is the vitest module line: the sum of the file's case
durations, which is the number the battery records.
| row (card's CI reading) | before, 3 runs (ms) | after, 3 runs (ms) |
cases, every run | change | this PR |
|:--|:--|:--|--:|:--|:--|
| `src/api/rest-api-config-dead-keys-retirement.test.ts` (17.8 s) | 2744
/ 2794 / 2907 | 1263 / 1359 / 1465 | 23/23 | walk skips `json-schema/` |
targeted |
| `src/data/cube-member-inner-name-retirement.test.ts` (17.6 s) | 3509 /
3750 / 3730 | 1769 / 1730 / 1747 | 20/20 | walk skips `json-schema/` |
targeted |
| `src/qa/requires-plugins-retirement.test.ts` (12.4 s) | 2472 / 2923 /
2825 | 1293 / 1249 / 1324 | 4/4 | walk skips `json-schema/` | targeted |
| `src/shared/retired-key-migrate-sentence.test.ts` (12.1 s) | 3406 /
3493 / 3340 | 1087 / 986 / 994 | 15/15 | corpus read once | targeted |
| `src/integration/connector-resilience-keys-retirement.test.ts` (11.9
s) | 2565 / 2319 / 2368 | 1559 / 1556 / 1508 | 21/21 | required-literal
guard | targeted |
| `src/data/cube-refresh-key-retirement.test.ts` (11.9 s) | 2198 / 2232
/ 2187 | 1081 / 1097 / 1064 | 21/21 | required-literal guard | targeted
|
| `src/system/compliance-families-retirement.test.ts` (14.6 s) | 4193 /
4299 / 4423 | 4587 / 4338 / 4391 | 10/10 | none | left at its floor |
- Before: base `b57228913a`. The third before-run restored the base
content of the six files into the tree and then restored HEAD, proven by
an empty `git diff HEAD` and a clean porcelain.
- After: `2add893d1d`. One more run at the final head `4c48c63724` (that
commit merged with `origin/main` `7ffc57846a`, which touches no
`packages/spec` file) gave 1297 / 1831 / 1262 / 1028 / 1508 / 1128 ms in
the table's order, and compliance 4327 ms.
- The untouched compliance file is the box-load control: it reads the
same before and after.
### Why the dispatch's bar does not settle these rows
The dispatch's bar is a module line of 4 s or less on three runs, on the
assumption that CI is about 2x slower. All six rows already met that bar
BEFORE this change (the highest before-reading is 3750 ms), so for this
class the bar cannot tell a repaired row from an untouched one.
Measured against the card's own CI readings, this class runs 3.5x to
6.4x slower in the battery than here:
| row | CI / local median, before | after median × that ratio |
|:--|--:|--:|
| rest-api | 17.8 s / 2.79 s = 6.4x | 8.7 s |
| cube-member | 17.6 s / 3.73 s = 4.7x | 8.3 s |
| requires-plugins | 12.4 s / 2.83 s = 4.4x | 5.7 s |
| migrate-sentence | 12.1 s / 3.41 s = 3.5x | 3.5 s |
| connector-resilience | 11.9 s / 2.37 s = 5.0x | 7.8 s |
| cube-refresh | 11.9 s / 2.20 s = 5.4x | 5.8 s |
Every projection is under 10 s. The CI effect is NOT MEASURED. The
card's pin decides each row: the next refresh PR's list no longer names
the file. So this PR targets six rows and takes none off the card by
itself.
### `compliance-families-retirement.test.ts` is left as it was
- Its case "runtime namespace agrees with the compiler view" runs `await
import('./index')` on the `system` barrel. That case took 2915 to 3115
ms in all six runs, out of a module line of 4193 to 4587 ms.
- The barrel's import graph is 312 modules, about 87 beyond what the
file's static imports already load. So the cost is vitest's transform of
an import graph that is itself the test's subject. That is the mechanism
of #23534's second class, at the size of one domain barrel rather than
the whole package.
- Even with its walk (1052 to 1317 ms) at zero, the file projects to
about 10.5 s at its 3.4x ratio.
- Per the claim, it is reported with its floor and left as it is.
## The three changes, and why none changes a verdict
1. **The generated `json-schema/` tree, in three walks** (rest-api,
cube-member, requires-plugins).
- Each filesystem walk now lists `packages/spec/json-schema/` in
`EXCLUDED_PREFIXES`. The entry and its comment match the ones
`cube-refresh-key-retirement.test.ts` and
`connector-resilience-keys-retirement.test.ts` already carry.
- The tree is gitignored `gen:schema` output. The walk reached it only
because it walks the filesystem: turbo's input hashing never sees it,
and an unbuilt checkout does not have it.
- It is 1,537 files and 45.5 M chars. It was also most of what these
walks lexed: 34 to 39 M of the 62 to 67 M chars each one handed to its
character lexer.
- Of the 27 five-root filesystem or git walkers in `packages/spec`, 21
other files already exclude this tree or list through git.
2. **A required-literal guard** (connector-resilience, cube-refresh).
- Every alternative of every `AUTHORING` pattern requires a literal:
`refreshKey` in one file, a `LEAF_KEYS` or `NAMES` alternative in the
other.
- `judge()` now runs the patterns only when the stripped text holds one
of those literals. The patterns no longer run over every file.
- The guard reads the STRIPPED text, never the raw text, because
stripping an inline code span can join a literal.
- The connector list is derived from the same `LEAF_KEYS` and `NAMES`
strings the patterns are built from.
3. **The migrate-sentence corpus, read once.**
- Four cases call `judgeTree()` or `claimTree()`, and each call used to
walk, read and reconstruct all three corpora again: about 0.8 s each
time.
- The walk, read and reconstruct now happen once per file run. Every
case still runs its own judgement over that input.
- The exported `judgeMigrateSentences` and `findWithdrawnClaims` keep
their signatures and bodies. Each now delegates to an internal function
that takes the reconstructed text.
## Equivalence readings
The harnesses were instrumented copies placed next to each file and run
with `--project local -t ZZ-EQUIV`. All six were removed afterwards, and
the tree ended at porcelain 0. Nothing from them is committed.
- **cube-refresh.** The guarded and unguarded `judge()` were run over
every file in the radius with NO exclusions: 11,792 files, 270.6 M
chars. Both found 4 matches (the conversion registry, the batch-D pin,
the pin itself and the copy). Index and matched text agreed on every
file, with 0 differences.
- **connector-resilience.** The same comparison over 11,640 files: 3
matches each, 0 differences.
- **rest-api, cube-member, requires-plugins.** Each walk was run with
the base prefix list and with the new one.
- The new walk dropped exactly 1,537 files, all under
`packages/spec/json-schema/`. It dropped 0 files elsewhere and added 0.
- Offenders were identical both ways. Seen from the copy, the original
pin's own fixtures count as offenders, so this comparison is not
vacuous.
- Anti-vacuity counters, old to new: `bearing` 18 to 15 (floor 5);
`bagBearing` 286 to 273 (floor 20); `suites` 1 to 1 (floor 0); `visited`
about 11.5k to 10.0k (floor 1000).
- **migrate-sentence.** The old per-call walk and the shared corpus gave
182 judged sites each, 182 ok. The output was JSON-identical on all
three `judgeTree()` calls, and `claimTree()` was identical too (0
claims). The corpus is 1,498 files from the `spec`, `lint` and
`driver-turso` corpora.
## Ablations (one per semantic shortcut; each run through `node
scripts/ablation-replace.mjs`)
The expected direction was red each time, and each run went red. No
`dist/` is in any of these paths: the subjects live in the test files
themselves.
- **A1, cube-refresh guard.** `'refreshKey'` was changed to
`'refreshKeyZ'`. Anchor 1 to 0, blob `c958c19a5f55` to `e0251312a8ea`.
Vitest went 1 failed / 20 passed: the anti-vacuity case reported
`expected null not to be null`. The restore left the blob equal to HEAD
`c958c19a5f55`, with `git diff HEAD` empty.
- **A2, connector guard.** The `LEAF_KEYS` half of `AUTHORING_LITERALS`
was dropped. Anchor 1 to 0, blob `75b4db70535f` to `e00ed55551c0`.
Vitest went 1 failed / 20 passed: a leaf-key positive returned null. The
restore left the blob equal to HEAD, with `git diff HEAD` empty.
- **A3, corpus memo.** The memo was made to hand later callers
`corpusMemo.slice(0, 1)`. Anchor 1 to 0, blob `afb7e349b3ae` to
`d3352368d35f`. Vitest went 2 failed / 13 passed: `expected 0 to be
greater than or equal to 50`, and `lint: expected 0 to be greater than
or equal to 1`. The restore left the blob equal to HEAD, with `git diff
HEAD` empty.
- The withdrawn-claim case stayed green under the broken memo. The
anti-vacuity floors are what catch a memo that hands later cases less.
- **No ablation for the `json-schema/` exclusion.** It is a declared
narrowing of the population, not a shortcut inside it. Ablating it on
this tree is a no-op, because no offender lives in that directory. The
population reading above shows exactly what it removes.
## Publish
No published file changes, so `skip-changeset`. `pnpm pack` of
`@objectstack/spec` 18.0.0-next.1 gave 2,091 files, with 0 `*.test.ts`.
Files containing `AUTHORING_LITERAL`, `reconstructedCorpus`,
`corpusMemo`, `judgeReconstructed` and `withdrawnClaimsIn`: 0 each.
Positive controls: `RestApiConfigSchema` in 24 files, `retiredKey` in
180.
## Gates
All gates were run at the final head `4c48c63724`. Each exit code was
captured before any pipe.
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 76 commands. All 76 were run in
sequence.
- 74 exited 0.
- 2 are NOT MEASURED: `pnpm check:dual-build-cjs-loads` and `pnpm
check:lean-entry-closure` both exited 3 (PREREQUISITE NOT MET). They
load other packages' built `dist/` (hono, account, objectql), and only
spec, formula and lint were built here. Neither can read a test file. CI
runs both.
- The `--ran` verdict: `76 derived famil(ies) accounted for — 74 run, 2
NOT-MEASURED (2 DERIVED from a recorded exit 3)`, exit 0.
- `pnpm --filter @objectstack/spec typecheck` exited 0. Its
`check:test-typecheck` reported `52 file(s) / 246 error(s) / 135 pinned
signature(s) held`. `tsc -p tsconfig.test.json --listFilesOnly` lists
all six edited files, and none of them is in `test-typecheck-debt.json`.
- `eslint --no-inline-config` on the 6 files exited 0.
- Declared narrowing: the spec package's full `test` and `test:repo`
projects were not run locally, because they carry the 900 s and 493 s
rows. The seven claimed files were run, as above. CI runs both projects.
## Acceptance notes
- Three five-root filesystem walkers in `packages/spec` still read
`json-schema/`, and they are outside this claim.
`src/kernel/metadata-type-registry-allow-org-override-absence.test.ts`
is one of them, and it is another row on this card (11.4 s). The other
two are `src/contracts/record-share-guest-recipient-census.test.ts` and
`src/ui/view-data-api-provider-retirement.test.ts`. This is a cost
observation, not a defect, so no card is filed.
- One option was measured and not taken. Reading files as latin1 for the
ASCII prefilters, and decoding as UTF-8 only on a hit, cut the bare read
from about 1.05 s to 0.60 s per walk in a scratch benchmark. It would
make the three lexer walks a little faster, but it adds an encoding
argument to every reader. It is left for a later round, if the refresh
still lists rest-api or cube-member.
- This round's measurements were taken in the same session as the claim.
No CI log or artifact was readable from this container, because the blob
host is refused, so every CI number above is the card's.
---
_Generated by [Claude
Code](https://claude.ai/code/session_0121ooBYRmS8ziFXm9ai5YHm)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent c980d11 commit 32e03d2
6 files changed
Lines changed: 54 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
322 | 325 | | |
323 | 326 | | |
324 | 327 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
407 | 410 | | |
408 | 411 | | |
409 | 412 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
367 | 374 | | |
368 | 375 | | |
| 376 | + | |
369 | 377 | | |
370 | 378 | | |
371 | 379 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
438 | 446 | | |
439 | 447 | | |
| 448 | + | |
440 | 449 | | |
441 | 450 | | |
442 | 451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
96 | 99 | | |
97 | 100 | | |
98 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| 238 | + | |
| 239 | + | |
238 | 240 | | |
239 | 241 | | |
240 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
241 | 246 | | |
242 | 247 | | |
243 | 248 | | |
| |||
257 | 262 | | |
258 | 263 | | |
259 | 264 | | |
260 | | - | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
261 | 269 | | |
262 | 270 | | |
263 | 271 | | |
| |||
276 | 284 | | |
277 | 285 | | |
278 | 286 | | |
279 | | - | |
280 | | - | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
281 | 297 | | |
282 | 298 | | |
283 | 299 | | |
284 | 300 | | |
285 | | - | |
| 301 | + | |
286 | 302 | | |
287 | 303 | | |
288 | | - | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
289 | 310 | | |
290 | 311 | | |
291 | 312 | | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
| 313 | + | |
301 | 314 | | |
302 | 315 | | |
303 | 316 | | |
| |||
0 commit comments