@@ -447,7 +447,7 @@ test("legacy tools config maps write/edit/patch/multiedit to edit permission", a
447447 } )
448448} )
449449
450- test ( "Truncate.DIR is allowed even when user denies external_directory globally" , async ( ) => {
450+ test ( "Truncate.GLOB is allowed even when user denies external_directory globally" , async ( ) => {
451451 const { Truncate } = await import ( "../../src/tool/truncation" )
452452 await using tmp = await tmpdir ( {
453453 config : {
@@ -460,14 +460,14 @@ test("Truncate.DIR is allowed even when user denies external_directory globally"
460460 directory : tmp . path ,
461461 fn : async ( ) => {
462462 const build = await Agent . get ( "build" )
463- expect ( PermissionNext . evaluate ( "external_directory" , Truncate . DIR , build ! . permission ) . action ) . toBe ( "allow" )
464463 expect ( PermissionNext . evaluate ( "external_directory" , Truncate . GLOB , build ! . permission ) . action ) . toBe ( "allow" )
464+ expect ( PermissionNext . evaluate ( "external_directory" , Truncate . DIR , build ! . permission ) . action ) . toBe ( "deny" )
465465 expect ( PermissionNext . evaluate ( "external_directory" , "/some/other/path" , build ! . permission ) . action ) . toBe ( "deny" )
466466 } ,
467467 } )
468468} )
469469
470- test ( "Truncate.DIR is allowed even when user denies external_directory per-agent" , async ( ) => {
470+ test ( "Truncate.GLOB is allowed even when user denies external_directory per-agent" , async ( ) => {
471471 const { Truncate } = await import ( "../../src/tool/truncation" )
472472 await using tmp = await tmpdir ( {
473473 config : {
@@ -484,21 +484,21 @@ test("Truncate.DIR is allowed even when user denies external_directory per-agent
484484 directory : tmp . path ,
485485 fn : async ( ) => {
486486 const build = await Agent . get ( "build" )
487- expect ( PermissionNext . evaluate ( "external_directory" , Truncate . DIR , build ! . permission ) . action ) . toBe ( "allow" )
488487 expect ( PermissionNext . evaluate ( "external_directory" , Truncate . GLOB , build ! . permission ) . action ) . toBe ( "allow" )
488+ expect ( PermissionNext . evaluate ( "external_directory" , Truncate . DIR , build ! . permission ) . action ) . toBe ( "deny" )
489489 expect ( PermissionNext . evaluate ( "external_directory" , "/some/other/path" , build ! . permission ) . action ) . toBe ( "deny" )
490490 } ,
491491 } )
492492} )
493493
494- test ( "explicit Truncate.DIR deny is respected" , async ( ) => {
494+ test ( "explicit Truncate.GLOB deny is respected" , async ( ) => {
495495 const { Truncate } = await import ( "../../src/tool/truncation" )
496496 await using tmp = await tmpdir ( {
497497 config : {
498498 permission : {
499499 external_directory : {
500500 "*" : "deny" ,
501- [ Truncate . DIR ] : "deny" ,
501+ [ Truncate . GLOB ] : "deny" ,
502502 } ,
503503 } ,
504504 } ,
@@ -507,8 +507,8 @@ test("explicit Truncate.DIR deny is respected", async () => {
507507 directory : tmp . path ,
508508 fn : async ( ) => {
509509 const build = await Agent . get ( "build" )
510- expect ( PermissionNext . evaluate ( "external_directory" , Truncate . DIR , build ! . permission ) . action ) . toBe ( "deny" )
511510 expect ( PermissionNext . evaluate ( "external_directory" , Truncate . GLOB , build ! . permission ) . action ) . toBe ( "deny" )
511+ expect ( PermissionNext . evaluate ( "external_directory" , Truncate . DIR , build ! . permission ) . action ) . toBe ( "deny" )
512512 } ,
513513 } )
514514} )
0 commit comments