@@ -948,6 +948,7 @@ describe("processGatewayAllowlist", () => {
948948 fs . writeFileSync ( shadowGit , "#!/bin/sh\nexit 0\n" , { mode : 0o755 } ) ;
949949 try {
950950 const command = "git status" ;
951+ const canonicalShadowGit = fs . realpathSync ( shadowGit ) ;
951952 await configurePlanBackedCommand ( {
952953 command,
953954 env : { PATH : tempDir } ,
@@ -961,9 +962,9 @@ describe("processGatewayAllowlist", () => {
961962 } ) ;
962963
963964 expect ( defaultExecAutoReviewerMock ) . toHaveBeenCalledWith (
964- expect . objectContaining ( { resolvedPath : shadowGit } ) ,
965+ expect . objectContaining ( { resolvedPath : canonicalShadowGit } ) ,
965966 ) ;
966- expect ( result ) . toEqual ( { execCommandOverride : `${ shadowGit } status` } ) ;
967+ expect ( result ) . toEqual ( { execCommandOverride : `${ canonicalShadowGit } status` } ) ;
967968 } finally {
968969 fs . rmSync ( tempDir , { recursive : true , force : true } ) ;
969970 }
@@ -1157,6 +1158,15 @@ describe("processGatewayAllowlist", () => {
11571158 if ( ! authorizationPlan . ok ) {
11581159 throw new Error ( authorizationPlan . reason ) ;
11591160 }
1161+ const enforced = buildAuthorizedShellCommandFromPlan ( {
1162+ plan : authorizationPlan ,
1163+ mode : "enforced" ,
1164+ segmentSatisfiedBy : [ "safeBuiltins" ] ,
1165+ } ) ;
1166+ expect ( enforced . ok ) . toBe ( true ) ;
1167+ if ( ! enforced . ok ) {
1168+ throw new Error ( enforced . reason ) ;
1169+ }
11601170 hasDurableExecApprovalMock . mockReturnValue ( true ) ;
11611171 hasExactCommandDurableExecApprovalMock . mockReturnValue ( true ) ;
11621172 evaluateShellAllowlistWithAuthorizationMock . mockReturnValue ( {
@@ -1183,7 +1193,7 @@ describe("processGatewayAllowlist", () => {
11831193 const result = await runGatewayAllowlist ( { command } ) ;
11841194
11851195 expect ( createAndRegisterDefaultExecApprovalRequestMock ) . not . toHaveBeenCalled ( ) ;
1186- expect ( result ) . toEqual ( { execCommandOverride : command } ) ;
1196+ expect ( result ) . toEqual ( { execCommandOverride : enforced . command } ) ;
11871197 expect ( commitExecAuthorizationMock ) . toHaveBeenCalledWith (
11881198 expect . objectContaining ( {
11891199 authorization : expect . objectContaining ( {
0 commit comments