Repository navigation
Commit c2c21f3
Fixes #21421
Clause-②: no
The one hook in `packages/spec/scripts/liveness/check-liveness.test.ts`
that spawns the whole liveness gate (the `beforeAll` of the tombstone
describe, #19062) now runs under the budget its sibling cases already
run the same gate under, instead of vitest's 10 s default `hookTimeout`.
Test-only: no runtime, spec, config or published file changes.
## Changes
One file, +105 / -1 (1673 to 1777 lines).
- `const GATE_BUDGET_MS = 60_000;` beside `runGate`, with the reason it
is a literal and not an import: `vitest.config.ts` exports no constant
and cannot be imported from a test (its top level runs the filter
preflights against `process.argv`).
- The hook passes it: the closing `});` becomes `}, GATE_BUDGET_MS);`.
- A new block at the end of the file reads the file's own source with
the TypeScript parser and holds three facts:
1. the scan can see `runGate` as reaching `spawnSync` and finds
lifecycle hooks (it cannot pass by scanning nothing);
2. every `beforeAll` / `beforeEach` / `afterAll` / `afterEach` whose
callback reaches `spawnSync`, directly or through another function in
the file, passes `GATE_BUDGET_MS` as its timeout argument;
3. `GATE_BUDGET_MS` is not below any `testTimeout` that
`vitest.config.ts` declares (the three declarations all read 60000
today).
Not done, per the ruling: no skip, retry or quarantine, no change to
vitest's `hookTimeout`, no edit to `vitest.config.ts`.
## Hook census (A1)
22 lifecycle hooks in the file: 11 `beforeAll` and 11 `afterAll`, no
`beforeEach` / `afterEach`. Exactly one reaches the gate, the
`beforeAll` of the #19062 describe (`runGate(undefined, ['--json'])`).
The other ten `beforeAll`s only `mkdtempSync` or `cpSync` the ledgers;
every `afterAll` is `rmSync`. The dispatch listed ten `beforeAll`s; the
file has eleven (the one in the #21127 block, which only creates a temp
directory, was not in the list). It does not change the answer.
## Evidence
- **Red before the fix.** With the pin in place and the hook still
unfixed: `Tests 1 failed | 2 passed | 68 skipped (71)`, the failing case
being the hook one, with `beforeAll at line 1412: timeout argument
absent (vitest hookTimeout default, 10 s)`. Line 1412 is the old line
1401 plus the 11 lines added above it.
- **Green after.** The whole file at `1ea92df0fb`: `Test Files 1 passed
(1)`, `Tests 71 passed (71)`, run with `vitest run --project local`
under the shared verify lock (322.8 s on a shared box).
- **The pin bites in both of its directions** (one-off ablations,
mutation proven on disk by `scripts/ablation-replace.mjs`, restored with
blob equal to HEAD and `git diff HEAD` empty):
- `GATE_BUDGET_MS` lowered to 9_999: the config case turns red
(`expected 9999 to be greater than or equal to 60000`), the other two
stay green.
- the hook given an explicit but wrong `10_000`: the hook case turns red
(`beforeAll at line 1414: timeout argument 10_000`), the other two stay
green.
- **Typecheck.** `pnpm --filter @objectstack/spec typecheck` exit 0
(`tsc --noEmit`, `check:scripts-typecheck`, `check:test-typecheck` OK
with its debt ledger unchanged). `tsc --noEmit -p tsconfig.scripts.json
--listFiles` lists the test file once, so the scripts program does
compile it.
## Gates
`dispatch-gates --commands` derived 59 commands for this diff.
Reconciled with `--ran`: 59 accounted for, 55 run (exit 0), 4 NOT
MEASURED, 0 unrun. The four are `check:dts-closure`,
`check:dual-build-cjs-loads`, `check:lean-entry-closure` and
`check:sourcemap-no-sources-content`: each exited 3 (prerequisite not
met, no built `dist`) and measured nothing. They read the published
build, which this diff cannot reach: `npm pack --dry-run` on
`packages/spec` lists 322 files and none under `scripts/` (positive
control: 83 files under `liveness/`). `check:query-options-erasure` and
`check:type-check-debt` hit my 250 s cap on the first pass and were
re-run with a larger cap: both exit 0. `check:nul-bytes` exit 0;
control-character scan of the file clean.
## Changeset
Not published: `scripts/` is outside the package's `files[]` (pack
listing above). `skip-changeset` is applied.
## Acceptance notes
- The third pin case (config drift) goes one step beyond the ruling's
pin, to keep the one literal from drifting from `vitest.config.ts`. It
is self-contained; deleting it leaves the other two intact.
- This file runs in the `local` vitest project (`vitest.repo-tests.json`
does not list it), not `repo`; both projects declare the same
`testTimeout`.
- Base is `39a912ea73`, not merged forward. The commits that reached
`main` since do not touch this file, `vitest.config.ts` or the spec
`package.json`.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01YDt3PzwfrkuFzUBF89WPmM)_
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6d728b8 commit c2c21f3
1 file changed
Lines changed: 105 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
47 | 58 | | |
48 | 59 | | |
49 | 60 | | |
| |||
1398 | 1409 | | |
1399 | 1410 | | |
1400 | 1411 | | |
| 1412 | + | |
| 1413 | + | |
1401 | 1414 | | |
1402 | 1415 | | |
1403 | 1416 | | |
| |||
1428 | 1441 | | |
1429 | 1442 | | |
1430 | 1443 | | |
1431 | | - | |
| 1444 | + | |
1432 | 1445 | | |
1433 | 1446 | | |
1434 | 1447 | | |
| |||
1671 | 1684 | | |
1672 | 1685 | | |
1673 | 1686 | | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
0 commit comments