@@ -71,7 +71,34 @@ function resolveCommandShardName(file) {
7171 if ( name . startsWith ( "doctor/shared/" ) || name . startsWith ( "doctor/" ) ) {
7272 return "agentic-commands-doctor-shared" ;
7373 }
74- return "agentic-commands-doctor" ;
74+ if ( name . startsWith ( "doctor-auth" ) || name . startsWith ( "doctor-claude" ) ) {
75+ return "agentic-commands-doctor-auth" ;
76+ }
77+ if ( name . startsWith ( "doctor-config" ) || name . startsWith ( "doctor-legacy-config" ) ) {
78+ return "agentic-commands-doctor-config" ;
79+ }
80+ if ( name . startsWith ( "doctor-cron" ) ) {
81+ return "agentic-commands-doctor-cron" ;
82+ }
83+ if (
84+ name . startsWith ( "doctor-gateway" ) ||
85+ name . startsWith ( "doctor-heartbeat" ) ||
86+ name . startsWith ( "doctor-memory" ) ||
87+ name . startsWith ( "doctor-plugin" ) ||
88+ name . startsWith ( "doctor-session" ) ||
89+ name . startsWith ( "doctor-state" ) ||
90+ name . startsWith ( "doctor-workspace" )
91+ ) {
92+ return "agentic-commands-doctor-runtime" ;
93+ }
94+ if (
95+ name . startsWith ( "doctor-platform-notes" ) ||
96+ name . startsWith ( "doctor-sandbox" ) ||
97+ name . startsWith ( "doctor-whatsapp" )
98+ ) {
99+ return "agentic-commands-doctor-misc-platform" ;
100+ }
101+ return "agentic-commands-doctor-misc-core" ;
75102 }
76103 if (
77104 name . startsWith ( "auth-choice" ) ||
@@ -95,7 +122,7 @@ function createAgenticCommandSplitShards() {
95122 const commandsLightTests = new Set ( commandsLightTestFiles ) ;
96123 const groups = new Map ( ) ;
97124 for ( const file of listTestFiles ( "src/commands" ) ) {
98- if ( commandsLightTests . has ( file ) ) {
125+ if ( commandsLightTests . has ( file ) || file . endsWith ( ".e2e.test.ts" ) ) {
99126 continue ;
100127 }
101128 const shardName = resolveCommandShardName ( file ) ;
@@ -104,7 +131,12 @@ function createAgenticCommandSplitShards() {
104131
105132 return [
106133 "agentic-commands-agent-channel" ,
107- "agentic-commands-doctor" ,
134+ "agentic-commands-doctor-auth" ,
135+ "agentic-commands-doctor-config" ,
136+ "agentic-commands-doctor-cron" ,
137+ "agentic-commands-doctor-misc-core" ,
138+ "agentic-commands-doctor-misc-platform" ,
139+ "agentic-commands-doctor-runtime" ,
108140 "agentic-commands-doctor-shared" ,
109141 "agentic-commands-models" ,
110142 "agentic-commands-onboard-config" ,
@@ -119,6 +151,117 @@ function createAgenticCommandSplitShards() {
119151 . filter ( ( shard ) => shard . includePatterns . length > 0 ) ;
120152}
121153
154+ function resolveInfraStateShardName ( file ) {
155+ const name = relative ( "src/infra" , file ) . replaceAll ( "\\" , "/" ) ;
156+ if ( name . startsWith ( "approval" ) ) {
157+ return "core-runtime-infra-approval" ;
158+ }
159+ if ( name . startsWith ( "exec" ) || name . startsWith ( "system-run" ) ) {
160+ return "core-runtime-infra-exec" ;
161+ }
162+ if ( name . startsWith ( "heartbeat" ) ) {
163+ return "core-runtime-infra-heartbeat" ;
164+ }
165+ if ( name . startsWith ( "outbound/" ) ) {
166+ return "core-runtime-infra-outbound" ;
167+ }
168+ if ( name . startsWith ( "net/" ) || name . startsWith ( "fetch" ) ) {
169+ return "core-runtime-infra-network" ;
170+ }
171+ if (
172+ name . startsWith ( "device" ) ||
173+ name . startsWith ( "node-pairing" ) ||
174+ name . startsWith ( "pairing" ) ||
175+ name . startsWith ( "push" )
176+ ) {
177+ return "core-runtime-infra-device-push" ;
178+ }
179+ if (
180+ name . startsWith ( "install" ) ||
181+ name . startsWith ( "npm" ) ||
182+ name . startsWith ( "package" ) ||
183+ name . startsWith ( "provider-usage" ) ||
184+ name . startsWith ( "update" )
185+ ) {
186+ return "core-runtime-infra-package-provider" ;
187+ }
188+ if ( name . startsWith ( "session" ) || name . startsWith ( "state-migrations" ) ) {
189+ return "core-runtime-infra-session-state" ;
190+ }
191+ if ( name < "g" ) {
192+ return "core-runtime-infra-misc-a-f" ;
193+ }
194+ if ( name . startsWith ( "gateway" ) ) {
195+ return "core-runtime-infra-misc-gateway" ;
196+ }
197+ if ( name < "m" ) {
198+ return "core-runtime-infra-misc-g-l" ;
199+ }
200+ if ( name < "p" ) {
201+ return "core-runtime-infra-misc-m-o" ;
202+ }
203+ if (
204+ name . startsWith ( "parse" ) ||
205+ name . startsWith ( "path" ) ||
206+ name . startsWith ( "plain" ) ||
207+ name . startsWith ( "plugin" ) ||
208+ name . startsWith ( "ports" ) ||
209+ name . startsWith ( "prototype" )
210+ ) {
211+ return "core-runtime-infra-misc-path-ports" ;
212+ }
213+ if (
214+ name . startsWith ( "process" ) ||
215+ name . startsWith ( "replace" ) ||
216+ name . startsWith ( "resolve" ) ||
217+ name . startsWith ( "restart" ) ||
218+ name . startsWith ( "retry" ) ||
219+ name . startsWith ( "run" ) ||
220+ name . startsWith ( "runtime" )
221+ ) {
222+ return "core-runtime-infra-misc-process-restart" ;
223+ }
224+ if ( name < "t" ) {
225+ return "core-runtime-infra-misc-s-system" ;
226+ }
227+ return "core-runtime-infra-misc-t-z" ;
228+ }
229+
230+ function createInfraStateSplitShards ( ) {
231+ const groups = new Map ( ) ;
232+ for ( const file of listTestFiles ( "src/infra" ) ) {
233+ const shardName = resolveInfraStateShardName ( file ) ;
234+ groups . set ( shardName , [ ...( groups . get ( shardName ) ?? [ ] ) , file ] ) ;
235+ }
236+
237+ return [
238+ "core-runtime-infra-approval" ,
239+ "core-runtime-infra-device-push" ,
240+ "core-runtime-infra-exec" ,
241+ "core-runtime-infra-heartbeat" ,
242+ "core-runtime-infra-misc-a-f" ,
243+ "core-runtime-infra-misc-g-l" ,
244+ "core-runtime-infra-misc-gateway" ,
245+ "core-runtime-infra-misc-m-o" ,
246+ "core-runtime-infra-misc-path-ports" ,
247+ "core-runtime-infra-misc-process-restart" ,
248+ "core-runtime-infra-misc-s-system" ,
249+ "core-runtime-infra-misc-t-z" ,
250+ "core-runtime-infra-network" ,
251+ "core-runtime-infra-outbound" ,
252+ "core-runtime-infra-package-provider" ,
253+ "core-runtime-infra-session-state" ,
254+ ]
255+ . map ( ( shardName ) => ( {
256+ configs : [ "test/vitest/vitest.infra.config.ts" ] ,
257+ includePatterns : groups . get ( shardName ) ?? [ ] ,
258+ requiresDist : false ,
259+ runner : "blacksmith-4vcpu-ubuntu-2404" ,
260+ shardName,
261+ } ) )
262+ . filter ( ( shard ) => shard . includePatterns . length > 0 ) ;
263+ }
264+
122265const GATEWAY_SERVER_BACKED_HTTP_TESTS = new Set ( [
123266 "src/gateway/embeddings-http.test.ts" ,
124267 "src/gateway/models-http.test.ts" ,
@@ -286,13 +429,16 @@ const SPLIT_NODE_SHARDS = new Map([
286429 [
287430 "core-runtime" ,
288431 [
432+ ...createInfraStateSplitShards ( ) ,
289433 {
290- shardName : "core-runtime-infra-state" ,
291- configs : [
292- "test/vitest/vitest.infra.config.ts" ,
293- "test/vitest/vitest.hooks.config.ts" ,
294- "test/vitest/vitest.secrets.config.ts" ,
295- ] ,
434+ shardName : "core-runtime-hooks" ,
435+ configs : [ "test/vitest/vitest.hooks.config.ts" ] ,
436+ requiresDist : false ,
437+ runner : "blacksmith-4vcpu-ubuntu-2404" ,
438+ } ,
439+ {
440+ shardName : "core-runtime-secrets" ,
441+ configs : [ "test/vitest/vitest.secrets.config.ts" ] ,
296442 requiresDist : false ,
297443 runner : "blacksmith-4vcpu-ubuntu-2404" ,
298444 } ,
0 commit comments