You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f8bacd0
Browse filesBrowse the repository at this point in the historyBrowse files
feat(scripts): a third test-budget class, "compiles the package type graph once"
TEST_BUDGET_CLASSES gains its third value, as ruling record 6212133431
(letter A) names it. The number rule and the three prohibitions of ruling
record 6181973363 are unchanged. The refusal now lists every class
("one of ...") and says "none of the 3 classes the rulings name" instead of
"neither class". The self-test pins the three spellings as literals and
reads the third end to end: the ruling's line under the spec files' header,
the two earlier classes in that same header, six near misses refused naming
all three classes, and a --diff run from disk that holds the file at 18.10 s
of its 30 s and lists it at 31 s. Battery pin 14 -> 18.
Claude-Session: https://claude.ai/code/session_016PVjjuVPte5XEJvaQx1E4t
Co-authored-by: Claude <noreply@anthropic.com>
// The ruled spellings, as LITERALS: a case that read them back out of
2990
+
// TEST_BUDGET_CLASSES would still pass with a value deleted from it.
2991
+
construledClasses=['spawns the real producer once per single-cause fixture','whole-package import','compiles the package type graph once'];
2983
2992
constdeclare=(seconds,cls=producerClass,reason='each case spawns the gate once')=>
2984
2993
`// test-budget: ${seconds} — ${cls}: ${reason}`;
2985
2994
// Line 3 of the file is `decl`; `rest` follows the header's blank line 4.
2986
2995
constfileWith=(decl,rest="import { it } from 'vitest';\n")=>`// Copyright (c) 2026 ObjectStack.\n//\n${decl}\n\n${rest}`;
2996
+
// The header of the two spec files the third class was ruled for, with the
2997
+
// declaration on line 2, where every declaration in the tree sits.
2998
+
constspecFileWith=(decl)=>
2999
+
`// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.\n${decl}\n\nimport { describe, it, expect } from 'vitest';\nimport ts from 'typescript';\n`;
3000
+
consttypeGraphLine=
3001
+
'// test-budget: 30 — compiles the package type graph once: one ts.createProgram over the published entries, and every probe after the first reads that one program';
2987
3002
constrefusalOf=(fn)=>{
2988
3003
try{
2989
3004
fn();
@@ -2993,11 +3008,49 @@ function selfTest() {
2993
3008
returnnull;
2994
3009
};
2995
3010
check(()=>{
2996
-
// The two classes, spelled as the ruling names them, and no third.
2997
-
if(TEST_BUDGET_CLASSES.length!==2||producerClass!=='spawns the real producer once per single-cause fixture'||wholePackageClass!=='whole-package import'){
3011
+
// The three classes, spelled as their rulings name them, in order, and no fourth.
3012
+
if(
3013
+
TEST_BUDGET_CLASSES.length!==3||
3014
+
producerClass!==ruledClasses[0]||
3015
+
wholePackageClass!==ruledClasses[1]||
3016
+
typeGraphClass!==ruledClasses[2]
3017
+
){
2998
3018
thrownewError(`budget: the classes read ${JSON.stringify(TEST_BUDGET_CLASSES)}`);
2999
3019
}
3000
3020
});
3021
+
check(()=>{
3022
+
// The third class (ruling record 6212133431), in the line the ruling
3023
+
// writes, under the header of the files it was ruled for: a declared budget.
if(heldCode!==0||held.includes('| `src/integration/graph.test.ts`')||!held.includes('`src/integration/graph.test.ts` (`spec`) 18.10 s of its 30 s, compiles the package type graph once')){
3237
+
thrownewError(`cli: a type-graph file under its declared budget exited ${heldCode} and wrote:\n${held}`);
0 commit comments