Commit 2f15284
test(devx): gate the module-top load of a dist-resolved workspace dep (clocked-window rule) (#10135)
* test(devx): gate the module-top load of a dist-resolved workspace dep
Extends `check:test-source-alias` with the clocked-window rule (#10126): a test
file that loads one of its package's unaliased specifiers through a dynamic
`import()` / `require()` inside a function body — an `it()` body, a hook, or any
nested function — with no module-scope load of the same specifier is a finding.
vitest clocks hooks and test bodies only; collection is clocked against nothing,
so a module-top side-effect import moves a cold transform OUT of every budget
rather than into a bigger one. #10115 / PR #10120 paid for that reading with 30
ejected merge-queue builds in one night.
Baseline sweep: 31 violations across 21 files in 9 packages, all fixed here the
PR #10120 way (module-top `import '<specifier>'`), none quarantined or
registry-exempted.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01URCaKuNTuK3BKJvwqM74QU
* test(devx): count the clocked-window fixture's findings on its full path
`packages/clocked-load` is also a prefix of `packages/clocked-load-paid`, so the
count assertion read the compliant fixture's findings as the violating one's.
Found by ablating the compliance leg: the count moved to 3 for a reason that was
in the assertion rather than in the gate.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01URCaKuNTuK3BKJvwqM74QU
* fix(devx): read a `}): Promise< { … } > {` signature as a function body
The classifier's backward walk bailed on the braces, the semicolon and the
newlines a multi-line signature puts between the parameter list and the body,
so a module-level helper called from test bodies read as "not a function" and
its file was exempted SILENTLY. Surfaced by ablating the classifier, not by the
sweep: `serve-marketplace-offline-runtime-config.test.ts` sat green through it.
Balanced groups are now jumped through the forward pass's `openOf` map, `=>`
inside a function type is not counted as a generic closer, and the shape is
pinned as its own self-test fixture. One more real violation follows, fixed the
same way.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01URCaKuNTuK3BKJvwqM74QU
* docs(devx): state the clocked-window convention where an author meets it
#10126's layer 4 asked for the sentence in AGENTS.md's testing conventions.
That file sits exactly on its shrink-only line ceiling (958, headroom 0,
`scripts/pm/check-skill-line-ratchet.mjs`); the sentence costs three lines and
its own section has two lines of lossless rewrap headroom. Raising a ceiling
takes a maintainer ruling, and truncating a maintainer-specified sentence to fit
one is not this gate's call — so the doc placement stays open and is reported.
Meanwhile the sentence is stated verbatim in the gate header AND in the failure
text, pinned by its own self-test assertion so it cannot decay into a comment.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01URCaKuNTuK3BKJvwqM74QU
* docs(devx): land the clocked-window convention in AGENTS.md (ceiling 958 -> 961)
Layer 4 of #10126, unblocked by a maintainer ruling. AGENTS.md sat exactly on its
shrink-only line ceiling with the mandated sentence costing three lines and its
section carrying two lines of lossless rewrap headroom, so it could not be paid
for in place. Ruling 2026-08-20, verbatim and untranslated:
「A — 抬上限到 961 (Recommended)」
The raise is exactly +3 and nothing more; headroom is 0 again by construction, so
the next author needing a line is back to compressing. The sentence lands beside
the sibling test-gate conventions in § Build & Test, unedited, and the gate
header's note about why it was NOT there is corrected.
The ratchet's self-test pins coverage and shape, never a ceiling's numeric value,
so it needed no extension; re-run green at 19 cases.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01URCaKuNTuK3BKJvwqM74QU
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent a659896 commit 2f15284
25 files changed
Lines changed: 727 additions & 8 deletions
File tree
- examples
- app-crm/test
- embed-objectql/test
- packages
- cli
- src
- commands
- utils
- test
- metadata-protocol/src
- objectql/src
- validation
- qa/dogfood/test
- rest/src
- runtime/src
- services/service-datasource/src/__tests__
- scripts
- pm
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
121 | 124 | | |
122 | 125 | | |
123 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
7 | 14 | | |
8 | 15 | | |
9 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
6 | 13 | | |
7 | 14 | | |
8 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
58 | 65 | | |
59 | 66 | | |
60 | 67 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
72 | 79 | | |
73 | 80 | | |
74 | 81 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
96 | 103 | | |
97 | 104 | | |
98 | 105 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
50 | 58 | | |
51 | 59 | | |
52 | 60 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
34 | 41 | | |
35 | 42 | | |
36 | 43 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
64 | 71 | | |
65 | 72 | | |
66 | 73 | | |
| |||
0 commit comments